/* Shared by all three landing versions: base, hero (Figma 84:74 / 84:6), buttons,
   section label, avatar, dock, bubbles. Tokens come from brand/tokens.css. */
@import url("../../brand/tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink-night); color: var(--paper); font: 600 var(--text-body)/1.35 var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main { overflow-x: clip; }
:focus-visible { outline: 3px solid var(--lilac-100); outline-offset: 3px; }

/* ---------- Top bar: logo + current section label ---------- */
.topbar {
  position: fixed; top: 16px; left: 16px; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(-12px); pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.topbar.is-on { opacity: 1; transform: none; pointer-events: auto; }
.topbar__tile { width: 44px; height: 44px; border-radius: var(--radius-tile); background: var(--purple-800); display: grid; place-items: center; }
.topbar__tile img { width: 32px; }
.section-label { font: 900 24px/1 var(--font-body); letter-spacing: .02em; white-space: nowrap; display: inline-flex; color: var(--paper); mix-blend-mode: difference; }
.section-label .ch { display: inline-block; white-space: pre; will-change: transform, opacity; }
.topbar__cta { position: fixed; top: 16px; right: 16px; z-index: 50; opacity: 0; pointer-events: none; transition: opacity var(--dur-base); }
.topbar.is-on ~ .topbar__cta { opacity: 1; pointer-events: auto; }

/* ---------- Hero ---------- */
.hero-wrap { padding: 10px; }
.hero {
  position: relative; overflow: hidden;
  min-height: min(794px, calc(100vh - 20px));
  border-radius: var(--radius-card); background: var(--surface); color: var(--black);
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-5);
}
.grain::before {
  content: ""; position: absolute; inset: -50%; pointer-events: none; z-index: 0;
  filter: url(#grain); opacity: .32; mix-blend-mode: multiply;
}
.hero__nav { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; }
.hero__links { display: flex; align-items: center; gap: var(--space-4); }
.hero__links a:not(.btn) { font: 800 var(--text-nav) var(--font-body); text-transform: uppercase; text-decoration: none; padding: 10px; }
.hero__links a:not(.btn):hover { color: var(--purple-800); }
.logo-tile { display: inline-grid; place-items: center; width: 48px; aspect-ratio: 1; background: var(--purple-800); border-radius: var(--radius-tile); }
.logo-tile img { width: 72%; }

.wordmark {
  position: relative; z-index: 1; margin: 0;
  font: 400 var(--text-display)/1.079 var(--font-display);
  letter-spacing: .05em; text-align: center; white-space: nowrap;
  cursor: crosshair; user-select: none;
  --mx: -999px; --my: -999px; --r: 0px;
}
.wordmark__layer { display: block; color: transparent; -webkit-background-clip: text; background-clip: text; background-size: 160px 160px; }
.wordmark__layer--base { background-color: #8f8a97; background-image: var(--tex-grey); }
.wordmark__layer--reveal {
  position: absolute; inset: 0; background-color: #9a86bd; background-image: var(--tex-purple);
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 0 55%, transparent 100%);
          mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 0 55%, transparent 100%);
}
@media (prefers-reduced-motion: reduce) { .wordmark:hover .wordmark__layer--reveal { -webkit-mask-image: none; mask-image: none; } }

.hero__row { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); margin-top: calc(var(--space-3) * -1); }
.hero__left { max-width: 468px; }
.hero__body { margin: 8px 0 0; }
.hero__right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); text-align: right; }
.accent { margin: 0; font: italic 700 24px/1.2 var(--font-accent); color: var(--purple-800); }
.quote { margin: 0; font: italic 500 24px/1.25 var(--font-accent); }

/* ---------- Buttons (Figma 84:45) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 171px; height: 47px; padding: 10px 18px;
  font: 900 var(--text-btn)/1 var(--font-body); text-transform: uppercase; letter-spacing: .02em; text-decoration: none;
  border: 2px solid; border-radius: var(--radius-btn); box-shadow: var(--shadow-soft); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-spring), border-color var(--dur-fast);
}
.btn--lg { min-width: 288px; height: 93px; padding: 20px 10px; border-width: 5px; font-size: 20px; }
.btn--light { background: var(--paper); color: var(--purple-800); border-color: var(--purple-800); }
.btn--purple { background: var(--purple-900); color: var(--paper); border-color: var(--lilac-100); }
.btn--black { background: var(--black); color: var(--paper); border-color: var(--lilac-100); }
.btn:hover, .btn:focus-visible { transform: translate(-2px, -2px); }
.btn--light:hover, .btn--light:focus-visible { box-shadow: 6px 7px 0 var(--purple-800); }
.btn--light.btn--lg:hover, .btn--light.btn--lg:focus-visible { box-shadow: 8px 9px 0 var(--purple-800); border-width: 3px; }
.btn--purple:hover, .btn--purple:focus-visible { border-color: var(--purple-900); box-shadow: 8px 10px 0 var(--purple-shadow); }
.btn--black:hover, .btn--black:focus-visible { border-color: var(--black); box-shadow: 8px 10px 0 var(--purple-shadow); }
.btn--purple.btn--lg:hover, .btn--black.btn--lg:hover { box-shadow: 10px 13px 0 var(--purple-shadow); }

/* ---------- Avatar ---------- */
.avatar { position: relative; aspect-ratio: 1; pointer-events: none; }
.avatar__stage { position: absolute; left: 0; top: 0; width: 1080px; height: 1080px; transform-origin: 0 0; }
.avatar__stage img { position: absolute; user-select: none; }
.avatar__body { position: absolute; inset: 0; transform-origin: 540px 700px; }
.avatar__body.snore { animation: snore 2.6s ease-in-out infinite; }
@keyframes snore { 50% { transform: translateY(4px) scale(1.008); } }
.pupil { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: #17161a; }
.zzz { position: absolute; left: 665px; top: 400px; opacity: 0; transition: opacity .5s; font: 900 40px/1 var(--font-body); color: var(--purple-800); }
.zzz span { position: absolute; opacity: 0; animation: zfloat 2.6s ease-in-out infinite; }
.zzz span:nth-child(2) { left: 22px; top: -20px; font-size: 1.3em; animation-delay: .5s; }
.zzz span:nth-child(3) { left: 48px; top: -44px; font-size: 1.6em; animation-delay: 1s; }
@keyframes zfloat { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-34px); opacity: 0; } }

.avatar--hero {
  --w: min(780px, 60vw);
  position: absolute; z-index: 2; width: var(--w);
  left: 50%; bottom: calc(var(--w) * -0.34); transform: translateX(-50%);
  transition: transform .6s var(--ease-in-out), opacity .6s;
}
.avatar--hero.is-gone { transform: translate(30%, 40%) scale(.6); opacity: 0; }

.bubble {
  position: absolute; max-width: 260px;
  background: var(--paper); color: var(--purple-800);
  border: 2px solid var(--purple-800); border-radius: 14px; box-shadow: 4px 5px 0 var(--purple-800);
  padding: 10px 14px; font: 800 18px/1.15 var(--font-body);
  opacity: 0; transform: translateY(6px) scale(.96); transform-origin: 90% 100%;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-spring);
  pointer-events: none;
}
.bubble.is-on { opacity: 1; transform: none; }
.bubble::after { content: ""; position: absolute; right: 34px; bottom: -9px; width: 14px; height: 14px; background: var(--paper); border-right: 2px solid var(--purple-800); border-bottom: 2px solid var(--purple-800); transform: rotate(45deg); }

.dock { position: fixed; right: 20px; bottom: 20px; z-index: 40; transform: translate(160%, 0); transition: transform .6s var(--ease-out); }
.dock.is-on { transform: none; }
.dock .avatar--dock { width: 116px; height: 108px; aspect-ratio: auto; overflow: hidden; background: var(--surface); border: 2px solid var(--purple-800); border-radius: 14px; box-shadow: 5px 6px 0 var(--purple-800); }
.dock .avatar--dock .avatar__stage { left: -57px; top: -66px; }
.dock .bubble { right: 0; bottom: 124px; width: max-content; }

/* ---------- Shared bits ---------- */
.eyebrow { margin: 0 0 12px; font: 800 16px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--purple-shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font: 900 13px/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.pill--live { background: #d9ffd0; color: #0d4a00; }
.pill--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1fae00; box-shadow: 0 0 0 3px rgba(31,174,0,.2); }
.pill--proto { background: var(--lilac-100); color: var(--purple-800); }
.pill--concept { background: #ffe9c7; color: #6a3b00; }

/* Typographic project covers (swap for real cover images) */
.cover { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 24px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cover--growth { background: #f7f7f5; color: #111; }
.cover--growth b { font: 900 clamp(48px, 7vw, 96px)/1 var(--font-accent); letter-spacing: -.04em; color: #1d4ed8; }
.cover--growth small { display: block; font: 600 14px ui-monospace, Menlo, monospace; letter-spacing: .04em; margin-top: 8px; }
.cover--zen { background: #1b1c22; color: #c6ef4e; }
.cover--zen b { font: 900 clamp(56px, 8vw, 110px)/1 var(--font-body); }
.cover--zen small { display: block; max-width: 30ch; margin: 8px auto 0; font: italic 600 16px/1.3 var(--font-accent); color: #e9ffd0; }
.cover--rally { background: linear-gradient(160deg, #ff8a3d, #ffcf5c); color: #2b1100; }
.cover--rally b { font: 900 clamp(48px, 7vw, 96px)/1 var(--font-accent); letter-spacing: -.03em; }
.cover--rally small { display: block; font: 800 16px var(--font-body); margin-top: 6px; }
.cover__todo { position: absolute; left: 10px; bottom: 10px; font: 700 11px ui-monospace, Menlo, monospace; opacity: .55; }

/* Scramble keeps layout stable */
[data-scramble], [data-scramble-row] { font-variant-ligatures: none; }

/* Footer */
.footer { max-width: 1240px; margin: 0 auto; padding: 60px 32px 150px; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-end; }
.footer__sign { margin: 0; font: italic 500 22px var(--font-accent); color: var(--lilac-100); }
.footer__links { display: flex; gap: 22px; font: 800 18px var(--font-body); text-transform: uppercase; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--purple-shadow); }
.footer__meta { width: 100%; display: flex; justify-content: space-between; font: 700 15px var(--font-body); color: var(--purple-shadow); }

@media (max-width: 900px) {
  .hero { padding: 20px; }
  .wordmark { font-size: 21.5vw; }
  .hero__row { flex-direction: column; }
  .hero__right { align-items: flex-start; text-align: left; }
  .hero__links a:not(.btn) { display: none; }
  .avatar--hero { --w: 92vw; }
  .dock { right: 12px; bottom: 12px; scale: .68; transform-origin: 100% 100%; }
  .btn--lg { min-width: 220px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .btn:focus-visible { transform: none; }
  .zzz span { animation: none; opacity: .8; }
}

/* =====================================================================
   Light theme: the final site. Whole page uses the hero colour #F2F2F7
   (Figma 84:75) with one fixed film-grain layer behind everything.
   ===================================================================== */
.theme-light { background: var(--bg); color: var(--black); }
.theme-light::before {
  content: ""; position: fixed; inset: -50%; z-index: -1; pointer-events: none;
  filter: url(#grain); opacity: .28; mix-blend-mode: multiply;
}
.theme-light .hero-wrap { padding: 0; }
.theme-light .hero { background: transparent; border-radius: 0; min-height: 100vh; min-height: 100svh; }
.theme-light .hero.grain::before { display: none; }

.theme-light .topbar { background: rgba(242,242,247,.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 6px 16px 6px 6px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(51,4,102,.12); }
.theme-light .section-label { mix-blend-mode: normal; color: var(--purple-800); }
.theme-light .eyebrow { color: var(--purple-800); }
.theme-light .dock .avatar--dock { background: #fff; }
.theme-light .footer__sign { color: var(--purple-800); }
.theme-light .footer__links a:hover { color: var(--purple-800); }
.theme-light .footer__meta { color: #4a4552; }
