/* =========================================================
   mohit joshi — workbench portfolio
   hand-written css, no framework
   ========================================================= */

:root {
  --ink: #0d0f0e;
  --ink-2: #121512;
  --panel: #161a17;
  --panel-2: #1b201c;
  --paper: #e9e4d6;
  --text: #e8e6df;
  --muted: #a8ada4;
  --dim: #7d857c;
  --line: rgba(232, 230, 223, 0.13);
  --line-strong: rgba(232, 230, 223, 0.24);
  --lime: #c6f24e;
  --lime-soft: rgba(198, 242, 78, 0.12);
  --amber: #ffc078;
  --rose: #ff9aae;
  --blue: #8bd3ff;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hand: 'Caveat', cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
::selection { background: var(--lime); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%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)' opacity='.35'/%3E%3C/svg%3E");
}

.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.section { padding: 112px 0; position: relative; }
.hero-copy, .hero-stage, .about-copy, .file-list, .project-preview,
.terminal-card, .tiles-wrap, .badge-grid, .mail-form, .resume-copy { min-width: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-star { color: var(--lime); font-size: .95rem; line-height: 1; }

.section-title {
  font-size: clamp(2rem, 4.4vw, 3.45rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 600;
  margin: 0 0 28px;
}
.section-title em {
  font-family: var(--hand);
  font-style: normal;
  font-weight: 600;
  color: var(--lime);
  font-size: 1.18em;
  letter-spacing: 0;
}
.section-head { margin-bottom: 52px; }
.section-sub { color: var(--muted); margin: -14px 0 0; font-size: .95rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn i { font-size: .9rem; }
.btn-solid { background: var(--lime); color: #10140d; }
.btn-solid:hover { background: #d7ff72; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-strong); background: rgba(255,255,255,.02); color: var(--text); }
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); transform: translateY(-2px); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 46px;
  z-index: 100;
  background: rgba(13, 15, 14, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .3s, box-shadow .3s;
}
.topbar.is-scrolled { background: rgba(13, 15, 14, .97); box-shadow: 0 10px 34px rgba(0, 0, 0, .38); }
.topbar-inner {
  height: 100%;
  width: min(1440px, 100%);
  margin-inline: auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.window-dots { display: flex; gap: 6px; }
.window-dots span { width: 9px; height: 9px; border-radius: 50%; background: #3a4139; }
.window-dots span:first-child { background: #ff7b72; }
.window-dots span:nth-child(2) { background: #ffc078; }
.window-dots span:nth-child(3) { background: var(--lime); }
.path {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.path > i, .branch { flex: 0 0 auto; }
.path > i { color: var(--lime); }
.branch { color: var(--dim); display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.live-status { font-family: var(--mono); font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(198,242,78,.6); }
.clock { font-family: var(--mono); font-size: .75rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.menu-btn {
  display: none;
  place-items: center;
  width: 40px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lime);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.menu-btn:hover { background: var(--lime-soft); }
.menu-btn:active { transform: scale(.96); }
.menu-btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.menu-lines { display: grid; gap: 4px; width: 17px; }
.menu-lines span {
  display: block;
  width: 17px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), opacity .18s ease;
  transform-origin: center;
}
.menu-lines span:nth-child(2) { width: 11px; justify-self: end; }
.menu-btn[aria-expanded="true"] {
  background: rgba(198, 242, 78, 0.18);
  color: var(--lime);
}
.menu-btn[aria-expanded="true"] .menu-lines span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines span:nth-child(2) { opacity: 0; transform: translateX(4px) scaleX(.4); }
.menu-btn[aria-expanded="true"] .menu-lines span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.site-nav { display: none; }

/* ---------- side rail ---------- */
.rail { display: none; }
@media (min-width: 1420px) {
  .rail {
    display: block;
    position: fixed;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 74px;
    font-family: var(--mono);
  }
  .rail-track { position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
  .rail-fill { display: block; width: 1px; height: 0; background: var(--lime); transition: height .12s linear; }
  .rail-links { display: flex; flex-direction: column; gap: 14px; padding-left: 16px; }
  .rail-links a { display: flex; gap: 7px; align-items: baseline; font-size: .66rem; color: var(--dim); transition: color .2s; }
  .rail-links a b { color: var(--dim); font-weight: 500; }
  .rail-links a span { opacity: 0; transform: translateX(-4px); transition: .2s; }
  .rail-links a:hover span, .rail-links a.is-current span { opacity: 1; transform: none; }
  .rail-links a.is-current, .rail-links a.is-current b { color: var(--lime); }
  .rail-end { padding-left: 16px; margin-top: 18px; font-size: .58rem; color: var(--dim); border-top: 1px solid var(--line); padding-top: 12px; }
}

/* ---------- hero ---------- */
.hero {
  --scroll: 0;
  min-height: 100vh;
  padding: 130px 0 90px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
@supports (height: 100svh) {
  .hero { min-height: 100svh; }
}
.hero::before {
  content: '';
  position: absolute;
  width: 620px; height: 620px;
  right: -180px; top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,242,78,.055), transparent 68%);
  pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 72px; align-items: center; }
.hero-copy { max-width: 620px; }
.hero-copy { transform: translateY(calc(var(--scroll) * -34px)); opacity: calc(1 - var(--scroll) * .4); }
.hero-title {
  font-size: clamp(3.4rem, 8vw, 6.6rem);
  line-height: .88;
  letter-spacing: -.07em;
  font-weight: 700;
  margin: 0 0 26px;
}
.hero-title span { display: block; color: transparent; -webkit-text-stroke: 1px rgba(232,230,223,.45); }
.hero-role { font-family: var(--mono); font-size: .9rem; color: var(--lime); margin: 0 0 24px; }
.hero-role .slash { color: var(--dim); margin: 0 6px; }
.hero-lede { color: var(--muted); font-size: 1.05rem; max-width: 520px; margin: 0 0 34px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 34px; font-family: var(--mono); font-size: .7rem; color: var(--dim); }
.hero-facts span { display: inline-flex; align-items: center; gap: 7px; }
.hero-facts i { color: var(--lime); }

.hero-stage { --mx: 0; --my: 0; height: 470px; position: relative; perspective: 1100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stage-glow {
  position: absolute; left: 50%; top: 44%;
  width: 440px; height: 440px;
  transform: translate(-50%, -50%) translate3d(calc(var(--mx) * 26px), calc(var(--my) * 20px), 0);
  background: radial-gradient(circle, rgba(198,242,78,.13), transparent 66%);
  filter: blur(6px); pointer-events: none;
  opacity: calc(1 - var(--scroll) * .7);
  transition: transform .25s ease-out;
}
.stage-grid {
  position: absolute;
  left: -12%; right: -12%; bottom: -12%; height: 62%;
  background-image: linear-gradient(rgba(198,242,78,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(198,242,78,.10) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: rotateX(72deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  pointer-events: none;
}
.stage-scene {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--mx) * 7deg)) rotateX(calc(var(--my) * -5deg))
    translateY(calc(var(--scroll) * -55px)) scale(calc(1 - var(--scroll) * .06));
  transition: transform .25s ease-out;
}
.stage-card {
  position: absolute; z-index: 4;
  display: flex; flex-direction: column; gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: rgba(16, 19, 16, .92);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .45);
  font-family: var(--mono); font-size: .62rem; line-height: 1.5; color: var(--muted);
  pointer-events: none;
  animation: cardFloat 5.5s ease-in-out infinite alternate;
}
.stage-card span { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.stage-card i { color: var(--lime); }
.stage-card b { font-weight: 500; color: var(--lime); }
.stage-card em { font-style: normal; color: var(--dim); }
.card-json {
  top: -6%; right: 2%; width: 168px;
  transform: translate3d(calc(var(--mx) * 34px), calc(var(--my) * -16px), -60px) rotate(7deg);
  animation-delay: -.8s;
}
.card-chip {
  top: -7%; left: -4%; width: 150px;
  transform: translate3d(calc(var(--mx) * -30px), calc(var(--my) * -14px), -40px) rotate(-5deg);
  animation-delay: -2.4s;
}
@keyframes cardFloat { from { margin-top: 0; } to { margin-top: -7px; } }
.slab-shadow {
  position: absolute;
  bottom: 74px; left: 50%;
  width: 320px; height: 44px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  filter: blur(24px);
  border-radius: 50%;
}
.code-slab {
  --rx: 0deg; --ry: 0deg; --dragX: 0deg; --dragY: 0deg;
  position: relative;
  width: min(100%, 470px);
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--rx) + var(--dragX))) rotateY(calc(var(--ry) + var(--dragY)));
  transition: transform .16s ease-out;
  cursor: grab;
  z-index: 2;
  user-select: none;
}
.code-slab:active { cursor: grabbing; transition: none; }
.slab-face { border-radius: 12px; border: 1px solid var(--line-strong); }
.slab-front { position: relative; z-index: 3; background: var(--panel); transform: translateZ(16px); box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.slab-mid, .slab-back {
  position: absolute; inset: 0;
  background: #0a0c0a;
  border-color: rgba(198,242,78,.16);
}
.slab-mid { transform: translateZ(0) translate(4px, 4px); }
.slab-back { transform: translateZ(-16px) translate(9px, 9px); }
.slab-top, .slab-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  font-family: var(--mono); font-size: .68rem; color: var(--dim);
}
.slab-top { border-bottom: 1px solid var(--line); }
.slab-top > i:last-child { margin-left: auto; color: var(--dim); }
.dots { display: flex; gap: 5px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: #3d443c; }
.dots span:first-child { background: #ff7b72; }
.dots span:nth-child(2) { background: #ffc078; }
.dots span:nth-child(3) { background: var(--lime); }
.slab-file { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.slab-file i { color: var(--lime); }
.slab-code { padding: 18px 20px 22px; }
.slab-code pre { margin: 0; font-family: var(--mono); font-size: .74rem; line-height: 1.85; color: var(--text); white-space: pre; }
.c-com { color: #7d857c; font-style: italic; }
.c-key { color: var(--rose); }
.c-str { color: var(--lime); }
.c-type { color: var(--blue); }
.c-fn { color: var(--amber); }
.slab-foot { border-top: 1px solid var(--line); justify-content: space-between; }
.slab-foot span { display: inline-flex; align-items: center; gap: 6px; }
.drag-hint { position: absolute; bottom: 12px; font-family: var(--mono); font-size: .66rem; color: var(--dim); margin: 0; }
.drag-hint i { color: var(--lime); margin-right: 6px; }
.drag-hint span { margin: 0 5px; }

.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue i { color: var(--lime); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- ticker ---------- */
.ticker { border-block: 1px solid var(--line); background: var(--ink-2); overflow: hidden; }
.ticker-inner {
  display: flex; align-items: center; gap: 0;
  width: max-content; padding: 13px 0;
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  animation: slide 34s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-group { display: flex; align-items: center; gap: 22px; padding-right: 22px; }
.ticker-group span:first-child { color: var(--lime); display: inline-flex; align-items: center; gap: 8px; }
.ticker-group em { color: var(--lime); font-style: normal; }
@keyframes slide { to { transform: translateX(var(--ticker-shift, -50%)); } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 88px; align-items: start; }
.about-copy > p:not(.eyebrow) { color: var(--muted); max-width: 590px; }
.about-copy > p strong { color: var(--text); font-weight: 600; }
.about-facts { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 11px; }
.about-facts li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .92rem; }
.about-facts i { color: var(--lime); width: 18px; }
.about-note {
  --rx: 0deg; --ry: 0deg;
  position: relative;
  background: var(--paper);
  color: #171a16;
  padding: 38px 32px 28px;
  border-radius: 3px;
  transform: rotate(-1.6deg) rotateX(var(--rx)) rotateY(var(--ry));
  box-shadow: 18px 22px 0 rgba(0,0,0,.22), 0 24px 50px rgba(0,0,0,.4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.about-note:hover { box-shadow: 12px 16px 0 rgba(0,0,0,.22), 0 30px 60px rgba(0,0,0,.45); }
.tape {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(2deg);
  width: 118px; height: 28px; background: rgba(198,242,78,.55); box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.note-head { font-family: var(--hand); font-size: 2rem; line-height: 1; margin: 0 0 18px; }
.note-head i { color: #5c7a12; font-size: 1.2rem; margin-left: 6px; }
.note-text { font-size: .98rem; line-height: 1.7; margin: 0 0 26px; }
.note-scribble { display: flex; align-items: center; gap: 10px; font-family: var(--hand); font-size: 1.5rem; color: #5c7a12; }
.note-scribble i { transform: rotate(-25deg); }
.note-index { position: absolute; right: 20px; bottom: 16px; font-family: var(--mono); font-size: .62rem; color: #555b4f; letter-spacing: .08em; }

/* ---------- work ---------- */
.work-layout { display: grid; grid-template-columns: 1fr 400px; gap: 52px; align-items: start; }
.file-list { border-top: 1px solid var(--line); }
.file-row {
  width: 100%; display: flex; align-items: center; gap: 18px;
  padding: 20px 14px; background: none; border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  text-align: left; cursor: pointer;
  transition: background .2s, border-color .2s, padding .2s;
}
.file-row:hover { background: rgba(255,255,255,.025); padding-left: 20px; }
.file-row.is-active { border-left-color: var(--lime); background: rgba(198,242,78,.035); }
.file-no { font-family: var(--mono); font-size: .7rem; color: var(--dim); }
.file-icon {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 9px;
  color: var(--lime); font-size: 1rem; background: var(--panel);
}
.file-main { display: flex; flex-direction: column; }
.file-main strong { font-size: 1.05rem; font-weight: 600; }
.file-main small { font-family: var(--mono); font-size: .66rem; color: var(--dim); margin-top: 3px; }
.file-arrow { margin-left: auto; color: var(--lime); opacity: 0; transform: translateX(-6px); transition: .2s; }
.file-row:hover .file-arrow, .file-row.is-active .file-arrow { opacity: 1; transform: none; }
.file-end { font-family: var(--mono); font-size: .66rem; color: var(--dim); padding: 16px 14px; margin: 0; }
.file-end i { color: var(--lime); margin-right: 6px; }

.project-preview {
  --rx: 0deg; --ry: 0deg;
  position: sticky; top: 92px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px; overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .18s ease-out, box-shadow .2s;
}
.project-preview:hover { box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.preview-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .66rem; color: var(--dim);
}
.preview-live { display: inline-flex; align-items: center; gap: 6px; }
.preview-live i { color: var(--lime); font-size: .5rem; }
.preview-visual {
  height: 176px; margin: 16px 16px 0; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid rgba(198,242,78,.14);
  background:
    linear-gradient(rgba(198,242,78,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198,242,78,.06) 1px, transparent 1px),
    radial-gradient(circle at 50% 40%, rgba(198,242,78,.10), transparent 70%),
    #0f120f;
  background-size: 26px 26px, 26px 26px, auto, auto;
}
.preview-visual i { font-size: 3.2rem; color: var(--lime); text-shadow: 0 0 30px rgba(198,242,78,.3); }
.preview-body { padding: 20px 20px 24px; }
.preview-body h3 { font-size: 1.15rem; margin: 0 0 8px; font-weight: 600; }
.preview-body p { color: var(--muted); font-size: .88rem; margin: 0 0 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span { font-family: var(--mono); font-size: .62rem; padding: 5px 10px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); }
.preview-link {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 14px; padding: 8px 12px;
  border: 1px solid rgba(198, 242, 78, .32); border-radius: 8px;
  background: var(--lime-soft); color: var(--lime);
  font-family: var(--mono); font-size: .66rem; text-decoration: none;
  transition: background .2s, border-color .2s;
}
.preview-link:hover { background: rgba(198, 242, 78, .16); border-color: var(--lime); }
.preview-link[hidden] { display: none !important; }
.preview-note { font-family: var(--mono); font-size: .61rem !important; color: var(--dim) !important; margin: 14px 0 0 !important; }
.preview-note i { color: var(--lime); margin-right: 5px; }

/* ---------- stack ---------- */
.stack-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 60px; align-items: start; }
.terminal-card { border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: #0f120f; }
.terminal-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .7rem; color: var(--muted); background: var(--panel);
}
.terminal-bar i { margin-left: auto; color: var(--lime); }
.terminal-out { margin: 0; padding: 24px; font-family: var(--mono); font-size: .76rem; line-height: 2; color: var(--text); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prompt { color: var(--lime); }
.caret { color: var(--lime); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tiles-wrap .eyebrow { margin-bottom: 22px; }
.tile-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; perspective: 800px; }
.tech-tile {
  --rx: 0deg; --ry: 0deg;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transform: rotateX(calc(7deg + var(--rx))) rotateY(calc(-7deg + var(--ry)));
  transition: transform .18s ease-out, border-color .2s, background .2s;
  cursor: default;
}
.tech-tile:hover { border-color: var(--lime); background: var(--panel-2); }
.tech-tile i { font-size: 1.5rem; color: var(--lime); }
.tech-tile span { font-family: var(--mono); font-size: .58rem; color: var(--muted); }
@keyframes tilePop {
  from { opacity: 0; transform: translateY(18px) rotateX(16deg) rotateY(-16deg) scale(.94); }
  to { opacity: 1; transform: rotateX(7deg) rotateY(-7deg) scale(1); }
}
.tile-wall.is-live .tech-tile { animation: tilePop .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.tile-wall.is-live .tech-tile:nth-child(2) { animation-delay: .06s; }
.tile-wall.is-live .tech-tile:nth-child(3) { animation-delay: .12s; }
.tile-wall.is-live .tech-tile:nth-child(4) { animation-delay: .18s; }
.tile-wall.is-live .tech-tile:nth-child(n+5) { animation-delay: .24s; }

/* ---------- log ---------- */
.log-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 76px; }
.commit-line { border-left: 1px solid var(--line); padding-left: 34px; position: relative; }
.commit-line::before {
  content: ''; position: absolute; left: -1px; top: 0; width: 1px; height: 100%;
  background: var(--lime); transform: scaleY(0); transform-origin: top;
  transition: transform 1.1s ease .1s;
}
.log-grid.is-live .commit-line::before { transform: scaleY(1); }
.commit { position: relative; padding-bottom: 34px; }
.commit:last-child { padding-bottom: 0; }
.commit-node {
  position: absolute; left: -45px; top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--lime);
  display: grid; place-items: center; color: var(--lime); font-size: .6rem;
  transform: scale(.5); opacity: .45;
  transition: transform .5s cubic-bezier(.2, 1.3, .3, 1), opacity .35s, box-shadow .35s;
}
.log-grid.is-live .commit-node { transform: none; opacity: 1; box-shadow: 0 0 0 5px rgba(198, 242, 78, .09); }
.commit-meta { font-family: var(--mono); font-size: .64rem; color: var(--lime); letter-spacing: .04em; }
.commit h3 { font-size: 1.12rem; font-weight: 600; margin: 6px 0 8px; }
.commit p { color: var(--muted); font-size: .9rem; margin: 0; }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.badge {
  --rx: 0deg; --ry: 0deg;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 22px 18px;
  display: flex; flex-direction: column; gap: 4px;
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .18s ease-out, border-color .2s;
}
.badge:hover { border-color: var(--line-strong); }
.badge-icon { font-size: 1.45rem; margin-bottom: 12px; }
.badge-icon.lime { color: var(--lime); }
.badge-icon.amber { color: var(--amber); }
.badge-icon.rose { color: var(--rose); }
.badge-icon.blue { color: var(--blue); }
.badge strong { font-size: .95rem; font-weight: 600; }
.badge small { font-family: var(--mono); font-size: .61rem; color: var(--dim); }
.awards-foot { font-family: var(--hand); font-size: 1.35rem; color: var(--muted); margin: 26px 0 0; line-height: 1.35; }
.awards-foot i { color: var(--lime); font-size: .8rem; }

/* ---------- resume ---------- */
.resume-card {
  position: relative;
  display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; gap: 34px; align-items: center;
  border: 1px dashed var(--line-strong); border-radius: 18px;
  background:
    radial-gradient(circle at 1px 1px, rgba(232, 230, 223, .055) 1px, transparent 0) 0 0 / 16px 16px,
    var(--panel);
  padding: 36px 40px;
  transition: border-color .3s ease;
}
.resume-card:hover { border-color: rgba(198, 242, 78, .32); }
.resume-paper {
  position: relative;
  width: 148px; height: 192px;
  padding: 13px 13px 11px;
  display: flex; flex-direction: column;
  border-radius: 9px;
  background: linear-gradient(180deg, #f7f2e5, #e8e2d2);
  color: #2b2f27;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .28);
  transform: rotate(-2deg);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}
.resume-card:hover .resume-paper { transform: rotate(-.6deg) translateY(-4px); }
.paper-head { display: flex; align-items: center; gap: 6px; padding: 0 20px 8px 0; border-bottom: 1px solid rgba(43, 47, 39, .16); }
.paper-dot { width: 6px; height: 6px; border-radius: 50%; background: #6f9c14; box-shadow: 0 0 0 2px rgba(111, 156, 20, .18); flex: 0 0 auto; }
.paper-file { flex: 1; min-width: 0; font-family: var(--mono); font-size: .47rem; letter-spacing: .02em; color: #616a58; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.paper-badge { flex: 0 0 auto; font-family: var(--mono); font-size: .44rem; padding: 2px 5px; border: 1px solid rgba(43, 47, 39, .25); border-radius: 3px; color: #4b5344; white-space: nowrap; }
.paper-body { flex: 1; padding-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.paper-body strong { font-family: var(--sans); font-size: .95rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.paper-body em { font-family: var(--mono); font-style: normal; font-size: .42rem; text-transform: uppercase; letter-spacing: .18em; color: #6f7764; margin-bottom: 4px; }
.paper-rule { height: 1px; background: rgba(43, 47, 39, .18); margin-bottom: 3px; }
.paper-line { height: 3px; border-radius: 3px; background: rgba(43, 47, 39, .15); }
.paper-line.w92 { width: 92%; } .paper-line.w86 { width: 86%; } .paper-line.w82 { width: 82%; }
.paper-line.w78 { width: 78%; } .paper-line.w64 { width: 64%; }
.paper-foot { display: flex; justify-content: space-between; border-top: 1px solid rgba(43, 47, 39, .16); padding-top: 8px; font-family: var(--mono); font-size: .43rem; text-transform: uppercase; letter-spacing: .1em; color: #737b68; }
.paper-stamp {
  position: absolute; right: 10px; bottom: 44px;
  padding: 4px 6px 3px;
  transform: rotate(-9deg);
  font-family: var(--mono); font-size: .38rem; line-height: 1; letter-spacing: .15em; text-transform: uppercase;
  color: #5f7a24;
  border: 1px solid rgba(95, 122, 36, .6);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(95, 122, 36, .16);
  opacity: .8;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.paper-fold {
  position: absolute; top: 0; right: 0; width: 26px; height: 26px;
  background: linear-gradient(225deg, #d8d1bf 0 49%, #f3edde 50%);
  border-bottom-left-radius: 6px;
  box-shadow: -2px 2px 5px rgba(0, 0, 0, .18);
}
.resume-copy .eyebrow { margin-bottom: 10px; }
.resume-copy .section-title { font-size: 2rem; margin-bottom: 8px; }
.resume-copy > p:not(.eyebrow):not(.resume-meta) { color: var(--muted); margin: 0; font-size: .92rem; }
.resume-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 0; }
.resume-meta span {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .6rem; line-height: 1.2; color: var(--dim);
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 100px;
}
.resume-meta i { font-size: .55rem; color: var(--lime); }
.resume-actions { display: flex; gap: 10px; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 76px; }
.contact-lede { color: var(--muted); max-width: 400px; }
.contact-lines { display: grid; gap: 10px; margin: 32px 0 26px; }
.contact-lines a, .contact-lines > div {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; border: 1px solid var(--line); border-radius: 9px;
  font-size: .92rem; transition: border-color .2s, background .2s;
}
.contact-lines a:hover { border-color: var(--lime); background: rgba(198,242,78,.03); }
.contact-lines i:first-child { color: var(--lime); width: 18px; }
.contact-lines span { font-family: var(--mono); font-size: .82rem; }
.contact-lines a i:last-child { margin-left: auto; color: var(--dim); font-size: .72rem; }
.socials { display: flex; gap: 10px; }
.social {
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s;
}
.social:hover { border-color: var(--lime); color: var(--lime); transform: translateY(-2px); }
.mail-form { border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); padding: 28px; }
.form-head { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .72rem; color: var(--lime); border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field input, .field textarea {
  width: 100%; background: var(--ink-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; outline: none; resize: vertical;
  transition: border-color .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #6b736a; }
.field input:focus, .field textarea:focus { border-color: var(--lime); }
.form-submit { width: 100%; }
.form-note { font-family: var(--mono); font-size: .6rem; color: var(--dim); margin: 14px 0 0; text-align: center; }
.form-note i { color: var(--lime); margin-right: 5px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; font-family: var(--mono); font-size: .68rem; color: var(--dim); }
.footer-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.footer-mark { color: var(--text); display: flex; align-items: center; gap: 8px; }
.footer-mark i { color: var(--lime); }
.footer-inner p { margin: 0; }
.to-top {
  flex: 0 0 auto;
  margin-left: auto; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: .2s;
}
.to-top:hover { color: var(--lime); border-color: var(--lime); transform: translateY(-2px); }

/* ---------- modal + toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,7,5,.94);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
}
.modal-bar i { color: var(--rose); margin-right: 8px; }
.modal-bar > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.modal-bar > span i { color: var(--rose); margin-right: 8px; }
.modal-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.modal-actions a, .modal-actions button {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 7px;
  background: none; border: 0; color: var(--muted);
  font-size: 1rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.modal-actions a:hover, .modal-actions button:hover { background: var(--panel-2); color: var(--text); }
.modal-actions a:focus-visible, .modal-actions button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.modal iframe { flex: 1; width: 100%; border: 0; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--lime); color: #10140d; border-radius: 8px;
  padding: 11px 18px; font-size: .85rem; font-weight: 600;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease var(--d, 0ms), transform .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
/* Navigation: hamburger until the fixed side rail appears */
@media (max-width: 1419px) {
  .live-status { display: none; }
  .menu-btn { display: inline-grid; flex: 0 0 auto; }
  .site-nav {
    display: flex; flex-direction: column;
    position: fixed; top: 46px; left: 0; right: 0;
    background: rgba(18, 21, 18, .98);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 10px 20px 18px; gap: 0;
    transform: translateY(-16px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
    max-height: calc(100vh - 46px);
    max-height: calc(100svh - 46px);
    overflow-y: auto;
    z-index: 99;
  }
  .site-nav.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .site-nav a {
    font-family: var(--mono); font-size: .8rem; color: var(--muted);
    padding: 11px 0; border-bottom: 1px solid var(--line);
    display: flex; align-items: center;
  }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a span { color: var(--lime); margin-right: 12px; min-width: 2ch; }
  .site-nav a:hover, .site-nav a.is-current { color: var(--text); }
}

/* Desktop -> tablet: tighten spacing */
@media (max-width: 1180px) {
  .hero-inner { grid-template-columns: 1fr .95fr; gap: 40px; }
  .about-grid { gap: 56px; }
  .work-layout { grid-template-columns: 1fr 360px; gap: 36px; }
  .stack-grid, .log-grid, .contact-grid { gap: 48px; }
}

@media (max-width: 1024px) {
  .hero { padding: 120px 0 84px; min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { max-width: 100%; }
  .hero-lede { max-width: 640px; }
  .hero-stage { width: min(100%, 560px); height: 430px; margin: 8px auto 0; }
  .card-json, .card-chip { display: none; }
  .scroll-cue { display: none; }

  .about-grid, .work-layout, .stack-grid, .log-grid, .contact-grid { grid-template-columns: 1fr; gap: 44px; }
  .about-note { max-width: 520px; margin-inline: auto; transform: rotate(-1deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
  .about-copy > p:not(.eyebrow) { max-width: 100%; }

  .project-preview { position: relative; top: 0; width: min(100%, 560px); margin-inline: auto; }
  .tiles-wrap { max-width: 100%; }
  .tile-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 560px; }
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
}

/* Tablet portrait + large phones */
@media (max-width: 860px) {
  .section { padding: 88px 0; }
  .section-head { margin-bottom: 40px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .path { font-size: .7rem; }
  .topbar-right { gap: 14px; }

  .hero { padding: 104px 0 72px; }
  .hero-title { font-size: clamp(3rem, 11vw, 5rem); }
  .hero-stage { height: 400px; }
  .resume-card { grid-template-columns: auto 1fr; padding: 30px; }
  .resume-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}

/* Phones */
@media (max-width: 680px) {
  .container { width: min(1180px, calc(100% - 32px)); }
  .section { padding: 72px 0; }
  .section-title { margin-bottom: 22px; }
  .eyebrow { margin-bottom: 14px; font-size: .7rem; }
  .path .branch, .clock { display: none; }

  .hero { padding: 96px 0 64px; }
  .hero-title { font-size: clamp(2.8rem, 14vw, 4.2rem); margin-bottom: 20px; }
  .hero-role { font-size: .82rem; line-height: 1.6; margin-bottom: 18px; }
  .hero-lede { font-size: .95rem; margin-bottom: 28px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 180px; }
  .hero-facts { gap: 10px 16px; margin-top: 28px; }
  .hero-stage { height: 360px; width: 100%; }
  .slab-shadow { width: min(280px, 80%); bottom: 60px; }
  .slab-top, .slab-foot { padding: 10px 12px; font-size: .62rem; gap: 8px; }
  .slab-code { padding: 14px 14px 16px; }
  .slab-code pre { font-size: .62rem; line-height: 1.75; }
  .drag-hint { font-size: .6rem; bottom: 8px; text-align: center; width: 100%; padding: 0 10px; }

  .about-note { padding: 34px 22px 24px; max-width: 100%; }
  .note-head { font-size: 1.75rem; }
  .note-scribble { font-size: 1.3rem; }

  .file-row { gap: 12px; padding: 16px 10px; }
  .file-row:hover { padding-left: 14px; }
  .file-no { display: none; }
  .file-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: .9rem; }
  .file-main strong { font-size: .98rem; }
  .file-main small { font-size: .62rem; word-break: break-word; }
  .file-arrow { display: none; }

  .project-preview { width: 100%; }
  .preview-visual { height: 150px; margin: 14px 14px 0; }
  .preview-body { padding: 18px 16px 20px; }

  .terminal-out { padding: 18px 16px; font-size: .68rem; line-height: 1.9; }
  .terminal-bar { padding: 11px 14px; font-size: .64rem; }
  .tile-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; }
  .tech-tile { aspect-ratio: auto; min-height: 108px; padding: 16px 10px; }

  .commit-line { padding-left: 28px; }
  .commit-node { left: -38px; width: 20px; height: 20px; font-size: .55rem; }
  .commit { padding-bottom: 28px; }
  .commit h3 { font-size: 1.04rem; }
  .commit p { font-size: .88rem; }

  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; gap: 12px; }
  .badge { padding: 18px 14px; }
  .awards-foot { font-size: 1.2rem; }

  .resume-card { grid-template-columns: 1fr; gap: 20px; padding: 26px 22px; }
  .resume-paper { width: 128px; height: 168px; padding: 11px 11px 9px; }
  .paper-head { padding-bottom: 7px; }
  .paper-body { padding-top: 10px; gap: 4px; }
  .paper-body strong { font-size: .86rem; }
  .paper-foot { padding-top: 7px; }
  .paper-stamp { right: 8px; bottom: 40px; font-size: .34rem; letter-spacing: .13em; padding: 3px 5px 2px; }
  .resume-actions { flex-direction: column; width: 100%; }
  .resume-actions .btn { width: 100%; }

  .contact-lines a, .contact-lines > div { padding: 13px 14px; gap: 12px; }
  .contact-lines span { font-size: .76rem; overflow-wrap: anywhere; }
  .mail-form { padding: 22px 18px; }

  .footer-inner { gap: 16px; }
  .modal-bar { padding: 12px 16px; font-size: .7rem; }
}

/* Small phones */
@media (max-width: 420px) {
  .container { width: calc(100% - 24px); }
  .topbar-inner { padding: 0 12px; }
  .path { font-size: .64rem; gap: 6px; overflow: hidden; text-overflow: ellipsis; }
  .hero-title { font-size: clamp(2.45rem, 15vw, 3.4rem); }
  .hero-role { font-size: .76rem; }
  .btn { padding: 12px 16px; font-size: .88rem; }
  .hero-actions .btn { flex-basis: 100%; }
  .hero-stage { height: 320px; }
  .slab-code pre { font-size: .56rem; line-height: 1.7; }
  .slab-top > i:last-child { display: none; }
  .ticker-inner { font-size: .66rem; }
  .ticker-group { gap: 16px; padding-right: 16px; }
  .badge-grid { grid-template-columns: 1fr; }
  .tech-tile { min-height: 96px; }
  .contact-lines span { font-size: .72rem; }
  .form-head { font-size: .66rem; }
}

/* Short landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 88px 0 56px; }
  .hero-stage { height: 320px; }
  .scroll-cue { display: none; }
  .site-nav { max-height: calc(100vh - 46px); max-height: calc(100svh - 46px); }
}

/* Touch devices: no hover-only motion cues */
@media (hover: none), (pointer: coarse) {
  .drag-hint { display: none; }
  .card-json, .card-chip { display: none; }
  .file-row:hover { padding-left: 14px; background: transparent; }
  .file-row.is-active { padding-left: 14px; }
  .code-slab, .about-note, .project-preview, .tech-tile, .badge { transform: none !important; }
  .code-slab { cursor: default; }
  .resume-card:hover .resume-paper { transform: rotate(-2deg); }
}

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