/* Kulra: wet-clay paper, fired-terracotta accent, kiln-dark close. Gloock for the voice, Hanken
   Grotesk for reading. */
:root {
  --paper: #EFE5D6;
  --paper-2: #E7DAC6;
  --ink: #2A1F18;
  --muted: #64503F;
  --line: #D3C2AA;
  --clay: #8F4C2C;
  --clay-ink: #FBF1E4;
  --kiln: #251B15;
  --kiln-ink: #EBDDCA;
  --kiln-muted: #B9A58E;
  --display: 'Gloock', 'Iowan Old Style', Georgia, serif;
  --body: 'Hanken Grotesk', system-ui, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  overflow-x: clip;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 6px; }

.banner {
  background: var(--kiln);
  color: var(--kiln-ink);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  padding: 9px 16px;
}
.banner p { margin: 0; text-wrap: balance; }
.banner b { font-weight: 600; }
.banner span { color: var(--kiln-muted); white-space: nowrap; }
.banner span::before { content: '· '; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px max(16px, 4vw);
}
.mark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 400 26px/1 var(--display); letter-spacing: -.01em; }
.mark svg { width: 30px; height: 30px; color: var(--clay); }
.jump {
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.jump:hover { background: var(--paper-2); border-color: var(--muted); }

/* ------------------------------------------------------------------ the story */
.story { position: relative; }
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
  outline-offset: -6px;
}
.stage canvas, .stage .poster {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  display: block;
}
.stage .poster { object-fit: contain; padding: 6% 4%; }
.stage canvas { opacity: 0; transition: opacity .6s var(--ease); touch-action: pan-y; cursor: grab; }
.is-live .stage canvas { opacity: 1; }
.is-live .stage .poster { opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s .6s; }
.stage.is-turning canvas { cursor: grabbing; }
.glow {
  grid-area: 1 / 1;
  width: min(80%, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226, 112, 46, .32), rgba(226, 112, 46, 0));
  opacity: 0;
  transform: scale(.85);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  pointer-events: none;
}
[data-story="3"] .glow { opacity: 1; transform: scale(1); }

.ticks {
  position: absolute;
  right: max(16px, 3vw);
  top: 50%;
  translate: 0 -50%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticks li { display: flex; align-items: center; justify-content: flex-end; gap: 10px; opacity: .55; transition: opacity .4s var(--ease), color .4s var(--ease); }
.ticks li::after { content: ''; width: 18px; height: 1.5px; background: currentColor; transition: width .4s var(--ease); }
[data-story="1"] .ticks li:nth-child(1), [data-story="2"] .ticks li:nth-child(2), [data-story="3"] .ticks li:nth-child(3),
[data-story="4"] .ticks li:nth-child(4), [data-story="5"] .ticks li:nth-child(5) { opacity: 1; color: var(--ink); }
[data-story="1"] .ticks li:nth-child(1)::after, [data-story="2"] .ticks li:nth-child(2)::after, [data-story="3"] .ticks li:nth-child(3)::after,
[data-story="4"] .ticks li:nth-child(4)::after, [data-story="5"] .ticks li:nth-child(5)::after { width: 34px; background: var(--clay); }

.hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.hint svg { width: 30px; height: 10px; }
.is-live[data-story="5"] .hint { display: inline-flex; }

.step { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 64px max(16px, 5vw); max-width: 560px; }
.step h1, .step h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.015em; margin: 0 0 18px; text-wrap: balance; }
.step h1 { font-size: clamp(44px, 5.6vw, 82px); line-height: 1.02; }
.step h2 { font-size: clamp(32px, 3.6vw, 50px); line-height: 1.08; }
.step p { margin: 0; max-width: 42ch; text-wrap: pretty; }
.kicker { max-width: none !important; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--clay); margin: 0 0 22px !important; }
.lede { font-size: 19px; color: var(--muted); }
.num { font: 400 15px/1 var(--display); color: var(--clay); margin: 0 0 18px !important; display: flex; align-items: center; gap: 12px; }
.num span { font: 600 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.num::after { content: ''; flex: 0 0 56px; height: 1px; background: var(--line); order: 1; }
.num span { order: 2; }
.step > p:not(.num):not(.kicker):not(.cue):not(.caption) { color: var(--muted); font-size: 18px; }
.cue { margin-top: 40px !important; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.cue span { width: 1.5px; height: 40px; background: linear-gradient(var(--clay), transparent); }

.is-live .step > * { transition: opacity .5s var(--ease), translate .5s var(--ease); }
.is-live .step:not(.is-on) > * { opacity: .38; }

fieldset { border: 0; margin: 26px 0 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font: 500 15px/1 var(--body);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 10px 15px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.chips button:hover { border-color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(42, 31, 24, .25), 0 0 0 2px rgba(239, 229, 214, .6); }
.chips small { font-size: 13px; opacity: .72; }
.caption { margin-top: 22px !important; font-size: 15px; color: var(--muted); min-height: 3.2em; }

/* ------------------------------------------------------------------ small things */
.small { max-width: 1240px; margin: 0 auto; padding: clamp(80px, 12vw, 160px) max(16px, 5vw); }
.small h2 { font: 400 clamp(34px, 4.4vw, 60px)/1.06 var(--display); letter-spacing: -.015em; margin: 0 0 56px; max-width: 16ch; text-wrap: balance; }
.small ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.small li { padding: 28px 28px 8px 0; counter-increment: s; }
.small li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.small b { display: block; font: 400 28px/1 var(--display); margin-bottom: 14px; }
.small b::before { content: counter(s, decimal-leading-zero) ' '; color: var(--clay); font-size: 15px; vertical-align: .55em; margin-right: 6px; }
.small p { margin: 0; color: var(--muted); text-wrap: pretty; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .small li { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .small li:nth-child(2) { animation-range: entry 8% entry 78%; }
    .small li:nth-child(3) { animation-range: entry 16% entry 86%; }
    .small li:nth-child(4) { animation-range: entry 24% entry 94%; }
  }
}
@keyframes rise { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }

/* ------------------------------------------------------------------ the close */
.kiln {
  background:
    radial-gradient(60% 80% at 50% 115%, rgba(196, 92, 40, .38), rgba(196, 92, 40, 0) 70%),
    var(--kiln);
  color: var(--kiln-ink);
  text-align: center;
  padding: clamp(96px, 14vw, 180px) 16px;
}
.kiln .kicker { color: #E39A6E; }
.kiln h2 { font: 400 clamp(40px, 7vw, 104px)/1 var(--display); letter-spacing: -.02em; margin: 0 auto 26px; max-width: 13ch; text-wrap: balance; }
.kiln p:not(.kicker) { color: var(--kiln-muted); max-width: 46ch; margin: 0 auto 34px; text-wrap: pretty; }
.cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 99px;
  background: var(--kiln-ink);
  color: var(--kiln);
  font-weight: 600;
  text-decoration: none;
  transition: background .25s var(--ease);
}
.cta:hover { background: #F6EBDC; }

.foot {
  background: var(--kiln);
  color: var(--kiln-muted);
  border-top: 1px solid #3A2C23;
  padding: 26px max(16px, 5vw) 34px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}
.foot p { margin: 0; }
.foot a { color: var(--kiln-ink); text-underline-offset: 3px; }

/* ------------------------------------------------------------------ layouts */
@media (min-width: 900px) {
  .story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .stage { grid-column: 2; grid-row: 1; }
  .steps { grid-column: 1; grid-row: 1; justify-self: end; width: 100%; max-width: 640px; }
  .step.hero { min-height: calc(100svh - 120px); justify-content: flex-start; padding-top: 10svh; max-width: 660px; }
  .step.hero h1 { font-size: clamp(48px, 5vw, 76px); }
}
@media (max-width: 899px) {
  .stage {
    height: 54svh;
    z-index: 2;
    background: var(--paper);
  }
  .stage::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 48px;
    background: linear-gradient(var(--paper), rgba(239, 229, 214, 0));
    pointer-events: none;
  }
  .ticks { top: auto; bottom: 8px; right: 0; left: 0; translate: none; display: flex; justify-content: center; gap: 14px; font-size: 10px; letter-spacing: .1em; }
  .ticks li { flex-direction: column-reverse; gap: 6px; }
  .ticks li::after, [data-story] .ticks li::after { width: 100%; min-width: 22px; }
  [data-story="1"] .ticks li:nth-child(1)::after, [data-story="2"] .ticks li:nth-child(2)::after, [data-story="3"] .ticks li:nth-child(3)::after,
  [data-story="4"] .ticks li:nth-child(4)::after, [data-story="5"] .ticks li:nth-child(5)::after { width: 100%; height: 2px; }
  .hint { top: 12px; bottom: auto; font-size: 13px; }
  .stage canvas, .stage .poster { height: calc(100% - 44px); align-self: start; }
  .stage .poster { padding: 2% 14% 4%; }
  .steps { position: relative; z-index: 1; }
  .step { min-height: 62svh; padding: 40px 16px 56px; max-width: none; justify-content: flex-start; }
  .step.hero { min-height: auto; padding-top: 28px; }
  .step.pick { min-height: 46svh; padding-bottom: 72px; }
  .step h1 { font-size: clamp(38px, 10.5vw, 52px); }
  .step h2 { font-size: clamp(28px, 8vw, 38px); }
  .lede, .step > p:not(.num):not(.kicker):not(.cue):not(.caption) { font-size: 17px; }
  .cue { margin-top: 24px !important; }
  .small ol { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .small li:nth-child(3) { padding-left: 0; border-left: 0; }
  .small li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .top { padding-block: 14px; }
  .jump { font-size: 14px; padding: 8px 13px; }
  .small ol { grid-template-columns: minmax(0, 1fr); }
  .small li, .small li + li { padding: 24px 0 18px; border-left: 0; }
  .small li + li { border-top: 1px solid var(--line); }
  .foot { flex-direction: column; }
}

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