/*
 * xenofables.com: one stylesheet for every page.
 *
 * The CSP (apps/website/nginx.conf) allows styles from this file only, so the
 * pages carry no style attribute and no style block. Fonts and screenshots are
 * served from /derived/, which the Dockerfile builds from the app's own files.
 *
 * Dark is the default because the app is dark by default; the light scheme
 * follows the visitor's system setting. Colour lives in the tokens below and
 * nowhere else.
 */

@font-face {
  font-family: "Inter";
  src: url("/derived/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/derived/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/derived/SpaceGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/derived/SpaceGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── tokens ────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  /* The brand coral, `kBrandSeedColor` in the app's brand_theme.dart. */
  --coral: #ff5c57;
  --bg: #0f0b0b;
  --surface: #171212;
  --surface-2: #201918;
  --line: #2e2423;
  --text: #f7f1f0;
  --muted: #b6a9a7;
  /* Coral used AS TEXT on --bg, lifted so it reads at body size. */
  --accent-ink: #ff7b76;
  --accent-wash: rgba(255, 92, 87, 0.12);
  --glow: rgba(255, 92, 87, 0.26);
  /* Text on a coral fill: dark ink, because white on this coral is under 3:1. */
  --on-coral: #250b09;
  --shadow: 0 32px 64px -28px rgba(0, 0, 0, 0.75);
  --radius: 20px;
  --gutter: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #fcf8f7;
    --surface: #ffffff;
    --surface-2: #f7eeec;
    --line: #eadcd9;
    --text: #1d1514;
    --muted: #6a5c5a;
    --accent-ink: #c22f2a;
    --accent-wash: rgba(255, 92, 87, 0.1);
    --glow: rgba(255, 92, 87, 0.2);
    --shadow: 0 32px 64px -32px rgba(90, 24, 18, 0.35);
  }
}

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
}

/* ── base ──────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* The coral glow at the top of every page. Explicit radii, so the ellipse is
   the same size at any width and never widens the page. */
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 620px 540px at 50% -120px, var(--glow), transparent);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1rem/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 6px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--coral);
  color: var(--on-coral);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ── header ────────────────────────────────────────────────────────────── */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.wordmark {
  font: 700 1.125rem/1 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

/* ── hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding: 40px 0 8px;
  text-align: center;
}

.app-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 22px;
  box-shadow: 0 20px 44px -14px rgba(255, 92, 87, 0.6);
}

.eyebrow {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 12px;
  font-size: clamp(3.25rem, 14vw, 6.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.tagline {
  margin-top: 16px;
  font: 500 clamp(1.5rem, 5.5vw, 2.5rem)/1.15 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.tagline span {
  color: var(--coral);
}

.hero .lead {
  max-width: 34rem;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  text-wrap: pretty;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;   /* the hero and the call to action centre their content; a flex row ignores text-align */
  gap: 4px 12px;
  margin-top: 20px;
}

.store-badge {
  display: inline-block;
  border-radius: 12px;
}

.store-badge img {
  /* The Play artwork carries its own clear space, so the visible badge is ~2/3 of this. */
  height: 76px;
  width: auto;
}

.store-badge.app-store img {
  /* Apple's artwork has no clear space: drawn at the Play badge's visible height. */
  height: 51px;
}

/* ── screenshots ───────────────────────────────────────────────────────── */

.gallery {
  padding: 32px 0 16px;
}

.shots {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 8px var(--gutter) 24px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.shots li {
  flex: 0 0 68%;
  max-width: 300px;
  scroll-snap-align: start;
}

.shots img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

@media (min-width: 960px) {
  .shots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1032px;
    margin: 0 auto;
    overflow: visible;
  }

  .shots li {
    max-width: none;
  }

  /* A gentle stagger, so the grid reads as a gallery rather than a table. */
  .shots li:nth-child(3n + 2) {
    transform: translateY(32px);
  }
}

/* ── sections ──────────────────────────────────────────────────────────── */

.section {
  padding: 72px 0;
}

.section + .section {
  padding-top: 24px;
}

.kicker {
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section h2 {
  margin-top: 10px;
  font-size: clamp(1.875rem, 5vw, 2.75rem);
}

.section-lead {
  max-width: 38rem;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* ── feature cards ─────────────────────────────────────────────────────── */

.features {
  display: grid;
  gap: 16px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

/* Icon beside the title, body text under both: compact enough that seven cards
   stacked on a phone stay a short scroll. */
.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  /* Cards in one grid row share its height; keep the content at the top. */
  align-content: start;
  column-gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature h3 {
  font-size: 1.1875rem;
}

.feature p {
  grid-column: 1 / -1;
  margin-top: 12px;
  color: var(--muted);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-lead {
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-wash), transparent 60%),
    var(--surface);
}

.feature-lead h3 {
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
}

.feature-lead p {
  max-width: 40rem;
  font-size: 1.0625rem;
}

/* Scoped under .feature so it outranks `.feature p` and keeps its own ink. */
.feature .prompt {
  justify-self: start;
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  background: var(--coral);
  color: var(--on-coral);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .feature-lead {
    grid-column: 1 / -1;
    padding: 32px;
  }
}

@media (min-width: 1040px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Pro + privacy ─────────────────────────────────────────────────────── */

.split {
  display: grid;
  gap: 16px;
  margin-top: 36px;
}

@media (min-width: 860px) {
  .split {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.panel {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel h3 {
  font-size: 1.375rem;
}

.ticks {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 32px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-wash);
}

.ticks li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: calc(0.2em + 5px);
  width: 5px;
  height: 9px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.fine-print {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ── closing call to action ────────────────────────────────────────────── */

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  text-align: center;
}

.cta::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(70% 90% at 50% 120%, var(--glow), transparent 70%);
}

.cta h2 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.cta p {
  margin-top: 12px;
  color: var(--muted);
}

/* ── support page ──────────────────────────────────────────────────────── */

.page-head {
  padding: 40px 0 8px;
}

.page-head h1 {
  font-size: clamp(2.5rem, 9vw, 4rem);
  letter-spacing: -0.03em;
}

.page-head .lead {
  max-width: 36rem;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.0625rem;
}

.contact-card {
  display: grid;
  gap: 18px;
  margin-top: 32px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 160% at 100% 0%, var(--accent-wash), transparent 60%),
    var(--surface);
}

.contact-card h2 {
  font-size: 1.5rem;
}

.contact-card p {
  margin-top: 8px;
  color: var(--muted);
}

@media (min-width: 760px) {
  .contact-card {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 32px;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--on-coral);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.button:hover {
  filter: brightness(1.06);
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.toc a:hover {
  border-color: var(--coral);
}

.help-list {
  display: grid;
  gap: 16px;
  padding: 40px 0 24px;
}

.help {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 24px;
}

.help h2 {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
}

.help h3 {
  margin-top: 22px;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.help p {
  margin-top: 12px;
  color: var(--muted);
  max-width: 44rem;
}

.help p strong,
.help li strong {
  color: var(--text);
  font-weight: 600;
}

.steps {
  margin: 12px 0 0;
  padding-left: 1.4em;
  color: var(--muted);
}

.steps li + li {
  margin-top: 6px;
}

.steps li::marker {
  color: var(--accent-ink);
  font-weight: 600;
}

.note {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--coral);
  border-radius: 0 12px 12px 0;
  background: var(--accent-wash);
  color: var(--text);
}

@media (min-width: 760px) {
  .help {
    padding: 32px;
  }
}

/* ── 404 ───────────────────────────────────────────────────────────────── */

.not-found {
  padding: 96px 0 120px;
  text-align: center;
}

.not-found .code {
  color: var(--coral);
  font: 700 clamp(4rem, 20vw, 8rem)/1 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.05em;
}

.not-found h1 {
  margin-top: 8px;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

.not-found p {
  margin-top: 12px;
  color: var(--muted);
}

.not-found .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.button-quiet {
  background: var(--surface-2);
  color: var(--text);
}

/* ── footer ────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 36px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 20px;
}

.footer-brand {
  color: var(--text);
  font: 700 1.0625rem/1.3 "Space Grotesk", system-ui, sans-serif;
}

.footer-brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 400 0.9375rem/1.5 "Inter", system-ui, sans-serif;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer-links a:hover {
  color: var(--accent-ink);
}

.legal {
  font-size: 0.8125rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .legal {
    grid-column: 1 / -1;
  }
}
