/* ==========================================================================
   Design tokens (UI/UX Pro Max "Cyberpunk UI" dark style, restrained)
   ========================================================================== */
:root {
  --bg: #05070a;
  --surface: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #e8edf4;
  --text-muted: #96a3b5;
  --green: #34f5a5;
  --green-dim: rgba(52, 245, 165, 0.1);
  --cyan: #38d6ef;
  --on-accent: #03120b;

  --font-mono: ui-monospace, "Cascadia Code", "Fira Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms; --t-base: 320ms; --t-slow: 900ms;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.65;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-sans); font-weight: 650; line-height: 1.05; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
p { margin: 0 0 var(--space-4); max-width: 66ch; }
a { color: var(--green); }
code { font-family: var(--font-mono); font-size: 0.88em; background: rgba(255, 255, 255, 0.06); padding: 0.1em 0.4em; border-radius: 4px; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: max(var(--space-6), env(safe-area-inset-left)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 1000;
  background: var(--green); color: var(--on-accent); padding: var(--space-2) var(--space-4); border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: var(--space-2); }

/* Atmosphere */
.aurora, .grain { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.aurora {
  background:
    radial-gradient(60vmax 40vmax at 90% 0%, rgba(56, 214, 239, 0.07), transparent 65%),
    radial-gradient(55vmax 40vmax at 0% 60%, rgba(52, 245, 165, 0.06), transparent 65%);
  will-change: transform;
}
.grain {
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h); }
.site-header::before {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: rgba(5, 7, 10, 0.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line); transition: opacity var(--t-base) var(--ease);
}
.site-header.is-scrolled::before { opacity: 1; }
.scroll-progress {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}
.nav { position: relative; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; font-family: var(--font-mono); font-weight: 700; color: var(--text); text-decoration: none; position: relative; z-index: 2; }
.brand-prompt { color: var(--green); }
.brand-name { font-size: 0.9rem; }
@media (max-width: 400px) { .brand-name { font-size: 0.78rem; } }
.nav-menu { display: flex; align-items: center; gap: var(--space-1); }
.nav-menu a {
  position: relative; display: inline-flex; align-items: baseline; gap: 0.5em; min-height: 44px; align-items: center; padding: 0 var(--space-3);
  color: var(--text-muted); text-decoration: none; font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.02em;
  transition: color var(--t-fast) var(--ease);
}
.nav-index { font-size: 0.68rem; color: var(--green); opacity: 0.7; }
.nav-menu a:not(.nav-cta)::after {
  content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 8px; height: 1px; background: var(--green);
  transform: scaleX(0); transform-origin: right; transition: transform var(--t-base) var(--ease);
}
.nav-menu a:not(.nav-cta):hover, .nav-menu a.is-active { color: var(--text); }
.nav-menu a:not(.nav-cta):hover::after, .nav-menu a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-menu a.nav-cta { margin-left: var(--space-2); padding: 0 var(--space-4); border: 1px solid rgba(52, 245, 165, 0.5); border-radius: 999px; color: var(--green); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-base); }
.nav-menu a.nav-cta:hover { background: var(--green); color: var(--on-accent); box-shadow: 0 0 28px rgba(52, 245, 165, 0.3); }

.nav-toggle { display: none; position: relative; z-index: 2; width: 44px; height: 44px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 18px; height: 2px; background: var(--text); position: relative; transition: transform var(--t-base) var(--ease), background var(--t-base); }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 859px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--space-2);
    padding: var(--header-h) var(--space-8) var(--space-8);
    background: radial-gradient(70vmax 50vmax at 100% 0%, rgba(52, 245, 165, 0.1), transparent 60%), rgba(5, 7, 10, 0.97);
    opacity: 0; visibility: hidden; transition: opacity var(--t-base) var(--ease), visibility var(--t-base);
  }
  .nav-menu.is-open { opacity: 1; visibility: visible; }
  .nav-menu li { width: 100%; overflow: hidden; }
  .nav-menu a { min-height: 56px; width: 100%; font-family: var(--font-sans); font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 600; letter-spacing: -0.02em; color: var(--text); padding: 0; transform: translateY(100%); transition: transform 600ms var(--ease), color var(--t-fast); }
  .nav-menu.is-open a { transform: none; }
  .nav-menu.is-open li:nth-child(2) a { transition-delay: 50ms; }
  .nav-menu.is-open li:nth-child(3) a { transition-delay: 100ms; }
  .nav-menu.is-open li:nth-child(4) a { transition-delay: 150ms; }
  .nav-menu.is-open li:nth-child(5) a { transition-delay: 200ms; }
  .nav-menu.is-open li:nth-child(6) a { transition-delay: 250ms; }
  .nav-menu a:not(.nav-cta)::after { display: none; }
  .nav-menu a.nav-cta { margin: var(--space-4) 0 0; width: auto; padding: 0 var(--space-6); font-size: 1.1rem; min-height: 52px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding-block: calc(var(--header-h) + var(--space-8)) var(--space-24); isolation: isolate; }
.hero-stage { position: absolute; inset: 0; z-index: -2; }
#scene { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s var(--ease); }
.has-3d #scene { opacity: 1; }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.92) 0%, rgba(5, 7, 10, 0.55) 45%, transparent 75%),
    linear-gradient(0deg, var(--bg) 0%, transparent 22%);
}
@media (max-width: 859px) {
  .hero-scrim { background: linear-gradient(0deg, var(--bg) 0%, transparent 25%), rgba(5, 7, 10, 0.55); }
  .has-3d #scene { opacity: 0.8; }
}

/* CSS-only fallback when WebGL / Three.js is unavailable */
.hero-fallback { position: absolute; top: 50%; right: 8%; width: min(46vw, 560px); aspect-ratio: 1; transform: translateY(-50%); transition: opacity var(--t-slow); }
.has-3d .hero-fallback { opacity: 0; visibility: hidden; }
.hero-fallback i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(52, 245, 165, 0.25); animation: orbit 40s linear infinite; }
.hero-fallback i:nth-child(1) { background: radial-gradient(circle at 35% 30%, rgba(52, 245, 165, 0.14), transparent 60%); }
.hero-fallback i:nth-child(2) { inset: -8%; border-color: rgba(56, 214, 239, 0.28); transform: rotateX(70deg); animation-duration: 55s; }
.hero-fallback i:nth-child(3) { inset: 14%; border-style: dashed; border-color: rgba(52, 245, 165, 0.2); animation-duration: 80s; animation-direction: reverse; }
@keyframes orbit { to { rotate: 360deg; } }
@media (max-width: 859px) { .hero-fallback { right: -20%; width: 90vw; opacity: 0.5; } }

.hero-content { position: relative; }
.hero-copy { max-width: 46rem; }
.hero-eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin-bottom: var(--space-6); max-width: 60ch; line-height: 1.7; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.045em; margin-bottom: var(--space-6); }
.accent { background: linear-gradient(100deg, var(--green), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--text-muted); margin-bottom: var(--space-6); max-width: 54ch; }
.availability { display: inline-flex; align-items: center; gap: 0.7em; margin: 0 0 var(--space-8); padding: 0.45rem 1rem; border: 1px solid rgba(52, 245, 165, 0.3); border-radius: 999px; background: var(--green-dim); font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); }
.availability-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 245, 165, 0.5); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(52, 245, 165, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 245, 165, 0); } }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.caret { display: inline-block; width: 0.5em; height: 1.05em; vertical-align: text-bottom; background: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.prompt { color: var(--green); margin-right: 0.35em; }

/* Terminal panel */
.terminal-panel { margin-top: var(--space-12); width: min(100%, 25rem); border: 1px solid var(--line); border-radius: 14px; background: rgba(8, 12, 17, 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 0.6rem var(--space-4); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.terminal-bar i:first-child { background: var(--green); opacity: 0.8; }
.terminal-bar span { margin-left: auto; }
.terminal-body { padding: var(--space-4) var(--space-4) var(--space-3); font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; }
.terminal-body p { margin: 0; max-width: none; }
.term-line { color: var(--text); }
.term-out { color: var(--text-muted); margin-bottom: var(--space-2) !important; padding-left: 1.1em; }
.term-out .ok { color: var(--green); margin-right: 0.4em; }
.js .term-out, .js .term-last { opacity: 0; transition: opacity 400ms var(--ease); }
.js .term-out.is-on, .js .term-last.is-on { opacity: 1; }
@media (min-width: 1100px) {
  .terminal-panel { position: absolute; right: var(--space-6); bottom: 0; margin-top: 0; width: 22rem; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 52px; padding: 0 var(--space-8);
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; text-decoration: none; border-radius: 999px; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-arrow { transition: transform var(--t-base) var(--ease); }
.btn-primary { background: var(--green); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(52, 245, 165, 0.3); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-ghost { color: var(--text); border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.hero-foot { position: absolute; left: 50%; bottom: var(--space-8); translate: -50% 0; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.scroll-cue { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; }
.scroll-cue i { display: block; width: 1px; height: 48px; background: linear-gradient(var(--green), transparent); transform-origin: top; animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 859px) { .hero-foot { display: none; } }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: clamp(5rem, 12vw, 9.5rem); }
.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.eyebrow { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-4); }
.eyebrow span { color: var(--green); }
.section h2 { font-size: clamp(2.5rem, 7.5vw, 5.5rem); letter-spacing: -0.04em; }
.mask { display: block; overflow: hidden; padding-block: 0.08em; }
.mask > span { display: inline-block; }
.section-note { color: var(--text-muted); margin: var(--space-6) 0 0; }

/* About */
.about-grid { display: grid; gap: var(--space-12); }
@media (min-width: 900px) { .about-grid { grid-template-columns: 7fr 5fr; gap: var(--space-16); align-items: start; } }
.about-copy .lead { font-size: clamp(1.1rem, 1.9vw, 1.4rem); line-height: 1.55; letter-spacing: -0.01em; color: var(--text); max-width: 52ch; margin-bottom: var(--space-6); }
.about-copy p:not(.lead) { color: var(--text-muted); }
.sysinfo { border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.025); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden; }
.sysinfo-bar { display: flex; align-items: center; gap: 6px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.sysinfo-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.sysinfo-bar i:first-child { background: var(--green); opacity: 0.8; }
.sysinfo-bar span { margin-left: auto; }
.facts { margin: 0; padding: var(--space-2) var(--space-6) var(--space-4); }
.facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px dashed var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--font-mono); font-size: 0.75rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; padding-top: 0.2em; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Skills */
.modules { display: grid; gap: var(--space-12); grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.module { position: relative; padding-top: var(--space-6); border-top: 1px solid var(--line); }
.module::before { content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, var(--green), var(--cyan)); transform: scaleX(0.18); transform-origin: left; transition: transform 700ms var(--ease); }
.module:hover::before { transform: scaleX(1); }
.module-index { font-family: var(--font-mono); font-size: 0.8rem; color: var(--green); margin-bottom: var(--space-8); }
.module h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: var(--space-3); transition: color var(--t-base); }
.module-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: var(--space-6); }
.module:hover h3 { color: var(--green); }

.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tags li { font-family: var(--font-mono); font-size: 0.78rem; padding: 0.3rem 0.75rem; border-radius: 999px; color: var(--text-muted); border: 1px solid var(--line); transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.module:hover .tags li, .project:hover .tags li { color: var(--text); border-color: rgba(52, 245, 165, 0.35); background: var(--green-dim); }

/* Projects */
.project-grid { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .project-grid { grid-template-columns: repeat(12, 1fr); gap: var(--space-8); }
  .project { grid-column: span 5; }
  .project:nth-child(4n + 1), .project:nth-child(4n + 4) { grid-column: span 7; }
  /* A trailing odd card spans the full row instead of leaving a gap */
  .project:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 17rem; }
}
.project {
  position: relative; display: flex; flex-direction: column; min-height: 22rem; padding: var(--space-8); border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line); overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: border-color var(--t-base) var(--ease), transform 280ms ease-out;
}
.project:hover { border-color: rgba(52, 245, 165, 0.4); }
.project-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--t-base); background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(52, 245, 165, 0.13), transparent 65%); }
.project:hover .project-glow { opacity: 1; }
.project > *:not(.project-glow) { position: relative; }
.project-num { position: absolute !important; top: var(--space-4); right: var(--space-6); margin: 0; font-family: var(--font-mono); font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.12); transition: -webkit-text-stroke-color var(--t-base); }
.project:hover .project-num { -webkit-text-stroke-color: rgba(52, 245, 165, 0.45); }
.project h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: var(--space-12) 0 var(--space-4); }
.project p:not(.project-meta):not(.project-num) { color: var(--text-muted); }
.project .tags { margin: var(--space-2) 0 var(--space-6); }
.project-meta { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--cyan); margin-bottom: var(--space-2); }
.project-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--space-6); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-mono); font-size: 0.88rem; color: var(--green); text-decoration: none; background: linear-gradient(currentColor, currentColor) left bottom 10px / 0 1px no-repeat; transition: background-size var(--t-base) var(--ease); }
.text-link[href]:hover { background-size: 100% 1px; }

/* CTF */
.timeline { border-top: 1px solid var(--line); }
.timeline-item { display: grid; gap: var(--space-4) var(--space-12); padding-block: var(--space-8); border-bottom: 1px solid var(--line); transition: background var(--t-base); }
@media (min-width: 760px) { .timeline-item { grid-template-columns: minmax(11rem, 17rem) 1fr; align-items: start; } }
.timeline-date { margin: 0; font-family: var(--font-mono); font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(52, 245, 165, 0.55); transition: color var(--t-base) var(--ease); }
.timeline-item:hover .timeline-date { color: var(--green); }
.timeline-body h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin-bottom: var(--space-3); }
.timeline-body p:last-child { color: var(--text-muted); margin-bottom: 0; }

/* Contact */
.contact { position: relative; }
.contact::after { content: ""; position: absolute; left: 50%; bottom: -10%; width: min(90vw, 900px); aspect-ratio: 2; translate: -50% 0; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(52, 245, 165, 0.09), transparent); }
.contact-title { font-size: clamp(2.6rem, 8.5vw, 6.5rem) !important; max-width: 14ch; }
.contact-list { border-top: 1px solid var(--line); }
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-link { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-1) var(--space-6); padding: var(--space-6) var(--space-2); min-height: 44px; color: var(--text); text-decoration: none; transition: padding var(--t-base) var(--ease), color var(--t-fast); }
@media (min-width: 760px) { .contact-link { grid-template-columns: 11rem 1fr auto; padding-block: var(--space-8); } }
.contact-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; }
.contact-value { font-size: clamp(1.15rem, 3vw, 2rem); letter-spacing: -0.02em; overflow-wrap: anywhere; grid-column: 1; }
@media (min-width: 760px) { .contact-value { grid-column: auto; } }
.contact-arrow { grid-column: 2; grid-row: 1 / span 2; color: var(--green); transition: transform var(--t-base) var(--ease); }
@media (min-width: 760px) { .contact-arrow { grid-row: auto; } }
.contact-link[href]:hover { padding-left: var(--space-6); color: var(--green); }
.contact-link[href]:hover .contact-arrow { transform: translate(4px, -4px); }

.site-footer { border-top: 1px solid var(--line); padding-block: var(--space-8); color: var(--text-muted); font-family: var(--font-mono); font-size: 0.82rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; }
.footer-inner p { margin: 0; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; }

/* ==========================================================================
   Scroll reveals (hidden only while JS is running; always visible otherwise)
   ========================================================================== */
.js .reveal {
  opacity: 0; translate: 0 28px;
  transition: opacity var(--t-slow) var(--ease) var(--d, 0s), translate var(--t-slow) var(--ease) var(--d, 0s), border-color var(--t-base) var(--ease), transform 280ms ease-out;
}
.js .reveal.is-visible { opacity: 1; translate: 0 0; }
.js .mask > span { transform: translateY(105%); transition: transform 1100ms var(--ease); }
.js .mask.is-visible > span { transform: none; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; translate: 0 0; }
  .js .mask > span { transform: none; }
  .js .term-out, .js .term-last { opacity: 1; }
  .caret { animation: none; }
  .project { transform: none !important; }
}

/* Skill status markers (shown only when data-status is set in the HTML) */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin-top: var(--space-6); font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.legend li { display: inline-flex; align-items: center; gap: 0.5em; }
.legend li[hidden] { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--text-muted); }
.dot[data-status="using"], .tags li[data-status="using"]::before { background: var(--green); border-color: var(--green); }
.dot[data-status="learning"], .tags li[data-status="learning"]::before { background: var(--cyan); border-color: var(--cyan); }
.dot[data-status="studied"], .tags li[data-status="studied"]::before { background: transparent; border-color: var(--text-muted); }
.tags li[data-status]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 0.55em; border-radius: 50%; border: 1px solid; vertical-align: 0.05em; }

/* Learning */
.learning-grid { display: grid; gap: var(--space-12); }
@media (min-width: 900px) { .learning-grid { grid-template-columns: 5fr 6fr; gap: var(--space-16); align-items: center; } }
.learning-main { position: relative; padding: var(--space-8); border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(150deg, rgba(52, 245, 165, 0.07), rgba(255, 255, 255, 0.01) 60%); overflow: hidden; }
.learning-label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin-bottom: var(--space-2); }
.learning-title { margin: 0 0 var(--space-4); font-family: var(--font-mono); font-size: clamp(4rem, 12vw, 7.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px rgba(52, 245, 165, 0.6); }
.learning-main h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); margin-bottom: var(--space-2); }
.learning-issuer { color: var(--text-muted); margin-bottom: var(--space-6); }
.learning-status { display: inline-flex; align-items: center; gap: 0.7em; margin: 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.lead-sm { font-size: clamp(1.1rem, 1.9vw, 1.4rem); line-height: 1.5; color: var(--text); margin-bottom: var(--space-8); }
.pipeline { position: relative; display: grid; gap: var(--space-4); padding-left: var(--space-8); counter-reset: step; }
.pipeline::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(var(--green), var(--cyan)); opacity: 0.5; }
.pipeline li { position: relative; counter-increment: step; font-family: var(--font-mono); font-size: 0.92rem; color: var(--text-muted); }
.pipeline li::before { content: ""; position: absolute; left: calc(-1 * var(--space-8) + 2px); top: 0.45em; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--green); }
.pipeline li span::before { content: "0" counter(step) "  "; color: var(--green); white-space: pre; }

/* Empty states */
.empty-state { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-8); border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--text-muted); background: rgba(255, 255, 255, 0.015); }
.empty-state svg { flex: none; color: var(--green); }
.empty-state p { margin: 0; font-size: clamp(1rem, 1.8vw, 1.2rem); }
.empty-state[hidden], .timeline[hidden] { display: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }

.project, .timeline-body { overflow-wrap: anywhere; }  /* long tokens */
