/* Kugb website. Tokens mirror the app's light theme (src/context/ThemeContext.tsx). */
@font-face { font-family: 'Bricolage'; src: url('assets/fonts/BricolageGrotesque-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('assets/fonts/BricolageGrotesque-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('assets/fonts/BricolageGrotesque-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('assets/fonts/BricolageGrotesque-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('assets/fonts/BricolageGrotesque-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #6B7280;
  --ink-3: #8B93A5;
  --chip: #E9ECF0;
  --accent: #34C759;
  --on-accent: #0E0F12;
  --dark: #15171A;
  --bevel-color: inset 0 .25rem .5rem rgba(255,255,255,.28), inset 0 -.375rem .625rem rgba(0,0,0,.16);
  --bevel-light: inset 0 .25rem .5rem rgba(255,255,255,.85), inset 0 -.375rem .625rem rgba(13,39,80,.14);
  --bevel-dark: inset 0 .25rem .45rem rgba(255,255,255,.1), inset 0 -.375rem .625rem rgba(0,0,0,.5);
  --surface: 0 .75rem 2rem -.75rem rgba(17,20,28,.14), 0 .125rem .375rem rgba(17,20,28,.05);
  --ease: cubic-bezier(.22,.8,.24,1);
  --phone: .476; /* width / height */
}

/* One unit scales the whole layout with the window (16px at a 1453px window). */
html { font-size: clamp(11px, calc(100vw / 90.8), 22px); scroll-behavior: smooth; overflow-x: clip; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Bricolage', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: .15rem solid var(--accent); outline-offset: .15rem; border-radius: .4rem; }

/* The app's 3D buttons: bevel, and a press that sinks in. */
.btn-3d { transition: transform .16s var(--ease), filter .16s var(--ease); cursor: pointer; }
.btn-3d:hover { filter: brightness(1.06); }
.btn-3d:active { transform: scale(.96); }

/* --- Nav: a frosted pill, content blurs under it ------------------------- */
.nav {
  position: fixed; z-index: 50; top: 1.05rem; left: 50%;
  width: 26rem; margin-left: -13rem;
  border-radius: .875rem;
  background: rgba(112,118,128,.55);
  -webkit-backdrop-filter: blur(1.1rem) saturate(1.3);
  backdrop-filter: blur(1.1rem) saturate(1.3);
  box-shadow: inset 0 .06rem 0 rgba(255,255,255,.25);
  color: #fff;
  overflow: hidden;
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 3rem; padding: 0 .375rem 0 1rem; }
.nav-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.nav-toggle {
  width: 2.25rem; height: 2.25rem; border: 0; border-radius: .625rem;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--bevel-color);
}
.nav-toggle svg { width: .875rem; height: .875rem; transition: transform .28s var(--ease); }
.nav.open .nav-toggle svg { transform: rotate(45deg); }
.nav-menu { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease); }
.nav.open .nav-menu { grid-template-rows: 1fr; }
.nav-links { overflow: hidden; display: grid; }
.nav-links a { padding: .55rem 1rem; font-size: 1rem; font-weight: 500; }
.nav-links a:last-child { margin-bottom: .5rem; }
.nav-links a:hover { background: rgba(255,255,255,.12); }

/* --- Inline words that act like buttons ---------------------------------- */
.token {
  display: inline-block;
  padding: .02em .28em .06em;
  border-radius: .24em;
  background: var(--chip);
  color: var(--ink-2);
  box-shadow: var(--bevel-light);
  transition: background .32s var(--ease), color .32s var(--ease), box-shadow .32s var(--ease);
}
.token.on { background: var(--accent); color: var(--on-accent); box-shadow: var(--bevel-color); }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; padding-top: 9.6rem; }
.hero-copy { text-align: center; position: relative; z-index: 2; }
.headline { font-size: 3.75rem; line-height: 1.14; font-weight: 700; letter-spacing: -.035em; }
.headline .line { display: block; }
.lede { max-width: 28rem; text-wrap: balance; margin: 1rem auto 0; font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); }
.stores { display: flex; justify-content: center; gap: .75rem; margin-top: 2rem; scroll-margin-top: 8rem; }
.store {
  display: flex; align-items: center; gap: .625rem; height: 3rem; padding: 0 1.25rem 0 .25rem;
  border-radius: .75rem; background: var(--dark); color: #fff; box-shadow: var(--bevel-dark);
}
.store-icon { width: 2.5rem; height: 2.5rem; border-radius: .5625rem; background: #fff; display: grid; place-items: center; box-shadow: var(--bevel-light); }
.store-icon svg { width: 1.25rem; height: 1.25rem; }
.store-text { display: grid; line-height: 1.12; text-align: left; }
.store-text small { font-size: .75rem; color: rgba(255,255,255,.7); }
.store-text strong { font-size: 1rem; font-weight: 600; }

.fan { position: relative; height: 40rem; margin-top: 4.5rem; }
.fan-phone { position: absolute; width: 18.1rem; will-change: transform; }
.fan-phone.inner.left { left: 50%; margin-left: -33.5rem; top: 4rem; }
.fan-phone.inner.right { left: 50%; margin-left: 15.4rem; top: 4rem; }
.fan-phone.outer.left { left: 50%; margin-left: -55rem; top: 8rem; }
.fan-phone.outer.right { left: 50%; margin-left: 36.9rem; top: 8rem; }
.fan-center { position: absolute; left: 50%; width: 28.1rem; margin-left: -14.05rem; top: 0; }

/* --- Topics strip -------------------------------------------------------- */
.marquee { overflow: hidden; margin-top: 4rem; padding: 1rem 0; }
.marquee-track { display: flex; gap: .25rem; width: max-content; animation: marquee 48s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.topic {
  display: flex; align-items: center; gap: .55rem; height: 4.75rem; padding: 0 1.4rem;
  border-radius: 1rem; background: var(--card); color: var(--ink-2); font-size: 1.3rem; font-weight: 600;
  box-shadow: var(--bevel-light);
}
.topic img { width: 2rem; height: 2rem; object-fit: contain; }

/* --- What's inside ------------------------------------------------------- */
.features { width: 81rem; max-width: calc(100vw - 2rem); margin: 7rem auto 0; }
.features-head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 2.75rem; }
.title { font-size: 3rem; line-height: 1.03; font-weight: 700; letter-spacing: -.035em; }
.features-side { width: 22rem; font-size: 1.25rem; line-height: 1.6; color: var(--ink-2); margin-right: 4rem; text-wrap: balance; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; }
.feature-card {
  height: 43rem; padding-top: 2.5rem; border-radius: 1rem; background: var(--card);
  display: flex; justify-content: center; box-shadow: var(--surface);
}
.feature-card .slot { width: 18.1rem; }
.feature h3 { margin-top: 1.5rem; font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
.feature p { margin-top: .6rem; max-width: 25rem; font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); padding-right: 1rem; }

/* --- Pinned: words drive the phone --------------------------------------- */
.pinned { height: 340vh; margin-top: 7rem; }
.pinned-sticky { position: sticky; top: 6rem; }
.pinned-card {
  position: relative;
  width: 81rem; max-width: calc(100vw - 2rem); height: calc(100vh - 7.75rem); margin: 0 auto;
  padding: 2rem; border-radius: 1rem; background: var(--card); box-shadow: var(--surface);
  display: flex; justify-content: space-between; gap: 2rem;
}
.pinned-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.statement { max-width: 47rem; font-size: 3rem; line-height: 1.16; font-weight: 700; letter-spacing: -.035em; }
.stages { position: relative; height: 8.5rem; overflow: hidden; }
.stage { position: absolute; left: 0; right: 0; bottom: 0; will-change: transform, opacity; }
.stage p { margin-top: .75rem; max-width: 34rem; font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); }
.tag {
  display: inline-flex; align-items: center; gap: .45rem; height: 1.75rem; padding: 0 .75rem 0 .3rem;
  border-radius: .5rem; background: var(--accent); color: var(--on-accent);
  font-size: .9375rem; font-weight: 600; box-shadow: var(--bevel-color);
}
.tag svg { width: 1.2rem; height: 1.2rem; padding: .22rem; border-radius: .34rem; background: rgba(255,255,255,.55); }
.pinned-phone { flex: none; width: min(18.1rem, calc((100vh - 11.5rem) * var(--phone))); margin-right: 2.25rem; align-self: center; }

/* --- Footer -------------------------------------------------------------- */
.footer { width: 81rem; max-width: calc(100vw - 2rem); margin: 3rem auto 1.5rem; display: grid; grid-template-columns: 22rem 1fr; gap: .25rem; }
.footer-dark { background: var(--dark); color: #fff; border-radius: 1rem; padding: 2rem; box-shadow: var(--bevel-dark); display: flex; flex-direction: column; justify-content: space-between; min-height: 20rem; }
.wordmark { font-size: 4.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--accent); }
.say { font-size: 1.0625rem; line-height: 1.5; color: rgba(255,255,255,.72); }
.say em { font-style: normal; color: #fff; font-weight: 600; }
.footer-light { background: var(--card); border-radius: 1rem; padding: 2rem; box-shadow: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.footer-light h2 { font-size: 3rem; line-height: 1.08; font-weight: 700; letter-spacing: -.035em; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: .375rem; flex-wrap: wrap; }
.footer-links a { height: 2.5rem; display: flex; align-items: center; padding: 0 1rem; border-radius: .75rem; background: var(--chip); box-shadow: var(--bevel-light); font-weight: 500; transition: transform .16s var(--ease); }
.footer-links a:active { transform: scale(.96); }
.footer small { font-size: .9375rem; color: var(--ink-3); }

/* --- Phone --------------------------------------------------------------- */
.phone { position: relative; width: 100%; aspect-ratio: var(--phone); container-type: inline-size; }
.phone-body {
  position: absolute; inset: 0; padding: 1.5cqw;
  border-radius: 15.5cqw;
  background: linear-gradient(145deg, #8b8f96, #2b2d31 22%, #1a1b1e 70%, #6f7278);
  box-shadow: 0 8cqw 16cqw -5cqw rgba(17,20,28,.36), 0 2cqw 5cqw rgba(17,20,28,.12);
}
.phone-body::before, .phone-body::after { content: ''; position: absolute; background: #2b2d31; border-radius: 1cqw; }
.phone-body::before { left: -.9cqw; top: 25%; width: 1cqw; height: 14%; box-shadow: 0 -8cqw 0 #2b2d31, 0 18cqw 0 #2b2d31; }
.phone-body::after { right: -.9cqw; top: 30%; width: 1cqw; height: 17%; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 14cqw; overflow: hidden; background: #0E0F12; }
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.carousel { position: absolute; inset: 0; will-change: transform; }
.carousel img { position: absolute; left: 0; width: 100%; height: 100%; }

/* The travelling layer: its phones sit over the page, moved by main.js. */
.stage-layer { position: absolute; top: 0; left: 0; width: 100%; height: 0; z-index: 20; pointer-events: none; }
.traveller { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.travel [data-own-hidden] > .phone { visibility: hidden; }

/* --- Small screens: no travelling; each phone stays where it is ---------- */
@media (max-width: 820px) {
  html { font-size: 16px; }
  .nav { width: calc(100vw - 2rem); margin-left: calc(-50vw + 1rem); }
  .hero { padding-top: 7rem; }
  .hero-copy { padding: 0 1rem; }
  .headline { font-size: clamp(2.1rem, 9.6vw, 3rem); }
  .stores { flex-wrap: wrap; }
  .fan { height: 92vw; margin-top: 3rem; overflow: hidden; }
  .fan-center { width: 54vw; margin-left: -27vw; }
  .fan-phone.outer { display: none; }
  .fan-phone { width: 40vw; }
  .fan-phone.inner.left { margin-left: -66vw; top: 8vw; }
  .fan-phone.inner.right { margin-left: 26vw; top: 8vw; }
  .marquee { margin-top: 1rem; }
  .topic { height: 3.5rem; font-size: 1.05rem; padding: 0 1rem; }
  .topic img { width: 1.5rem; height: 1.5rem; }
  .features { margin-top: 3.5rem; }
  .features-head { flex-direction: column; align-items: flex-start; gap: .75rem; padding-bottom: 1.5rem; }
  .title { font-size: 2.25rem; }
  .features-side { width: auto; margin: 0; font-size: 1.0625rem; }
  .cards { grid-template-columns: 1fr; gap: 2rem; }
  .feature-card { height: auto; max-height: 34rem; overflow: hidden; padding-top: 2rem; }
  .feature-card .slot { width: min(68vw, 16rem); }
  .pinned { margin-top: 3.5rem; height: 300vh; }
  .pinned-sticky { top: 4.5rem; }
  .pinned-card { height: calc(100svh - 5.5rem); flex-direction: column; padding: 1.25rem; gap: .75rem; overflow: hidden; }
  .pinned-copy { flex: none; gap: .75rem; }
  .statement { font-size: clamp(1.45rem, 6.4vw, 2rem); }
  .stages { height: 7.25rem; }
  .stage p { font-size: .95rem; margin-top: .4rem; }
  .pinned-phone { margin: 0 auto; width: min(60vw, calc((100svh - 22rem) * var(--phone))); }
  .footer { grid-template-columns: 1fr; margin-top: 2rem; }
  .footer-dark { min-height: 14rem; }
  .footer-light { gap: 3rem; }
  .footer-light h2 { font-size: 2.25rem; }
}

/* --- Reduced motion: everything readable, nothing travels ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .btn-3d, .token, .nav-menu { transition: none; }
}

/* --- Terms, privacy and guidelines --------------------------------------- */
/* Reading text stays a readable size at any window width. */
html.legal { font-size: clamp(15px, calc(100vw / 90.8), 18px); }
.doc { width: 66rem; max-width: calc(100vw - 2rem); margin: 0 auto; padding-top: 7.5rem; }
.doc-tabs { display: flex; gap: .375rem; flex-wrap: wrap; }
.doc-tabs a { height: 2.5rem; display: flex; align-items: center; padding: 0 1rem; border-radius: .75rem; background: var(--chip); color: var(--ink-2); box-shadow: var(--bevel-light); font-weight: 500; transition: transform .16s var(--ease); }
.doc-tabs a:active { transform: scale(.96); }
.doc-tabs a[aria-current] { background: var(--accent); color: var(--on-accent); box-shadow: var(--bevel-color); font-weight: 600; }
.doc-head { margin-top: 2.5rem; }
.doc-head h1 { font-size: 3.75rem; line-height: 1.08; font-weight: 700; letter-spacing: -.035em; }
.doc-lede { max-width: 42rem; margin-top: 1rem; font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.doc-date { margin-top: 1rem; font-size: .9375rem; color: var(--ink-3); }
.doc-body { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; align-items: start; margin-top: 3rem; }
.doc-toc { position: sticky; top: 5.5rem; display: grid; gap: .1rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
.doc-toc a { padding: .35rem 0; font-size: .9375rem; line-height: 1.3; color: var(--ink-2); }
.doc-toc a:hover { color: var(--ink); }
.doc-card { padding: 2.5rem; border-radius: 1rem; background: var(--card); box-shadow: var(--surface); }
.doc-card section { scroll-margin-top: 5.5rem; }
.doc-card section + section { margin-top: 2.5rem; }
.doc-card h2 { font-size: 1.625rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.doc-card h3 { margin-top: 1.25rem; font-size: 1.0625rem; font-weight: 600; }
.doc-card p, .doc-card li { font-size: 1.0625rem; line-height: 1.6; color: #3F4550; }
.doc-card p { margin-top: .75rem; max-width: 40rem; }
.doc-card ul { margin-top: .75rem; max-width: 40rem; padding-left: 1.25rem; }
.doc-card li + li { margin-top: .4rem; }
.doc-card li::marker { color: var(--accent); }
.doc-card strong { font-weight: 600; color: var(--ink); }
.doc-card a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .12em; text-underline-offset: .15em; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 3rem 0 1.5rem; }
.doc-foot small { font-size: .9375rem; color: var(--ink-3); }
.doc-foot .footer-links a { color: var(--ink); }

@media (max-width: 820px) {
  html.legal { font-size: 16px; }
  .doc { padding-top: 5.5rem; }
  .doc-head h1 { font-size: clamp(2.25rem, 10vw, 3rem); }
  .doc-lede { font-size: 1.125rem; }
  .doc-body { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2rem; }
  .doc-toc { display: none; } /* 18 links would bury the text on a phone */
  .doc-card { padding: 1.5rem 1.25rem; }
}
