/* Pinchloft: brand tokens */
:root {
  --cobalt: #2B4CFF;
  --butter: #FFD23F;
  --cream: #FFF4E4;
  --ink: #101326;
  --paper: #FFFCF7;
  --cobalt-deep: #1C36D6;
  --cobalt-soft: rgba(43, 76, 255, 0.1);
  --muted: rgba(16, 19, 38, 0.68);
  --line: rgba(16, 19, 38, 0.14);
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bh: 36px;            /* demo banner height */
  --nh: 76px;            /* nav height */
  --gutter: clamp(16px, 4.4vw, 64px);
  --vh: 1vh;             /* replaced by JS with a stable px value of 1% of the viewport */
  --ease-out: cubic-bezier(0.2, 0.9, 0.25, 1);
  --ease-spring: cubic-bezier(0.25, 1.35, 0.4, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--cream); overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 8px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- demo banner (always visible) */
.demo-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--bh);
  background: var(--ink); color: var(--cream);
  font-size: 13.5px; line-height: 1.2;
  display: flex; align-items: center; justify-content: center;
}
.demo-in { display: flex; align-items: center; gap: 8px; padding: 0 var(--gutter); min-width: 0; }
.demo-in .ic { width: 16px; height: 16px; color: var(--butter); }
.demo-in span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-in .short { display: none; }
.demo-in span.long { flex: 0 1 auto; }
.demo-banner a { color: var(--butter); font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; left: 0; right: 0; top: var(--bh); z-index: 40;
  height: var(--nh);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 27px; letter-spacing: -0.03em; }
.mark { width: 32px; height: 32px; flex: none; }
.mark.big { width: 64px; height: 64px; }
.nav-links { margin-left: auto; display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255, 252, 247, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line); }
.nav-links a { text-decoration: none; font-weight: 500; font-size: 15px; padding: 7px 14px; border-radius: 999px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.nav-links a:hover { background: var(--ink); color: var(--cream); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --mx: 0px; --my: 0px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 28px; border-radius: 999px; border: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transform: translate(var(--mx), var(--my));
  transition: transform 0.35s var(--ease-out), background 0.2s, box-shadow 0.25s, color 0.2s;
}
.btn-sm { height: 44px; padding: 0 20px; font-size: 16px; }
.btn-cobalt { background: var(--cobalt); color: var(--cream); box-shadow: 0 14px 30px -16px rgba(43, 76, 255, 0.9); }
.btn-cobalt:hover { background: var(--cobalt-deep); box-shadow: 0 0 0 4px var(--butter), 0 18px 34px -16px rgba(43, 76, 255, 0.95); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: var(--cobalt); }
.btn:active { transform: translate(var(--mx), var(--my)) scale(0.97); }

/* ---------------------------------------------------------------- type */
.display, h2 { font-family: var(--font-display); font-weight: 800; margin: 0; text-wrap: balance; }
.display { font-size: clamp(54px, 7.7vw, 148px); line-height: 0.9; letter-spacing: -0.045em; }
.display .l1, .display .l2 { display: block; }
.display .l2 { color: var(--cobalt); }
h2 { font-size: clamp(40px, 4.4vw, 76px); line-height: 0.96; letter-spacing: -0.04em; }
.kicker { align-self: flex-start; display: inline-flex; align-items: center; gap: 9px; margin: 0 0 26px; padding: 8px 15px 8px 11px; border-radius: 999px; background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; font-size: 15px; }
.kicker .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--butter); box-shadow: 0 0 0 2px var(--cobalt); }
.lede { margin: 26px 0 34px; max-width: 26ch; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.4; color: var(--muted); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hint { display: flex; align-items: center; gap: 10px; margin: 30px 0 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.hint .ic { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--butter); color: var(--ink); box-sizing: content-box; }
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }

.step { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cobalt); }
.step span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--cobalt); color: var(--cream); font-size: 12px; letter-spacing: 0; }
.copy p:not(.step) { margin: 22px 0 0; max-width: 34ch; font-size: clamp(17px, 1.25vw, 19px); color: var(--muted); }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; }
.facts li { padding: 6px 12px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 500; }
.copy .ctas { margin-top: 30px; }
.ship-again { margin-top: 28px; }

/* split words (wrapped by JS; text is always visible) */
[data-split] .w { display: inline-block; white-space: pre; transform-origin: 50% 85%; }
.is-active [data-split] .w, .hero.is-active [data-split] .w { animation: pinch 0.95s var(--ease-spring) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes pinch {
  0% { transform: translateY(0.14em) scale(1.12, 0.84); color: var(--cobalt); }
  45% { transform: translateY(-0.02em) scale(0.97, 1.05); }
  100% { transform: none; }
}

/* ---------------------------------------------------------------- light layout (default; also no-JS, no-WebGL, reduced motion) */
.stage, .grain { display: none; }
.zoom-hud { display: none; }
main { position: relative; z-index: 1; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px);
  min-height: min(max(640px, 100svh), 1000px);
  padding: calc(var(--bh) + var(--nh) + 24px) var(--gutter) 64px;
}
.hero-visual { margin: 0; }
.hero-visual img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.chapter {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(24px, 4vw, 72px);
  padding: clamp(56px, 8vw, 120px) var(--gutter);
  border-top: 1px solid var(--line);
}
.chapter .visual { margin: 0; }
.chapter .visual img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; box-shadow: 0 30px 60px -40px rgba(16, 19, 38, 0.45); }
.ship-again { display: none; }
.finale .copy { max-width: 40rem; }

.foot { position: relative; z-index: 2; background: var(--ink); color: var(--cream); }
.foot-in { display: grid; gap: 10px; padding: 48px var(--gutter) 56px; max-width: 1100px; }
.foot p { margin: 0; color: rgba(255, 244, 228, 0.78); max-width: 62ch; }
.foot a:not(.brand) { color: var(--butter); font-weight: 600; text-underline-offset: 3px; }
.foot .brand { margin-bottom: 10px; color: var(--cream); }

@media (max-width: 860px) {
  .hero, .chapter { grid-template-columns: 1fr; }
  .hero { min-height: 0; padding-top: calc(var(--bh) + var(--nh) + 8px); }
  .hero-visual { max-width: 520px; }
}
@media (max-width: 720px) {
  :root { --nh: 64px; }
  .btn { height: 48px; padding: 0 20px; font-size: 16.5px; }
  .ctas { gap: 10px; }
  .lede { margin: 18px 0 22px; font-size: 18px; }
  .kicker { margin-bottom: 18px; font-size: 14px; }
  .hint { margin-top: 18px; font-size: 13px; }
  .demo-in .long { display: none; }
  .demo-in .short { display: inline; }
  .demo-banner { font-size: 13px; }
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
  .brand { font-size: 24px; }
}

/* ---------------------------------------------------------------- immersive layout (hardware WebGL, motion allowed) */
.immersive body { overscroll-behavior: none; }
.immersive .stage { display: block; position: fixed; inset: 0; z-index: 0; opacity: 0; transition: opacity 0.6s ease; }
.immersive .stage canvas { display: block; width: 100%; height: 100%; }
.immersive.gl-ready .stage { opacity: 1; }
.immersive .grain {
  display: block; position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.07 0 0 0 0 0.15 0 0 0 1.2 -0.25'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.immersive .nav::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--bh) * -1); height: calc(var(--bh) + var(--nh) + 34px); z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(255, 244, 228, 0.96) 55%, rgba(255, 244, 228, 0)); }
.hint .ic path { animation: pinch-hint 2.4s var(--ease-out) infinite; transform-origin: 12px 12px; }
@keyframes pinch-hint { 0%, 20% { transform: scale(1); } 50%, 65% { transform: scale(0.72); } 100% { transform: scale(1); } }
.immersive .zoom-hud {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  position: fixed; right: var(--gutter); top: 50%; z-index: 20; transform: translateY(-50%);
  opacity: 0; transition: opacity 0.4s;
}
.immersive.show-hud .zoom-hud { opacity: 1; }
.hud-label { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-right: 14px; }
.hud-track { --lv: 0; position: relative; display: flex; flex-direction: column; padding: 5px; border-radius: 22px; background: rgba(255, 252, 247, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line), 0 20px 40px -30px rgba(16, 19, 38, 0.5); }
.hud-track a { position: relative; z-index: 1; display: block; height: 36px; line-height: 36px; padding: 0 16px; text-align: right; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); transition: color 0.25s; }
.hud-track a.on { color: var(--cream); }
.hud-pill { position: absolute; left: 5px; right: 5px; top: 5px; height: 36px; border-radius: 18px; background: var(--ink); transform: translateY(calc(var(--lv) * 36px)); }

.immersive .hero { display: block; position: relative; height: calc(var(--vh) * 100); min-height: 0; padding: 0; }
.immersive .hero-copy { position: absolute; left: var(--gutter); top: calc(var(--bh) + var(--nh)); bottom: 0; display: flex; flex-direction: column; justify-content: center; max-width: min(46vw, 720px); padding-bottom: calc(var(--vh) * 4); }
.immersive .hero-visual { position: absolute; z-index: -1; left: var(--hx, 50%); top: var(--hy, 50%); width: var(--hs, 40vw); transition: opacity 0.7s ease; }
.immersive .hero-visual img { border-radius: 0; }
.immersive.gl-ready .hero-visual { opacity: 0; transition: opacity 0.45s ease 0.6s; } /* poster stays until the canvas under it is fully in */
.immersive .chapter { display: block; position: relative; padding: 0; border: 0; height: calc(var(--vh) * var(--len, 250)); }
.immersive .chapter .visual { display: none; }
.immersive .sticky { position: sticky; top: 0; height: calc(var(--vh) * 100); display: flex; align-items: center; padding: calc(var(--bh) + var(--nh)) var(--gutter) 0; }
.immersive .copy { position: relative; max-width: min(36vw, 520px); }
.immersive .copy::before { content: ""; position: absolute; inset: -22% -30% -22% -40%; z-index: -1; background: radial-gradient(closest-side, rgba(255, 244, 228, 0.92), rgba(255, 244, 228, 0.7) 55%, rgba(255, 244, 228, 0)); pointer-events: none; }
.immersive .ship-again { display: inline-flex; }
.immersive #quarter { --len: 250; }
.immersive #week { --len: 250; }
.immersive #day { --len: 250; }
.immersive #hour { --len: 250; }
.immersive #finale { --len: 220; }
.immersive .foot { box-shadow: 0 -40px 60px -30px rgba(16, 19, 38, 0.25); }

@media (max-width: 860px) {
  .immersive .hero-copy { max-width: none; right: var(--gutter); justify-content: flex-start; padding-top: 18px; }
  .immersive .sticky { align-items: flex-end; padding-bottom: calc(var(--vh) * 5); }
  .immersive .copy { max-width: 34rem; }
  .immersive .copy::before { inset: -40% -20% -30% -20%; background: radial-gradient(closest-side, rgba(255, 244, 228, 0.95), rgba(255, 244, 228, 0.82) 60%, rgba(255, 244, 228, 0)); }
  .immersive .nav::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--bh) * -1); height: calc(var(--bh) + var(--nh) + 34px); z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(255, 244, 228, 0.96) 55%, rgba(255, 244, 228, 0)); }
.hint .ic path { animation: pinch-hint 2.4s var(--ease-out) infinite; transform-origin: 12px 12px; }
@keyframes pinch-hint { 0%, 20% { transform: scale(1); } 50%, 65% { transform: scale(0.72); } 100% { transform: scale(1); } }
.immersive .zoom-hud { top: calc(var(--bh) + var(--nh) + 4px); right: auto; left: 50%; transform: translateX(-50%); align-items: center; }
  .immersive .hud-label { display: none; }
  .immersive .hud-track { flex-direction: row; border-radius: 999px; }
  .immersive .hud-track a { height: 30px; line-height: 30px; padding: 0 11px; font-size: 12.5px; text-align: center; }
  .immersive .hud-pill { top: 5px; bottom: 5px; left: 0; right: auto; height: auto; width: var(--pw, 60px); border-radius: 15px; transform: translateX(var(--px, 5px)); }
}
@media (max-width: 860px) and (max-height: 700px) {
  .immersive .copy h2 { font-size: 34px; }
  .immersive .copy p:not(.step) { font-size: 15.5px; margin-top: 12px; }
  .immersive .facts { display: none; }
}

/* ---------------------------------------------------------------- the honest demo panel */
.demo-panel {
  width: min(440px, calc(100vw - 32px)); padding: 30px 30px 32px; border: 0; border-radius: 26px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 2.5px var(--ink), 0 40px 80px -30px rgba(16, 19, 38, 0.6);
}
.demo-panel[open] { animation: pop 0.45s var(--ease-spring); }
.demo-panel::backdrop { background: rgba(16, 19, 38, 0.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.demo-panel h3 { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.03em; line-height: 1; margin: 18px 0 10px; }
.demo-panel p { margin: 0 0 24px; color: var(--muted); }
.panel-close-row { position: absolute; right: 14px; top: 14px; margin: 0; }
.panel-x { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.panel-x:hover { background: rgba(16, 19, 38, 0.08); }
.panel-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@keyframes pop { from { transform: translateY(14px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* og image capture */
.og .nav-links, .og .nav .btn, .og .hint, .og .ctas, .og .zoom-hud { display: none !important; }
.og .grain { display: none !important; }

/* capture mode for still renders */
.capture .stage { transition: none !important; }
.capture .demo-banner, .capture .nav, .capture main, .capture .foot, .capture .zoom-hud, .capture .grain { visibility: hidden !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; }
}

/* "Made in UX Pilot" badge: UX Pilot's own badge (MadeInUXPilotBadge), a little larger so it reads as a feature. */
.uxp-badge {
  position: fixed; z-index: 60;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 15px 10px 13px; border-radius: 6px;
  background: #fff; border: 1px solid rgba(19, 5, 55, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  color: #000; font: 600 15px/1.2 var(--font-body); text-decoration: none; white-space: nowrap;
  transition: box-shadow 0.2s, transform 0.25s var(--ease-spring);
}
.uxp-badge svg { width: 20px; height: 19px; flex: none; }
.uxp-badge:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); transform: translateY(-2px); }
.uxp-badge:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
@media (max-width: 860px) {
  .uxp-badge { padding: 8px 12px 8px 10px; font-size: 13.5px; gap: 7px; }
  .uxp-badge svg { width: 17px; height: 16px; }
  .immersive .sticky { padding-bottom: calc(var(--vh) * 5 + 56px); }
}
@media (prefers-reduced-motion: reduce) { .uxp-badge { transition: none; } .uxp-badge:hover { transform: none; } }
