/*
 * Spilla web — one stylesheet for the whole site.
 *
 * The palette is lifted from the app (spilla-app/src/constants/theme.ts), not
 * re-picked by eye: same black ground, same deeper-than-the-page cards, one
 * accent. If a value changes there, change it here too.
 */

:root {
  --background: #000000;
  --foreground: #f8f8f8;
  /* Cards are deeper than the page, not lighter. The border separates. */
  --card: #090406;
  --secondary: #170f12;
  --muted-foreground: #a9a2a6;
  --border: rgba(52, 35, 43, 0.55);
  --border-strong: #34232b;
  /* The one accent. */
  --hot: #f80a72;
  --on-hot: #fcfcfc;

  --radius-chip: 10px;
  --radius-tile: 14px;
  --radius-card: 18px;
  --radius-hero: 26px;

  --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
    Roboto, sans-serif;
  --font-display: 'Playfair Display', ui-serif, Georgia, 'Times New Roman',
    serif;

  /* The page column. Wider than the app's 430pt phone column — this is a
     desktop page, not a screenshot of the app. */
  --page: 1080px;
  --prose: 720px;
  --gutter: 22px;

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* A single wash of the accent behind the top of the page, so black does not
     read as "unstyled". Fixed so it does not travel on scroll. */
  background-image: radial-gradient(
    900px 520px at 50% -180px,
    rgba(248, 10, 114, 0.18),
    transparent 70%
  );
  background-repeat: no-repeat;
  background-attachment: fixed;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: var(--hot);
  color: var(--on-hot);
}

:focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------- Layout -------------------------------- */

.shell {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--hot);
  color: var(--on-hot);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-chip) 0;
  font-weight: 700;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* --------------------------------- Header -------------------------------- */

.site-header {
  padding-block: 26px 8px;
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--foreground);
}

.wordmark svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.wordmark span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -0.4px;
  line-height: 1;
}

.wordmark .dot {
  color: var(--hot);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 600;
}

.header-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

.header-nav a:hover {
  color: var(--foreground);
}

@media (max-width: 560px) {
  .header-nav {
    gap: 16px;
    font-size: 13px;
  }
}

/* ---------------------------------- Hero --------------------------------- */

.hero {
  padding-block: 64px 72px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  /* No text-transform: the copy is already capitalised by hand, so that the
     lowercase i in "iOS" survives. */
  color: var(--hot);
  border: 1px solid var(--border-strong);
  background: var(--secondary);
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 0 26px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  /* One fluid step: 44px on a phone, 92px on a wide screen. */
  font-size: clamp(44px, 9vw, 92px);
  line-height: 0.98;
  letter-spacing: -1.5px;
  margin: 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--hot);
}

.hero .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(19px, 3vw, 25px);
  color: var(--foreground);
  margin: 18px 0 0;
}

.hero p.lead {
  max-width: 54ch;
  margin: 20px auto 0;
  color: var(--muted-foreground);
  font-size: 17px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn-primary {
  background: var(--hot);
  color: var(--on-hot);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--secondary);
  border-color: var(--border);
  color: var(--foreground);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* -------------------------------- Sections ------------------------------- */

.section {
  padding-block: 56px;
}

.section-head {
  max-width: 46ch;
  margin-bottom: 30px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.6px;
  margin: 0;
}

.section-head p {
  color: var(--muted-foreground);
  margin: 12px 0 0;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.card h3 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.2px;
  margin: 14px 0 8px;
  font-weight: 800;
}

.card p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 15px;
}

.card .icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-chip);
  background: rgba(248, 10, 114, 0.12);
  color: var(--hot);
}

.card .icon svg {
  width: 21px;
  height: 21px;
}

/* The strip of legal / help links above the footer. */
.link-grid {
  display: grid;
  gap: 12px;
  /* 300px, so the six links land as 3 x 2 rather than 4 + 2. */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.link-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  padding: 18px 20px;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.link-card:hover {
  border-color: var(--hot);
  background: var(--secondary);
}

.link-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.link-card span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* --------------------------------- Footer -------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-block: 40px 56px;
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 14px;
  max-width: 620px;
}

.footer-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.colophon {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 0;
}

/* ------------------------------- Prose pages ----------------------------- */

.doc {
  max-width: var(--prose);
  margin-inline: auto;
  padding-block: 44px 8px;
}

.doc .kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--hot);
  margin: 0 0 12px;
}

.doc h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 0;
}

.doc .updated {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 14px 0 0;
}

.doc .intro {
  font-size: 18px;
  color: var(--foreground);
  margin: 26px 0 0;
}

.doc h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 44px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.doc h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 26px 0 8px;
}

.doc p,
.doc li {
  color: var(--muted-foreground);
}

.doc p {
  margin: 0 0 14px;
}

.doc ul,
.doc ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc li {
  margin-bottom: 8px;
}

.doc a {
  color: var(--hot);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc strong {
  color: var(--foreground);
  font-weight: 700;
}

.doc .callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--hot);
  border-radius: var(--radius-tile);
  padding: 18px 20px;
  margin: 26px 0;
}

.doc .callout p:last-child {
  margin-bottom: 0;
}

.doc dl {
  margin: 0 0 14px;
}

.doc dt {
  color: var(--foreground);
  font-weight: 700;
  margin-top: 16px;
}

.doc dd {
  margin: 4px 0 0;
  color: var(--muted-foreground);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
  margin-top: 40px;
}

.back:hover {
  color: var(--foreground);
}

/* ------------------------------- Not found ------------------------------- */

.notfound {
  text-align: center;
  padding-block: 100px 60px;
}

.notfound h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(46px, 10vw, 84px);
  margin: 0;
  letter-spacing: -1.5px;
}

.notfound p {
  color: var(--muted-foreground);
  margin: 14px 0 30px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
