/* ==========================================================================
   Joseph Clyde S. Daño — portfolio styles
   Dark developer aesthetic with a light theme. Accent is used sparingly.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #09090b;
  --bg-2: #111114;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #8b8b94;
  --border: #27272a;
  --border-2: #3f3f46;
  --accent: #a3e635;
  --accent-text: #a3e635;
  --accent-ink: #0b0f05;
  --accent-soft: rgba(163, 230, 53, 0.1);
  --dim: #09090b;              /* colour turned-away carousel cards fade toward */
  --glass: rgba(9, 9, 11, 0.72);
  --grid-line: rgba(255, 255, 255, 0.045);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.6);

  --tok-kw: #c084fc;
  --tok-var: #60a5fa;
  --tok-prop: #e4e4e7;
  --tok-str: #a3e635;
  --tok-punc: #71717a;
  --tok-comment: #6b6b74;

  --font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 64px;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Soft off-white page with brighter cards, darker text, and visible edges (pure white read as glare). */
  --bg: #eeeeeb;
  --bg-2: #e4e4e0;
  --surface: #fafaf8;
  --surface-2: #efefeb;
  --text: #111113;
  --text-2: #3f3f46;
  --text-3: #57575f;
  --border: #d3d3ce;
  --border-2: #b9b9b3;
  --accent: #a3e635;
  --accent-text: #3f6212;
  --accent-ink: #0b0f05;
  --accent-soft: rgba(77, 124, 15, 0.13);
  --dim: #d6d6d0;
  --glass: rgba(238, 238, 235, 0.85);
  --grid-line: rgba(9, 9, 11, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 40px -22px rgba(0, 0, 0, 0.28);

  --tok-kw: #7c3aed;
  --tok-var: #2563eb;
  --tok-prop: #27272a;
  --tok-str: #3f6212;
  --tok-punc: #5b5b63;
  --tok-comment: #6b6b74;

  color-scheme: light;
}

@media (min-width: 640px) { :root { --gutter: 24px; } }

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.icon { width: 18px; height: 18px; flex: none; }
i.icon { display: inline-block; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 550; line-height: 1; white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn .icon { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.btn:hover .icon:last-child:not(:first-child) { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #b5f04f; }
.btn-ghost { border-color: var(--border-2); background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: var(--text-3); background: var(--surface); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--text-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-text); font-size: 0.9375rem; font-weight: 500;
}
.text-link .icon { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.text-link:hover .icon { transform: translateX(3px); }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
}

/* Navigation ------------------------------------------------------------- */
.site-nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.site-nav.is-scrolled, .site-nav.is-solid, .site-nav.menu-open {
  background: var(--glass);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 100%; }
/* Logo mark: J + D strokes with a terminal-cursor block (also used, animated, on the loading screen). */
.logo { display: inline-flex; align-items: center; padding: 2px 0; border-radius: 10px; }
.logo-mark { display: block; width: 36px; height: 36px; overflow: visible; }
.logo-tile { fill: var(--surface); stroke: var(--border-2); stroke-width: 1.5; transition: stroke 0.25s var(--ease); }
.logo-stroke { fill: none; stroke: var(--text); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.logo-cursor { fill: var(--accent); }
.logo:hover .logo-tile { stroke: var(--accent-text); }
@media (prefers-reduced-motion: no-preference) {
  .logo:hover .logo-cursor { animation: logo-blink 1s steps(1) infinite; }
}
@keyframes logo-blink { 50% { opacity: 0; } }
.nav-links { display: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-resume-long { display: none; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 0.875rem;
}
.back-link:hover { color: var(--text); }
.back-link .icon { width: 16px; height: 16px; }

@media (min-width: 900px) {
  .nav-menu-btn { display: none; }
  .nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
  .nav-links + .nav-actions { margin-left: 8px; }
  .nav-links a {
    position: relative; display: block; padding: 8px 12px;
    color: var(--text-2); font-size: 0.875rem; font-weight: 500;
    border-radius: 999px; transition: color 0.2s var(--ease);
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links a.is-active { color: var(--text); }
  .nav-links a.is-active::after {
    content: ""; position: absolute; left: 50%; bottom: 2px;
    width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
    background: var(--accent);
  }
}
@media (min-width: 1080px) { .nav-resume-long { display: inline; } }

@media (max-width: 899px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto; height: calc(100dvh - var(--nav-h));
    display: flex; flex-direction: column; gap: 4px;
    padding: 24px var(--gutter);
    background: var(--bg);
    border-top: 1px solid var(--border);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
  }
  .menu-open .nav-links { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-links a {
    display: flex; align-items: center; min-height: 52px;
    border-bottom: 1px solid var(--border);
    font-size: 1.25rem; font-weight: 500; color: var(--text-2);
  }
  .nav-links a.is-active { color: var(--text); }
  .nav-links a.is-active::before { content: ""; width: 6px; height: 6px; margin-right: 12px; border-radius: 50%; background: var(--accent); }
}
@media (max-width: 380px) { .nav-resume { display: none; } }

/* Section scaffolding ------------------------------------------------------ */
.section { position: relative; padding: 88px 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
@media (min-width: 900px) { .section { padding: 120px 0; } }

.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head-row { max-width: none; display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 900px) {
  .section-head-row { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .section-head-row > div:first-child { flex: 1 1 340px; max-width: 600px; }
  .section-head-row > .filter-tabs { flex: 0 1 auto; max-width: 620px; justify-content: flex-end; }
}
.section-index {
  margin-bottom: 14px;
  color: var(--accent-text); font-family: var(--mono); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.section-index span { color: var(--text-3); margin: 0 4px; }
h2 { font-size: clamp(2rem, 4.2vw, 2.75rem); font-weight: 650; line-height: 1.1; letter-spacing: -0.035em; }
.section-lead { margin-top: 16px; color: var(--text-2); font-size: 1.0625rem; max-width: 600px; }
.subhead {
  margin-bottom: 16px; color: var(--text-3);
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
}

/* Reveal ----------------------------------------------------------------- */
.can-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.can-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* Hero ------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + 56px) 0 80px;
  min-height: min(100svh, 920px);
  display: flex; align-items: center;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
}
.hero-bg::after {
  content: ""; position: absolute; left: 50%; top: -20%;
  width: 900px; height: 600px; margin-left: -450px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  opacity: 0.8;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-bg { animation: grid-drift 40s linear infinite; }
  @keyframes grid-drift { to { background-position: center 56px; } }
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px; } }

.hero-status { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.avatar {
  display: grid; place-items: center; overflow: hidden; flex: none;
  border: 1px solid var(--border-2); border-radius: 50%;
  background: var(--surface); color: var(--text-2);
  font-family: var(--mono); font-weight: 600;
}
.avatar-sm { width: 40px; height: 40px; font-size: 0.75rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 0.8125rem;
}
.status-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .status-pill .status-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent);
    animation: ping 2.4s var(--ease) infinite;
  }
  @keyframes ping { 70%, 100% { transform: scale(2.6); opacity: 0; } }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 700;
  line-height: 1; letter-spacing: -0.045em;
}
.hero-headline {
  margin-top: 20px;
  color: var(--text); font-family: var(--mono); font-size: clamp(0.8125rem, 1.6vw, 0.9375rem); font-weight: 500;
  letter-spacing: 0.01em;
}
.hero-headline span { color: var(--accent-text); margin: 0 6px; }
.hero-intro { margin-top: 20px; max-width: 580px; color: var(--text-2); font-size: clamp(1rem, 1.6vw, 1.125rem); line-height: 1.7; }
.hero-intro em { font-style: normal; color: var(--text); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 40px; }
.social-links { display: flex; gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-row li { padding: 3px 9px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-family: var(--mono); font-size: 0.75rem; }

/* Editor: a VS Code-style window -----------------------------------------
   .editor-wrap draws the 1px frame (with a light travelling around it) and tilts toward the
   cursor (effects.js sets --erx/--ery); .editor is the opaque window on top of it. */
@property --beam-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.editor-wrap {
  position: relative; min-width: 0; padding: 1px; border-radius: 14px;
  background: var(--border);
  transform: perspective(1400px) rotateX(var(--erx, 0deg)) rotateY(var(--ery, 0deg));
  transition: transform 0.4s var(--ease);
}
.editor-wrap::before, .editor-wrap::after {
  content: ""; position: absolute; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--beam-angle), transparent 0deg 250deg, color-mix(in srgb, var(--accent) 85%, transparent) 320deg, transparent 360deg);
  animation: beam-spin 8s linear infinite;
}
.editor-wrap::before { inset: 0; }
.editor-wrap::after { inset: 8px; z-index: -1; filter: blur(26px); opacity: 0.45; }
@keyframes beam-spin { to { --beam-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .editor-wrap::before, .editor-wrap::after { animation: none; } }
.editor {
  position: relative; z-index: 1; overflow: hidden;
  border-radius: 13px; background: var(--surface); box-shadow: var(--shadow);
}
.editor-bar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  height: 38px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.editor-dots { display: flex; gap: 7px; }
.editor-dots i { width: 11px; height: 11px; border-radius: 50%; }
.editor-dots .dot-close { background: #ff5f57; }
.editor-dots .dot-min { background: #febc2e; }
.editor-dots .dot-max { background: #28c840; }
.editor-title { margin: 0; padding-right: 47px; color: var(--text-3); font-family: var(--mono); font-size: 0.6875rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-main { display: flex; min-width: 0; }
.editor-activity {
  display: flex; flex-direction: column; align-items: center; gap: 16px; flex: none;
  width: 44px; padding: 14px 0; border-right: 1px solid var(--border); background: var(--bg-2); color: var(--text-3);
}
.activity-item { position: relative; display: grid; place-items: center; width: 100%; }
.activity-item .icon { width: 18px; height: 18px; }
.activity-item.is-active { color: var(--text); }
.activity-item.is-active::before { content: ""; position: absolute; left: 0; top: -5px; bottom: -5px; width: 2px; background: var(--accent); }
.editor-content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.editor-tabs { display: flex; height: 36px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.editor-tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 0 12px; border: 0; border-right: 1px solid var(--border); background: none;
  color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; white-space: nowrap;
}
.editor-tab:hover { color: var(--text-2); }
.editor-tab.is-active { margin-bottom: -1px; background: var(--surface); color: var(--text); }
.editor-tab.is-active::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); }
.file-icon { display: inline-grid; place-items: center; min-width: 18px; height: 14px; padding: 0 3px; border-radius: 3px; font-size: 0.5625rem; font-weight: 700; }
.file-ts { background: #3178c6; color: #fff; }
.file-json { min-width: 14px; padding: 0; color: #d4a72c; font-size: 0.75rem; }
.tab-close { margin-left: 2px; font-size: 0.875rem; line-height: 1; opacity: 0; transition: opacity 0.15s var(--ease); }
.editor-tab.is-active .tab-close, .editor-tab:hover .tab-close { opacity: 0.6; }
.editor-crumbs { margin: 0; padding: 7px 16px 0; color: var(--text-3); font-family: var(--mono); font-size: 0.6875rem; white-space: nowrap; overflow: hidden; }
.editor-crumbs span { margin: 0 4px; opacity: 0.6; }
.editor-body { padding: 8px 0 14px; overflow-x: auto; }
.editor-body:focus-visible { outline-offset: -2px; }
.editor-code {
  margin: 0; counter-reset: line;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.75; tab-size: 2;
}
.editor-code .line { display: block; padding-right: 20px; white-space: pre; }
.editor-code .line::before {
  counter-increment: line; content: counter(line);
  display: inline-block; width: 3.2em; padding-right: 1.4em; text-align: right;
  color: var(--text-3); opacity: 0.55; user-select: none;
}
@media (prefers-reduced-motion: no-preference) {
  .editor-code .line { animation: line-in 0.45s var(--ease) both; }
  .editor-code .line:nth-child(2) { animation-delay: 0.04s; } .editor-code .line:nth-child(3) { animation-delay: 0.08s; }
  .editor-code .line:nth-child(4) { animation-delay: 0.12s; } .editor-code .line:nth-child(5) { animation-delay: 0.16s; }
  .editor-code .line:nth-child(6) { animation-delay: 0.2s; } .editor-code .line:nth-child(7) { animation-delay: 0.24s; }
  .editor-code .line:nth-child(8) { animation-delay: 0.28s; } .editor-code .line:nth-child(9) { animation-delay: 0.32s; }
  .editor-code .line:nth-child(10) { animation-delay: 0.36s; } .editor-code .line:nth-child(11) { animation-delay: 0.4s; }
  .editor-code .line:nth-child(12) { animation-delay: 0.44s; } .editor-code .line:nth-child(n+13) { animation-delay: 0.48s; }
  @keyframes line-in { from { opacity: 0; transform: translateX(-6px); } }
}
.tok-kw { color: var(--tok-kw); }
.tok-var { color: var(--tok-var); }
.tok-prop { color: var(--tok-prop); }
.tok-str { color: var(--tok-str); }
.tok-punc { color: var(--tok-punc); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
/* The line holding the cursor is highlighted, as in VS Code. */
.editor-code .line:last-child { background: color-mix(in srgb, var(--text) 5%, transparent); }

/* Integrated terminal (effects.css types the command once the code has finished) */
.editor-terminal { padding: 0 16px 12px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-2) 55%, var(--surface)); font-family: var(--mono); font-size: 0.75rem; }
.terminal-head { display: flex; align-items: center; gap: 16px; height: 30px; margin: 0 0 6px; color: var(--text-3); font-size: 0.625rem; letter-spacing: 0.06em; text-transform: uppercase; }
.terminal-head .is-active { align-self: stretch; display: grid; align-items: center; color: var(--text); box-shadow: inset 0 -1px 0 var(--accent); }
.terminal-head b { margin-left: auto; font-weight: 400; letter-spacing: 0; text-transform: none; }
.term-line { margin: 0; overflow: hidden; white-space: pre; color: var(--text-2); line-height: 1.7; }
.term-prompt { color: var(--accent-text); }
.term-out { color: var(--accent-text); }

.editor-status {
  display: flex; align-items: center; gap: 14px; height: 26px; padding: 0 12px;
  border-top: 1px solid var(--border); background: var(--bg-2);
  color: var(--text-3); font-family: var(--mono); font-size: 0.6875rem;
}
.editor-status > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.editor-status > span:first-child { color: var(--accent-text); }
.editor-status .icon { width: 12px; height: 12px; }
.editor-status .status-spacer { flex: 1; }
@media (max-width: 520px) {
  .editor-activity, .status-optional, .editor-title { display: none; }
  .editor-bar { grid-template-columns: auto; }
}

/* About ------------------------------------------------------------------ */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 80px; align-items: start; } }
.about-copy { display: grid; gap: 20px; color: var(--text-2); font-size: 1.0625rem; line-height: 1.75; max-width: 640px; }
.about-copy .lead { color: var(--text); font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.5; letter-spacing: -0.015em; }
.about-card { display: grid; gap: 24px; }
@media (min-width: 900px) { .about-card { position: sticky; top: calc(var(--nav-h) + 32px); width: 100%; max-width: 360px; justify-self: end; } }
.portrait {
  position: relative; aspect-ratio: 4 / 5; max-width: 360px; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
/* The backdrop-removed photo sits inside the same framed panel as other surfaces: a soft accent
   glow behind the head, the shared grid texture, and shoulders cropped cleanly by the frame. */
.portrait.has-photo {
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, var(--accent-soft), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface);
}
.portrait.has-photo img { object-position: center bottom; }
.portrait-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--border-2); font-family: var(--mono); font-size: 4rem; font-weight: 700; letter-spacing: -0.05em;
}

/* Timeline --------------------------------------------------------------- */
.timeline { position: relative; display: grid; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 1px; background: var(--border); }
.timeline-item { position: relative; display: grid; gap: 8px; padding: 0 0 48px 36px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--border-2);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.timeline-item:first-child::before { background: var(--accent); border-color: var(--accent); }
.timeline-item:hover::before { border-color: var(--accent); }
@media (min-width: 760px) {
  .timeline::before { left: 205px; }
  .timeline-item { grid-template-columns: 180px 1fr; gap: 50px; padding-left: 0; }
  .timeline-item::before { left: 200px; }
}
.timeline-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-3); font-family: var(--mono); font-size: 0.8125rem; }
@media (min-width: 760px) { .timeline-when { flex-direction: column; align-items: flex-start; padding-top: 3px; } }
.timeline-body h3 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; }
.timeline-role { margin-top: 2px; color: var(--accent-text); font-weight: 500; }
.timeline-body .text-link { margin-top: 16px; font-size: 0.875rem; }
.duties { margin-top: 14px; max-width: 640px; }
.duties summary {
  display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  color: var(--text-2); font-size: 0.875rem; font-weight: 500;
}
.duties summary::-webkit-details-marker { display: none; }
.duties summary .icon { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.duties[open] summary .icon { transform: rotate(180deg); }
.duties summary:hover { color: var(--text); }
.duties ul, .bullet-list { display: grid; gap: 8px; margin-top: 12px; }
.duties li, .bullet-list li { position: relative; padding-left: 20px; color: var(--text-2); }
.duties li::before, .bullet-list li::before { content: ""; position: absolute; left: 2px; top: 0.75em; width: 8px; height: 1px; background: var(--text-3); }
@media (min-width: 760px) {
  .duties summary { display: none; }
  .duties ul { margin-top: 14px; }
}
.certs { margin-top: 72px; }

/* Lists of rows (more builds, certificates) */
.build-list { border-top: 1px solid var(--border); }
.build-row > a, .build-row > div {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 24px;
  padding: 18px 4px; border-bottom: 1px solid var(--border);
  transition: background-color 0.2s var(--ease), padding 0.2s var(--ease);
}
.build-row > a:hover { background: var(--surface); padding-inline: 12px; }
.build-title { display: flex; flex-direction: column; font-weight: 550; }
.build-title small { color: var(--text-3); font-size: 0.875rem; font-weight: 400; }
.build-tech { display: none; color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; }
.build-row .icon { color: var(--text-3); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.build-row > a:hover .icon { color: var(--accent-text); transform: translate(2px, -2px); }
@media (min-width: 700px) {
  .build-row > a { grid-template-columns: 1fr auto auto; }
  .build-tech { display: block; }
}

/* Projects --------------------------------------------------------------- */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn {
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text-2); font-size: 0.8125rem; font-weight: 500;
  transition: all 0.2s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-2); }
.filter-btn.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

.project-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.project-num { color: var(--accent-text); font-weight: 600; }
.project-tagline { color: var(--text-2); font-weight: 500; }

/* 3D rotating project carousel ---------------------------------------------
   carousel.js places the slides around a ring (rotateY + translateZ), turns the ring slowly,
   and sets --dist (angular distance from the front, in slide steps) to dim turned-away cards. */
/* The viewport bleeds to the window edges; clip at the section so 100vw (which includes the scrollbar) never widens the page. */
#projects, #stack { overflow-x: clip; } /* #stack: edge tiles' hover tooltips */
.carousel { --slide-w: min(600px, 84vw); position: relative; margin-bottom: 72px; }
.carousel-viewport {
  position: relative; margin-inline: calc(50% - 50vw); padding-block: 16px 8px;
  overflow: hidden; perspective: 1800px; perspective-origin: 50% 35%;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.carousel-track { position: relative; height: 640px; transform-style: preserve-3d; will-change: transform; }
.slide {
  position: absolute; top: 0; left: 50%; width: var(--slide-w); margin-left: calc(var(--slide-w) / -2);
  backface-visibility: hidden; cursor: pointer;
}
.slide.is-active { cursor: auto; }
.slide.is-hidden { visibility: hidden; pointer-events: none; }

/* Prev / next arrows, floating over the ring's left and right edges */
.carousel-arrow {
  position: absolute; top: 42%; z-index: 5;
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
  border: 1px solid var(--border-2); border-radius: 50%;
  background: var(--glass); color: var(--text); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.carousel-arrow .icon { width: 22px; height: 22px; }
.carousel-arrow:hover { border-color: var(--accent-text); color: var(--accent-text); transform: scale(1.06); }
.carousel-arrow:active { transform: scale(0.96); }
.carousel-arrow-prev { left: 0; }
.carousel-arrow-next { right: 0; }
.carousel-arrow[hidden] { display: none; }
@media (max-width: 699px) {
  .carousel-arrow { top: 30%; width: 44px; height: 44px; }
  .carousel-arrow-prev { left: -6px; }
  .carousel-arrow-next { right: -6px; }
}
.slide-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Side slides dim toward the page colour so the front card leads, in either theme. */
.slide-card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--dim); opacity: min(0.75, calc(var(--dist, 0) * 0.3));
}
.slide.is-active .slide-card { border-color: var(--border-2); }
.slide.is-active .slide-card:hover { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow); }
.slide-media {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.slide-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.slide.is-active .slide-card:hover .slide-media img { transform: scale(1.03); }
.slide-body { display: grid; gap: 10px; padding: 22px 24px 24px; }
.slide-body h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.slide-body h3 a { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size 0.3s var(--ease); }
.slide-body h3 a:hover { background-size: 100% 1px; }
.slide-body .project-tagline { margin-top: -6px; font-size: 0.9375rem; }
.slide-summary {
  color: var(--text-2); font-size: 0.9375rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
@media (max-width: 699px) {
  .slide-body { padding: 18px 18px 20px; }
}
/* Real screenshots sit in a browser frame at their natural ratio (no cropping of nav or CTAs). */
.shot { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--surface); }
.shot img { flex: 1; width: 100%; min-height: 0; object-fit: cover; object-position: top center; }
.case-cover:has(.shot) { aspect-ratio: auto; }
.case-cover:has(.shot) img { height: auto; }
.illus { position: relative; width: 100%; height: 100%; background: #0d0d10; }
.illus img { width: 100%; height: 100%; object-fit: cover; }
.illus-label {
  position: absolute; right: 10px; bottom: 10px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 9, 11, 0.7); color: #a1a1aa;
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.case-cover:has(.illus) { aspect-ratio: 16 / 10; }
.check-list { display: grid; gap: 6px; font-size: 0.9375rem; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { width: 16px; height: 16px; margin-top: 4px; color: var(--accent-text); }
@media (min-width: 560px) { .check-list-cols { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tags li {
  padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-2); font-family: var(--mono); font-size: 0.75rem;
}
.tech-tags-lg li { padding: 6px 12px; font-size: 0.8125rem; background: var(--surface); }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.empty-filter { padding: 40px 0; color: var(--text-2); text-align: center; }

/* Placeholder visuals (used when no screenshot is supplied) */
.placeholder {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--bg-2);
  color: var(--text-3);
}
.ph-chrome { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.ph-chrome i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.ph-chrome span { margin-left: 10px; padding: 2px 10px; border-radius: 4px; background: var(--bg-2); font-family: var(--mono); font-size: 0.6875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-art { position: relative; flex: 1; display: flex; gap: 14px; padding: 18px; min-height: 0; }
.ph-side { width: 22%; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.ph-lines { flex: 1; display: grid; grid-template-rows: 1.4fr 1fr 1fr 1fr; gap: 10px; }
.ph-lines i { border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.ph-lines i:first-child { background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--surface); }
.placeholder-board .ph-art, .placeholder-logic .ph-art { align-items: center; justify-content: center; }
.chip {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 84px; height: 84px; border-radius: 8px;
  border: 1px solid var(--border-2); background: var(--surface);
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-2);
  box-shadow: 0 0 0 6px var(--bg-2), 0 0 0 7px var(--border);
}
.chip b { color: var(--accent-text); font-weight: 600; }
.trace { position: absolute; height: 1px; background: var(--border-2); }
.trace.t1 { left: 10%; right: 50%; top: 40%; }
.trace.t2 { left: 50%; right: 12%; top: 58%; }
.trace.t3 { left: 30%; right: 30%; top: 76%; background: var(--accent); opacity: 0.5; }
.bits { font-family: var(--mono); font-size: 0.9375rem; line-height: 1.8; color: var(--text-2); text-align: right; }
.bits b { color: var(--accent-text); font-weight: 600; border-top: 1px solid var(--border-2); display: inline-block; padding-top: 2px; }
.ph-label {
  position: absolute; right: 12px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.6875rem; color: var(--text-3);
}
.ph-label .icon { width: 13px; height: 13px; }
.placeholder-small .ph-art { padding: 14px; }
.placeholder-small .chip { width: 64px; height: 64px; }
.placeholder-small .bits { font-size: 0.8125rem; }

/* Tech stack ------------------------------------------------------------- */
/* Header row: title, hint, and category tabs beside the rotating tech globe (tech-sphere.js). */
.stack-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 48px; }
@media (min-width: 900px) { .stack-top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; } }
.stack-head { margin-bottom: 0; }
.stack-head .filter-tabs { margin-top: 28px; }
.stack-panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 900px) { .stack-panels { grid-template-columns: repeat(2, 1fr); column-gap: 48px; } }
.stack-group h3 { margin-bottom: 14px; color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tech-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); text-align: center;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tech-tile:hover, .tech-tile:focus-visible { border-color: var(--border-2); color: var(--text); transform: translateY(-2px); }
.tech-icon { display: grid; place-items: center; width: 28px; height: 28px; transition: color 0.2s var(--ease); }
.tech-tile:hover .tech-icon, .tech-tile:focus-visible .tech-icon { color: var(--accent-text); }
.brand-icon { width: 24px; height: 24px; }
.tech-mono { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; letter-spacing: -0.02em; }
/* Long names wrap to two lines instead of being cut off mid-word. */
.tech-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  max-width: 100%; overflow: hidden; font-size: 0.75rem; line-height: 1.35; overflow-wrap: anywhere;
}
.tech-tile::after {
  content: attr(data-tooltip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 5;
  padding: 5px 9px; border-radius: 6px; border: 1px solid var(--border-2);
  background: var(--text); color: var(--bg); font-size: 0.75rem; font-weight: 500; white-space: nowrap;
  opacity: 0; transform: translate(-50%, 4px); pointer-events: none;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}
.tech-tile:hover::after, .tech-tile:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .tech-tile::after { display: none; } }

/* Contact ---------------------------------------------------------------- */
.contact { overflow: hidden; }
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: -320px; z-index: -1;
  width: 900px; height: 600px; margin-left: -450px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
}
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (min-width: 1000px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 80px; align-items: start; } }
.contact-copy h2 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); }
.contact-list { display: grid; margin-top: 36px; border-top: 1px solid var(--border); max-width: 520px; }
.contact-list li { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.contact-list li > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.contact-list a, .contact-list li > div > span:last-child { font-weight: 500; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent-text); }
.contact-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); background: var(--surface); }
.contact-label { color: var(--text-3); font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text-2); font-size: 0.8125rem;
  transition: all 0.2s var(--ease);
}
.copy-btn .icon { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--text); border-color: var(--border-2); }
.copy-btn.is-copied { color: var(--accent-text); border-color: var(--accent-text); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 32px; }

.contact-form {
  display: grid; gap: 16px; padding: 28px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  box-shadow: var(--shadow);
}
.contact-form .subhead { margin: 0; }
.contact-form label { display: grid; gap: 6px; color: var(--text-2); font-size: 0.8125rem; font-weight: 500; }
.contact-form input, .contact-form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.contact-form .btn { justify-self: start; }
.form-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } .is-compose .form-row { grid-template-columns: 1fr; } }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.topic-chips legend { width: 100%; margin-bottom: 6px; padding: 0; color: var(--text-2); font-size: 0.8125rem; font-weight: 500; }
.contact-form .topic-chips label { position: relative; display: block; }
.topic-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.topic-chips span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  color: var(--text-2); font-size: 0.8125rem; font-weight: 500;
  transition: all 0.2s var(--ease);
}
.topic-chips span:hover { color: var(--text); border-color: var(--border-2); }
.topic-chips input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.topic-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.honeypot { position: absolute !important; left: -9999px !important; }
.form-status:empty { display: none; }
.form-status { color: var(--text-2); font-size: 0.875rem; }
.fine-print { color: var(--text-3); font-size: 0.75rem; }
.fine-print a { text-decoration: underline; text-underline-offset: 2px; }

/* Footer / utilities ----------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-3); font-size: 0.875rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a:hover { color: var(--text); }

.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 0.875rem; font-weight: 500;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

/* Case study ------------------------------------------------------------- */
.case { padding-top: var(--nav-h); }
.case-loading { padding: 120px var(--gutter); color: var(--text-2); }
.case-hero { padding: 64px 0 0; }
.case-hero h1 { margin-top: 16px; font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1.02; }
.case-tagline { margin-top: 12px; color: var(--text-2); font-size: clamp(1.125rem, 2vw, 1.375rem); }
.case-cover {
  margin-top: 48px; overflow: hidden; aspect-ratio: 16 / 9;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
.case-cover img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-cover .ph-art { padding: clamp(18px, 4vw, 40px); gap: clamp(14px, 3vw, 28px); }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 72px 40px; }
@media (min-width: 960px) { .case-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 72px; } }
.case-toc { display: none; }
@media (min-width: 960px) {
  .case-toc { display: block; position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
  .case-toc ol { display: grid; gap: 2px; margin-top: 12px; border-left: 1px solid var(--border); }
  .case-toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--text-3); font-size: 0.875rem; }
  .case-toc a:hover { color: var(--text); border-left-color: var(--accent); }
}
.mini-label { color: var(--text-3); font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.case-body { display: grid; gap: 56px; max-width: 760px; }
.case-section { display: grid; gap: 18px; color: var(--text-2); font-size: 1.0625rem; line-height: 1.75; }
.case-section h2 { display: flex; align-items: baseline; gap: 14px; color: var(--text); font-size: clamp(1.375rem, 2.6vw, 1.75rem); letter-spacing: -0.025em; }
.case-section h2 span { color: var(--accent-text); font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; }
.case-section .lead { color: var(--text); font-size: 1.1875rem; }
.case-section .check-list { font-size: 1rem; }
.arch-flow { display: grid; gap: 10px; counter-reset: step; }
@media (min-width: 700px) {
  .arch-flow { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
  .arch-flow li + li { margin-left: 18px; }
  .arch-flow li:not(:last-child)::after {
    content: ""; position: absolute; top: 50%; right: -19px; width: 19px; height: 1px; background: var(--border-2);
  }
}
.arch-flow li {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 0.8125rem; line-height: 1.4;
}
.arch-flow strong { color: var(--text); font-size: 0.875rem; font-weight: 600; }
.arch-step { color: var(--accent-text); font-family: var(--mono); font-size: 0.6875rem; }
.gallery { display: grid; gap: 16px; }
@media (min-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; } }
.gallery figure { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty {
  display: flex; align-items: center; gap: 12px; padding: 28px 20px;
  border: 1px dashed var(--border-2); border-radius: var(--radius-sm);
  color: var(--text-3); font-size: 0.9375rem;
}
.challenges { display: grid; gap: 12px; }
.challenge { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.9375rem; }
@media (min-width: 640px) { .challenge { grid-template-columns: 1fr 1fr; gap: 28px; } }
.challenge p { margin-top: 6px; }
.case-links { padding-top: 32px; border-top: 1px solid var(--border); }
.case-links .hero-actions { margin-top: 0; }
.case-footer-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; padding-block: 32px 96px; }
.next-project { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.next-project strong { display: inline-flex; align-items: center; gap: 8px; font-size: 1.25rem; letter-spacing: -0.02em; }
.next-project .icon { color: var(--accent-text); transition: transform 0.2s var(--ease); }
.next-project:hover .icon { transform: translateX(3px); }
.missing { padding-block: 160px 120px; display: grid; gap: 16px; justify-items: start; }
.missing h1 { font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -0.04em; line-height: 1; }
.missing-list { width: 100%; max-width: 760px; margin: 16px 0 8px; }

/* Policy pages ------------------------------------------------------------ */
.policy { padding-block: calc(var(--nav-h) + 72px) 96px; }
.policy h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); letter-spacing: -0.04em; line-height: 1.05; }
.policy > .container > p { margin-top: 16px; max-width: 640px; color: var(--text-2); font-size: 1.0625rem; }
.policy-grid { display: grid; gap: 12px; margin-top: 48px; }
@media (min-width: 700px) { .policy-grid { grid-template-columns: 1fr 1fr; } }
.policy-grid article { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.policy-grid h2 { font-size: 1.0625rem; letter-spacing: -0.01em; }
.policy-grid p { margin-top: 8px; color: var(--text-2); font-size: 0.9375rem; }
.policy-grid a { color: var(--accent-text); overflow-wrap: anywhere; }
.policy-updated { margin-top: 32px; color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; }

/* Resume ----------------------------------------------------------------- */
.resume-page main { padding-block: calc(var(--nav-h) + 40px) 80px; }
.resume-sheet {
  max-width: 820px; margin-inline: auto; padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.resume-head h1 { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.04em; line-height: 1.05; }
.resume-headline { margin-top: 8px; color: var(--accent-text); font-family: var(--mono); font-size: 0.875rem; }
.resume-contact { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 14px; color: var(--text-2); font-size: 0.875rem; }
.resume-contact a:hover { color: var(--text); }
.resume-contact span[aria-hidden] { color: var(--border-2); }
.resume-section { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }
.resume-section h2 { margin-bottom: 14px; color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.resume-section > p { color: var(--text-2); }
.resume-item + .resume-item { margin-top: 18px; }
.resume-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.resume-item h3 { font-size: 1rem; font-weight: 600; }
.resume-item h3 span { color: var(--text-2); font-weight: 400; }
.resume-item time { color: var(--text-3); font-family: var(--mono); font-size: 0.8125rem; }
.resume-item p, .resume-item li { color: var(--text-2); font-size: 0.9375rem; }
.resume-item ul { margin-top: 6px; padding-left: 18px; list-style: disc; }
.resume-tech { margin-top: 2px; font-family: var(--mono); font-size: 0.75rem !important; color: var(--text-3) !important; }
.resume-skills { display: grid; gap: 8px; }
.resume-skills div { display: grid; gap: 2px 16px; font-size: 0.9375rem; }
@media (min-width: 600px) { .resume-skills div { grid-template-columns: 170px 1fr; } }
.resume-skills dt { font-weight: 600; }
.resume-skills dd { color: var(--text-2); }

@media print {
  :root, :root[data-theme="light"] { --bg: #fff; --surface: #fff; --text: #111; --text-2: #333; --text-3: #555; --border: #ddd; --accent-text: #3f6212; }
  body { background: #fff; font-size: 11pt; }
  .site-nav, .site-footer, .back-to-top, .toast, .skip-link { display: none !important; }
  .resume-page main { padding: 0; }
  .resume-sheet { border: 0; padding: 0; max-width: none; }
  .resume-section { break-inside: avoid-page; }
  .resume-item { break-inside: avoid; }
  a { text-decoration: none; }
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
