/* APP home page: the scrolling 3D story. Shares its palette and type with css/app.css. */

:root {
  --ink: #0f3540;
  --ink-soft: #46666e;
  --water: #dcebe8;
  --water-deep: #c3dcd7;
  --paper: #fbfdfc;
  --line: #c9dad6;
  --buoy: #f5b700;
  --buoy-deep: #d99e00;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 1px 2px rgba(15, 53, 64, .08), 0 8px 24px rgba(15, 53, 64, .10);
  --bar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font: 400 17px/1.55 var(--body); color: var(--ink);
  background: linear-gradient(180deg, #f3f8f7 0%, var(--water) 55%, var(--water-deep) 100%) fixed;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--buoy); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 8px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-soft); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ink:hover { background: #0a2830; border-color: #0a2830; }
.btn--buoy { background: var(--buoy); border-color: var(--buoy); }
.btn--buoy:hover { background: var(--buoy-deep); border-color: var(--buoy-deep); }
.btn--big { min-height: 56px; padding: 12px 28px; font-size: 1.0625rem; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--bar-h); padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(243, 248, 247, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 218, 214, .7);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-name { font: 800 1.5rem/1 var(--display); letter-spacing: .02em; }
.brand-full { font-size: .875rem; color: var(--ink-soft); padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 3D stage: fixed behind the story ---------- */
.stage { position: fixed; inset: 0; z-index: 0; transition: opacity .4s; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.stage.is-grabbable canvas { cursor: grab; }
.stage.is-grabbing canvas { cursor: grabbing; }
.stage-note {
  position: absolute; right: 25%; top: 50%; transform: translate(50%, -50%); padding: 8px 14px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); font-size: .875rem; font-weight: 600; color: var(--ink-soft);
}
.stage-note[hidden] { display: none; }

/* ---------- story steps ---------- */
main { position: relative; z-index: 1; pointer-events: none; }
main a, main .card, .after { pointer-events: auto; }
.step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--bar-h) + 24px) clamp(20px, 6vw, 96px) 24px; }
.step--spin { min-height: 160vh; align-items: flex-start; }
.step--spin .card { position: sticky; top: 30vh; }
.card {
  width: min(440px, 100%); padding: 28px; border-radius: 16px;
  background: rgba(251, 253, 252, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.card--hero { width: min(560px, 100%); background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
.eyebrow { font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
h1 { font: 800 clamp(2.2rem, 4.6vw, 3.6rem)/1.04 var(--display); letter-spacing: -.02em; text-wrap: balance; }
h2 { font: 700 clamp(1.5rem, 2.4vw, 1.9rem)/1.12 var(--display); letter-spacing: -.01em; margin-bottom: 10px; text-wrap: balance; }
.lede { margin-top: 18px; font-size: 1.125rem; color: var(--ink-soft); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hint { margin-top: 34px; font-size: .875rem; font-weight: 600; color: var(--ink-soft); }
.hint::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(2px) rotate(45deg); } }
.ticks li { position: relative; padding-left: 22px; margin-top: 8px; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--buoy); }

/* ---------- after the story ---------- */
.after { position: relative; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -20px 60px rgba(15, 53, 64, .12); }
.block { max-width: 1080px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 48px) 0; }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; counter-reset: flow; }
.flow li { counter-increment: flow; padding: 22px; border-radius: 14px; background: var(--water); }
.flow li::before { content: counter(flow); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 1rem var(--display); }
.flow h3 { font: 700 1.2rem/1.2 var(--display); margin-bottom: 6px; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; margin-top: clamp(48px, 8vw, 96px); padding: clamp(28px, 4vw, 44px); border-radius: 20px; background: var(--ink); color: #fff; }
.cta h2 { margin-bottom: 8px; }
.cta p { color: #cfe0e2; max-width: 36em; }
.foot { max-width: 1080px; margin: 0 auto; padding: 36px clamp(20px, 5vw, 48px) 48px; font-size: .875rem; color: var(--ink-soft); }

/* ---------- small screens: buoy on top, card below ---------- */
@media (max-width: 820px) {
  .brand-full { display: none; }
  .bar { padding: 0 14px; }
  .step { align-items: flex-end; padding: 0 14px 18px; }
  .step--hero { padding-bottom: 28px; }
  .card { width: 100%; padding: 20px; }
  .card--hero { padding: 18px; border-radius: 16px; background: rgba(251, 253, 252, .9); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .lede { font-size: 1rem; margin-top: 12px; }
  .actions { margin-top: 16px; }
  .hint { display: none; }
  .step--spin { align-items: flex-end; }
  .step--spin .card { position: sticky; top: auto; bottom: 18px; }
  .stage-note { right: 50%; top: 30%; }
  .flow { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint::before { animation: none; }
}
