/* ==========================================================================
   shubhamsomani.com
   Paper & ink palette, burnt-orange accent, cobalt blueprint lines.
   Mobile-first. Motion is added by JS, and only when
   prefers-reduced-motion is not "reduce".
   ========================================================================== */

:root {
  --paper: #eee8dd;
  --paper-2: #e6dfd2;
  --paper-3: #f6f2ea;
  --ink: #17140f;
  --ink-2: #2a251d;
  --muted: #6b6356;
  --line: rgba(23, 20, 15, 0.13);
  --line-strong: rgba(23, 20, 15, 0.32);
  --accent: #e4572e;
  --accent-ink: #b8401c;
  --blue: #2e4de0;
  --blue-soft: rgba(46, 77, 224, 0.12);
  --good: #2f9e5b;

  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --maxw: 1240px;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { line-height: 1.02; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--accent); }
kbd {
  font-family: var(--mono); font-size: .75em; padding: .1em .45em; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--paper-3);
}
::selection { background: var(--accent); color: var(--paper-3); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.outline { color: var(--accent); }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 1000; padding: .6em 1em; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-weight: 700; transform: translateY(-150%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* ---------- chrome: paper grain, progress, cursor ---------- */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 200; }
.progress span {
  display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: var(--accent);
}

.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
  .has-cursor input { cursor: text; }
  .has-cursor .cursor { display: block; }
  .cursor__dot, .cursor__ring {
    position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; border-radius: 50%;
    transform: translate3d(var(--x, -100px), var(--y, -100px), 0) translate(-50%, -50%);
  }
  .cursor__dot { width: 6px; height: 6px; background: var(--accent); }
  .cursor__ring {
    width: 34px; height: 34px; border: 1px solid var(--ink);
    transform: translate3d(var(--rx, -100px), var(--ry, -100px), 0) translate(-50%, -50%) scale(var(--rs, 1));
    transition: width .25s var(--ease), height .25s var(--ease), background .25s, border-color .25s;
  }
  .cursor.is-hover .cursor__ring { width: 60px; height: 60px; background: rgba(228, 87, 46, .14); border-color: var(--accent); }
  .cursor.is-down .cursor__ring { --rs: .8; }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter); padding-top: env(safe-area-inset-top);
  transition: background .3s, border-color .3s, transform .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(238, 232, 221, .82); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__logo { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 16px; font-weight: 600; z-index: 2; }
.nav__logo-mark { flex: none; width: 34px; height: 34px; transition: transform .5s var(--ease); }
.nav__logo:hover .nav__logo-mark { transform: rotate(-8deg) scale(1.06); }
.nav__logo-cursor { display: inline-block; width: 9px; height: 3px; margin-left: 3px; background: var(--accent); animation: nav-blink 1.1s steps(1) infinite; }
@keyframes nav-blink { 50% { opacity: 0; } }
.nav__links {
  position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: var(--gutter); background: var(--paper);
  clip-path: circle(0 at calc(100% - 40px) 32px); visibility: hidden;
  transition: clip-path .6s var(--ease), visibility 0s .6s;
}
.nav__links a { font-size: clamp(40px, 12vw, 64px); font-weight: 700; letter-spacing: -.03em; padding: 4px 0; }
.nav__links a:hover { color: var(--accent); }
.nav.is-open .nav__links { clip-path: circle(150vmax at calc(100% - 40px) 32px); visibility: visible; transition: clip-path .7s var(--ease); }
.nav__actions { display: flex; align-items: center; gap: 10px; z-index: 2; }
.kbd-btn { display: none; gap: 3px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); }
.kbd-btn:hover { border-color: var(--line-strong); }
.nav__burger { width: 44px; height: 44px; display: grid; place-content: center; gap: 6px; }
.nav__burger span { display: block; width: 24px; height: 2px; background: var(--ink); transition: transform .4s var(--ease); }
.nav.is-open .nav__burger span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (min-width: 860px) {
  .nav__links {
    position: static; flex-direction: row; gap: 4px; padding: 0; background: none;
    clip-path: none; visibility: visible; transition: none;
  }
  .nav__links a {
    font-size: 15px; font-weight: 500; letter-spacing: 0; padding: 8px 14px; border-radius: 999px; color: var(--muted);
    transition: color .2s, background .2s;
  }
  .nav__links a:hover, .nav__links a.is-active { color: var(--ink); background: var(--paper-2); }
  .nav__burger { display: none; }
  .kbd-btn { display: inline-flex; }
}

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  transition: transform .35s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .3s;
  will-change: transform;
}
.btn--primary { background: var(--ink); color: var(--paper-3); }
.btn--primary:hover { background: var(--accent); box-shadow: 0 14px 34px -14px rgba(228, 87, 46, .8); }
.btn--primary svg { transition: transform .3s var(--ease); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { border: 1px solid var(--line-strong); background: rgba(246, 242, 234, .6); }
.btn--ghost:hover { border-color: var(--ink); background: var(--paper-3); }

.hero__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(246, 242, 234, .75); margin: 0; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(47, 158, 91, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(47, 158, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 91, 0); } }
.hero__tag { max-width: 34ch; font-size: clamp(18px, 2.1vw, 22px); line-height: 1.45; margin: 16px 0 0; }
.scramble { color: var(--accent); font-family: var(--mono); font-size: .9em; white-space: nowrap; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ==========================================================================
   HERO: exploded app stack
   Name and intro on the left; on the right, a phone built from Shubham's
   real work comes apart into six labelled layers (UI → cloud) when the
   visitor hovers, scrolls or taps, and tilts with the cursor. JS sizes and
   labels it; without JS (or with reduced motion) it shows already exploded
   with the labels as a list.
   ========================================================================== */
.hero { position: relative; padding: calc(var(--nav-h) + 28px) var(--gutter) 64px; }
.hero__inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) {
  .hero { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding-bottom: 48px; }
  .hero__inner { width: 100%; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); }
}
.hero__name { font-size: clamp(60px, 15vw, 116px); line-height: .84; letter-spacing: -.06em; text-transform: uppercase; margin: 0 0 26px; }
@media (min-width: 960px) { .hero__name { font-size: clamp(64px, 7.2vw, 116px); } }
.hero__name span { display: block; }
.hero__name span:last-child { color: var(--accent); font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.03em; font-size: 1.08em; }
.hero__link { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* ---- the figure ---- */
.stackfig { position: relative; margin: 0; --explode: 1; --s: .72; --label-w: 210px; }
.js .stackfig { --explode: 0; } /* assembled until main.js takes over */
.stackfig__scene { position: relative; height: calc(700px * var(--s)); display: grid; place-items: center; pointer-events: none; }
/* ---- the stack ---- */
.stack {
  --gap: calc(6px + var(--explode, 0) * 84px);
  position: relative; width: 240px; height: 480px; transform-style: preserve-3d;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--s, 1)) rotateX(58deg) rotateZ(var(--rz, -38deg));
}
.layer {
  position: absolute; inset: 0; border-radius: 30px; transform: translateZ(calc(var(--i) * var(--gap) + var(--lift, 0px)));
  transition: box-shadow .3s;
  border: 1px solid var(--line-strong); background: rgba(246, 242, 234, .9);
  box-shadow: 0 1px 0 rgba(23, 20, 15, .25), 0 0 0 1px rgba(255, 255, 255, .4) inset;
}
.layer__pin { position: absolute; right: 6px; bottom: 18%; width: 2px; height: 2px; }
.layer--infra { background: #d9d0bf; box-shadow: 0 40px 60px -10px rgba(23, 20, 15, .35); }
.infra { position: absolute; inset: 40px 24px 76px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.infra span { border-radius: 8px; background: var(--paper-3); border: 1px solid var(--line-strong); position: relative; display: grid; place-items: center; font: 600 11px var(--mono); color: var(--ink-2); }
.infra span::after { content: ""; position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.layer__tag { position: absolute; left: 0; right: 0; bottom: 26px; text-align: center; font-size: 13px; color: var(--ink-2); margin: 0; }

.layer--data { border-color: rgba(46, 77, 224, .55); }
.data { position: absolute; left: 22px; right: 22px; top: 40px; display: flex; justify-content: space-between; }
.data b {
  position: relative; width: 58px; height: 74px; border: 2px solid var(--blue); border-radius: 50% / 14px; display: grid; place-items: end center;
  padding-bottom: 8px; font: 600 11px var(--mono); color: var(--blue); background: rgba(46, 77, 224, .06);
}
.data b::before { content: ""; position: absolute; left: -2px; right: -2px; top: -2px; height: 26px; border: 2px solid var(--blue); border-radius: 50%; background: var(--paper-3); }
.rows { position: absolute; left: 22px; right: 22px; top: 160px; bottom: 70px; display: grid; gap: 10px; }
.rows span { border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(46, 77, 224, .18) 0 30%, transparent 30% 34%); }

.graph { position: absolute; inset: 0; width: 100%; height: 100%; }
.graph path { stroke: var(--ink); stroke-width: 2; fill: none; stroke-dasharray: 5 5; }
.graph rect { fill: var(--paper-3); stroke: var(--ink); stroke-width: 2; }
.graph text { font: 600 12px var(--mono); fill: var(--ink); text-anchor: middle; }

.layer--rt { background: rgba(228, 87, 46, .07); border: 1.5px dashed var(--accent); }
.pulse-net { position: absolute; inset: 0; width: 100%; height: 100%; }
.pulse-net path { stroke: var(--accent); stroke-width: 2; fill: none; }
.pulse-net circle { fill: var(--accent); }
.pay--top { top: 34px; bottom: auto !important; }
.pay { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); margin: 0; font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--paper-3); border: 1px solid var(--accent); color: var(--accent-ink); white-space: nowrap; }

.layer--comp { background: rgba(46, 77, 224, .05); border: 1.5px dashed var(--blue); }
.wire { position: absolute; inset: 30px 20px; display: grid; grid-template-rows: 46px 150px 50px 50px 1fr; gap: 12px; }
.wire span { border: 1.5px dashed var(--blue); border-radius: 10px; display: grid; place-items: center; font: 600 11px var(--mono); color: var(--blue); }
.wire .w-btn { align-self: end; height: 46px; border-radius: 999px; }

.layer--ui { background: var(--paper-3); border: 7px solid var(--ink); border-radius: 34px; box-shadow: 0 0 0 1px var(--ink); overflow: hidden; }
.ui { position: absolute; inset: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; }
.ui__bar { display: flex; justify-content: space-between; font: 600 11px var(--mono); }
.ui__hi { margin: 6px 0 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.ui__card { background: var(--ink); color: var(--paper-3); border-radius: 16px; padding: 12px 14px; }
.ui__card p { margin: 0; font-size: 11px; opacity: .7; }
.ui__card b { font-size: 26px; letter-spacing: -.03em; }
.ui__card small { font-size: 11px; opacity: .7; }
.ui__bars { display: flex; align-items: end; gap: 6px; height: 64px; margin-top: 6px; }
.ui__bars i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--accent); opacity: .9; }
.ui__bars i:nth-child(2n) { background: #f2a183; }
.ui__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--paper-2); }
.ui__row span { width: 22px; height: 22px; border-radius: 7px; background: var(--blue); flex: none; }
.ui__row:nth-of-type(2) span { background: var(--good); }
.ui__row p { margin: 0; flex: 1; font-weight: 600; }
.ui__row b { font: 500 10.5px var(--mono); color: var(--muted); }
.ui__row:nth-of-type(3) span { background: var(--accent); }
.ui__btn { margin-top: auto; text-align: center; padding: 11px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }


/* labels: a plain list until JS takes over */
.stackfig__labels { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 8px 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .stackfig__labels { grid-template-columns: 1fr 1fr; } }
.xlabel { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-3); }
.xlabel__n { font-size: 12px; color: var(--accent); font-weight: 600; padding-top: 3px; }
.xlabel p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.xlabel strong { display: block; color: var(--ink); font-size: 16.5px; letter-spacing: -.01em; }
.xlabel__t { display: block; font-size: 11px; color: var(--accent-ink); margin: 2px 0 3px; }
.stackfig__lines { display: none; }
.stackfig__cap { margin: 10px 0 0; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* JS layout */
.stack-on.stackfig { height: var(--fig-h, 600px); }
.stack-on .stackfig__scene { position: absolute; inset: 0; height: auto; }
.stack-on .stackfig__labels { display: block; margin: 0; }
.stack-on .xlabel {
  position: absolute; z-index: 3; top: 0; right: 0; width: var(--label-w); padding: 0; border: 0; background: none; border-radius: 0; gap: 9px;
  opacity: 0; transform: translateX(12px); cursor: default;
}
.stack-ready .xlabel { transition: opacity .5s var(--ease), transform .6s var(--ease); }
/* Before main.js lays the figure out, keep the static label list from flashing. */
.js .stackfig:not(.stack-on) .stackfig__labels, .js .stackfig:not(.stack-on) .stackfig__hint { visibility: hidden; }
.stack-on .xlabel.is-on { opacity: 1; transform: none; }
.stack-on .xlabel__n { flex: none; height: 20px; margin-top: 1px; padding: 0 7px; border: 1px solid var(--accent); border-radius: 999px; font-size: 11px; line-height: 18px; }
.stack-on .xlabel strong { font-size: 17px; line-height: 1.2; }
.stack-on .xlabel p { font-size: 12.5px; line-height: 1.4; text-shadow: 0 0 2px var(--paper), 0 0 8px var(--paper); }
.stack-on .xlabel:hover .xlabel__n, .stack-on .xlabel.is-hot .xlabel__n { background: var(--accent); color: #fff; }
.stackfig--compact .xlabel__d { display: none; }
.stack-on .stackfig__lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.stackfig__lines path { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0; transition: opacity .4s; }
.stackfig__lines path.is-on { opacity: .75; }
.stackfig__lines circle { fill: var(--accent); opacity: 0; transition: opacity .4s; }
.stackfig__lines circle.is-on { opacity: 1; }
.stack-on .stackfig__cap { display: none; }
.stackfig__hint { display: none; }
.stack-on .stackfig__hint {
  display: block; position: absolute; left: 0; right: var(--label-w); bottom: 0; margin: 0; text-align: center; pointer-events: none;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); opacity: calc(1 - var(--explode) * 4);
}
.when-touch { display: none; }
@media (hover: none) { .when-touch { display: inline; } .when-fine { display: none; } }
.layer.is-hot { --lift: 26px; box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 639px) {
  .stack-on .xlabel { gap: 6px; }
  .stack-on .xlabel__n { height: auto; margin: 0; padding: 0; border: 0; line-height: 1.3; }
  .stack-on .xlabel strong { font-size: 14px; line-height: 1.3; }
  .stack-on .xlabel__t, .stack-on .xlabel__d { display: none; }
}

/* ---------- stats ---------- */
.stats { padding: 0 var(--gutter); }
.stats__grid {
  max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
}
.stat { padding: 28px 12px 24px; border-right: 1px solid var(--line); }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.stat__num { display: block; font-size: clamp(32px, 7vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat__label { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.35; }
.stat:hover .stat__num { color: var(--accent); }
@media (min-width: 860px) {
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 40px 28px; border-bottom: 0 !important; }
  .stat:nth-child(2n) { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
}

/* ---------- sections ---------- */
.section { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(88px, 13vw, 168px) var(--gutter) 0; }
.section__head { margin-bottom: clamp(40px, 6vw, 72px); }
.section__kicker { color: var(--accent-ink); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px; }
.section__title { font-size: clamp(44px, 9vw, 112px); letter-spacing: -.045em; }
.section__title em, .contact__title em, .shell__title em { letter-spacing: -.02em; }
.mono-inline { font-family: var(--mono); font-weight: 600; letter-spacing: -.06em; }

/* ---------- shell (terminal) ---------- */
.shell__grid { display: grid; gap: 32px; align-items: center; }
.shell__title { font-size: clamp(36px, 6vw, 72px); letter-spacing: -.04em; margin-bottom: 18px; }
.shell b { color: var(--ink); font-family: var(--mono); font-size: .92em; }
@media (min-width: 960px) { .shell__grid { grid-template-columns: 1fr 1.15fr; gap: 64px; } }

.terminal {
  width: 100%; border-radius: 14px; overflow: hidden; background: var(--ink); color: #ece6da;
  box-shadow: 0 40px 80px -40px rgba(23, 20, 15, .55), 0 0 0 1px rgba(23, 20, 15, .9);
}
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); background: #211d17; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.terminal__title { margin-left: 8px; font-size: 12px; color: #9b9284; }
.terminal__body { height: 260px; overflow-y: auto; padding: 14px 16px 4px; font-size: 13.5px; line-height: 1.65; overscroll-behavior: contain; }
.terminal__body p { margin: 0 0 2px; white-space: pre-wrap; word-break: break-word; }
.terminal__body a { color: #8fa3ff; text-decoration: underline; text-underline-offset: 3px; }
.t-prompt { color: var(--accent); margin-right: 8px; }
.t-out { color: #a59c8d; }
.t-out b, .t-cmd { color: #f6f2ea; }
.t-err { color: #ff7a6b; }
.terminal__form { display: flex; align-items: center; padding: 6px 16px 14px; font-size: 13.5px; }
.terminal__form label { display: flex; }
.terminal__form input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #f6f2ea; font: inherit; caret-color: var(--accent);
  font-size: 16px; /* avoid iOS zoom */
}
@media (min-width: 600px) { .terminal__form input { font-size: inherit; } }
.terminal__form input::placeholder { color: rgba(246, 242, 234, .3); }

/* ---------- about ---------- */
.about__grid { display: grid; gap: 40px; }
.about__photo { position: relative; margin: 0; max-width: 380px; border-radius: var(--radius); overflow: hidden; transform-style: preserve-3d; box-shadow: 0 30px 60px -30px rgba(23, 20, 15, .45); }
.about__photo img { width: 100%; filter: sepia(.25) saturate(.85) contrast(1.02); transition: filter .6s var(--ease), transform .8s var(--ease); }
.about__photo:hover img { filter: none; transform: scale(1.03); }
.about__photo figcaption { position: absolute; left: 12px; bottom: 12px; font-size: 11.5px; padding: 4px 10px; border-radius: 8px; background: rgba(246, 242, 234, .9); color: var(--ink); }
.lead { font-size: clamp(20px, 2.6vw, 28px); line-height: 1.4; letter-spacing: -.01em; }
.about__copy > p:not(.lead) { color: var(--muted); max-width: 60ch; }
.about__copy strong { color: var(--ink); }
.about__cards { display: grid; gap: 12px; margin-top: 28px; }
.mini-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-3); transition: border-color .3s, transform .4s var(--ease); }
.mini-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.mini-card h3 { font-size: 12.5px; font-weight: 600; color: var(--blue); margin-bottom: 8px; letter-spacing: 0; }
.mini-card p { margin: 0; font-size: 15px; color: var(--muted); }
@media (min-width: 860px) {
  .about__grid { grid-template-columns: 360px 1fr; gap: 64px; align-items: start; }
  .about__photo { position: sticky; top: calc(var(--nav-h) + 24px); }
  .about__cards { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- git log ---------- */
.gitlog { position: relative; padding-left: 36px; }
.gitlog::before, .gitlog::after {
  content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; background: var(--line);
}
.gitlog::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--draw, 1)); }
.commit { position: relative; padding: 0 0 56px; }
.commit::before {
  content: ""; position: absolute; left: -32px; top: 5px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent); z-index: 1; box-shadow: 0 0 0 4px var(--paper);
}
.commit[data-branch="freelance"] { padding-left: 28px; }
.commit[data-branch="freelance"]::before { left: -4px; border-color: var(--blue); }
.commit[data-branch="freelance"]::after {
  content: ""; position: absolute; left: -26px; top: 12px; width: 26px; height: 2px; background: var(--blue); opacity: .6;
}
.commit__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.commit__hash { color: #a8741a; }
.ref { padding: 1px 8px; border-radius: 6px; font-size: 12px; border: 1px solid; }
.ref--head { color: var(--accent-ink); border-color: rgba(228, 87, 46, .45); background: rgba(228, 87, 46, .08); }
.ref--branch { color: var(--blue); border-color: rgba(46, 77, 224, .4); background: var(--blue-soft); }
.ref--tag { color: var(--good); border-color: rgba(47, 158, 91, .4); background: rgba(47, 158, 91, .08); }
.commit__role { font-size: clamp(22px, 3.2vw, 34px); letter-spacing: -.025em; margin-bottom: 14px; }
.commit__role .at { color: var(--muted); font-weight: 500; }
.commit__list { display: grid; gap: 8px; max-width: 72ch; color: var(--muted); font-size: 16px; }
.commit__list li { position: relative; padding-left: 20px; }
.commit__list li::before { content: "+"; position: absolute; left: 0; color: var(--good); font-family: var(--mono); }
.commit__tags { margin-top: 14px; font-size: 12.5px; color: var(--blue); }

/* ---------- project cards ---------- */
.projects__grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .projects__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .projects__grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; padding: 28px 24px 24px; min-height: 380px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-3); overflow: hidden;
  transform-style: preserve-3d; transition: border-color .3s, transform .5s var(--ease), box-shadow .4s;
}
.card:hover { border-color: var(--ink); box-shadow: 0 30px 60px -36px rgba(23, 20, 15, .5); }
.card__glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(380px circle at var(--mx) var(--my), hsla(var(--hue), 80%, 55%, .14), transparent 50%);
}
.card:hover .card__glow { opacity: 1; }
.card > * { position: relative; }
.card__index { font-size: 12px; color: var(--accent-ink); margin-bottom: 40px; }
.card__index::after { content: ""; display: inline-block; vertical-align: middle; width: 32px; height: 1px; margin-left: 10px; background: currentColor; }
.card__title { font-size: 34px; letter-spacing: -.035em; margin-bottom: 6px; transform: translateZ(30px); }
.card__sub { font-size: 12px; color: var(--blue); margin-bottom: 16px; }
.card p { font-size: 15.5px; color: var(--muted); }
.card__tags { font-size: 12px !important; color: var(--ink-2) !important; margin-top: auto; }
.card__metric { margin-top: auto; color: var(--ink) !important; }
.card__metric b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 34px; color: var(--accent); margin-right: 4px; letter-spacing: -.02em; }
.card__link {
  display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; margin-top: 8px; padding: 8px 0;
  font-weight: 600; border-bottom: 1px solid var(--line-strong); transition: border-color .3s, gap .3s var(--ease), color .3s;
}
.card__link:hover { border-color: var(--accent); color: var(--accent-ink); gap: 10px; }

/* ---------- skills ---------- */
.marquee {
  overflow: hidden; margin: 0 calc(-1 * var(--gutter)); padding: 10px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee--reverse .marquee__track { animation-direction: reverse; animation-duration: 44s; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span {
  font-size: clamp(32px, 6vw, 72px); font-weight: 700; letter-spacing: -.04em; padding: 0 .4em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(23, 20, 15, .35); transition: color .3s;
}
.marquee span:nth-child(3n+1) { color: var(--ink); -webkit-text-stroke: 0; }
.marquee span:nth-child(3n+2) { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); -webkit-text-stroke: 0; letter-spacing: -.02em; }
.marquee span:hover { color: var(--blue); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

.skills__grid { display: grid; gap: 12px; margin-top: 56px; }
@media (min-width: 720px) { .skills__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .skills__grid { grid-template-columns: repeat(3, 1fr); } }
.skill-group { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-3); }
.skill-group h3 { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 14px; letter-spacing: .04em; text-transform: uppercase; }
.skill-group ul { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group li {
  font-size: 14px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.skill-group li:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); }

.edu { display: grid; gap: 24px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.edu h3 { font-size: 12.5px; color: var(--blue); font-weight: 600; margin-bottom: 10px; letter-spacing: .04em; text-transform: uppercase; }
.edu p { color: var(--muted); }
.edu b { color: var(--ink); }

/* ---------- contact (ink block) ---------- */
.contact {
  margin-top: clamp(88px, 13vw, 168px); max-width: none; padding: clamp(80px, 12vw, 160px) var(--gutter);
  text-align: center; background: var(--ink); color: var(--paper-3);
}
.contact .section__kicker { color: var(--accent); }
.contact__title { font-size: clamp(48px, 12vw, 160px); letter-spacing: -.055em; line-height: .92; margin: 8px 0 48px; }
.contact__line { display: block; }
.contact__mail {
  display: inline-block; font-size: clamp(20px, 4.4vw, 44px); font-weight: 600; letter-spacing: -.02em; padding: 8px 4px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
  transition: background-size .5s var(--ease), color .3s; word-break: break-all;
}
.contact__mail:hover { color: var(--ink); background-size: 100% 100%; }
.socials { display: flex; justify-content: center; gap: 12px; margin-top: 36px; }
.socials a { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(246, 242, 234, .3); font-weight: 500; transition: background .25s, color .25s; }
.socials a:hover { background: var(--paper-3); color: var(--ink); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: var(--ink); color: #9b9284; border-top: 1px solid rgba(246, 242, 234, .1); font-size: 12.5px;
}
.footer p { margin: 0; }
.footer kbd { border-color: rgba(246, 242, 234, .25); background: transparent; }
@media (hover: none) { .footer__hint { display: none; } }

/* ---------- command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 400; display: grid; place-items: start center; padding: 14vh 16px 16px; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(23, 20, 15, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s; }
.palette__box {
  position: relative; width: 100%; max-width: 560px; border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden;
  background: var(--paper-3); box-shadow: 0 40px 120px -20px rgba(23, 20, 15, .5); animation: pop .3s var(--ease);
}
.palette__input { width: 100%; padding: 18px 20px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 16px; outline: 0; }
.palette__list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette__list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px; cursor: pointer; font-size: 15px;
}
.palette__list li span:last-child { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.palette__list li[aria-selected="true"] { background: var(--paper-2); }
.palette__list li[aria-selected="true"] span:first-child { color: var(--accent-ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translate3d(0, 40px, 0); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .party { animation: none; }
}

.commit__role a { color: inherit; }
.skill-group--feature { grid-column: 1 / -1; }

/* ---------- hero phone: lock screen ---------- */
.ui--lock { background: radial-gradient(120% 60% at 20% 0%, #f08a5d 0%, #e4572e 28%, #3a1d14 62%, #17140f 100%); color: #fff; gap: 7px; padding: 12px 12px 10px; }
.lock__bar { display: flex; justify-content: space-between; font: 600 10.5px var(--mono); opacity: .9; padding: 0 4px; }
.lock__date { margin: 14px 0 0; text-align: center; font-size: 12px; font-weight: 600; opacity: .85; }
.lock__time { margin: -4px 0 10px; text-align: center; font-size: 68px; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.note { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 14px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .14); }
.note i { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--c); display: grid; place-items: center; font: 700 11px var(--sans, inherit); font-style: normal; color: #fff; }
.note p { margin: 0; flex: 1; font-size: 10.5px; line-height: 1.3; min-width: 0; }
.note b { display: block; font-size: 11px; }
.note small { align-self: flex-start; font-size: 9px; opacity: .7; }
.lock__home { margin: auto auto 2px; width: 84px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .7); }

/* ---------- contact dialog ---------- */
.contact-dlg {
  width: min(520px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line-strong); border-radius: 22px;
  background: var(--paper-3); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(23, 20, 15, .5);
}
.contact-dlg::backdrop { background: rgba(23, 20, 15, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.contact-dlg[open] { animation: dlg-in .35s var(--ease); }
/* no transform on the dialog itself: it would offset the fixed cursor moved inside it */
.contact-dlg[open] > :not(.cursor) { animation: dlg-up .35s var(--ease); }
@keyframes dlg-in { from { opacity: 0; } }
@keyframes dlg-up { from { transform: translateY(14px); } }
.contact-dlg__close { position: absolute; top: 14px; right: 14px; margin: 0; }
.contact-dlg__close button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; font-size: 14px; }
.contact-dlg__close button:hover { border-color: var(--ink); }
.contact-dlg__title { font-size: clamp(30px, 6vw, 40px); letter-spacing: -.03em; line-height: 1.05; margin: 0; }
.contact-dlg__title em { font-family: var(--serif); font-weight: 400; color: var(--accent); }
.contact-dlg__lead { color: var(--muted); margin: 10px 0 20px; }
.contact-dlg__email { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); }
.contact-dlg__email span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.contact-dlg__copy { min-height: 42px; padding: 0 18px; }
.contact-dlg__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.contact-dlg__opts .btn { justify-content: center; min-height: 46px; }
