/* self-hosted variable fonts (Inter, JetBrains Mono), latin subset; both SIL OFL 1.1, see assets/fonts/LICENSE.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: dark;
  --navy: #e8edf5;
  --orange: #2dd4bf; /* accent (teal); name kept for legacy page styles */
  --accent-bright: #14b8a6;
  --ink: #e8edf5;
  --muted: #9aa5b8;
  --line: #232c3d;
  --bg: #0b1220;
  --surface: #111a2c;
  --dash: #34405a;
  --grid: rgba(45,212,191,0.07);
  --on-accent: #0b1220;
  --rail: 124px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --navy: #0b1220; --orange: #0f766e; --ink: #0b1220; --muted: #5b6270;
  --line: #e6e9ee; --bg: #fbfcfd; --surface: #fff; --dash: #cdd3dc;
  --grid: rgba(15,118,110,0.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding-left: var(--rail);
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.55;
}
h1, h2, h3 { letter-spacing: -0.02em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 40px; }
.mono-label.cmd { text-transform: none; letter-spacing: 0.02em; }
.mono-label { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); }

/* side rail */
header {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 28px 0 24px;
  background: var(--surface); border-right: 1px solid var(--line);
  z-index: 20;
}
header .brand { margin: 0 0 40px 24px; display: block; line-height: 0; }
header .brand img { width: 44px; height: auto; } /* sidebar mark width */
.mark-light { display: none; }
:root[data-theme="light"] .mark-light { display: block; }
:root[data-theme="light"] .mark-dark { display: none; }
nav { display: flex; flex-direction: column; }
header nav a {
  display: block; padding: 10px 8px 10px 24px;
  border-left: 3px solid transparent;
  text-decoration: none; color: var(--muted);
  font-size: 13px; font-weight: 500; line-height: 1.25;
}
header nav a span { display: block; font-family: var(--mono); font-size: 10px; color: var(--orange); }
header nav a:hover { color: var(--ink); }
header nav a.active { color: var(--ink); font-weight: 700; border-left-color: var(--accent-bright); }
.theme-toggle, .motion-toggle { margin: 0 0 14px 24px; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.motion-toggle { margin-top: auto; }
.motion-toggle ~ .theme-toggle { margin-top: 0; }
.theme-toggle { margin-top: auto; }
.theme-toggle svg, .motion-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.motion-toggle .play { display: none; }
:root[data-motion="paused"] .motion-toggle .play { display: block; }
:root[data-motion="paused"] .motion-toggle .pause { display: none; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
header .rail-social { margin-left: 24px; display: flex; flex-direction: column; gap: 14px; }
header .rail-social a { color: var(--navy); display: block; }
header .rail-social svg { width: 20px; height: 20px; fill: currentColor; display: block; }

/* mobile nav */
.hamburger { display: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.hamburger::before { content: "\2630"; font-size: 24px; color: var(--navy); }
.hamburger[aria-expanded="true"]::before { content: "\2715"; }
@media (max-width: 820px) {
  body { padding-left: 0; padding-top: 64px; }
  .wrap { padding: 0 20px; }
  header {
    flex-direction: row; align-items: center; justify-content: space-between;
    bottom: auto; right: 0; width: auto; padding: 8px 20px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  header .brand { margin: 0; }
  header .brand img { width: 36px; }
  .hamburger { display: block; order: 3; }
  .theme-toggle, .motion-toggle { margin: 0; order: 2; width: 44px; height: 44px; }
  .theme-toggle { margin-left: auto; }
  .motion-toggle ~ .theme-toggle { margin-left: 0; }
  .motion-toggle { margin-left: auto; }
  header nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); padding: 8px 20px 20px; border-bottom: 1px solid var(--line);
  }
  header nav.open { display: flex; }
  header nav a { padding: 10px 0 10px 12px; }
  header nav a span { display: inline; margin-right: 8px; }
  header .rail-social { display: none; }
}

/* footer */
footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
footer nav { flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }
footer nav a { color: var(--muted); text-decoration: none; }
footer nav a:hover { color: var(--ink); }
footer .mono { font-family: var(--mono); font-size: 12px; }

/* shared buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 13px 22px; border-radius: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--accent-bright); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(20,184,166,0.7); }
.btn-link { padding: 13px 0; color: var(--orange); border-bottom: 2px solid var(--accent-bright); border-radius: 0; }
.more { color: var(--orange); font-size: 13px; font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* a11y */
.skip { position: absolute; left: -9999px; background: var(--surface); color: var(--ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* drifting hero grid (40px tile, so the loop is seamless) */
#home { animation: grid-drift 6s linear infinite; } /* motion is home-page only */
@keyframes grid-drift { to { background-position: 40px 40px; } }

/* terminal prompt + blinking cursor */
.ps1 { color: var(--muted); margin-right: 6px; }
.cursor { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 3px; vertical-align: text-bottom; background: var(--accent-bright); }
#home .cursor { animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* gentle pulse on the "current" timeline dot (home .job, about .exp-item) */
.job.current::before, .exp-item.current::before { animation: dot-pulse 2.4s ease-in-out infinite; }
@keyframes dot-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-bright) 4%, transparent); } }

/* user-paused motion (WCAG 2.2.2) */
:root[data-motion="paused"] :is(.job, .exp-item).current::before { animation: none; }
:root[data-motion="paused"] #home { animation-play-state: paused; }
:root[data-motion="paused"] #home .cursor { animation: none; }

/* pause button lives in the bottom-right corner of the animated home hero (moved there by header.php's script) */
#home { position: relative; }
.motion-toggle.in-hero { position: absolute; right: 20px; bottom: 20px; margin: 0; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); z-index: 2; }

/* subtle company links in experience headings */
.co-link { color: inherit; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.co-link:hover, .co-link:focus-visible { text-decoration-style: solid; text-decoration-color: var(--accent-bright); }

/* home fx (see fx.js; classes only exist when JS runs and motion is allowed) */
.ln { opacity: 0; transition: opacity 0.2s; }
.ln.on { opacity: 1; }
.rv { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.rv.in { opacity: 1; transform: none; }
.timeline.rv { opacity: 1; transform: none; } /* container stays; its line draws instead */
.timeline.rv::before { transform: scaleY(0); transform-origin: top; transition: transform 1.4s ease-out; }
.timeline.rv.in::before { transform: none; }
#home::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(circle 200px at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent-bright) 6%, transparent), transparent);
}
#home.lit::before { opacity: 1; }
#home .wrap { position: relative; }

/* cross-fade between pages (Chromium/Safari; ignored elsewhere) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* card hovers */
.pillar { transition: opacity 0.6s ease, transform 0.25s ease; }
.pillar:hover { transform: translateY(-3px); }
.pillar svg { transition: stroke 0.2s; }
.pillar:hover svg { stroke: var(--accent-bright); }
.pillar.draw:hover svg * { stroke-dasharray: 1; animation: draw 0.7s ease-out; } /* pathLength set in fx.js */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.project .thumb { transition: box-shadow 0.2s; }
.project:hover .thumb { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-bright) 40%, transparent), 0 8px 24px -10px color-mix(in srgb, var(--accent-bright) 30%, transparent); }
.project:hover .arrow { transform: translateX(4px); }
.proj-card { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.proj-card.linked:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--accent-bright) 30%, transparent); }
:root[data-motion="paused"] .pillar:hover, :root[data-motion="paused"] .proj-card.linked:hover { transform: none; }

/* theme switch: the JS-driven circle wipe replaces the cross-fade (only while .theme-wipe is set) */
.theme-wipe::view-transition-old(root), .theme-wipe::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.scanline { position: fixed; left: 0; right: 0; top: 0; height: 2px; view-transition-name: scan; pointer-events: none; background: var(--accent-bright); box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent-bright) 60%, transparent); }
.cmdline { position: fixed; left: calc(var(--rail) + 20px); bottom: 20px; z-index: 30; padding: 6px 10px; font: 600 12px var(--mono); color: var(--orange); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; pointer-events: none; }
@media (max-width: 820px) { .cmdline { left: 20px; } }
