/* ==========================================================
   Ginesh Tandel — Portfolio · Dark neon theme
   ========================================================== */
:root {
  --bg: #050b10;
  --bg-2: #08131a;
  --panel: rgba(12, 28, 36, 0.62);
  --panel-solid: #0b1b23;
  --line: rgba(34, 211, 238, 0.16);
  --line-strong: rgba(34, 211, 238, 0.38);
  --text: #e6f4f7;
  --muted: #93aab3;
  --accent: #22d3ee;
  --accent-2: #0ea5c6;
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.4);
  --radius: 6px;
  --radius-lg: 10px;
  --max: 1200px;
  --pad: clamp(18px, 4vw, 40px);
  --font-head: "Outfit", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 96px; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 75% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(800px 500px at -10% 40%, rgba(14, 165, 198, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #031016; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, rgba(16, 38, 48, 0.7), rgba(8, 20, 27, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(34, 211, 238, 0.28), 0 0 40px rgba(34, 211, 238, 0.05), 0 20px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(34, 211, 238, 0.08); border: 1px solid var(--line);
  color: var(--accent); font: 600 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.chip svg { width: 13px; height: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 8px;
  font: 600 15px/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg, #3fe0f6, var(--accent)); color: #031016; box-shadow: var(--glow); border: 0; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--accent); }
.btn-ghost { background: rgba(34, 211, 238, 0.04); color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: var(--glow); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; min-height: 44px; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s; }
.link-arrow:hover svg { transform: translate(3px, -1px); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 14px 0; }
.site-header.scrolled .nav-wrap { background: rgba(5, 13, 18, 0.88); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 10px 8px 18px; border-radius: var(--radius-lg); transition: background .3s; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font: 700 19px var(--font-head); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(34, 211, 238, 0.12); border: 1px solid var(--line-strong); color: var(--accent); font: 700 14px var(--font-mono); }
.brand span b { color: var(--accent); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); background: rgba(34, 211, 238, 0.06); }
.nav-links a.active { color: var(--accent); background: rgba(34, 211, 238, 0.14); }
.nav-cta { min-height: 40px; padding: 0 16px; font-size: 14px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav-cta { display: none; }
  .nav-links { position: absolute; left: var(--pad); right: var(--pad); top: calc(100% - 6px); flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; background: rgba(6, 16, 22, 0.97); border: 1px solid var(--line); border-radius: var(--radius-lg); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 46px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; margin-top: 16px; min-height: 640px; padding: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr); gap: 40px; align-items: center; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(520px 320px at 85% 90%, rgba(34, 211, 238, 0.2), transparent 70%), radial-gradient(420px 260px at 30% 40%, rgba(14, 165, 198, 0.12), transparent 70%); pointer-events: none; }
.hero-photo { position: absolute; top: 0; bottom: 0; left: 31%; width: 31%; z-index: 0; pointer-events: none; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%, #000 70%, transparent 100%), linear-gradient(to bottom, #000 70%, transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent 0%, #000 30%, #000 70%, transparent 100%), linear-gradient(to bottom, #000 70%, transparent 100%); mask-composite: intersect; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; display: block; filter: brightness(.95) contrast(1.08) saturate(.95); }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: #0b4254; mix-blend-mode: multiply; opacity: .65; }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-width: 0; }
.hero-copy .chip { align-self: flex-start; }
.eyebrow { margin: 0; font: 500 13px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.02; font-weight: 600; letter-spacing: -0.03em; }
.hero h1 span { display: block; color: var(--accent); }
.hero .lede { color: var(--muted); max-width: 380px; font-size: 15.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-side { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stats { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; background: rgba(8, 20, 27, 0.72); }
.stat { display: flex; gap: 12px; align-items: flex-start; }
.stat-icon { flex: none; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: rgba(34, 211, 238, 0.08); border: 1px solid var(--line); }
.stat-icon svg { width: 18px; height: 18px; display: block; }
.stat b { display: block; font: 700 22px/1.1 var(--font-head); color: var(--accent); }
.stat b i { font-style: normal; color: var(--accent); }
.stat div span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 3px; }
.socials { display: flex; gap: 10px; }
.social { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; color: var(--text); background: var(--panel); border: 1px solid var(--line); transition: .2s; }
.social:hover { color: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.social svg { width: 19px; height: 19px; }
.laptop { position: relative; margin: 6px 0 0 8%; filter: drop-shadow(0 24px 36px rgba(34, 211, 238, 0.18)); }
.screen { border-radius: 10px 10px 3px 3px; border: 7px solid #1a2228; border-bottom-width: 10px; background: #04090d; padding: 12px 14px; font: 10.5px/1.7 var(--font-mono); color: #9fb7c0; overflow: hidden; height: 190px; position: relative; white-space: nowrap; }
.screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 70%, #04090d); pointer-events: none; }
.screen .bar { display: flex; gap: 6px; margin-bottom: 8px; }
.screen .bar i { width: 8px; height: 8px; border-radius: 50%; background: #2a3a42; }
.screen .k { color: #c084fc; } .screen .t { color: #22d3ee; } .screen .s { color: #86efac; } .screen .c { color: #55707a; } .screen .f { color: #fcd34d; }
.base { height: 12px; margin: 0 -5%; border-radius: 0 0 14px 14px; background: linear-gradient(180deg, #2b363d, #11181d); }
.base::before { content: ""; display: block; width: 18%; height: 4px; margin: 0 auto; border-radius: 0 0 5px 5px; background: #0b1013; }
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-photo { position: relative; left: auto; width: 100%; height: 340px; order: 2; margin: 0 auto; max-width: 420px; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); }
  .hero-side { order: 3; }
}
@media (max-width: 460px) { .stats { grid-template-columns: 1fr; } .laptop { margin-left: 0; } }

/* ---------- Sections ---------- */
section.block { margin-top: 28px; padding: clamp(28px, 4.5vw, 48px); }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.sec-head > div { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; line-height: 1.1; }
.sec-head p { color: var(--muted); max-width: 520px; }

/* Skills */
.core { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.core article { padding: 28px 28px 12px; }
.core article:first-child { padding-left: 0; }
.core article + article { border-left: 1px solid var(--line); }
.core .n { font: 600 13px var(--font-mono); color: var(--accent); }
.core h3 { margin-top: 10px; font-size: clamp(24px, 2.8vw, 34px); font-weight: 600; line-height: 1.1; }
.core .sub { margin-top: 6px; font: 500 12px var(--font-mono); color: var(--muted); }
.core ul { list-style: none; margin: 22px 0 0; padding: 0; }
.core li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; color: #c3d6dc; }
.more { margin: 36px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.more > div { padding: 18px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; }
.more dt { font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
.more dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .core { grid-template-columns: 1fr; } .core article, .core article:first-child { padding: 24px 0 8px; } .core article + article { border-left: 0; border-top: 1px solid var(--line); } .more { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .more > div { grid-template-columns: 1fr; gap: 6px; } }
.tag { border-color: var(--line-strong); color: var(--text); }
.tag { padding: 6px 10px; border-radius: 8px; background: rgba(34, 211, 238, 0.06); border: 1px solid var(--line); font: 500 12px var(--font-mono); color: #c3d6dc; }
.stack-row { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) { .sk { grid-template-columns: minmax(0, 1fr); } }

/* Projects */
.work { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.work-row { display: grid; grid-template-columns: 48px minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px 40px; align-items: start; padding: 48px 12px; border-bottom: 1px solid var(--line); transition: background .25s; }
.work-row:hover { background: rgba(34, 211, 238, 0.04); }
.idx { font: 600 13px var(--font-mono); color: var(--accent); padding-top: 14px; }
.work-row h3 { font-size: clamp(36px, 5.4vw, 68px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; transition: color .25s; }
.work-row:hover h3 { color: var(--accent); }
.kick { margin-top: 14px; font: 500 12px var(--font-mono); letter-spacing: .06em; color: var(--muted); }
.work-body { display: flex; flex-direction: column; gap: 20px; padding-top: 6px; }
.work-desc { color: #c3d6dc; font-size: 16px; }
.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 14px 40px; }
.facts dt { font: 600 clamp(28px, 3vw, 38px)/1 var(--font-head); letter-spacing: -0.02em; color: var(--accent); }
.facts dd { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.work-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.work-meta .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.work-meta .tag { font-size: 11px; padding: 4px 8px; }
.work-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.work-row.small { padding: 26px 12px; }
.work-row.small h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; }
.work-row.small .idx { padding-top: 6px; }
.work-row.small .kick { margin-top: 8px; }
.work-row.small .work-body { gap: 12px; padding-top: 0; }
@media (max-width: 900px) {
  .work-row { grid-template-columns: 40px minmax(0, 1fr); padding: 32px 4px; }
  .work-row .work-body { grid-column: 2; }
}
/* Contact */
.cta { margin-top: 28px; padding: clamp(28px, 4.5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px 64px; align-items: center; }
.cta-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.cta h2 { font-size: clamp(32px, 4.2vw, 56px); font-weight: 600; line-height: 1.05; }
.cta p { color: var(--muted); max-width: 440px; }
.cta-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cta-links a { display: grid; grid-template-columns: 90px minmax(0, 1fr) 20px; align-items: center; gap: 16px; min-height: 64px; padding: 0 12px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .25s; }
.cta-links a:hover { background: rgba(34, 211, 238, 0.05); }
.cta-links span { font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cta-links b { font: 500 clamp(15px, 1.5vw, 18px) var(--font-body); overflow-wrap: anywhere; }
.cta-links a:hover b { color: var(--accent); }
.cta-links svg { width: 18px; height: 18px; color: var(--accent); transition: transform .2s; }
.cta-links a:hover svg { transform: translate(3px, -3px); }
@media (max-width: 900px) { .cta { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) { .cta-links a { grid-template-columns: minmax(0, 1fr) 20px; padding: 10px 12px; } .cta-links span { grid-column: 1 / -1; } }

/* Footer */
.site-footer { margin: 28px 0 0; padding: 48px 0 28px; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px 48px; }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.foot-brand p { color: var(--muted); font-size: 14.5px; max-width: 340px; }
.foot-h { margin: 0 0 8px; font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text); text-decoration: none; font-size: 15px; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; }
.site-footer small { color: var(--muted); font-size: 13px; }
.to-top { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 14px; min-height: 44px; }
.to-top i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--accent); }
.to-top svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .foot-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .foot-brand { grid-column: 1 / -1; } }

/* ---------- The Climb ---------- */
.climb { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 22px; }
.climb::before, .climb::after { content: ""; position: absolute; left: 15px; top: 8px; width: 2px; border-radius: 2px; }
.climb::before { bottom: 8px; background: rgba(34, 211, 238, 0.12); }
.climb::after { height: calc((100% - 16px) * var(--p, 1)); background: var(--accent); }
.scene { position: relative; z-index: 1; padding-left: 52px; }
.scene::before { content: ""; box-sizing: border-box; position: absolute; left: 8px; top: 30px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: border-color .4s, background .4s, box-shadow .4s; }
.scene.on::before, .scene.now::before { border-color: var(--accent); box-shadow: var(--glow); }
.scene.now::before { background: var(--accent); }
.sc-card { padding: 22px 26px; border-radius: 8px; background: #08141b; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sc-card .when { font: 600 13px var(--font-mono); color: var(--accent); letter-spacing: .08em; }
.sc-card h3 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; line-height: 1.15; }
.sc-card > p { color: var(--muted); font-size: 15.5px; max-width: 760px; }
.sc-stats { display: flex; flex-wrap: wrap; gap: 14px 44px; margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sc-stats b { display: block; font: 700 clamp(28px, 3.4vw, 40px)/1 var(--font-head); color: var(--accent); }
.sc-stats span { color: var(--muted); font-size: 13.5px; }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; padding: 0 28px 20px; background: #08141b; border: 1px solid var(--line); border-radius: 8px; }
.rule { padding: 26px 24px 8px; display: flex; flex-direction: column; gap: 10px; }
.rule + .rule { border-left: 1px solid var(--line); }
.rule:first-child { padding-left: 0; }
.rn { font: 600 13px var(--font-mono); color: var(--accent); }
.rule-vis { height: 168px; display: grid; align-content: center; margin: 6px 0 10px; }
.rule h4 { margin: 0; font: 600 20px var(--font-head); }
.rule p { color: var(--muted); font-size: 14.5px; }
.status { display: grid; gap: 8px; font: 500 12px var(--font-mono); color: var(--muted); }
.status span { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(34, 211, 238, 0.04); }
.status span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; }
.scene.on .status span::before { animation: ok 2.4s ease-in-out infinite; }
.scene.on .status span:nth-child(2)::before { animation-delay: .4s; } .scene.on .status span:nth-child(3)::before { animation-delay: .8s; } .scene.on .status span:nth-child(4)::before { animation-delay: 1.2s; }
@keyframes ok { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } 40% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.3); } }
.swap, .walls { font: 500 11px var(--font-mono); }
.swap { display: grid; justify-items: center; gap: 0; }
.swap-logic { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--text); background: rgba(34, 211, 238, 0.08); }
.swap-link { width: 2px; height: 14px; background: var(--accent); }
.swap-models { position: relative; width: 100%; height: 32px; }
.swap-models span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); opacity: 0; }
.swap-models span:first-child { opacity: 1; }
.scene.on .swap-models span { animation: swap 9s infinite; }
.scene.on .swap-models span:nth-child(2) { animation-delay: 3s; }
.scene.on .swap-models span:nth-child(3) { animation-delay: 6s; }
@keyframes swap { 0%, 4% { opacity: 0; } 8%, 30% { opacity: 1; } 34%, 100% { opacity: 0; } }
.walls { display: flex; align-items: stretch; gap: 6px; height: 64px; }
.lane { flex: 1; display: grid; place-items: center; border-radius: 8px; background: rgba(34, 211, 238, 0.06); border: 1px solid var(--line); color: var(--muted); text-align: center; }
.wall { width: 4px; border-radius: 2px; background: var(--accent); transform-origin: bottom; }
.js .wall { transform: scaleY(0); }
.js .scene.on .wall { transform: scaleY(1); transition: transform .8s ease .3s; }
.js .scene.on .wall + .lane + .wall { transition-delay: .7s; }
.js .scene { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .scene.on { opacity: 1; transform: none; }
.js .scene.now .tag { opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.js .scene.now.on .tag { opacity: 1; transform: none; }
.js .scene.now.on .tag:nth-child(2) { transition-delay: .15s; } .js .scene.now.on .tag:nth-child(3) { transition-delay: .3s; } .js .scene.now.on .tag:nth-child(4) { transition-delay: .45s; } .js .scene.now.on .tag:nth-child(5) { transition-delay: .6s; }
@media (max-width: 900px) { .rules { grid-template-columns: 1fr; } .rule, .rule:first-child { padding: 22px 0 8px; } .rule + .rule { border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 640px) { .sc-card { padding: 18px; } }
@media (min-width: 900px) {
  .climb { gap: 56px; }
  .climb::before, .climb::after { left: 50%; margin-left: -1px; }
  .scene { padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 88px; align-items: start; }
  .scene::before { left: calc(50% - 8px); top: 10px; }
  .sc-card { display: contents; }
  .sc-card > * { grid-column: 2; }
  .sc-card .when { grid-column: 1; grid-row: 1 / span 4; text-align: right; font: 600 clamp(22px, 2.4vw, 32px)/1.15 var(--font-head); letter-spacing: -0.01em; color: var(--accent); padding-top: 2px; }
  .sc-card h3 { font-size: clamp(22px, 2.4vw, 30px); }
  .sc-card .rules { grid-column: 1 / -1; margin-top: 18px; }
  .scene.now .sc-card .when { color: var(--text); }
  /* left/right: odd scenes put the text left and the date right of the line */
  .scene:nth-child(odd) .sc-card > * { grid-column: 1; }
  .scene:nth-child(odd) .sc-card .when { grid-column: 2; text-align: left; }
  .scene:nth-child(odd) .sc-card .rules { grid-column: 1 / -1; }
  .js .scene:nth-child(odd) { transform: translateX(-28px); }
  .js .scene:nth-child(even) { transform: translateX(28px); }
  .js .scene.on { transform: none; }
  /* LogiqCube: stats fill the empty side under the date */
  .scene.wide .sc-card .when { grid-row: 1; }
  .scene.wide .sc-card h3 { grid-row: 1; }
  .scene.wide .sc-card > p { grid-row: 2; }
  .scene.wide .sc-stats { grid-column: 1; grid-row: 2; justify-content: flex-end; border-top: 0; padding-top: 0; margin-top: 0; text-align: right; flex-direction: column; gap: 14px; }
  .scene.wide .sc-card .when { padding-bottom: 18px; }
}

/* ---------- Case study pages ---------- */
.cs-hero { margin-top: 12px; padding: clamp(32px, 5vw, 64px); position: relative; overflow: hidden; }
.cs-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 90% 0%, rgba(34, 211, 238, 0.1), transparent 70%); pointer-events: none; }
.cs-hero > * { position: relative; }
.cs-hero > .hero-photo { position: absolute; left: auto; right: 0; top: 0; bottom: 0; width: 36%; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%), linear-gradient(to bottom, #000 40%, transparent 85%); mask-image: linear-gradient(to right, transparent 0%, #000 55%), linear-gradient(to bottom, #000 40%, transparent 85%); }
.cs-hero .lede { max-width: 560px; }
@media (max-width: 900px) { .cs-hero > .hero-photo { display: none; } }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font: 500 13px var(--font-mono); min-height: 44px; }
.back:hover { color: var(--accent); }
.back svg { width: 16px; height: 16px; }
.cs-hero h1 { margin-top: 18px; font-size: clamp(48px, 8vw, 96px); font-weight: 600; line-height: 1; color: var(--accent); }
.cs-hero .lede { margin-top: 22px; max-width: 560px; font: 500 clamp(18px, 2vw, 23px)/1.5 var(--font-head); color: #cfe2e7; }
.cs-meta { margin: 44px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs-meta > div { padding: 22px 20px 0 0; }
.cs-meta > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.cs-meta dt { font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.cs-meta dd { margin: 6px 0 0; font-size: 15px; }
.cs-meta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }
@media (max-width: 820px) { .cs-meta { grid-template-columns: 1fr 1fr; } .cs-meta > div { padding: 18px 12px 0 0; } .cs-meta > div + div { border-left: 0; padding-left: 0; } }
section.block .act { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px 64px; }
.act + .act { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--line); }
.act > div:first-child { position: sticky; top: 110px; align-self: start; }
.act .label { font: 600 13px var(--font-mono); letter-spacing: .14em; color: var(--accent); }
.act h2 { margin-top: 10px; font-size: clamp(26px, 3vw, 36px); font-weight: 600; line-height: 1.1; }
.act .prose { display: flex; flex-direction: column; gap: 16px; color: #c3d6dc; font-size: 17px; max-width: 720px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps .i { font: 600 13px var(--font-mono); color: var(--accent); padding-top: 4px; }
.steps h3 { font-size: 19px; font-weight: 600; }
.steps p { color: var(--muted); font-size: 15px; margin-top: 4px; max-width: 620px; }
.decisions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.decision { border-top: 2px solid var(--line-strong); padding-top: 16px; }
.decision h3 { font-size: 18px; font-weight: 600; }
.decision p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.outcome { display: flex; flex-wrap: wrap; gap: 20px 56px; }
.outcome div b { display: block; font: 600 clamp(44px, 6vw, 72px)/1 var(--font-head); letter-spacing: -0.03em; }
.outcome div span { color: var(--muted); font-size: 14px; }
@media (max-width: 900px) { section.block .act { grid-template-columns: 1fr; } .act > div:first-child { position: static; } .decisions { grid-template-columns: 1fr; } }
.next-story { margin-top: 28px; padding: clamp(24px, 4vw, 40px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.next-story a.next { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.next-story a.next span { font: 500 12px var(--font-mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.next-story a.next b { font: 600 clamp(26px, 3.4vw, 40px) var(--font-head); }
.next-story a.next:hover b { color: var(--accent); }
.next-story .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .scene, .js .scene.now .tag { opacity: 1; transform: none; transition: none; }
  .js .wall { transform: none; transition: none; }
  .js .scene:nth-child(n) { transform: none; }
  .scene.on .swap-models span, .scene.on .status span::before { animation: none; }
  .hero-copy > *, .stats { animation: none; }
}

/* ---------- Phone refinements ---------- */
@media (max-width: 640px) {
  .rules { padding: 0 16px 12px; }
  .rule-vis { height: auto; margin: 4px 0 8px; }
  .cta { padding: 24px 18px; }
}
@media (max-width: 460px) {
  .cta-links b { font-size: 14px; overflow-wrap: normal; word-break: normal; }
  .cta-links a { padding: 10px 4px; }
}

@media (max-width: 380px) {
  .climb::before, .climb::after { left: 9px; }
  .scene { padding-left: 34px; }
  .scene::before { left: 2px; }
  .sc-card { padding: 14px; min-width: 0; }
  .sc-card h3, .sc-card p { overflow-wrap: anywhere; }
  .sc-stats { gap: 12px 24px; }
  .sc-stats b { font-size: 26px; }
  .rules { padding: 0 12px 10px; }
}
@media (max-width: 380px) {
  .work-row { grid-template-columns: 26px minmax(0, 1fr); gap: 10px 10px; }
  .work-row h3 { font-size: 28px; overflow-wrap: anywhere; }
  .work-row.small h3 { font-size: 22px; }
}
