/* =========================================================
   AKSHAJ V NAIR — portfolio
   Palette: ink / bone / signal-orange / neural-cyan
   ========================================================= */
:root {
  --bg: #07080a;
  --bg-2: #0e1014;
  --bg-3: #151820;
  --fg: #ecebe5;
  --fg-2: #a3a39c;
  --fg-3: #5f6068;
  --line: rgba(236, 235, 229, 0.1);
  --line-2: rgba(236, 235, 229, 0.2);
  --hot: #ff5b1f;
  --cool: #5be7ff;
  --hot-soft: rgba(255, 91, 31, 0.14);
  --cool-soft: rgba(91, 231, 255, 0.12);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(20px, 4.5vw, 72px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="light"] {
  --bg: #f1efe8;
  --bg-2: #e8e5dc;
  --bg-3: #dedad0;
  --fg: #0d0e11;
  --fg-2: #4b4c52;
  --fg-3: #8a8a86;
  --line: rgba(13, 14, 17, 0.12);
  --line-2: rgba(13, 14, 17, 0.25);
  --hot: #e8440a;
  --cool: #0a8fb0;
  --hot-soft: rgba(232, 68, 10, 0.1);
  --cool-soft: rgba(10, 143, 176, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
.term-input input::placeholder { color: #555; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
body.booting { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--hot); color: #000; }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; }

/* ---------- grain + progress ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-5%,4%)} 40%{transform:translate(4%,-6%)} 60%{transform:translate(-3%,7%)} 80%{transform:translate(6%,2%)} }
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 120; background: linear-gradient(90deg, var(--hot), var(--cool)); }

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 200; background: #050506; color: #d6d5cf;
  display: flex; flex-direction: column; justify-content: flex-end; padding: var(--pad);
  font-family: var(--mono); font-size: 13px;
  transition: clip-path 0.9s var(--ease);
  clip-path: inset(0 0 0 0);
}
#boot.done { clip-path: inset(0 0 100% 0); }
#boot-log { white-space: pre-wrap; line-height: 1.8; min-height: 40vh; }
#boot-log .ok { color: #7dff9a; } #boot-log .hot { color: #ff5b1f; } #boot-log .dim { color: #666; }
.boot-bar { height: 2px; background: #1b1c20; margin-top: 18px; }
#boot-fill { display: block; height: 100%; width: 0; background: #ff5b1f; transition: width 0.25s linear; }
#boot-skip { position: absolute; top: var(--pad); right: var(--pad); font-family: var(--mono); font-size: 12px; color: #777; }
#boot-skip:hover { color: #fff; }

/* ---------- cursor ---------- */
#cursor-dot, #cursor-ring { position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; border-radius: 50%; }
#cursor-dot { width: 6px; height: 6px; background: var(--hot); transform: translate(-50%, -50%); }
#cursor-ring {
  width: 36px; height: 36px; border: 1px solid var(--line-2); transform: translate(-50%, -50%);
  display: grid; place-items: center;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s, border-color 0.3s;
}
#cursor-ring.big { width: 84px; height: 84px; background: var(--hot); border-color: var(--hot); mix-blend-mode: difference; }
#cursor-label { font-family: var(--mono); font-size: 10px; color: #000; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0; }
#cursor-ring.big #cursor-label { opacity: 1; }
@media (pointer: coarse) { #cursor-dot, #cursor-ring { display: none; } }

/* ---------- nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.4s, padding 0.4s, transform 0.4s var(--ease);
}
#nav.scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#nav.hide { transform: translateY(-100%); }
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-mark { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.04em; }
.logo-mark i { font-family: var(--serif); font-weight: 400; color: var(--hot); font-size: 1.5rem; }
.logo-sub { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.nav-links { display: flex; gap: 26px; font-family: var(--mono); font-size: 12px; }
.nav-links a { color: var(--fg-2); position: relative; transition: color 0.2s; }
.nav-links a::before { content: "./"; color: var(--hot); opacity: 0; margin-right: 2px; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a:hover::before, .nav-links a.active::before { opacity: 1; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.kbd-btn { display: flex; gap: 4px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; }
kbd { font-family: var(--mono); font-size: 10px; padding: 2px 6px; background: var(--bg-3); border-radius: 4px; color: var(--fg-2); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 16px; transition: transform 0.5s var(--ease), background 0.2s; }
.icon-btn:hover { background: var(--bg-3); }
#theme-toggle:hover { transform: rotate(180deg); }
.menu-btn { display: none; flex-direction: column; gap: 5px; }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: var(--fg); transition: transform 0.3s; }
.menu-open .menu-btn span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
#mobile-menu {
  position: fixed; inset: 0; z-index: 95; background: var(--bg); display: flex; flex-direction: column;
  justify-content: center; padding: var(--pad); gap: 6px;
  clip-path: circle(0% at calc(100% - 40px) 40px); transition: clip-path 0.7s var(--ease);
}
.menu-open #mobile-menu { clip-path: circle(150% at calc(100% - 40px) 40px); }
#mobile-menu a { font-size: clamp(2.4rem, 11vw, 4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }
#mobile-menu a:hover { color: var(--hot); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 100px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; white-space: nowrap;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn span { transition: transform 0.3s var(--ease); }
.btn:hover span { transform: translate(3px, 2px); }
.btn-solid { background: var(--hot); color: #000; font-weight: 700; }
.btn-solid:hover { background: var(--fg); }
.btn-ghost { border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--fg); }
.btn-text { padding-left: 6px; color: var(--fg-2); }
.btn-text:hover { color: var(--cool); }

/* ---------- hero ---------- */
#hero { position: relative; min-height: 100svh; padding: 110px var(--pad) 28px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
#neural { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
#hero > *:not(canvas) { position: relative; z-index: 1; }
#hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; z-index: 0; }
.hero-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--fg-2); text-transform: uppercase; }
.hero-meta b { font-weight: 500; color: var(--fg); }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ef08a; margin-right: 10px; box-shadow: 0 0 0 0 rgba(62, 240, 138, 0.6); animation: pulse 2s infinite; vertical-align: 1px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(62, 240, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 240, 138, 0); } }
.hero-core { margin: auto 0; padding: 40px 0; }
.hero-hi { color: var(--cool); margin-bottom: 14px; }
.hero-name { font-weight: 800; font-size: clamp(3.6rem, 15.5vw, 15rem); line-height: 0.84; letter-spacing: -0.06em; display: flex; flex-direction: column; }
.hero-name .row { display: block; }
.hero-name .outline { -webkit-text-stroke: 2px var(--fg); padding-left: 0.6em; transition: color 0.4s; }
.hero-name .outline:hover { color: var(--hot); -webkit-text-stroke-color: var(--hot); }
.hero-role { margin-top: 28px; font-size: clamp(1.3rem, 3vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; min-height: 1.3em; }
.hero-role .serif { color: var(--fg-2); }
#typed { color: var(--fg); }
.caret { color: var(--hot); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-tag { color: var(--fg-2); max-width: 46ch; margin-top: 10px; font-size: 1.05rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; align-items: center; }
.hero-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.stats { display: flex; gap: clamp(18px, 4vw, 60px); flex-wrap: wrap; }
.stat b { display: block; font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat b small { font-size: 0.45em; color: var(--fg-3); font-weight: 500; }
.stat span { font-family: var(--mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; }
.scroll-hint { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--fg-3); }
.scroll-hint i { width: 1px; height: 44px; background: linear-gradient(var(--hot), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--bg-2); transform: rotate(-1.2deg) scale(1.03); margin: 30px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; padding: 0 28px; display: inline-flex; align-items: center; gap: 56px; white-space: nowrap; }
.marquee-track span::after { content: "✦"; color: var(--hot); font-size: 0.6em; }
.marquee-track span:nth-child(3n) { font-family: var(--serif); font-style: italic; font-weight: 400; }
.marquee-track span:nth-child(4n) { color: transparent; -webkit-text-stroke: 1px var(--fg); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 12vw, 160px) var(--pad) 0; }
.section-head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 48px; }
.idx { color: var(--hot); }
.section-head h2 { font-size: clamp(2.6rem, 7vw, 6rem); font-weight: 700; letter-spacing: -0.05em; line-height: 0.9; }
.hint { color: var(--fg-3); text-align: right; }
.sub { color: var(--fg-3); text-transform: lowercase; margin-bottom: 18px; }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(30px, 6vw, 90px); }
.lead { font-size: clamp(1.4rem, 2.6vw, 2.15rem); line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 26px; }
.lead em { font-family: var(--serif); color: var(--hot); font-weight: 400; }
.about-text > div p { color: var(--fg-2); margin-bottom: 16px; max-width: 62ch; }
.about-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 30px; }
.about-facts div { background: var(--bg); padding: 14px 16px; }
.about-facts dt { color: var(--fg-3); font-size: 10px; text-transform: uppercase; margin-bottom: 4px; }
.about-facts dd { color: var(--fg); }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.pillar { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 24px 20px; overflow: hidden; background: var(--bg-2); min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; transition: border-color 0.3s, transform 0.4s var(--ease); }
.pillar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--hot-soft), transparent 60%); opacity: 0; transition: opacity 0.3s; }
.pillar:hover { border-color: var(--line-2); transform: translateY(-4px); }
.pillar:hover::before { opacity: 1; }
.pillar .ic { font-size: 1.8rem; color: var(--hot); }
.pillar:nth-child(even) .ic { color: var(--cool); }
.pillar h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.pillar p { font-size: 0.86rem; color: var(--fg-2); }

/* ---------- prompt & context engineering ---------- */
.craft { margin-top: clamp(60px, 9vw, 120px); display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(30px, 5vw, 72px); align-items: center; scroll-margin-top: 90px; }
.craft .eyebrow { color: var(--cool); text-transform: uppercase; margin-bottom: 18px; }
.craft h3 { font-size: clamp(2rem, 4.2vw, 3.6rem); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; margin-bottom: 22px; }
.craft h3 em { font-family: var(--serif); font-weight: 400; color: var(--cool); letter-spacing: -0.02em; }
.craft-copy > p:not(.eyebrow):not(.proof) { color: var(--fg-2); margin-bottom: 14px; max-width: 58ch; }
.craft ul { list-style: none; margin: 22px 0; display: grid; gap: 10px; }
.craft li { padding-left: 26px; position: relative; }
.craft li::before { content: "❯"; position: absolute; left: 0; color: var(--cool); font-family: var(--mono); }
.craft .proof { color: var(--hot); }
.ctx { position: relative; border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; background: linear-gradient(160deg, var(--cool-soft), transparent 45%), var(--bg-2); box-shadow: 0 40px 100px -50px var(--cool); }
.ctx-head { display: flex; justify-content: space-between; color: var(--fg-3); margin-bottom: 10px; }
.ctx-used { color: var(--cool); }
.ctx-meter { height: 6px; border-radius: 6px; background: var(--bg-3); overflow: hidden; margin-bottom: 18px; }
.ctx-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cool), var(--hot)); transition: width 1.4s var(--ease); }
.ctx.run .ctx-meter i { width: 81%; }
.ctx-layer { position: relative; display: grid; grid-template-columns: 104px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 8px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; isolation: isolate; opacity: 0.35; transform: translateX(-12px); transition: opacity 0.5s var(--ease) var(--d), transform 0.5s var(--ease) var(--d); }
.ctx-layer::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cool-soft); z-index: -1; transition: width 1s var(--ease) var(--d); }
.ctx-layer:nth-of-type(odd)::before { background: var(--hot-soft); }
.ctx.run .ctx-layer { opacity: 1; transform: none; }
.ctx.run .ctx-layer::before { width: var(--w); }
.ctx-k { color: var(--cool); text-transform: uppercase; font-size: 10.5px; }
.ctx-v { font-size: 0.9rem; }
.ctx-layer b { color: var(--fg-3); font-weight: 400; font-size: 11px; }
.ctx-arrow { text-align: center; color: var(--fg-3); margin: 14px 0 10px; }
.ctx-out { min-height: 3.4em; white-space: pre-wrap; word-break: break-word; padding: 14px 16px; border-radius: 10px; background: #0a0b0e; color: #3ef08a; font-size: 12px; border: 1px solid rgba(62, 240, 138, 0.25); }
.ctx-out:empty::after { content: "▍"; color: #3ef08a; animation: blink 1s steps(1) infinite; }
.ctx-cap { color: var(--fg-3); margin-top: 12px; font-size: 10.5px; }

.research { margin-top: clamp(60px, 9vw, 120px); display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: clamp(28px, 5vw, 64px); border-radius: 28px; background: radial-gradient(120% 140% at 0% 0%, var(--hot-soft), transparent 50%), radial-gradient(120% 140% at 100% 100%, var(--cool-soft), transparent 50%), var(--bg-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.research .eyebrow { color: var(--hot); text-transform: uppercase; margin-bottom: 18px; }
.research h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 3rem); line-height: 1.05; letter-spacing: -0.01em; }
.research dl { display: grid; gap: 0; }
.research dl div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.research dt { font-family: var(--mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; padding-top: 3px; }
.research .stamp { position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; border: 1px dashed var(--line-2); display: grid; place-items: center; animation: spin 24s linear infinite; font-family: var(--mono); font-size: 9px; color: var(--fg-3); opacity: 0.8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 9px 16px; border-radius: 100px; border: 1px solid var(--line-2); color: var(--fg-2); transition: all 0.2s; }
.chip sup { color: var(--fg-3); margin-left: 4px; }
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.on sup { color: var(--hot); }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; perspective: 1400px; }
.card {
  grid-column: span 2; position: relative; border-radius: 22px; padding: 26px; background: var(--bg-2);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; min-height: 340px;
  transform-style: preserve-3d; transition: transform 0.25s ease-out, border-color 0.3s, opacity 0.4s, scale 0.4s;
  overflow: hidden; cursor: pointer;
}
.card.featured { grid-column: span 3; min-height: 440px; }
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), var(--hot-soft), transparent 55%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card.hidden { display: none; }
.card .top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.card .badge { color: #000; background: var(--hot); padding: 4px 10px; border-radius: 100px; font-weight: 700; text-transform: uppercase; font-size: 10px; }
.card.k-ai .badge { background: var(--cool); }
.card .num { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.06em; line-height: 0.8; color: transparent; -webkit-text-stroke: 1px var(--line-2); position: absolute; right: 18px; bottom: 10px; transform: translateZ(30px); pointer-events: none; transition: -webkit-text-stroke-color 0.3s; }
.card:hover .num { -webkit-text-stroke-color: var(--hot); }
.card h3 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; transform: translateZ(40px); }
.card p.blurb { color: var(--fg-2); font-size: 0.93rem; transform: translateZ(20px); }
.card ul { list-style: none; display: grid; gap: 8px; transform: translateZ(20px); }
.card li { font-size: 0.86rem; color: var(--fg-2); padding-left: 18px; position: relative; }
.card li::before { content: "▸"; position: absolute; left: 0; color: var(--hot); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-right: 90px; }
.card .tags span { font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; border-radius: 6px; background: var(--bg-3); color: var(--fg-2); }
.card .links { display: flex; gap: 8px; position: relative; z-index: 2; }
.card .links a { font-family: var(--mono); font-size: 11px; padding: 7px 12px; border-radius: 100px; border: 1px solid var(--line-2); transition: all 0.2s; }
.card .links a:hover { background: var(--fg); color: var(--bg); }

/* ---------- journey ---------- */
.journey-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(30px, 6vw, 90px); }
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.timeline .line-fill { position: absolute; left: 6px; top: 8px; width: 1px; background: linear-gradient(var(--hot), var(--cool)); height: 0; }
.job { position: relative; padding-bottom: 46px; }
.job::before { content: ""; position: absolute; left: -34px; top: 8px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--fg-3); transition: all 0.4s; }
.job.lit::before { border-color: var(--hot); background: var(--hot); box-shadow: 0 0 0 6px var(--hot-soft); }
.job .when { display: flex; gap: 12px; align-items: center; color: var(--fg-3); margin-bottom: 8px; }
.job .now { color: #000; background: #3ef08a; padding: 2px 8px; border-radius: 100px; font-weight: 700; font-size: 10px; }
.job h3 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.job .org { color: var(--hot); font-family: var(--serif); font-style: italic; font-size: 1.15rem; margin: 4px 0 2px; }
.job .place { color: var(--fg-3); font-size: 0.85rem; margin-bottom: 12px; }
.job li { color: var(--fg-2); list-style: none; padding-left: 18px; position: relative; margin-bottom: 6px; max-width: 64ch; }
.job li::before { content: "→"; position: absolute; left: 0; color: var(--fg-3); }
.edu-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 12px; background: var(--bg-2); }
.edu-card .w { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.edu-card h4 { font-size: 1.15rem; letter-spacing: -0.02em; margin: 4px 0; }
.edu-card p { font-size: 0.85rem; color: var(--fg-2); margin-bottom: 10px; }
.edu-card .score { font-family: var(--mono); font-size: 11px; background: var(--hot-soft); color: var(--hot); padding: 4px 10px; border-radius: 100px; display: inline-block; }
.edu h3.sub:not(:first-child) { margin-top: 32px; }
.lang { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-bottom: 14px; }
.lang b { font-weight: 600; }
.lang span { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.lang .bar { grid-column: 1 / -1; height: 3px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.lang .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hot), var(--cool)); transition: width 1.4s var(--ease); }
.lang.in .bar i { width: var(--w); }

/* ---------- stack ---------- */
.stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.stack-group { background: var(--bg); padding: 26px 24px; transition: background 0.3s; }
.stack-group:hover { background: var(--bg-2); }
.stack-group h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--hot); text-transform: uppercase; margin-bottom: 16px; display: flex; justify-content: space-between; }
.stack-group h3 span { color: var(--fg-3); }
.stack-group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.stack-group li { font-size: 0.98rem; padding: 5px 12px; border-radius: 100px; border: 1px solid var(--line); transition: all 0.2s; cursor: default; }
.stack-group li:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px) rotate(-2deg); }

/* ---------- certs ---------- */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cert { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; background: var(--bg-2); transition: transform 0.35s var(--ease), border-color 0.3s; position: relative; }
.cert:hover { transform: translateY(-4px); border-color: var(--line-2); }
.cert.top::after { content: "★"; position: absolute; top: 14px; right: 16px; color: var(--hot); font-size: 12px; }
.cert .o { font-family: var(--mono); font-size: 10px; color: var(--fg-3); text-transform: uppercase; padding-right: 20px; }
.cert h4 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.cert .m { margin-top: auto; font-family: var(--mono); font-size: 11px; color: var(--cool); }
.cert.gone { display: none; }

/* ---------- services ---------- */
.services { list-style: none; counter-reset: svc; border-top: 1px solid var(--line); }
.svc { counter-increment: svc; display: grid; grid-template-columns: 70px 1fr 1.2fr 40px; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; isolation: isolate; transition: padding 0.4s var(--ease), color 0.3s; }
.svc::before { content: counter(svc, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--fg-3); }
.svc::after { content: ""; position: absolute; inset: 0; background: var(--hot); transform: translateY(101%); transition: transform 0.45s var(--ease); z-index: -1; }
.svc h3 { font-size: clamp(1.2rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.03em; }
.svc p { color: var(--fg-2); font-size: 0.92rem; }
.svc .arr { font-size: 1.4rem; transition: transform 0.4s var(--ease); }
.svc:hover { padding-left: 20px; padding-right: 20px; color: #000; }
.svc:hover::after { transform: none; }
.svc:hover p, .svc:hover::before { color: #000; }
.svc:hover .arr { transform: rotate(-45deg); }
.services { position: relative; z-index: 0; }

/* ---------- terminal ---------- */
.term { border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: #0a0b0e; color: #d9d8d2; box-shadow: 0 40px 120px -40px var(--hot-soft); max-width: 1100px; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #121318; border-bottom: 1px solid rgba(255,255,255,0.06); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; color: #777; }
.term-body { padding: 18px 20px 4px; height: 360px; overflow-y: auto; font-family: var(--mono); font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.term-body .cmd { color: #fff; } .term-body .cmd b { color: #ff7a45; font-weight: 500; }
.term-body .k { color: #5be7ff; } .term-body .h { color: #ff7a45; } .term-body .g { color: #3ef08a; } .term-body .d { color: #777; }
.term-body a { color: #5be7ff; text-decoration: underline; text-underline-offset: 3px; }
.term-input { display: flex; gap: 10px; align-items: center; padding: 8px 20px 16px; }
.term-input label { color: #888; white-space: nowrap; }
.term-input label b { color: #3ef08a; font-weight: 500; } .term-input label em { color: #5be7ff; font-style: normal; }
.term-input input { flex: 1; background: transparent; border: 0; outline: 0; color: #fff; font-size: 13px; caret-color: #ff5b1f; }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.term-chips button { font-family: var(--mono); font-size: 11px; color: #aaa; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 4px 10px; }
.term-chips button:hover { color: #000; background: #ff5b1f; border-color: #ff5b1f; }

/* ---------- contact ---------- */
.contact { padding-bottom: 60px; }
.contact-big h2 { font-size: clamp(3rem, 10vw, 9.5rem); line-height: 0.88; letter-spacing: -0.06em; font-weight: 800; margin: 18px 0 26px; }
.contact-big h2 em { color: var(--hot); font-weight: 400; letter-spacing: -0.03em; }
.contact-big h2 .outline { -webkit-text-stroke-width: 2px; }
.contact-big p { color: var(--fg-2); max-width: 52ch; font-size: 1.05rem; }
.copy-mail { margin-top: 30px; font-size: clamp(1.2rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; border-bottom: 2px solid var(--hot); padding-bottom: 4px; display: inline-flex; gap: 14px; align-items: baseline; text-align: left; word-break: break-all; }
.copy-mail small { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0; word-break: normal; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 90px); margin-top: 70px; }
.contact-links a { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); transition: padding 0.3s var(--ease), color 0.2s; }
.contact-links a:first-child { border-top: 1px solid var(--line); }
.contact-links a span:first-child { font-family: var(--mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; }
.contact-links a b { font-weight: 500; font-size: 1.05rem; word-break: break-all; }
.contact-links a i { font-style: normal; transition: transform 0.3s var(--ease); }
.contact-links a:hover { padding-left: 12px; color: var(--hot); }
.contact-links a:hover i { transform: rotate(45deg); }
.contact-form { display: flex; flex-direction: column; gap: 4px; }
.contact-form label { display: flex; flex-direction: column; font-family: var(--mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; border-bottom: 1px solid var(--line); padding: 14px 0; transition: border-color 0.3s; }
.contact-form label:focus-within { border-color: var(--hot); color: var(--hot); }
.contact-form input, .contact-form textarea { background: transparent; border: 0; outline: 0; color: var(--fg); font-family: var(--display); font-size: 1.1rem; padding-top: 6px; resize: none; text-transform: none; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--fg-3); }
.contact-form .btn { align-self: flex-start; margin-top: 20px; }

/* ---------- footer ---------- */
footer { padding: 40px var(--pad) 26px; overflow: hidden; border-top: 1px solid var(--line); margin-top: 60px; }
.foot-name { font-size: 25vw; font-weight: 800; letter-spacing: -0.07em; line-height: 0.75; text-align: center; color: transparent; -webkit-text-stroke: 1px var(--line-2); user-select: none; transition: color 0.6s; }
.foot-name:hover { color: var(--hot); -webkit-text-stroke-color: var(--hot); }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--fg-3); margin-top: 30px; }
.foot-row a:hover { color: var(--hot); }

/* ---------- palette ---------- */
#palette { position: fixed; inset: 0; z-index: 180; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; }
#palette[hidden] { display: none; }
.palette-box { width: min(620px, 92vw); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,0.5); animation: pop 0.25s var(--ease); }
@keyframes pop { from { transform: scale(0.96) translateY(-10px); opacity: 0; } }
#palette-in { width: 100%; padding: 18px 20px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--fg); font: 500 1.05rem var(--display); outline: 0; }
#palette-list { list-style: none; max-height: 50vh; overflow-y: auto; padding: 6px; }
#palette-list li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 10px; cursor: pointer; }
#palette-list li span { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
#palette-list li.sel { background: var(--hot); color: #000; }
#palette-list li.sel span { color: #000; }
.palette-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 10.5px; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, calc(100% + 60px)); opacity: 0; z-index: 190; background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 12px; padding: 12px 20px; border-radius: 100px; transition: transform 0.45s var(--ease); pointer-events: none; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- party mode (easter egg) ---------- */
body.party { animation: hue 3s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .card, .card.featured { grid-column: span 3; }
  .nav-links { gap: 16px; }
}
@media (max-width: 900px) {
  .nav-links, .kbd-btn { display: none; }
  .menu-btn { display: flex; }
  .about-grid, .journey-grid, .contact-grid, .research, .craft { grid-template-columns: 1fr; }
  .ctx-layer { grid-template-columns: 1fr auto; }
  .ctx-v { grid-column: 1 / -1; grid-row: 2; }
  .card, .card.featured { grid-column: span 6; min-height: 0; }
  .section-head { grid-template-columns: auto 1fr; }
  .section-head .hint { grid-column: 1 / -1; text-align: left; }
  .svc { grid-template-columns: 44px 1fr 30px; }
  .svc p { grid-column: 2 / 3; grid-row: 2; }
  .svc .arr { grid-row: 1; grid-column: 3; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .scroll-hint { display: none; }
  .hero-name .outline { padding-left: 0; }
}
@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; }
  .about-facts { grid-template-columns: 1fr; }
  .contact-links a { grid-template-columns: 1fr auto; }
  .contact-links a span:first-child { grid-column: 1 / -1; }
  .research dl div { grid-template-columns: 1fr; gap: 2px; }
  .term-body { height: 300px; font-size: 12px; }
  .term-input label { display: none; }
  .term-input input { font-size: 16px; }
  .copy-mail { font-size: 6.2vw; flex-direction: column; gap: 4px; word-break: normal; }
  .hero-name { font-size: clamp(3.4rem, 21vw, 5.5rem); }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .hero-cta .btn-text { flex-basis: 100%; }
  .card { padding: 22px; }
  .card .tags { padding-right: 0; }
  .card .num { font-size: 3rem; top: 18px; bottom: auto; right: 16px; opacity: 0.5; }
  .card .top { padding-right: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
