/* ChromaTap site: landing pages (built by build.mjs) and the privacy/support documents (main.doc).
   "Ink on paper", like the app: the parchment palette from src/theme/palettes.ts and Lora for headings. */
@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #efe9db;
  --surface: #f6f1e5;
  --text: #2b2926;
  --muted: #8f887a;
  --body: #5c574e;
  --line: rgba(43, 41, 38, 0.14);
  --accent: #3f6152;
  --accent-ink: #f6f1e5;
  --accent-soft: rgba(63, 97, 82, 0.1);
  --secondary: #6e93a0;
  --band: #2b2926;
  --band-text: #ede7d9;
  --band-muted: rgba(237, 231, 217, 0.7);
  --glow: rgba(110, 147, 160, 0.35);
  --shadow: 0 30px 60px -20px rgba(43, 41, 38, 0.35), 0 12px 24px -12px rgba(43, 41, 38, 0.2);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #242220;
    --surface: #2e2b28;
    --text: #ede7d9;
    --muted: #9a9385;
    --body: #b9b2a4;
    --line: rgba(237, 231, 217, 0.14);
    --accent: #6ba089;
    --accent-ink: #242220;
    --accent-soft: rgba(107, 160, 137, 0.14);
    --secondary: #7fa3af;
    --band: #1a1917;
    --glow: rgba(127, 163, 175, 0.2);
    --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(237, 231, 217, 0.06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1, h2 { font-family: Lora, Georgia, 'Iowan Old Style', serif; letter-spacing: -0.015em; }
h2 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; }
h3 { font-size: 19px; letter-spacing: -0.01em; }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--body); margin: 0; }
.eyebrow { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 16px; }

/* Buttons and chips */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 999px;
  transition: filter 0.15s ease;
}
.button:hover { filter: brightness(1.08); }
.button.small { padding: 8px 16px; font-size: 15px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.chips li { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px max(16px, calc((100% - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-family: Lora, Georgia, serif; font-weight: 600; font-size: 19px; text-decoration: none; margin-right: auto; }
.brand img { border-radius: 7px; }
.nav nav { display: flex; gap: 22px; font-size: 15px; }
.nav nav a { color: var(--muted); text-decoration: none; }
.nav nav a:hover { color: var(--text); }
.nav > *, .button { white-space: nowrap; }
.button .short { display: none; }
@media (max-width: 720px) {
  .nav nav a:not([hreflang]) { display: none; }
  .nav { gap: 14px; }
}
@media (max-width: 560px) {
  .button .long { display: none; }
  .button .short { display: inline; }
}

/* Landing layout */
main:not(.doc) { overflow-x: clip; }
.section, .hero, .showcase, .final { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
  padding-top: clamp(48px, 9vw, 110px);
  padding-bottom: clamp(56px, 9vw, 120px);
}
.hero h1 { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.06; margin-bottom: 22px; }
.hero h1 span { color: var(--accent); }
.hero .lead { margin-bottom: 32px; max-width: 32em; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.cta-row.center { justify-content: center; }

/* Phones: real screenshots in a rounded frame (no device artwork) */
.phone {
  margin: 0;
  width: 270px;
  aspect-ratio: 660 / 1434;
  border-radius: 44px;
  padding: 7px;
  background: linear-gradient(160deg, #3a3835, #1c1b19);
  box-shadow: var(--shadow);
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 37px; }
.hero-phones { position: relative; display: flex; justify-content: center; align-items: center; min-height: 600px; }
.hero-phones::before {
  content: '';
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  filter: blur(20px);
}
.hero-phones .front { position: relative; z-index: 2; }
.hero-phones .side { position: absolute; width: 230px; opacity: 0.95; }
.hero-phones .left { transform: translateX(-62%) rotate(-7deg) scale(0.92); }
.hero-phones .right { transform: translateX(62%) rotate(7deg) scale(0.92); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .cta-row, .hero .chips { justify-content: center; }
  .hero-phones { min-height: 520px; }
  .phone { width: 240px; }
  .hero-phones .side { width: 200px; }
}
@media (max-width: 520px) {
  .hero-phones .left { transform: translateX(-48%) rotate(-7deg) scale(0.85); }
  .hero-phones .right { transform: translateX(48%) rotate(7deg) scale(0.85); }
}

/* Feature grid */
.section { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
.section > h2 { text-align: center; max-width: 16em; margin: 0 auto 48px; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border-radius: 24px; padding: 26px 24px; border: 1px solid var(--line); }
.tile p { color: var(--body); margin: 8px 0 0; font-size: 16px; }
.icon { width: 32px; height: 32px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 5px; margin-bottom: 18px; }

/* Showcase rows */
.showcase { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: clamp(32px, 7vw, 96px); padding-top: 40px; padding-bottom: 40px; }
.showcase.flip { grid-template-columns: auto 1fr; }
.showcase.flip .phone { order: -1; }
.showcase-copy { max-width: 30em; }
.showcase-copy h2 { margin-bottom: 16px; }
@media (max-width: 760px) {
  .showcase, .showcase.flip { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .showcase.flip .phone { order: 0; }
}

/* "No nonsense" band */
.band { background: var(--band); color: var(--band-text); margin: clamp(56px, 8vw, 96px) 0; }
.band-inner { max-width: 1120px; margin: 0 auto; padding: clamp(64px, 9vw, 112px) 16px; text-align: center; }
.band .icon { width: 48px; height: 48px; padding: 9px; border-radius: 14px; color: #8fc2ab; background: rgba(143, 194, 171, 0.14); }
.band h2 { margin-bottom: 14px; }
.band .lead { color: var(--band-muted); }
.trio { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; text-align: left; }
.trio p { color: var(--band-muted); margin: 8px 0 0; }

/* FAQ */
.narrow { max-width: 760px; }
details { border-bottom: 1px solid var(--line); padding: 18px 4px; }
summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--accent); font-weight: 400; font-size: 24px; line-height: 1; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--body); margin: 10px 0 0; }

/* Closing call to action */
.final { text-align: center; padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(72px, 10vw, 128px); }
.final img { border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 28px; }
.final h2 { margin-bottom: 14px; }
.final .lead { margin-bottom: 32px; }

.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--muted);
  font-size: 14px;
}
.footer span { margin-right: auto; }

/* Privacy policy and support pages */
.doc { max-width: 680px; margin: 0 auto; padding: 72px 20px 56px; }
.doc h1 { font-size: 40px; line-height: 1.1; margin: 0 0 20px; }
.doc h2 { font-size: 26px; margin: 44px 0 12px; }
.doc h3 { margin: 32px 0 6px; }
.doc p, .doc li { color: var(--body); }
.doc strong { color: var(--text); }
.doc .eyebrow a { text-decoration: none; }
.doc .muted { color: var(--muted); font-style: italic; }
.doc .lede { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.doc .lede p { margin: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.doc ul { padding-left: 20px; }
.doc a { color: var(--accent); }

/* Official App Store badge (min 40 pt high, clear space around it) */
.badge { display: inline-block; line-height: 0; padding: 2px; }
.badge img { height: 54px; width: auto; }

/* Hero demo: a playable round of the game inside the phone (demo.js). Sizes in cqw so it scales with the phone. */
.demo { container-type: inline-size; position: relative; overflow: hidden; }
.demo.live > img { visibility: hidden; }
.game {
  position: absolute;
  inset: 7px;
  border-radius: 37px;
  overflow: hidden;
  background: #efe9db;
  color: #2b2926;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16cqw 7cqw 10cqw;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}
.g-mode { font-size: 3.2cqw; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: #8f887a; }
.g-level { font-family: Lora, Georgia, serif; font-weight: 600; font-size: 13cqw; line-height: 1.1; margin: 1cqw 0 0; font-variant-numeric: tabular-nums; }
.g-label { font-size: 3.4cqw; color: #8f887a; }
.g-board {
  margin: auto 0;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  gap: 2.2cqw;
  padding: 3cqw;
  border-radius: 6cqw;
  background: #f6f1e5;
  box-shadow: 0 2cqw 6cqw rgba(43, 41, 38, 0.12);
}
.g-board.shake { animation: shake 0.35s ease; }
.g-board button {
  border: 0;
  padding: 0;
  border-radius: 2.6cqw;
  cursor: pointer;
  transition: background-color 0.35s ease;
}
.g-board button:focus-visible { outline: 0.8cqw solid #2b2926; outline-offset: 0.6cqw; }
.g-hint { font-size: 3.6cqw; color: #5c574e; min-height: 2.6em; }
@keyframes shake {
  20% { transform: translateX(-2.5%); }
  40% { transform: translateX(2.5%); }
  60% { transform: translateX(-1.5%); }
  80% { transform: translateX(1.5%); }
}

/* The side phones float a little; `translate` keeps their own tilt and position intact. */
.hero-phones .left { animation: float 6s ease-in-out infinite alternate; }
.hero-phones .right { animation: float 6s ease-in-out -3s infinite alternate; }
@keyframes float { from { translate: 0 6px; } to { translate: 0 -10px; } }

@media (prefers-reduced-motion: reduce) {
  .hero-phones .side { animation: none; }
  .g-board.shake { animation: none; }
  .g-board button { transition: none; }
}

/* "Coming soon to Android": same height as the App Store badge, clearly not a button */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.soon svg { width: 20px; height: 20px; }
