/* ============================================================
   RAUSHAN KHEMANI — PORTFOLIO
   Design system: "Night Flight"
   Midnight instrument panels · gauge amber · chart paper.
   Aviation lives in the details (placards, ticks, readouts),
   never in the theme.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg0: #0a0e15;            /* page — midnight panel */
  --bg1: #0e141d;            /* raised panel */
  --bg2: #131b26;            /* card / input */
  --line: rgba(226, 232, 240, 0.08);
  --line2: rgba(226, 232, 240, 0.17);

  /* text */
  --hi: #e9edf2;
  --mid: #9aa5b4;
  --low: #66707f;

  /* accents */
  --amber: #e9b45b;          /* gauge amber */
  --amber2: #f5ce8a;         /* amber, lit */
  --amber-ink: #241a08;      /* text on amber */
  --sky: #9cc8e8;            /* attitude sky — sparse */
  --ok: #5fc98e;             /* status ok */

  /* chart-paper (light relief) */
  --paper: #edeff1;
  --paper2: #e3e7eb;
  --ink: #131b26;
  --ink-mid: #4a5462;
  --ink-low: #79828f;
  --amber-paper: #9a6a1b;    /* amber, printable on paper */

  /* type */
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* scale */
  --fs-hero: clamp(2.75rem, 7.6vw, 6rem);
  --fs-h2: clamp(2rem, 4.4vw, 3.3rem);
  --fs-h3: clamp(1.3rem, 2.3vw, 1.65rem);

  --r-card: 10px;
  --r-ctl: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.4, 0, 0.2, 1);
  --wrap: 1168px;

  /* fine grain — instrument-panel texture, not decoration. two variants:
     light specks for dark surfaces, dark specks for the paper surface. */
  --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

section[id], div[id] { scroll-margin-top: 92px; }

body {
  position: relative;
  background: var(--bg0) var(--grain-light);
  color: var(--hi);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* atmosphere — night-flight glow: cool sky above, amber horizon below.
   Fixed layer (cheaper than background-attachment on mobile), behind all content. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(56% 42% at 82% -8%, rgba(156, 200, 232, 0.06), transparent 100%),
    radial-gradient(70% 52% at -12% 18%, rgba(96, 130, 170, 0.075), transparent 100%),
    radial-gradient(78% 58% at 50% 112%, rgba(233, 180, 91, 0.075), transparent 100%),
    radial-gradient(120% 100% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.28) 100%);
}

/* tapestry of real project work behind the whole page.
   Real <img> elements (not CSS backgrounds) so each one can fade in
   independently as it scrolls into view, reusing the [data-reveal] system. */
.bg-tapestry {
  position: absolute; top: 0; left: 0; right: 0; z-index: -1;
  pointer-events: none;
}
.bg-shot {
  position: absolute;
  border-radius: 10px;
  filter: grayscale(0.6) brightness(1.05) contrast(0.9);
  box-shadow: 0 30px 70px -32px rgba(0, 0, 0, 0.7);
}
html.js .bg-shot[data-reveal] {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1.3s var(--ease), transform 1.3s var(--ease);
  transition-delay: var(--d, 0s);
}
html.js .bg-shot[data-reveal].in { opacity: var(--bo, 0.07); transform: none; }

@media (max-width: 640px) {
  .bg-shot { filter: grayscale(0.7) brightness(1) contrast(0.85); width: 44vw !important; left: auto !important; right: -4vw !important; }
  .bg-shot.bg-sm-hide { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-shot[data-reveal] { opacity: var(--bo, 0.07) !important; transform: none !important; transition: none !important; }
}

img { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--amber); color: var(--amber-ink);
  font: 500 14px var(--sans); padding: 10px 18px; border-radius: 0 0 6px 6px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(20px, 4.4vw, 48px); }

.sec { padding-block: clamp(76px, 11vw, 148px); position: relative; }
.sec-tight { padding-block: clamp(56px, 8vw, 104px); }

/* placard — the cockpit micro-label that opens every section */
.placard {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--low);
}
.placard::before {
  content: ''; width: 14px; height: 1px; background: var(--amber);
  box-shadow: 4px 0 0 -0.5px var(--bg0), 18px 0 0 -0.5px var(--amber);
}
.placard .idx { color: var(--amber); }

.sec-head { margin-bottom: clamp(40px, 6vw, 68px); }
.sec-head h2 {
  font: 400 var(--fs-h2) var(--serif);
  line-height: 1.06; letter-spacing: 0.002em;
  margin-top: 18px; max-width: 18ch;
  text-wrap: balance;
}
.sec-head h2 em, .hero h1 em {
  font-style: italic; color: var(--amber);
}
.sec-head .sub { color: var(--mid); max-width: 54ch; margin-top: 16px; font-size: 17px; }

/* tick rule — altimeter graduation divider */
.tick-rule {
  margin-top: 26px; height: 9px;
  border-top: 1px solid var(--line);
  background: repeating-linear-gradient(to right, var(--line2) 0 1px, transparent 1px 64px);
  background-size: 100% 8px; background-repeat: no-repeat;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 105;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s;
}
.nav.scrolled {
  background: rgba(10, 14, 21, 0.78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-color: var(--line);
}
/* dissolve strip — content scrolling up fades through the same glass
   the nav is already made of (inherits its bg/blur) instead of hitting
   a hard clip at the bar's edge. Height and opacity animate with the
   nav itself since both come from .scrolled's transition. */
.nav::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%;
  height: 0; pointer-events: none;
  background: inherit; -webkit-backdrop-filter: inherit; backdrop-filter: inherit;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
  mask-image: linear-gradient(to bottom, black, transparent);
  transition: height 0.4s;
}
.nav.scrolled::after { height: 46px; }
.nav-inner {
  max-width: var(--wrap); margin-inline: auto;
  padding: 0 clamp(20px, 4.4vw, 48px);
  height: 66px; display: flex; align-items: center; gap: 28px;
}
.brand {
  font: 500 15px var(--mono); letter-spacing: 0.08em;
  text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px;
}
.brand .tail { color: var(--amber); }

.nav-links { display: flex; gap: 30px; margin-left: auto; position: relative; }
.nav-indicator {
  position: absolute; bottom: -2px; height: 2px; left: 0; width: 0;
  background: var(--amber); border-radius: 2px; opacity: 0;
  transition: left 0.35s var(--ease), width 0.35s var(--ease), opacity 0.25s var(--ease);
  pointer-events: none;
}
.nav-links a {
  font: 500 14.5px var(--sans); letter-spacing: 0.01em;
  color: var(--mid); text-decoration: none;
  padding: 6px 0; position: relative;
  transition: color 0.22s;
}
.nav-links a:hover { color: var(--hi); }
.nav-links a.active { color: var(--hi); }
.nav-cta { margin-left: 6px; }

.burger {
  display: none; margin-left: auto;
  width: 44px; height: 44px; position: relative; z-index: 120;
}
.burger span {
  position: absolute; left: 10px; right: 10px; height: 1.6px;
  background: var(--hi); transition: transform 0.32s var(--ease), top 0.32s var(--ease);
}
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 26px; }
.burger.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* mobile menu */
.m-menu {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg0);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(24px, 8vw, 64px);
  opacity: 0; visibility: hidden; transition: opacity 0.34s var(--ease), visibility 0.34s;
}
.m-menu.open { opacity: 1; visibility: visible; }
.m-menu a.m-link {
  font: 400 clamp(2.2rem, 9vw, 3.2rem) var(--serif);
  color: var(--hi); text-decoration: none;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.2s;
}
.m-menu.open a.m-link { opacity: 1; transform: none; }
.m-menu.open a.m-link:nth-child(2) { transition-delay: 0.05s; }
.m-menu.open a.m-link:nth-child(3) { transition-delay: 0.1s; }
.m-menu.open a.m-link:nth-child(4) { transition-delay: 0.15s; }
.m-menu a.m-link:hover, .m-menu a.m-link.active { color: var(--amber); }
.m-menu a.m-link .no { font: 500 12px var(--mono); color: var(--low); letter-spacing: 0.12em; }
.m-menu .m-foot {
  margin-top: 40px; font: 400 12px var(--mono);
  color: var(--low); letter-spacing: 0.1em; text-transform: uppercase;
  display: flex; flex-direction: column; gap: 6px;
}
.m-menu .m-foot a { color: var(--mid); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 15px var(--sans); letter-spacing: 0.01em;
  padding: 14px 26px; border-radius: var(--r-ctl);
  text-decoration: none; cursor: pointer;
  transition: transform 0.24s var(--ease), background 0.24s, border-color 0.24s, color 0.24s, box-shadow 0.24s;
}
.btn .arr { transition: transform 0.24s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-solid { background: var(--amber); color: var(--amber-ink); border: 1px solid var(--amber); }
.btn-solid:hover { background: var(--amber2); border-color: var(--amber2); transform: translateY(-2px); }
.btn-solid:active { background: var(--amber); transform: translateY(0) scale(0.97); transition-duration: 0.12s; transition-timing-function: var(--ease-snap); }

.btn-line { background: transparent; color: var(--hi); border: 1px solid var(--line2); }
.btn-line:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }
.btn-line:active { transform: translateY(0) scale(0.97); background: rgba(233, 180, 91, 0.07); transition-duration: 0.12s; transition-timing-function: var(--ease-snap); }

.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* animated pill CTA — arrow slides across + rotates on hover (vanilla port) */
.btn-pill {
  position: relative; display: inline-flex; align-items: center;
  height: 52px; padding: 0 62px 0 26px;
  border-radius: 50px; background: var(--amber); color: var(--amber-ink);
  font: 500 15px var(--sans); letter-spacing: 0.01em;
  text-decoration: none; overflow: hidden; white-space: nowrap;
  transition: padding 0.5s var(--ease), background 0.3s;
}
.btn-pill .btn-pill-tx { position: relative; z-index: 1; }
.btn-pill .btn-pill-ic {
  position: absolute; right: 6px; top: 6px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--amber-ink); color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  transition: right 0.5s var(--ease), transform 0.5s var(--ease);
}
.btn-pill:hover { padding: 0 26px 0 62px; background: var(--amber2); }
.btn-pill:hover .btn-pill-ic { right: calc(100% - 46px); transform: rotate(45deg); }
.btn-pill:active { transform: scale(0.97); transition: transform 0.12s var(--ease-snap); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: 120px; padding-bottom: 72px;
  position: relative; overflow: hidden;
}
.hero-horizon {
  position: absolute; left: 0; right: 0; bottom: 23%;
  border-top: 1px dashed rgba(226, 232, 240, 0.1);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
/* single parallax element — amber horizon wash, drifts ~22% of scroll (JS) */
.hero-wash {
  position: absolute; left: -8%; right: -8%; bottom: -26%; height: 62%;
  background: radial-gradient(58% 56% at 50% 100%, rgba(233, 180, 91, 0.11), transparent 72%);
  pointer-events: none;
  will-change: transform;
}

/* hero wordmark — JS splits into words (.w) and letters (.ch);
   one global --i counter drives a continuous stagger across the phrase */
.hero h1 .w { display: inline-block; }
html.js .hero h1.split .ch {
  display: inline-block;
  opacity: 0; transform: translateY(0.32em); filter: blur(7px);
  transition: opacity 0.55s var(--ease), transform 0.65s var(--ease), filter 0.55s var(--ease);
  transition-delay: calc(var(--i) * 26ms + 100ms);
}
html.js .hero h1.split.play .ch { opacity: 1; transform: none; filter: none; }

.hero-status {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px var(--mono); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--mid);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 14px; margin-bottom: 34px;
  background: var(--bg1);
}
.hero-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px rgba(95, 201, 142, 0.8);
}
.hero h1 {
  font: 400 var(--fs-hero) var(--serif);
  line-height: 1.02; letter-spacing: 0.002em;
  max-width: 13ch; text-wrap: balance;
}
.hero .lede {
  margin-top: 28px; max-width: 56ch;
  color: var(--mid); font-size: clamp(16.5px, 1.9vw, 18.5px);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 38px; }

/* split hero: copy left, dashboard in a browser frame right */
.hero-grid {
  display: grid; grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(32px, 5vw, 68px); align-items: center; width: 100%;
}
.hero-visual { position: relative; }
.hero-visual::before {
  content: ''; position: absolute; inset: -10% -6% -14% -6%; z-index: -1;
  background: radial-gradient(58% 50% at 62% 42%, rgba(233, 180, 91, 0.12), transparent 70%);
  filter: blur(8px);
}
.hero-shot {
  position: relative; margin: 0;
  border: 1px solid var(--line2); border-radius: 14px; overflow: hidden;
  background: var(--bg2); line-height: 0;
  box-shadow: 0 46px 90px -34px rgba(0, 0, 0, 0.82);
}
.hero-shot img {
  width: 100%; height: clamp(470px, 72vh, 680px);
  object-fit: cover; object-position: center 42%; display: block;
}
.hero-shot-tag {
  position: absolute; left: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 9px;
  font: 500 11px var(--mono); letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--hi); line-height: 1;
  background: rgba(10, 14, 21, 0.72); border: 1px solid var(--line2);
  border-radius: 5px; padding: 8px 12px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-shot-tag .d {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px rgba(95, 201, 142, 0.8);
}

/* readout strip — real numbers, mono, hairline-separated */
.readout {
  margin-top: clamp(48px, 7vw, 76px);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap;
}
.readout .r-item {
  padding: 20px 34px 0 0; margin-right: 34px;
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line);
}
.readout .r-item:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.readout .r-val { font: 500 clamp(20px, 2.6vw, 27px) var(--mono); color: var(--hi); letter-spacing: 0.02em; }
.readout .r-val .u { color: var(--amber); }
.readout .r-key {
  font: 500 11px var(--mono); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--low);
}

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding-top: clamp(140px, 20vh, 190px); padding-bottom: clamp(28px, 4vw, 44px); }
.page-hero h1 {
  font: 400 clamp(2.6rem, 6.4vw, 4.6rem) var(--serif);
  line-height: 1.04; margin-top: 18px; text-wrap: balance;
}
.page-hero h1 em { font-style: italic; color: var(--amber); }
.page-hero .sub { color: var(--mid); max-width: 58ch; margin-top: 18px; font-size: 17px; }

/* ---------- Cards / work ---------- */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; perspective: 1600px; }
.work-card {
  grid-column: span 1;
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-card);
  overflow: hidden; text-decoration: none; position: relative;
  transition: transform 0.34s var(--ease), border-color 0.34s;
  display: flex; flex-direction: column;
}
.work-card.wide { grid-column: span 2; }
.work-card:hover { transform: translateY(-5px); border-color: var(--line2); }
.work-card:active { transform: translateY(-2px) scale(0.99); transition-duration: 0.12s; transition-timing-function: var(--ease-snap); }

/* cursor-aware spotlight — a soft glow that follows the pointer, set via
   --mx/--my in app.js. A real child element (not a pseudo) so it never
   collides with existing ::before/::after use (e.g. work-card HUD brackets).
   On project cards, app.js also tracks --rx/--ry so the box tilts gently
   toward the cursor, like tipping a record sleeve to catch the light. */
.spot-glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity 0.4s var(--ease);
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(233, 180, 91, 0.1), transparent 72%);
}
.spot:hover .spot-glow { opacity: 1; }
/* [data-reveal] qualifier bumps specificity past html.js [data-reveal].in's
   transform:none (styles.css ~line 829), which would otherwise cancel this. */
.work-card[data-reveal].spot:hover { transform: translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }

/* HUD corner brackets */
.work-card::before, .work-card::after {
  content: ''; position: absolute; width: 15px; height: 15px; z-index: 3;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.work-card::before { top: 9px; left: 9px; border-top: 1.5px solid var(--amber); border-left: 1.5px solid var(--amber); }
.work-card::after { bottom: 9px; right: 9px; border-bottom: 1.5px solid var(--amber); border-right: 1.5px solid var(--amber); }
.work-card:hover::before, .work-card:hover::after { opacity: 1; }

.work-media { aspect-ratio: 16 / 9.4; overflow: hidden; border-bottom: 1px solid var(--line); }
.work-card.wide .work-media { aspect-ratio: 21 / 8.2; }
.work-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  filter: saturate(0.94);
  transition: transform 0.55s var(--ease);
}
.work-card:hover .work-media img { transform: scale(1.035); }

.work-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.work-tag {
  font: 500 11.5px var(--mono); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--amber);
}
.work-body h3 { font: 400 var(--fs-h3) var(--serif); line-height: 1.15; }
.work-body p { color: var(--mid); font-size: 15.5px; }
.work-meta {
  margin-top: auto; padding-top: 16px;
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font: 400 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--low);
}
.work-meta .go { margin-left: auto; color: var(--hi); transition: color 0.2s; }
.work-card:hover .work-meta .go { color: var(--amber); }

/* ---------- Case rows (work page) ---------- */
.case { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; padding-block: clamp(44px, 6vw, 72px); border-top: 1px solid var(--line); perspective: 1600px; }
.case:first-of-type { border-top: 0; padding-top: 0; }
.case.flip .case-media { order: 2; }

.case-media {
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  display: block; text-decoration: none; position: relative;
  transition: transform 0.34s var(--ease);
}
.case-media img {
  width: 100%; aspect-ratio: 16 / 10.4; object-fit: cover; object-position: top;
  filter: saturate(0.94);
  transition: transform 0.55s var(--ease);
}
.case-media:hover img { transform: scale(1.03); }
.case-media[data-reveal].spot:hover { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.case-media .open-tag {
  position: absolute; left: 12px; bottom: 12px;
  font: 500 11.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(10, 14, 21, 0.82); color: var(--hi);
  border: 1px solid var(--line2); border-radius: 4px;
  padding: 8px 12px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.case-media:hover .open-tag { color: var(--amber); border-color: var(--amber); }
.case-media:active img { transform: scale(1.005); transition: transform 0.12s var(--ease-snap); }

.case-body h3 { font: 400 clamp(1.7rem, 3vw, 2.3rem) var(--serif); line-height: 1.1; margin: 10px 0 14px; }
.case-body > p { color: var(--mid); }
.case-points { margin: 18px 0 6px; display: grid; gap: 9px; }
.case-points li {
  position: relative; padding-left: 22px; color: var(--mid); font-size: 15.5px;
}
.case-points li::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 12px; height: 1.5px; background: var(--amber);
}

/* mono metadata table */
.spec {
  margin: 20px 0 22px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em;
}
.spec .row {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}
.spec .k { color: var(--low); }
.spec .v { color: var(--hi); text-align: right; }
.spec .v.ok { color: var(--ok); }
.spec .v.amber { color: var(--amber); }

/* before/after comparison strip */
.compare { display: flex; gap: 10px; margin: 20px 0 6px; }
.compare figure { flex: 1; min-width: 0; margin: 0; }
.compare img {
  width: 100%; aspect-ratio: 16 / 9.6; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--r-card);
  filter: saturate(0.94);
}
.compare figcaption {
  margin-top: 7px; font: 500 10.5px var(--mono); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--low); text-align: center;
}

.case-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.pitch {
  margin-top: 18px; padding: 14px 16px;
  border: 1px dashed var(--line2); border-radius: var(--r-ctl);
  font-size: 14px; color: var(--mid);
}
.pitch a { color: var(--amber); text-decoration: none; }
.pitch a:hover { text-decoration: underline; }

/* ---------- Services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.svc {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 28px 26px; position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.svc:hover { transform: translateY(-4px); border-color: var(--line2); }
.svc:active { transform: translateY(-1px) scale(0.99); transition-duration: 0.12s; transition-timing-function: var(--ease-snap); }
.svc .svc-no {
  font: 500 12px var(--mono); letter-spacing: 0.14em; color: var(--amber);
}
.svc h3 { font: 400 1.5rem var(--serif); margin: 12px 0 10px; }
.svc p { color: var(--mid); font-size: 15.5px; }
.svc .svc-spec {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  font: 400 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--low);
}

/* ---------- Chart paper (light relief) ---------- */
.paper {
  background-color: var(--paper); color: var(--ink);
  background-image:
    repeating-linear-gradient(to right, rgba(19, 27, 38, 0.045) 0 1px, transparent 1px 96px),
    var(--grain-dark);
}
.paper .placard { color: var(--ink-low); }
.paper .placard::before { box-shadow: 4px 0 0 -0.5px var(--paper), 18px 0 0 -0.5px var(--amber-paper); background: var(--amber-paper); }
.paper .placard .idx { color: var(--amber-paper); }
.paper .sec-head h2 { color: var(--ink); }
.paper .sec-head h2 em { color: var(--amber-paper); }
.paper .sec-head .sub { color: var(--ink-mid); }
.paper .tick-rule {
  border-top-color: rgba(19, 27, 38, 0.18);
  background-image: repeating-linear-gradient(to right, rgba(19, 27, 38, 0.22) 0 1px, transparent 1px 64px);
}

/* checklist — the process, literally as a pre-flight checklist */
.checklist { display: grid; gap: 0; max-width: 860px; }
.check {
  display: grid; grid-template-columns: 74px 1fr auto; gap: 20px; align-items: baseline;
  padding: 22px 4px; border-bottom: 1px solid rgba(19, 27, 38, 0.14);
}
.check:first-child { border-top: 1px solid rgba(19, 27, 38, 0.14); }
.check .c-no { font: 500 14px var(--mono); letter-spacing: 0.1em; color: var(--amber-paper); }
.check .c-body h3 { font: 400 1.35rem var(--serif); color: var(--ink); }
.check .c-body p { color: var(--ink-mid); font-size: 15.5px; margin-top: 4px; max-width: 56ch; }
.check .c-body a { color: var(--amber-paper); }
.check .c-state {
  font: 500 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-low); white-space: nowrap;
  border: 1px solid rgba(19, 27, 38, 0.2); border-radius: 4px; padding: 5px 10px;
}

/* ---------- Testimonials (hidden until first real review) ---------- */
.t-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.t-card {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 26px;
}
.t-stars { color: var(--amber); letter-spacing: 3px; font-size: 15px; }
.t-quote { margin: 14px 0 20px; color: var(--mid); font-size: 15.5px; }
.t-who { display: flex; align-items: center; gap: 12px; }
.t-ava {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  font: 500 15px var(--mono); color: var(--amber);
}
.t-name { font-weight: 600; font-size: 15px; }
.t-role { color: var(--low); font-size: 13.5px; }

/* ---------- CTA band ---------- */
.cta-band {
  border: 1px solid var(--line2); border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(233, 180, 91, 0.055), rgba(233, 180, 91, 0) 55%),
    var(--bg1);
  padding: clamp(44px, 7vw, 80px) clamp(24px, 6vw, 72px);
  text-align: center; position: relative; overflow: hidden;
}
.cta-band::before, .cta-band::after {
  content: ''; position: absolute; width: 18px; height: 18px;
}
.cta-band::before { top: 12px; left: 12px; border-top: 1.5px solid var(--amber); border-left: 1.5px solid var(--amber); }
.cta-band::after { bottom: 12px; right: 12px; border-bottom: 1.5px solid var(--amber); border-right: 1.5px solid var(--amber); }
.cta-band h2 {
  font: 400 clamp(1.9rem, 4.4vw, 3rem) var(--serif); line-height: 1.08;
  max-width: 22ch; margin-inline: auto; text-wrap: balance;
}
.cta-band h2 em { font-style: italic; color: var(--amber); }
.cta-band p { color: var(--mid); max-width: 52ch; margin: 16px auto 0; }
.cta-band .cta-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 32px; }
.cta-band .cta-note { margin-top: 22px; font: 400 12.5px var(--mono); letter-spacing: 0.06em; color: var(--low); }
.cta-band .cta-note a { color: var(--mid); text-decoration: none; white-space: nowrap; }
.cta-band .cta-note a:hover { color: var(--amber); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.channel {
  display: flex; gap: 16px; padding: 18px 0;
  border-bottom: 1px solid var(--line); align-items: baseline;
}
.channel:first-child { padding-top: 0; }
.channel .ch-key {
  font: 500 11px var(--mono); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--low); min-width: 108px;
}
.channel .ch-val { font-size: 15.5px; color: var(--hi); }
.channel .ch-val a { color: var(--hi); text-decoration: none; border-bottom: 1px solid var(--line2); transition: color 0.2s, border-color 0.2s; }
.channel .ch-val a:hover { color: var(--amber); border-color: var(--amber); }
.channel .ch-val .note { display: block; color: var(--mid); font-size: 14px; margin-top: 2px; }

/* ---------- Forms ---------- */
.form-panel {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: clamp(22px, 3.4vw, 34px);
}
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label {
  font: 500 11px var(--mono); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--low);
}
.field label .opt { color: var(--low); opacity: 0.7; text-transform: none; letter-spacing: 0.04em; }
.field input, .field textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 13px 15px; color: var(--hi);
  font: 400 15.5px var(--sans);
  transition: border-color 0.22s, box-shadow 0.22s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--low); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(233, 180, 91, 0.13);
}
.form-note { margin-top: 14px; font: 400 12.5px var(--mono); letter-spacing: 0.04em; color: var(--low); text-align: center; }

/* star rating */
.stars-track { position: relative; display: inline-block; font-size: 30px; letter-spacing: 5px; line-height: 1; }
.stars-empty { color: var(--bg2); -webkit-text-stroke: 1px var(--line2); }
.stars-fill {
  position: absolute; inset: 0; overflow: hidden; width: 0%;
  color: var(--amber); white-space: nowrap; pointer-events: none;
}
.stars-hit { position: absolute; inset: 0; display: flex; }
.stars-hit button { flex: 1; opacity: 0; }
.rating-label { display: block; margin-top: 6px; font: 400 12.5px var(--mono); letter-spacing: 0.06em; color: var(--mid); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details {
  background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-ctl);
  transition: border-color 0.25s;
}
.faq details[open] { border-color: var(--line2); }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 18px 52px 18px 20px; position: relative;
  font-weight: 600; font-size: 15.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 20px; top: 50%; translate: 0 -50%;
  font: 400 20px var(--mono); color: var(--amber);
  transition: transform 0.28s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
/* smooth open/close — override the browser's native instant snap.
   grid-template-rows 0fr→1fr animates height without measuring it in JS;
   the !important defeats the UA rule that hides closed-details children. */
.faq details > .faq-body {
  display: grid !important; grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.faq details[open] > .faq-body { grid-template-rows: 1fr; }
.faq details > .faq-body > p { min-height: 0; overflow: hidden; margin: 0; padding: 0 20px 20px; color: var(--mid); font-size: 15px; }
.faq details a { color: var(--amber); }

/* ---------- About ---------- */
.feature { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature.flip > .feature-media { order: 2; }
.feature-media {
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; position: relative;
}
.feature-media img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; filter: saturate(0.9); }
.feature-media .cap {
  position: absolute; left: 12px; bottom: 12px;
  font: 500 11px var(--mono); letter-spacing: 0.13em; text-transform: uppercase;
  background: rgba(10, 14, 21, 0.82); color: var(--mid);
  border: 1px solid var(--line); border-radius: 4px; padding: 7px 11px;
}
.feature-body h3 { font: 400 clamp(1.6rem, 3vw, 2.1rem) var(--serif); margin-bottom: 16px; line-height: 1.12; }
.feature-body p { color: var(--mid); margin-bottom: 14px; }
.feature-body p:last-of-type { margin-bottom: 0; }
.feature-body strong { color: var(--hi); font-weight: 600; }

.value-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.value {
  border: 1px solid rgba(19, 27, 38, 0.14); border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.5);
  padding: 24px;
}
.value .v-no { font: 500 12px var(--mono); letter-spacing: 0.12em; color: var(--amber-paper); }
.value h3 { font: 400 1.35rem var(--serif); color: var(--ink); margin: 10px 0 8px; }
.value p { color: var(--ink-mid); font-size: 15px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.tag {
  font: 500 12px var(--mono); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--mid); border: 1px solid var(--line2); border-radius: 4px;
  padding: 7px 12px;
  transition: color 0.2s, border-color 0.2s;
}
.tag:hover { color: var(--amber); border-color: var(--amber); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 76px) 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer .f-brand p { color: var(--mid); font-size: 15px; max-width: 30ch; margin-top: 12px; }
.f-key {
  font: 500 11px var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--low); margin-bottom: 14px;
}
.f-col a {
  display: block; color: var(--mid); text-decoration: none;
  font-size: 15px; padding: 4px 0; transition: color 0.2s;
}
.f-col a:hover { color: var(--amber); }
.footer-base {
  margin-top: clamp(36px, 5vw, 56px); padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font: 400 11.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--low);
}

/* mobile scroll progress */
.sky-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 110;
  background: var(--amber); transform: scaleX(0); transform-origin: 0 50%;
  display: none;
}

/* ---------- Reveal system (JS adds .js to <html>) ---------- */
html.js [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--d, 0s);
}
html.js [data-reveal].in { opacity: 1; transform: none; }

/* tick-rule draws in like a needle sweep, right after its heading lands.
   clip-path (not scaleX) so the tick pattern itself doesn't distort. */
html.js .sec-head .tick-rule {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.9s var(--ease) 0.25s;
}
html.js .sec-head.in .tick-rule { clip-path: inset(0 0 0 0); }

/* ---------- Custom cursor: default arrow shape, recolored black ----------
   True OS-cursor recoloring isn't possible via CSS, so this swaps in a
   custom image matching the standard arrow silhouette, filled black with
   a thin light edge (same reason the real Windows cursor has one — pure
   black would vanish against this site's dark navy sections).
   Set on interactive elements too (not just body) so their UA/site
   `cursor: pointer` never swaps the arrow for a hand. The fill is
   slightly translucent so text stays readable through the arrow itself. */
@media (pointer: fine) {
  body, a, button, .btn, summary, label {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M6 2 L6 27.5 L11.7 21.9 L15.8 30.9 L19.8 29 L15.9 20.3 L23.7 20.1 Z' fill='%23000000' fill-opacity='0.62' stroke='%23f2f2f2' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 6 2, auto;
  }
}

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-lg { margin-top: clamp(36px, 5vw, 56px); }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .sky-progress { display: block; }
}

@media (max-width: 940px) {
  .nav-links, .nav .nav-cta { display: none; }
  .burger { display: block; }

  .work-grid { grid-template-columns: 1fr; }
  .work-card.wide { grid-column: span 1; }
  .work-card.wide .work-media { aspect-ratio: 16 / 9.4; }

  .case, .case.flip { grid-template-columns: 1fr; }
  .case.flip .case-media { order: 0; }

  .svc-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip > .feature-media { order: 0; }
  .value-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .check { grid-template-columns: 52px 1fr; }
  .check .c-state { display: none; }

  .readout { flex-direction: column; }
  .readout .r-item {
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 14px 0; margin-right: 0;
    flex-direction: row; align-items: baseline; justify-content: space-between;
  }
  .readout .r-item:last-child { border-bottom: 0; }

  .hero { min-height: auto; padding-top: 128px; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .hero-visual { order: 2; }
  .hero-shot img { height: clamp(340px, 62vh, 480px); }
}

/* ---------- Mobile pass (<=640px) ----------
   Not a shrunk desktop layout: shorter sections, a phone-tuned type
   scale, and tighter component padding so the page reads as designed
   for the hand, not squeezed to fit it. Most visitors are on mobile. */
@media (max-width: 640px) {
  /* vertical rhythm — shorter sections, tighter heading margins */
  .sec { padding-block: clamp(48px, 13vw, 80px); }
  .sec-tight { padding-block: clamp(36px, 10vw, 60px); }
  .sec-head { margin-bottom: clamp(26px, 7vw, 40px); }
  .sec-head .tick-rule { margin-top: 20px; }
  .footer { padding: clamp(36px, 10vw, 52px) 0 26px; }
  .footer-grid { gap: 30px; }
  .footer-base { margin-top: 30px; padding-top: 18px; gap: 10px; }

  /* nav — a touch shorter, anchors follow */
  .nav-inner { height: 58px; }
  section[id], div[id] { scroll-margin-top: 74px; }

  /* hero — less empty air before the first line, a smaller preview shot */
  .hero { padding-top: 92px; padding-bottom: 44px; }
  .hero h1 { font-size: clamp(2.35rem, 9.6vw, 3rem); line-height: 1.06; }
  .hero-status { margin-bottom: 22px; }
  .hero .lede { margin-top: 20px; font-size: 16px; }
  .hero-actions { margin-top: 28px; gap: 12px; }
  .hero-actions .btn-pill { width: 100%; justify-content: center; }
  .hero-shot img { height: clamp(280px, 48vh, 380px); }
  .readout { margin-top: 32px; }
  .readout .r-item { padding: 12px 0; }
  .readout .r-val { font-size: clamp(20px, 5.4vw, 23px); }

  /* headings — a real mobile scale: fluid between phone sizes, not a
     desktop clamp pinned flat at its floor */
  .sec-head h2 { font-size: clamp(1.7rem, 7.4vw, 2.15rem); max-width: 100%; }
  .sec-head .sub { font-size: 15.5px; margin-top: 12px; }
  .page-hero { padding-top: clamp(104px, 26vw, 140px); }
  .page-hero h1 { font-size: clamp(2.1rem, 8.8vw, 2.7rem); }
  .page-hero .sub { font-size: 15.5px; margin-top: 14px; }
  .case-body h3, .feature-body h3 { font-size: clamp(1.4rem, 6.4vw, 1.75rem); }
  .cta-band h2 { font-size: clamp(1.55rem, 7vw, 2rem); }

  /* cards — tighter padding + gaps so the grid reads as one composition */
  .work-grid { gap: 14px; }
  .work-body { padding: 18px 18px 20px; gap: 8px; }
  .svc-grid { gap: 14px; }
  .svc { padding: 22px 20px; }
  .value-grid { gap: 12px; }
  .value { padding: 20px; }
  .case { padding-block: clamp(30px, 8vw, 48px); }
  .feature { gap: 26px; }
  .check { padding: 16px 4px; }
  .cta-band { padding: clamp(32px, 9vw, 52px) clamp(20px, 6vw, 32px); }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 2.15rem; }
  .page-hero h1 { font-size: 2rem; }
  .sec-head h2 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero-actions .btn, .case-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .sky-progress { display: none !important; }
}
