/* =========================================================================
   Laszlo Romsics — Portfolio
   Data-as-portrait · monochrome + electric accent · JetBrains Mono
   ========================================================================= */

:root {
  /* Neutrals (cool, low-chroma) — DARK is default */
  --bg:        oklch(0.155 0.006 255);
  --bg-2:      oklch(0.185 0.007 255);
  --surface:   oklch(0.205 0.008 255);
  --line:      oklch(0.30 0.008 255);
  --line-soft: oklch(0.255 0.007 255);
  --fg:        oklch(0.93 0.004 255);
  --fg-dim:    oklch(0.74 0.006 255);
  --muted:     oklch(0.56 0.008 255);

  /* Electric accent (swappable via Tweaks) */
  --accent:      #43E6C9;
  --accent-ink:  #04221d;     /* text on accent */

  --maxw: 1180px;
  --gut: clamp(20px, 5vw, 64px);

  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --reveal-dur: 0.9s;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        oklch(0.975 0.003 255);
  --bg-2:      oklch(0.955 0.004 255);
  --surface:   oklch(0.99 0.002 255);
  --line:      oklch(0.86 0.005 255);
  --line-soft: oklch(0.91 0.004 255);
  --fg:        oklch(0.20 0.008 255);
  --fg-dim:    oklch(0.38 0.008 255);
  --muted:     oklch(0.52 0.01 255);
  --accent:     #0a7a68;
  --accent-ink: #fff;
  color-scheme: light;
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html, body { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html, body { scroll-behavior: auto; } }

body {
  font-family: var(--f-mono);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  font-size: 16px;
  overflow-x: hidden;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
  cursor: none;
}
@media (hover: none), (pointer: coarse) { body { cursor: auto; } }

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
canvas { display: block; }

/* ------------------------------------------------------------- utilities */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.mono-label {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }

/* ============================================================== CURSOR == */
.cursor, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  border-radius: 50%; mix-blend-mode: difference; will-change: transform;
}
.cursor { width: 7px; height: 7px; background: #fff; translate: -50% -50%; }
.cursor-ring {
  width: 38px; height: 38px; border: 1px solid #fff; translate: -50% -50%;
  transition: width .25s var(--ease), height .25s var(--ease),
              background .25s var(--ease), opacity .25s var(--ease);
  opacity: 0.5;
}
.cursor-ring.hot { width: 60px; height: 60px; background: rgba(255,255,255,0.08); opacity: 0.9; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-ring { display: none; } }

/* =============================================================== HEADER = */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(16px, 2.2vw, 26px) var(--gut);
  mix-blend-mode: normal;
}
.site-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, var(--bg) 10%, transparent);
  opacity: 0; transition: opacity .4s var(--ease);
}
.site-head.solid::before { opacity: 0.92; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.01em; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent); }
  70%,100% { box-shadow: 0 0 0 10px transparent; }
}
.brand small { color: var(--muted); font-weight: 400; }

.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav a {
  font-size: 0.82rem; color: var(--fg-dim); position: relative; padding: 4px 0;
  transition: color .25s var(--ease);
}
.nav a .idx { color: var(--accent); margin-right: 6px; font-size: 0.7rem; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav a:hover { color: var(--fg); }
.nav a:hover::after { width: 100%; }
.nav-links { display: flex; gap: clamp(14px, 2vw, 30px); }
@media (max-width: 720px) { .nav-links { display: none; } }

.theme-toggle {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--fg); display: grid; place-items: center;
  cursor: none; transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-25deg); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ================================================================ HERO == */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; isolation: isolate; }
#field {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
}
.hero::after {  /* vignette to seat text */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 90% at 70% 40%, transparent 30%, var(--bg) 92%);
}
.hero-inner { width: 100%; }
.hero .eyebrow {
  display: flex; align-items: center; gap: 14px; margin-bottom: clamp(20px, 4vh, 40px);
  opacity: 0; animation: rise .9s var(--ease) .15s forwards;
}
.hero .eyebrow .bar { height: 1px; width: 52px; background: var(--accent); }

.hero h1 {
  font-size: clamp(2.6rem, 9vw, 7.4rem); line-height: 0.96; font-weight: 800;
  letter-spacing: -0.045em; margin-bottom: clamp(18px, 3vh, 30px);
}
.hero h1 .l1 { display: block; font-size: clamp(1.3rem, 3.8vw, 3.2rem); font-weight: 300; letter-spacing: 0.05em; color: var(--fg-dim); opacity: 0; animation: rise 1s var(--ease) .25s forwards; }
.hero h1 .l2 { display: block; font-size: clamp(3.8rem, 12vw, 10rem); color: var(--fg-dim); opacity: 0; animation: rise 1s var(--ease) .4s forwards; }
.hero h1 .l2 b { color: var(--fg); font-weight: 800; }

.scramble { font-variant-ligatures: none; }

.hero .lede {
  max-width: 56ch; color: var(--fg-dim); font-size: clamp(0.95rem, 1.6vw, 1.18rem);
  line-height: 1.7; margin-bottom: clamp(26px, 5vh, 48px);
  opacity: 0; animation: rise 1s var(--ease) .55s forwards;
}
.hero .lede b { color: var(--fg); font-weight: 600; }

.status {
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--muted);
  opacity: 0; animation: rise 1s var(--ease) .7s forwards;
}
.status .live { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-dim); }
.status .live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: blink 1.8s steps(1) infinite;
}
@keyframes blink { 0%,60% { opacity: 1; } 61%,100% { opacity: .25; } }
.status .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

.scroll-cue {
  position: absolute; left: var(--gut); bottom: clamp(20px, 4vh, 38px);
  display: flex; align-items: center; gap: 12px; font-size: 0.7rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
  opacity: 0; animation: rise 1s var(--ease) 1s forwards;
}
.scroll-cue .track { width: 1px; height: 46px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue .track::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  animation: scrolldn 2.2s var(--ease-io) infinite;
}
@keyframes scrolldn { 0% { transform: translateY(-100%); } 60%,100% { transform: translateY(100%); } }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* =========================================================== SECTIONS == */
.section { position: relative; padding-block: clamp(80px, 13vh, 170px); }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(40px, 7vh, 80px); }
.section-head .num {
  font-size: 0.82rem; color: var(--accent); font-weight: 600; letter-spacing: 0.1em;
}
.section-head h2 {
  font-size: clamp(1.7rem, 4.4vw, 3.1rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1;
}
.section-head .rule { flex: 1; height: 1px; background: var(--line-soft); align-self: center; }

/* reveal primitive */
[data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity var(--reveal-dur) var(--ease), transform var(--reveal-dur) var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: .08s; }
[data-reveal][data-d="2"] { transition-delay: .16s; }
[data-reveal][data-d="3"] { transition-delay: .24s; }
[data-reveal][data-d="4"] { transition-delay: .32s; }
[data-reveal][data-d="5"] { transition-delay: .40s; }
/* If we never opted into motion (hidden tab, print, reduced-motion),
   everything is shown in its final, fully-visible state. */
html:not(.motion) [data-reveal] { opacity: 1 !important; transform: none !important; }
html:not(.motion) .hero .eyebrow,
html:not(.motion) .hero h1 .l1,
html:not(.motion) .hero h1 .l2,
html:not(.motion) .hero .lede,
html:not(.motion) .status,
html:not(.motion) .scroll-cue { animation: none !important; opacity: 1 !important; transform: none !important; }

/* ---- stats strip ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); }
.stat { background: var(--bg); padding: clamp(22px, 3vw, 36px); }
.stat .n { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat .n .suf { color: var(--accent); }
.stat .k { margin-top: 10px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; }

/* ---- about ---- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 80px); align-items: start; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid p { color: var(--fg-dim); font-size: clamp(1rem, 1.5vw, 1.22rem); line-height: 1.8; }
.about-grid p + p { margin-top: 1.3em; }
.about-grid p b { color: var(--fg); font-weight: 600; }
.about-aside { display: flex; flex-direction: column; gap: 18px; }
.kv { display: flex; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 1px solid var(--line-soft); }
.kv .k { color: var(--muted); font-size: 0.8rem; }
.kv .v { color: var(--fg); font-size: 0.86rem; text-align: right; }

/* ---- skills ---- */
.skills-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(36px, 6vw, 72px); align-items: center; }
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-groups { display: grid; gap: clamp(26px, 4vw, 40px); }
.skill-group h3 { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.bar { margin-bottom: 17px; }
.bar .top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 9px; }
.bar .name { font-size: 0.86rem; color: var(--fg); white-space: nowrap; flex: 0 0 auto; }
.bar .pct { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .track { height: 4px; background: var(--line-soft); position: relative; overflow: hidden; }
.bar .fill { position: absolute; inset: 0 100% 0 0; background: var(--accent);
  transition: right 1.1s var(--ease); }
.in .bar .fill { right: var(--rest, 30%); }

.radar-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
#radar { width: 100%; max-width: 380px; aspect-ratio: 1; }
.radar-cap { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---- experience timeline ---- */
.timeline { position: relative; display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 150px 1fr; gap: clamp(20px, 4vw, 50px);
  padding: clamp(26px, 4vw, 40px) 0; border-top: 1px solid var(--line-soft); position: relative; }
.tl-item:last-child { border-bottom: 1px solid var(--line-soft); }
@media (max-width: 720px) { .tl-item { grid-template-columns: 1fr; gap: 10px; } }
.tl-when { color: var(--muted); font-size: 0.82rem; padding-top: 4px; }
.tl-when .now { color: var(--accent); }
.tl-body h3 { font-size: clamp(1.15rem, 2.3vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em; }
.tl-body .org { color: var(--fg-dim); font-size: 0.92rem; margin: 6px 0 14px; }
.tl-body p { color: var(--muted); font-size: 0.92rem; line-height: 1.7; max-width: 60ch; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { font-size: 0.72rem; color: var(--fg-dim); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; }
.tl-item:hover .tl-marker { background: var(--accent); transform: scale(1.4); }
.tl-marker { position: absolute; left: -5px; top: calc(clamp(26px, 4vw, 40px) + 6px); width: 9px; height: 9px;
  border-radius: 50%; background: var(--line); transition: all .3s var(--ease); }
@media (max-width: 720px) { .tl-marker { display: none; } }

/* ---- projects ---- */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 2.4vw, 28px); }
@media (max-width: 760px) { .proj-grid { grid-template-columns: 1fr; } }
.proj {
  position: relative; border: 1px solid var(--line-soft); background: var(--bg-2);
  overflow: hidden; transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.proj:hover { border-color: var(--accent); }
.proj .shot { aspect-ratio: 16/10; position: relative; overflow: hidden; }
.proj .ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, var(--line-soft) 0 1px, transparent 1px 11px);
  display: grid; place-items: center;
}
.proj .ph span { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; background: var(--bg-2); padding: 4px 10px; }
.proj .shot::after { /* scan sweep on hover */
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 22%, transparent), transparent);
  transition: transform .8s var(--ease);
}
.proj:hover .shot::after { transform: translateX(100%); }
.proj .meta { padding: clamp(18px, 2.4vw, 26px); position: relative; }
.proj .meta .yr { position: absolute; top: clamp(18px, 2.4vw, 26px); right: clamp(18px, 2.4vw, 26px); color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.proj .meta h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; padding-right: 48px; }
.proj .meta p { color: var(--muted); font-size: 0.86rem; line-height: 1.65; margin: 10px 0 16px; }
.proj .meta .stack { display: flex; flex-wrap: wrap; gap: 7px; }
.proj .meta .stack span { font-size: 0.7rem; color: var(--fg-dim); }
.proj .meta .stack span::before { content: "/ "; color: var(--accent); }
.proj .arrow { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center;
  color: var(--fg-dim); opacity: 0; transform: translate(-6px,6px); transition: all .35s var(--ease); z-index: 2; }
.proj:hover .arrow { opacity: 1; transform: none; border-color: var(--accent); color: var(--accent); }

/* ---- education ---- */
.edu-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: clamp(18px, 2.4vw, 28px); }
@media (max-width: 720px) { .edu-grid { grid-template-columns: 1fr; } }
.edu {
  border: 1px solid var(--line-soft); padding: clamp(24px, 3vw, 34px); background: var(--bg);
  transition: border-color .3s var(--ease); }
.edu:hover { border-color: var(--accent); }
.edu .yr { color: var(--accent); font-size: 0.78rem; letter-spacing: 0.08em; }
.edu h3 { font-size: 1.18rem; font-weight: 700; margin: 12px 0 6px; letter-spacing: -0.01em; }
.edu .org { color: var(--fg-dim); font-size: 0.9rem; }
.edu p { color: var(--muted); font-size: 0.86rem; line-height: 1.65; margin-top: 14px; }

/* ---- contact ---- */
.contact { text-align: left; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px,7vw,100px); align-items: start; }
.contact-left h2 { font-size: clamp(2.2rem, 6vw, 5rem); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; }
.contact-left h2 .ghost { color: var(--fg-dim); }
.contact-left .sub { color: var(--fg-dim); max-width: 42ch; margin: clamp(20px,3.5vh,30px) 0; font-size: clamp(0.95rem,1.4vw,1.08rem); line-height: 1.7; }
.contact-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: clamp(24px,4vh,40px); }
.social-link { display: flex; align-items: center; gap: 8px; color: var(--fg-dim); font-size: 0.86rem; transition: color .25s var(--ease); }
.social-link:hover { color: var(--accent); }
.social-link .k { color: var(--muted); }

/* form */
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font-family: var(--f-mono); font-size: 0.92rem; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 12px 14px; resize: vertical;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
  outline: none;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 18%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.form-bottom { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.form-bottom .cf-turnstile { flex-shrink: 0; }
.form-bottom .btn { margin-left: auto; }
.form-status {
  min-height: 1.4em; font-size: 0.88rem; padding: 0 2px;
  transition: color .3s var(--ease), opacity .3s var(--ease);
}
.form-status.ok  { color: var(--accent); }
.form-status.err { color: #ff6b6b; }

.btn {
  display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-mono);
  font-size: 0.92rem; font-weight: 600; padding: 16px 26px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg); background: transparent; cursor: none;
  transition: border-color .3s var(--ease), color .3s var(--ease), background .3s var(--ease);
}
.btn .ico { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover .ico { transform: translate(3px,-3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.6; pointer-events: none; }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .form-bottom { flex-direction: column; align-items: stretch; }
  .form-bottom .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ---- footer ---- */
.foot { padding: 40px var(--gut); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.76rem; }
.foot .uptime b { color: var(--accent); }

/* progress bar */
.scroll-prog { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 300; }

/* magnetic helper */
.magnetic { will-change: transform; }

/* ============================================================ ENHANCEMENTS */

/* ---- film grain overlay ---- */
body::after {
  content: ""; position: fixed; inset: -100%; z-index: 9997; pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain 0.45s steps(1) infinite;
}
@keyframes grain {
  0%  { transform: translate(0,0); }    12% { transform: translate(-5%,-8%); }
  25% { transform: translate(-12%,5%); } 37% { transform: translate(7%,-20%); }
  50% { transform: translate(-4%,22%); } 62% { transform: translate(-14%,9%); }
  75% { transform: translate(13%,0%); }  87% { transform: translate(1%,13%); }
}
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

/* ---- card glint (3D tilt highlight) ---- */
.proj::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle 120px at var(--glint-x,50%) var(--glint-y,50%),
    color-mix(in oklab, var(--accent) 15%, transparent), transparent 65%);
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.proj:hover::before { opacity: 1; }

/* ---- timeline draw line ---- */
#timeline::before {
  content: ""; position: absolute; left: -1px; top: 0;
  width: 1px; height: 0;
  background: linear-gradient(to bottom, var(--accent), transparent);
  transition: height 1.8s var(--ease);
}
#timeline.tl-drawn::before { height: 100%; }
@media (max-width: 720px) { #timeline::before { display: none; } }

/* ---- section heading glitch ---- */
@keyframes glitch-h {
  0%   { clip-path: inset(0 0 92% 0); transform: translate(-3px,0); color: var(--accent); }
  16%  { clip-path: inset(0 0 0 0);   transform: none; color: inherit; }
  32%  { clip-path: inset(38% 0 52% 0); transform: translate(2px,0); }
  48%  { clip-path: inset(0 0 0 0);   transform: none; }
  64%  { clip-path: inset(75% 0 12% 0); transform: translate(-2px,0); color: var(--accent); }
  80%  { clip-path: inset(0 0 0 0);   transform: none; color: inherit; }
  100% { clip-path: inset(0 0 0 0);   transform: none; }
}
.section-head h2.glitch-play { animation: glitch-h 0.42s steps(1) forwards; }

/* ============================================================ DESIGN REVIEW PASS */

/* ---- skip link (accessibility) ---- */
.skip-link {
  position: fixed; top: -100%; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 22px; font-size: 0.82rem; font-weight: 600;
  z-index: 10001; border-radius: 0 0 8px 8px; white-space: nowrap;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; outline: none; }

/* ---- hamburger button ---- */
.ham {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--fg);
  transition: border-color .25s var(--ease);
  position: relative; z-index: 210;
}
.ham:hover { border-color: var(--accent); }
.ham-line {
  width: 14px; height: 1px; background: currentColor;
  transform-origin: center;
  transition: transform .38s var(--ease), opacity .38s var(--ease);
}
.ham.open .ham-line:first-child { transform: translateY(3.5px) rotate(45deg); }
.ham.open .ham-line:last-child  { transform: translateY(-3.5px) rotate(-45deg); }
@media (max-width: 720px) { .ham { display: flex; } }

/* ---- mobile nav overlay ---- */
.mob-nav {
  position: fixed; inset: 0; z-index: 195;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: clamp(28px, 7vh, 52px);
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.mob-nav.open { opacity: 1; pointer-events: all; }
.mob-links { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mob-link {
  font-size: clamp(2.2rem, 12vw, 3.6rem); font-weight: 800;
  letter-spacing: -0.04em; color: var(--fg-dim);
  display: flex; align-items: baseline; gap: 14px;
  opacity: 0; transform: translateY(22px);
  transition: color .2s var(--ease), opacity .45s var(--ease), transform .45s var(--ease);
}
.mob-nav.open .mob-link { opacity: 1; transform: none; }
.mob-nav.open .mob-link:nth-child(1) { transition-delay: .04s; }
.mob-nav.open .mob-link:nth-child(2) { transition-delay: .08s; }
.mob-nav.open .mob-link:nth-child(3) { transition-delay: .12s; }
.mob-nav.open .mob-link:nth-child(4) { transition-delay: .16s; }
.mob-nav.open .mob-link:nth-child(5) { transition-delay: .20s; }
.mob-link:hover { color: var(--fg); }
.mob-link em { font-style: normal; color: var(--accent); font-size: 0.44em; font-weight: 600; letter-spacing: 0.12em; }
.mob-foot {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.82rem;
  opacity: 0; transform: translateY(12px);
  transition: opacity .4s var(--ease) .28s, transform .4s var(--ease) .28s;
}
.mob-nav.open .mob-foot { opacity: 1; transform: none; }
.mob-foot a { color: inherit; transition: color .2s var(--ease); }
.mob-foot a:hover { color: var(--accent); }

/* ---- CRT scanlines ---- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 9996; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 1px,
    color-mix(in oklab, var(--fg) 2.2%, transparent) 1px,
    color-mix(in oklab, var(--fg) 2.2%, transparent) 2px
  );
}
@media (prefers-reduced-motion: reduce) { body::before { display: none; } }

/* ---- ghost section numbers ---- */
.section[data-n] { overflow: hidden; }
.section[data-n]::before {
  content: attr(data-n);
  position: absolute; right: var(--gut); top: clamp(55px, 9vh, 110px);
  font-size: clamp(9rem, 20vw, 18rem); font-weight: 800;
  letter-spacing: -0.07em; line-height: 1;
  color: var(--fg); opacity: 0.04;
  pointer-events: none; user-select: none; z-index: 0;
}

/* ---- active nav link ---- */
.nav a.active { color: var(--fg); }
.nav a.active::after { width: 100%; }

/* ---- terminal cursor ---- */
.term-cur {
  color: var(--accent); font-weight: 300; margin-left: 0.05em;
  opacity: 0;
  animation: cursor-blink-term 1.1s step-end 2.2s infinite;
}
@keyframes cursor-blink-term { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
html:not(.motion) .term-cur { opacity: 1; animation: none; }

/* ---- stats hover glow ---- */
.stat { cursor: default; transition: background .3s var(--ease); }
.stat:hover { background: color-mix(in oklab, var(--accent) 6%, var(--bg)); }
.stat:hover .n { color: var(--accent); }

/* ---- project card visual fingerprints ---- */
.proj[data-proj="0"] .ph {
  background-color: color-mix(in oklab, var(--accent) 4%, var(--bg-2));
  background-image: repeating-linear-gradient(45deg, var(--line-soft) 0 1px, transparent 1px 11px);
}
.proj[data-proj="1"] .ph {
  background-color: color-mix(in oklab, #5B8CFF 5%, var(--bg-2));
  background-image: radial-gradient(circle, var(--line) 1.1px, transparent 1.1px);
  background-size: 14px 14px;
}
.proj[data-proj="2"] .ph {
  background-color: color-mix(in oklab, #C7F03A 3%, var(--bg-2));
  background-image:
    repeating-linear-gradient(-45deg, var(--line-soft) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(45deg, var(--line-soft) 0 1px, transparent 1px 13px);
}
.proj[data-proj="3"] .ph {
  background-color: color-mix(in oklab, #FF5CA8 4%, var(--bg-2));
  background-image: repeating-linear-gradient(
    0deg, transparent 0, transparent 8px,
    var(--line-soft) 8px, var(--line-soft) 9px
  );
}

/* ---- contact section differentiation ---- */
.contact { background: var(--bg-2); }
