/* Fahim Fuad: portfolio. An amber CRT running an engine console. VT323 for titles, JetBrains Mono for everything else. */

@font-face { font-family: 'VT323'; src: url('../fonts/VT323-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/JetBrainsMono-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root
{
    --bg: #1a1a1a;
    --surface: #202020;      /* panels */
    --surface-2: #272727;    /* panel title bars, hover */
    --surface-3: #303030;
    --sunken: #141414;
    --line: rgba(255, 165, 0, 0.24);
    --line-hi: rgba(255, 165, 0, 0.6);
    --amber: #ffa500;        /* titles */
    --amber-hi: #ffc04a;
    --amber-deep: #c77a00;
    --ink: #1a1a1a;          /* text on amber */
    --text: #ffd9a0;         /* light amber body text */
    --muted: #cfae7d;
    --dim: #957d5b;
    --glow: 0 0 6px rgba(255, 165, 0, 0.55), 0 0 24px rgba(255, 165, 0, 0.22);
    --glow-soft: 0 0 5px rgba(255, 190, 90, 0.28);
    --display: 'VT323', 'Consolas', monospace;
    --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    --gutter: max(16px, 4.5vw);
    --nav-h: 58px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15.5px/1.7 var(--mono); text-shadow: var(--glow-soft); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--amber); color: var(--ink); text-shadow: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
code, kbd, pre, samp { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--amber); color: var(--ink); padding: 8px 14px; font-weight: 700; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.page { position: relative; overflow-x: clip; }

/* The CRT: scanlines, a slow rolling bar and a vignette over everything ------------------------------- */
body::after
{
    content: ''; position: fixed; inset: 0; z-index: 150; pointer-events: none;
    background:
        repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse 120% 95% at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.45) 100%);
}
body::before
{
    content: ''; position: fixed; left: 0; right: 0; top: -30vh; height: 30vh; z-index: 149; pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(255, 190, 90, 0.022) 50%, transparent);
    animation: roll 9s linear infinite;
}
@keyframes roll { to { transform: translateY(160vh); } }
@keyframes blink { 50% { opacity: 0; } }

/* Nav: the editor's menu bar ------------------------------------------------------------------------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--nav-h); padding: 0 var(--gutter); display: flex; align-items: center; gap: 24px; background: rgba(26, 26, 26, 0.94); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.brand-name { font: 400 1.7rem/1 var(--display); letter-spacing: 0.06em; color: var(--amber); text-shadow: var(--glow); }
.brand-handle { font-size: 0.74rem; color: var(--dim); }
.nav-links { margin-left: auto; display: flex; gap: 4px; }
.nav-links a { text-decoration: none; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 12px; color: var(--muted); }
.nav-links a::before { content: '['; color: var(--dim); margin-right: 4px; }
.nav-links a::after { content: ']'; color: var(--dim); margin-left: 4px; }
.nav-links a:hover { color: var(--amber); }
.nav-links a.active { color: var(--ink); background: var(--amber); text-shadow: none; }
.nav-links a.active::before, .nav-links a.active::after { color: var(--ink); }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--amber); transition: transform 0.2s, top 0.2s; }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* Type ------------------------------------------------------------------------------------------------ */
.h-sec { margin: 0 0 14px; font: 400 clamp(40px, 5.4vw, 68px)/0.95 var(--display); color: var(--amber); text-shadow: var(--glow); letter-spacing: 0.01em; }
.h-sec.big { font-size: clamp(54px, 8vw, 104px); }
.lede { margin: 0; max-width: 64ch; color: var(--text); font-size: clamp(15px, 1.2vw, 17px); }
.note { margin: 0 0 22px; font-size: 0.84rem; color: var(--dim); }
.text-link { display: inline-block; margin-top: 18px; font-size: 0.86rem; color: var(--amber); text-underline-offset: 4px; }
.text-link:hover { color: var(--amber-hi); }
.loading { color: var(--dim); }
.loading::after { content: '_'; animation: blink 1s steps(1) infinite; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.fetching { display: flex; align-items: center; gap: 14px; margin: 0; color: var(--muted); }
.fetching a { color: var(--amber); }
.spinner { flex: none; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--amber); border-right-color: var(--amber); box-shadow: var(--glow); animation: spin 0.8s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.caret { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.22em; background: var(--amber); box-shadow: var(--glow); animation: blink 1s steps(1) infinite; }

/* A PowerShell prompt line above headings: PS D:\Rid> Get-Something */
.prompt { margin: 0 0 10px; font-size: 0.82rem; color: var(--dim); overflow-wrap: anywhere; }
.prompt b { color: var(--amber); font-weight: 400; }
.prompt i { font-style: normal; color: var(--text); }

/* Buttons --------------------------------------------------------------------------------------------- */
.btn
{
    display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; text-decoration: none;
    border: 1px solid var(--line-hi); background: transparent; color: var(--amber);
    font: 700 0.82rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-shadow: var(--glow-soft);
    box-shadow: 4px 4px 0 rgba(255, 165, 0, 0.18); transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn::before { content: '>'; opacity: 0; margin-left: -14px; transition: opacity 0.15s, margin 0.15s; }
.btn:hover { background: rgba(255, 165, 0, 0.1); }
.btn:hover::before { opacity: 1; margin-left: 0; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(255, 165, 0, 0.18); }
.btn .arr { transition: transform 0.15s; }
.btn:hover .arr { transform: translateX(3px); }
.btn-amber { background: var(--amber); color: var(--ink); border-color: var(--amber); text-shadow: none; box-shadow: 4px 4px 0 var(--amber-deep), 0 0 22px rgba(255, 165, 0, 0.25); }
.btn-amber:hover { background: var(--amber-hi); }
.btn-amber:active { box-shadow: 1px 1px 0 var(--amber-deep); }
.btns { display: flex; flex-wrap: wrap; gap: 14px; }

/* Panels: docked editor windows. Give one a data-title to get a title bar ------------------------------ */
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); padding: 22px; }
.tile[data-title] { padding-top: 54px; }
.tile[data-title]::before
{
    content: attr(data-title); position: absolute; left: 0; right: 0; top: 0; height: 32px; padding: 0 12px;
    display: flex; align-items: center; background: var(--surface-2); border-bottom: 1px solid var(--line);
    font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber);
}
.tile[data-title]::after { content: '_ [] x'; position: absolute; right: 12px; top: 0; height: 32px; display: flex; align-items: center; font-size: 0.72rem; letter-spacing: 0.2em; color: var(--dim); }
a.tile { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
a.tile:hover { border-color: var(--line-hi); background: var(--surface-2); }
.tile-amber { background: var(--amber); color: var(--ink); border-color: var(--amber); text-shadow: none; }
.tile-amber span, .tile-amber .meta { color: rgba(26, 26, 26, 0.72) !important; }
.tag { display: inline-block; font-size: 0.7rem; line-height: 1; padding: 5px 7px; border: 1px solid var(--line); color: var(--amber-hi); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Screenshots look like they are on the monitor: amber phosphor until you point at them */
.phosphor img, img.phosphor { filter: grayscale(1) sepia(1) saturate(2.6) hue-rotate(-12deg) brightness(0.82) contrast(1.15); transition: filter 0.3s; }
a:hover .phosphor img, a:hover img.phosphor, .phosphor:hover img { filter: none; }

/* Sections -------------------------------------------------------------------------------------------- */
.section { position: relative; padding: clamp(70px, 10vw, 130px) 0; }
.section + .section { border-top: 1px dashed var(--line); }
.page-head { padding: calc(var(--nav-h) + clamp(40px, 6vw, 80px)) 0 clamp(30px, 4vw, 48px); }
.left-col { max-width: 720px; }

/* Hero: name + engine console over a vector-display asteroid field ------------------------------------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 30px) 0 70px; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(30px, 5vw, 70px); align-items: center; width: 100%; pointer-events: none; }
.hero-grid a, .hero-grid button, .console { pointer-events: auto; }
.hero-kicker { margin: 0 0 6px; font-size: 0.82rem; color: var(--muted); }
.hero-name { margin: 0; font: 400 clamp(84px, 13vw, 190px)/0.8 var(--display); color: var(--amber); letter-spacing: 0.01em; text-shadow: 0 0 8px rgba(255, 165, 0, 0.7), 0 0 40px rgba(255, 165, 0, 0.35), 3px 0 0 rgba(255, 80, 0, 0.25), -2px 0 0 rgba(255, 230, 150, 0.15); }
.hero-name .word { display: block; }
.hero-name .word + .word { color: var(--amber-hi); }
.hero-role { margin: 22px 0 28px; max-width: 46ch; color: var(--text); }
.hero-role a { color: var(--amber); text-underline-offset: 4px; }
.hud { position: absolute; top: calc(var(--nav-h) + 14px); right: var(--gutter); margin: 0; font-size: 0.72rem; line-height: 1.6; color: var(--dim); text-align: right; pointer-events: none; white-space: pre; }
.hud b { color: var(--amber); font-weight: 400; }
.hero-hint { position: absolute; left: var(--gutter); bottom: 22px; margin: 0; font-size: 0.74rem; color: var(--dim); pointer-events: none; }

/* Console panel (hero + 404) */
.console { padding: 0; background: rgba(20, 20, 20, 0.92); box-shadow: 8px 8px 0 rgba(255, 165, 0, 0.08); }
.console.tile[data-title] { padding-top: 32px; }
.console pre { margin: 0; padding: 14px 16px 18px; min-height: 19.5em; font-size: 0.78rem; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
/* The boot log never wraps: the text shrinks to fit the longest line (~58 chars), scrolling only on tiny phones */
.hero .console { container-type: inline-size; }
.hero .console pre { white-space: pre; overflow-wrap: normal; overflow-x: auto; scrollbar-width: none; font-size: clamp(0.5rem, calc((100cqi - 36px) / 35.5), 0.8rem); }
.console .ps { color: var(--amber); }
.console .t { color: var(--dim); }
.console .ch { color: var(--amber-hi); }
.console .ok { color: #b9e27a; text-shadow: 0 0 5px rgba(185, 226, 122, 0.4); }
.console .warn { color: #ffcf5a; }
.console .err { color: #ff7a4a; text-shadow: 0 0 5px rgba(255, 122, 74, 0.4); }

/* About ----------------------------------------------------------------------------------------------- */
.bio p { margin: 0 0 16px; max-width: 70ch; }
.bio p:first-child { color: var(--amber-hi); font-size: 1.06rem; }
.now { margin-top: 26px; max-width: 70ch; padding: 14px 16px; border: 1px dashed var(--line-hi); color: var(--text); }
.now b { color: var(--amber); font-weight: 400; }
.now b span { color: var(--dim); }

/* Featured -------------------------------------------------------------------------------------------- */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(26px, 4vw, 56px); align-items: center; }
.feature-label { margin: 0 0 8px; font-size: 0.8rem; color: var(--dim); }
.feature .lede { margin-bottom: 26px; }
.feature-art { display: block; padding: 0; overflow: hidden; }
.feature-art.tile[data-title] { padding-top: 32px; }
.feature-art img, .feature-art svg { width: 100%; aspect-ratio: 16 / 9.4; object-fit: cover; }
.caption { margin: 10px 0 0; font-size: 0.74rem; color: var(--dim); }

/* Skills ---------------------------------------------------------------------------------------------- */
.skills-list { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 26px 0 0; border-top: 1px solid var(--line); }
.skills-list dt, .skills-list dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.skills-list dt { color: var(--amber); font-size: 0.82rem; }
.skills-list dd { margin: 0; }

/* Post lists ------------------------------------------------------------------------------------------ */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list a { display: grid; grid-template-columns: 96px 1fr; gap: 18px; padding: 14px 0; text-decoration: none; border-bottom: 1px dashed var(--line); }
.post-list time { font-size: 0.78rem; color: var(--dim); }
.post-list b { display: block; font-weight: 500; color: var(--amber-hi); transition: color 0.15s; }
.post-list i { display: block; font-style: normal; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.post-list a:hover b { color: var(--amber); }
.post-list a:hover b::before { content: '> '; }
.posts { display: grid; gap: 12px; }
.post-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 22px; align-items: baseline; }
.post-row time { font-size: 0.78rem; color: var(--amber); }
.post-row h3 { margin: 0 0 6px; font: 400 1.9rem/1 var(--display); color: var(--amber-hi); }
.post-row p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.post-row .arr { color: var(--amber); transition: transform 0.15s; }
.post-row:hover .arr { transform: translateX(5px); }

/* Contact: one button, then every platform in a single strip ------------------------------------------- */
.ico { display: inline-block; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ico-link { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }
.btn .ico { width: 16px; height: 16px; margin: -2px 0; }
.btn-amber .ico { background: var(--ink); }

.strip { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.strip li { flex: 1 1 auto; display: flex; }
.strip a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 15px 18px; background: var(--bg); text-decoration: none; color: var(--muted); font-size: 0.84rem; white-space: nowrap; }
.strip a:hover { background: var(--amber); color: var(--ink); text-shadow: none; }
.strip .ico { width: 16px; height: 16px; }
/* Home ends with the strip, so the footer doesn't repeat it */
[data-section="top"] .footer-links { display: none; }

/* Project grid ---------------------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 26px; }
.filters button { border: 1px solid var(--line); padding: 7px 11px; background: transparent; color: var(--muted); font-size: 0.78rem; text-shadow: inherit; }
.filters button:hover { color: var(--amber); border-color: var(--line-hi); }
.filters button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--ink); text-shadow: none; }
.filters button sup { font-size: 0.66rem; margin-left: 3px; opacity: 0.7; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pcard { padding: 0; display: flex; flex-direction: column; }
.pcard .cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sunken); border-bottom: 1px solid var(--line); }
.pcard .cover img, .pcard .cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .status { position: absolute; top: 10px; left: 10px; font-size: 0.66rem; padding: 4px 7px; background: var(--ink); color: var(--amber); border: 1px solid var(--line-hi); }
.pcard .body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 0.72rem; color: var(--amber); }
.pcard .meta span:last-child { color: var(--dim); }
.pcard h3 { margin: 0; font: 400 2rem/0.95 var(--display); color: var(--amber-hi); }
.pcard p { margin: 0; color: var(--muted); font-size: 0.88rem; flex: 1; }
.pcard .go { font-size: 0.74rem; color: var(--amber); }
.pcard .go::before { content: '> '; }
.pcard:hover h3 { color: var(--amber); text-shadow: var(--glow); }

/* Project / post detail -------------------------------------------------------------------------------- */
.crumbs { font-size: 0.8rem; color: var(--dim); margin: 0 0 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--amber); }
.project-title { max-width: 18ch; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 28px 0 22px; max-width: 820px; }
.fact { padding: 12px 14px 14px; }
.fact span { display: block; font-size: 0.66rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.fact b { font-weight: 500; }
.hero-art { margin: clamp(24px, 4vw, 44px) 0 0; }
.hero-art.tile[data-title] { padding: 32px 0 0; }
.hero-art img, .hero-art svg { width: 100%; max-height: 620px; object-fit: cover; display: block; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.gallery button { padding: 0; border: 1px solid var(--line); background: var(--sunken); cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: clamp(30px, 5vw, 56px); max-width: 940px; }
.prose { padding: clamp(20px, 4vw, 44px); }
.prose.tile[data-title] { padding-top: calc(32px + clamp(20px, 4vw, 44px)); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font: 400 2.4rem/1 var(--display); color: var(--amber); text-shadow: var(--glow); margin: 1.6em 0 0.5em; }
.prose h3 { font: 400 1.8rem/1 var(--display); color: var(--amber-hi); margin: 1.5em 0 0.4em; }
.prose h4, .prose h5, .prose h6 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 1.5em 0 0.5em; color: var(--muted); }
.prose a { color: var(--amber); text-underline-offset: 3px; }
.prose img { display: inline-block; margin: 0.6em 0; max-height: 560px; width: auto; }
.prose p > img:only-child, .prose p > a:only-child > img { display: block; margin: 1.2em 0; }
.prose hr { border: 0; border-top: 1px dashed var(--line-hi); margin: 2.2em 0; }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; background: var(--surface-2); border-left: 3px solid var(--amber); }
.prose blockquote p { margin: 0; }
.prose :not(pre) > code { font-size: 0.88em; padding: 0.1em 0.4em; background: var(--surface-3); color: var(--amber-hi); }
.prose pre { margin: 1.3em 0; padding: 16px 18px; background: var(--sunken); border: 1px solid var(--line); overflow-x: auto; font-size: 0.84rem; line-height: 1.6; text-shadow: none; }
.prose pre code { background: none; padding: 0; color: #e6d3b3; }
.table-wrap { overflow-x: auto; margin: 1.3em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.prose th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); background: var(--amber); padding: 8px 12px; text-shadow: none; }
.prose td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; max-width: 940px; }
.pager a span { display: block; font-size: 0.72rem; color: var(--amber); margin-bottom: 2px; }
.pager a b { font: 400 1.7rem/1 var(--display); color: var(--amber-hi); }
.pager a:last-child { text-align: right; }
.post-meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 0.8rem; color: var(--muted); }
.post-meta time { color: var(--amber); }

/* Code highlighting (highlight.js classes), phosphor tints */
.hljs-keyword, .hljs-built_in, .hljs-type, .hljs-meta .hljs-keyword { color: var(--amber); }
.hljs-string, .hljs-char { color: #c9e08a; }
.hljs-number, .hljs-literal { color: #ff8f4a; }
.hljs-comment { color: #7d6d55; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-function .hljs-title { color: #fff0d0; }
.hljs-meta, .hljs-attr, .hljs-variable { color: #ffd38a; }

/* Resume ---------------------------------------------------------------------------------------------- */
.resume { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; }
.resume-side { display: grid; gap: 12px; position: sticky; top: calc(var(--nav-h) + 16px); }
.resume-id h1 { margin: 0 0 4px; font: 400 2.6rem/0.9 var(--display); }
.resume-id p { margin: 0; font-size: 0.8rem; }
.resume-contact { display: grid; gap: 8px; font-size: 0.8rem; }
.resume-contact a { text-decoration: none; display: flex; justify-content: space-between; gap: 10px; }
.resume-contact a span { color: var(--dim); }
.resume-contact a:hover b { color: var(--amber); }
.resume-contact b { font-weight: 400; overflow-wrap: anywhere; text-align: right; }
.resume-skills h3 { margin: 18px 0 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber); }
.resume-skills h3:first-child { margin-top: 0; }
.resume-skills p { margin: 0; font-size: 0.88rem; }
.resume-main { display: grid; gap: 12px; }
.resume-block h2 { margin: 0 0 16px; font: 400 2.2rem/1 var(--display); color: var(--amber); text-shadow: var(--glow); }
.r-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 20px; padding: 16px 0; border-top: 1px dashed var(--line); }
.r-item:first-of-type { border-top: 0; padding-top: 0; }
.r-item h3 { margin: 0; font-size: 1.04rem; font-weight: 500; color: var(--amber-hi); }
.r-item h3 a { text-decoration: none; }
.r-item h3 a:hover { color: var(--amber); text-decoration: underline; }
.r-item .org { grid-column: 1; color: var(--muted); font-size: 0.88rem; }
.r-item time { grid-row: 1; grid-column: 2; font-size: 0.76rem; color: var(--amber); white-space: nowrap; }
.r-item ul { grid-column: 1 / -1; margin: 10px 0 0; padding-left: 18px; }
.r-item li { margin-bottom: 6px; font-size: 0.9rem; }
.r-item li::marker { content: '> '; color: var(--amber); }
.resume-summary p { margin: 0; }

/* Footer: the status bar ------------------------------------------------------------------------------- */
.footer { position: relative; padding: 30px 0 34px; border-top: 1px solid var(--line); background: var(--sunken); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 16px 40px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand b { display: block; font: 400 1.6rem/1 var(--display); color: var(--amber); text-shadow: var(--glow); }
.footer-brand span { display: block; font-size: 0.74rem; color: var(--dim); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.footer-links a { font-size: 0.78rem; text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--amber); text-decoration: underline; }
.footer-note { grid-column: 1 / -1; margin: 0; font-size: 0.72rem; color: var(--dim); }
.footer-note::before { content: '● Ready  '; color: #b9e27a; }

/* Page change: the tube switches off to a line, the next page switches on ----------------------------- */
.crt { position: fixed; inset: 0; z-index: 200; pointer-events: none; visibility: hidden; }
.crt::before, .crt::after { content: ''; position: absolute; left: 0; right: 0; height: 50.5%; background: #0c0c0c; transform: scaleY(0); }
.crt::before { top: 0; transform-origin: 50% 0; }
.crt::after { bottom: 0; transform-origin: 50% 100%; }
.crt i { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; z-index: 1; background: #ffe2a8; box-shadow: 0 0 12px 3px var(--amber), 0 0 40px 8px rgba(255, 165, 0, 0.4); opacity: 0; }
.crt.off, .crt.on { visibility: visible; pointer-events: auto; }
.crt.off::before, .crt.off::after { animation: crt-close 0.24s cubic-bezier(0.7, 0, 0.9, 0.4) forwards; }
.crt.off i { animation: crt-line-out 0.3s 0.2s ease-in forwards; }
.crt.on::before, .crt.on::after { transform: scaleY(1); animation: crt-close 0.32s 0.16s cubic-bezier(0.2, 0.7, 0.3, 1) reverse both; }
.crt.on i { animation: crt-line-in 0.34s ease-out forwards; }
@keyframes crt-close { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes crt-line-out { 0% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0.9; transform: scaleX(0.004); } }
@keyframes crt-line-in { 0% { opacity: 1; transform: scaleX(0.004); } 45% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }
.pt-enter body > :not(.crt) { visibility: hidden; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 160; background: rgba(12, 12, 12, 0.96); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1600px, 94vw); max-height: 86vh; border: 1px solid var(--line-hi); }
.lightbox button { position: absolute; top: 14px; right: 18px; border: 1px solid var(--line-hi); background: var(--surface); color: var(--amber); width: 44px; height: 44px; }

/* Reveal: lines "print" in */
.js .reveal { opacity: 0; transition: opacity 0.45s steps(4); }
.js .reveal.in { opacity: 1; }

/* 404 */
.nf { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 30px) 0 60px; }
.nf-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(30px, 5vw, 70px); align-items: center; width: 100%; }
.nf-code { margin: 0; font: 400 clamp(120px, 20vw, 260px)/0.8 var(--display); color: var(--amber); text-shadow: 0 0 8px rgba(255, 165, 0, 0.7), 0 0 50px rgba(255, 165, 0, 0.35); }
.nf .console pre { min-height: 0; }

/* Responsive ------------------------------------------------------------------------------------------ */
@media (max-width: 1000px)
{
    .grid { grid-template-columns: repeat(2, 1fr); }
    .hero-grid, .feature, .nf-grid { grid-template-columns: 1fr; }
    .hero { align-items: flex-start; }
    .console pre { min-height: 0; }
    .resume { grid-template-columns: 1fr; }
    .resume-side { position: static; grid-template-columns: 1fr 1fr; }
    .resume-id { grid-column: 1 / -1; }
}
@media (max-width: 860px)
{
    .nav-toggle { display: block; }
    .brand-handle { display: none; }
    .nav-links
    {
        position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 4px; padding: 10px var(--gutter) 20px;
        background: rgba(20, 20, 20, 0.98); border-bottom: 1px solid var(--line); visibility: hidden;
    }
    .nav-links.open { visibility: visible; }
    .nav-links a { padding: 14px 12px; font-size: 0.95rem; border: 1px solid var(--line); }
    .post-row { grid-template-columns: 1fr auto; }
    .post-row time { grid-column: 1 / -1; }
    .facts { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-links { justify-content: flex-start; }
    .hud { display: none; }
}
@media (max-width: 640px)
{
    body { font-size: 14.5px; }
    .grid, .gallery, .pager { grid-template-columns: 1fr; }
    .hero-name { font-size: clamp(76px, 27vw, 130px); }
    .console pre { font-size: 0.7rem; }
    .skills-list { grid-template-columns: 1fr; }
    .skills-list dt { padding-bottom: 0; border-bottom: 0; }
    .post-list a { grid-template-columns: 1fr; gap: 2px; }
    .resume-side { grid-template-columns: 1fr; }
    .r-item { grid-template-columns: 1fr; }
    .r-item time { grid-row: auto; grid-column: 1; }
    .pager a:last-child { text-align: left; }
    .btns .btn { flex: 1 1 auto; justify-content: center; }
    .tile[data-title]::after { display: none; }
}
@media (prefers-reduced-motion: reduce)
{
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
    body::before { display: none; }
    .js .reveal { opacity: 1; }
}

/* Print (resume) -------------------------------------------------------------------------------------- */
@media print
{
    :root { --surface: #fff; --surface-2: #fff; --surface-3: #f1f1f1; --text: #000; --muted: #333; --dim: #555; --amber: #8a5000; --amber-hi: #000; --line: #ddd; --glow: none; --glow-soft: none; }
    html, body { background: #fff !important; color: #000; font-size: 10.5pt; text-shadow: none; }
    body::before, body::after, .nav, .footer, .crt, .no-print { display: none !important; }
    .page-head { padding: 0 0 12pt; }
    .tile { border: 0; padding: 0; background: none !important; color: #000 !important; }
    .tile[data-title]::before, .tile[data-title]::after { display: none; }
    .resume { grid-template-columns: 200px 1fr; gap: 18pt; }
    .resume-side { position: static; grid-template-columns: 1fr; }
    .js .reveal { opacity: 1 !important; }
    .r-item { border-top: 1px solid #ddd; break-inside: avoid; }
    a { color: #000; text-decoration: none; }
}
