/* Clive landing page. Brand tokens come from the app's ThemeProvider.kt. */
@font-face {
  font-family: "Inter";
  src: url("assets/inter-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --yellow: #FCD240;
  --gold: #B98D07;
  --ink: #1B1B1B;
  --ink-soft: #4A4136;
  --muted: #767676;
  --cream: #F7F1E4;
  --card: #FFFFFF;
  --success: #52BD94;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(40, 28, 6, .35), 0 2px 6px rgba(40, 28, 6, .08);
  --pad-x: clamp(20px, 6vw, 96px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--yellow);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ── 3D canvas sits behind all content ── */
#scene {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
  display: block;
}
main { position: relative; z-index: 1; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad-x);
  transition: color .4s ease;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .22em; font-size: 17px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.nav-cta {
  text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff;
  transition: transform .2s ease, background .4s ease, color .4s ease;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav.on-dark { color: #fff; }
.nav.on-dark .nav-cta { background: var(--yellow); color: var(--ink); }

/* ── Shared layout ── */
.frame {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 3vw;
  padding: 96px var(--pad-x) 40px;
  min-height: 100vh; min-height: 100svh;
}
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.chapter { position: relative; height: var(--len, 300vh); }
.stage { position: relative; height: 100%; min-height: 320px; }
.copy { position: relative; max-width: 520px; }

.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 18px;
}
.eyebrow.pill { color: var(--ink); background: rgba(255,255,255,.55); padding: 8px 14px; border-radius: 999px; letter-spacing: .08em; }
h1, h2 { font-weight: 800; letter-spacing: -.035em; line-height: .98; }
h1 { font-size: clamp(48px, 7.4vw, 108px); }
h2 { font-size: clamp(38px, 5vw, 72px); }
.copy > p, .phase > p { margin-top: 22px; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.55; color: var(--ink-soft); max-width: 44ch; }
.lede { margin-top: 24px; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: #3B2C12; max-width: 40ch; }

.dark { color: #F5F2EA; }
.dark .copy > p { color: #B8B4AC; }
.dark .eyebrow { color: var(--yellow); }

/* ── Store buttons (placeholders until links exist; see main.js CONFIG) ── */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.store {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px 11px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
  transition: transform .2s ease, box-shadow .2s ease;
}
.store:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(0,0,0,.55); }
.store:focus-visible, .nav-cta:focus-visible, .footer a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.store svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.store span { display: flex; flex-direction: column; font-size: 17px; font-weight: 700; line-height: 1.1; }
.store small { font-size: 10.5px; font-weight: 500; opacity: .8; letter-spacing: .02em; }
.store .soon {
  position: absolute; top: -8px; right: -8px;
  font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: #fff; color: var(--ink); padding: 3px 7px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.store.live .soon { display: none; }

/* ── Hero ── */
.hero { position: relative; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: #5C4019;
}
.scroll-cue i { width: 22px; height: 34px; border: 2px solid currentColor; border-radius: 12px; position: relative; }
.scroll-cue i::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px;
  border-radius: 2px; background: currentColor; animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* ── 01 Shelf ── */
.counter { display: flex; align-items: baseline; gap: 12px; margin-top: 30px; }
.counter b { font-size: clamp(44px, 5vw, 64px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; min-width: 1.4ch; }
.counter span { font-size: 15px; color: var(--muted); font-weight: 500; }

.book-head, .case-head {
  position: absolute; left: 0; right: 0; top: 2%;
  text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
.book-head.on, .case-head.on { opacity: 1; transform: none; }
.book-head h3, .case-head h3 { font-size: clamp(22px, 2.4vw, 34px); font-weight: 700; letter-spacing: -.02em; }
.book-head p, .case-head p { margin-top: 6px; font-size: 15px; color: var(--muted); }
.status { display: inline-block; font-weight: 700; color: var(--ink); background: var(--yellow); padding: 2px 10px; border-radius: 999px; transition: background .3s; }
.status.done { background: var(--success); color: #fff; }
.stars { position: relative; display: inline-block; margin-top: 8px; font-size: 22px; letter-spacing: 4px; color: #DDD3BF; }
.stars i {
  position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap;
  font-style: normal; color: #F2B600; width: calc(var(--fill) * 100%);
}

/* ── 02 Movies & series ── */
.case-head { top: 0; }
.case-head p { color: #9C978D; }
.tabs { display: inline-flex; gap: 6px; margin-top: 28px; background: rgba(255,255,255,.07); padding: 5px; border-radius: 12px; }
.tabs span { padding: 9px 18px; border-radius: 9px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9C978D; transition: background .3s, color .3s; }
.tabs span.on { background: var(--yellow); color: var(--ink); }
.scrubber { position: absolute; left: 50%; bottom: 1%; width: 220px; height: 46px; transform: translateX(-50%); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.scrubber .ticks { position: absolute; left: 50%; bottom: 6px; display: flex; gap: 10px; align-items: flex-end; will-change: transform; }
.scrubber .ticks b { display: block; width: 2px; height: 18px; background: #6F6B64; border-radius: 1px; }
.scrubber .ticks b:nth-child(5n+1) { height: 26px; }
.scrubber > i { position: absolute; left: 50%; bottom: 4px; width: 3px; height: 38px; margin-left: -1px; background: #F5F2EA; border-radius: 2px; }
.scrubber > i::before { content: ""; position: absolute; top: -4px; left: -3px; width: 9px; height: 9px; border-radius: 50%; background: #F5F2EA; }

/* ── 03/04 Social ── */
.phase { transition: opacity .45s ease, transform .45s ease; }
#social .copy { display: grid; }
#social .phase { grid-area: 1 / 1; align-self: center; }
#phase-b { opacity: 0; transform: translateY(20px); pointer-events: none; }
.social-b #phase-a { opacity: 0; transform: translateY(-20px); pointer-events: none; }
.social-b #phase-b { opacity: 1; transform: none; pointer-events: auto; }

.feed, .notes { list-style: none; margin-top: 26px; display: grid; gap: 12px; }
.card, .note, .suggest {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(26px) scale(.97);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .9, .25, 1.2);
}
.card.in, .note.in, .suggest.in { opacity: 1; transform: none; }
.card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; }
.card p { font-size: 14px; color: #3A3A3A; }
.card p b, .note p b, .person b { color: var(--gold); }
.card q { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); font-style: italic; }
.av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.15);
}
.av.sm { width: 32px; height: 32px; font-size: 13px; }
.item { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.thumb { width: 34px; height: 48px; border-radius: 5px; flex: none; background: linear-gradient(160deg, var(--t1), var(--t2)); box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.item strong { display: block; font-size: 15px; }
.item em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.item em.mini-stars { color: #F2B600; letter-spacing: 2px; }
.likes { font-size: 13px; color: #E2435A; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.note { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.note p { font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.note p > span { font-size: 12.5px; color: var(--muted); }
.note .tick { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; font-weight: 800; flex: none; }
.suggest { padding: 14px 16px; }
.suggest h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.person p { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.person p span { font-size: 12.5px; color: var(--muted); }
.person button, .result button {
  font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 10px;
  padding: 8px 14px; background: var(--yellow); color: var(--ink); cursor: default;
  transition: background .3s, color .3s, transform .3s;
}
.person button.on, .result button.on { background: #EFEFEF; color: var(--ink); }
.result button.on { background: var(--success); color: #fff; }

/* ── 05 Add ── */
.search { margin-top: 28px; display: grid; gap: 10px; max-width: 420px; }
.field {
  display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow); font-size: 16px;
}
.field svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
#typed:empty::before { content: "Search media & people..."; color: #A9A9A9; }
.caret { width: 2px; height: 20px; background: var(--ink); animation: blink 1s steps(1) infinite; margin-left: -8px; }
@keyframes blink { 50% { opacity: 0; } }
.result {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff;
  border-radius: 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-8px); transition: opacity .4s, transform .4s;
}
.result.in { opacity: 1; transform: none; }
.result > span:nth-child(2) { flex: 1; }
.result strong { display: block; font-size: 15px; }
.result em { font-style: normal; font-size: 12px; color: var(--muted); }

.scan-chip {
  position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
  transition: background .3s, color .3s;
}
.scan-chip.found { background: var(--success); }

/* ── CTA + footer ── */
.cta { position: relative; }
.cta .frame { min-height: calc(100vh - 90px); min-height: calc(100svh - 90px); }
.footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px;
  padding: 26px var(--pad-x) 34px;
  border-top: 1px solid rgba(27, 27, 27, .14);
  font-size: 14px;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.footer nav a { font-weight: 700; text-decoration: none; }
.footer nav a:hover, .footer p a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer p { color: #5C4019; }
.footer p a { text-decoration: none; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 40;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── No WebGL: keep the page useful with the app icon as the hero visual ── */
.no-webgl #scene { display: none; }
.no-webgl .hero .stage { background: url("assets/clive-icon.png") center / min(70%, 360px) no-repeat; }

/* ── Tablet / mobile: copy on top, 3D stage below ── */
@media (max-width: 900px) {
  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 84px 22px 22px;
  }
  .hero .frame, .cta .frame { grid-template-rows: auto minmax(300px, 1fr); }
  .stage { min-height: 0; }
  .copy { max-width: none; }
  h2 { font-size: clamp(32px, 8.6vw, 52px); }
  .copy > p, .phase > p { margin-top: 12px; font-size: 15px; }
  .lede { margin-top: 14px; font-size: 16px; }
  .eyebrow { margin-bottom: 10px; font-size: 12px; }
  .stores { margin-top: 20px; }
  .counter { margin-top: 12px; }
  .tabs { margin-top: 14px; }
  .search { margin-top: 14px; }
  .scroll-cue { display: none; }

  /* social chapter: cards float over the bottom of the stage */
  #social .copy { position: static; }
  #social .phase { align-self: start; }
  .feed, .notes { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; gap: 8px; z-index: 2; }
  .card { padding: 10px 12px; }
  .card q { display: none; }
  .feed .card:not(.latest) { display: none; }
  .notes .note:not(.latest) { display: none; }
  .suggest .person:nth-child(3) { display: none; }
}
@media (max-width: 900px) and (max-height: 720px) {
  .copy > p, .phase > p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue i::after, .caret { animation: none; }
}
