/* Boxley website. Colours are the app's day and night tokens (Docs/BRAND_DESIGN_SYSTEM.md). */
:root {
  --canvas: #FDF9F0;
  --card: #FFFCF7;
  --ink: #19365F;
  --muted: #52636A;
  --line: #E8DCCB;
  --tonal: #FFF3DA;
  --action: #C8432C;
  --action-label: #FFFFFF;
  --action-surface: #FCE8E5;
  --action-surface-label: #B43722;
  --create: #246B4B;
  --photo: #087682;
  --play: #B83C67;
  --story: #7450AA;
  --library: #286BB2;
  --paper: #FFFFFF;
  --shadow: 0 1px 2px rgb(25 54 95 / 0.06), 0 8px 24px rgb(25 54 95 / 0.08);
  --town: url("/images/town-day-strip.webp");
  --radius: 24px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #151F2C;
    --card: #22303F;
    --ink: #FDF9F0;
    --muted: #C6CFD8;
    --line: #3A4A5C;
    --tonal: #1C2836;
    --action: #FF9A80;
    --action-label: #19365F;
    --action-surface: #492B27;
    --action-surface-label: #FF9A80;
    --create: #99DBAE;
    --photo: #80D6DE;
    --play: #FFA1BD;
    --story: #C8ADF2;
    --library: #9AC7FF;
    --paper: #FFFFFF;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    --town: url("/images/town-night-strip.webp");
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--library); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin-bottom: 0.9em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}
.narrow { max-width: 780px; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--card);
  padding: 8px 14px;
  border-radius: 12px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Header */
.top { padding: 14px 0; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand img { width: 116px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; font-weight: 600; }
.nav a { text-decoration: none; padding: 6px 2px; }
.nav a:hover { text-decoration: underline; }

/* Hero: the cardboard town lines the foot, as on the app's creative screens. */
.hero { padding-top: clamp(16px, 4vw, 48px); }
.town {
  height: clamp(110px, 22vw, 300px);
  background: var(--town) center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%);
  mask-image: linear-gradient(to bottom, transparent, #000 35%);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(16px, 4vw, 56px);
}
.eyebrow { font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin-bottom: 0.6em; }
.lede { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); max-width: 34em; }
.hero-art { width: 100%; max-width: 460px; justify-self: center; filter: drop-shadow(0 10px 18px rgb(25 54 95 / 0.12)); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 1.4em 0 1em; }
.soon {
  margin: 0;
  background: var(--action);
  color: var(--action-label);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
}
.button-tonal {
  background: var(--action-surface);
  color: var(--action-surface-label);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
}
.button-tonal:hover { text-decoration: underline; }
.note { color: var(--muted); font-weight: 600; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 210px; grid-row: 1; }
}
@media (max-width: 480px) {
  .brand img { width: 88px; }
  .nav { gap: 2px 14px; font-size: 0.95rem; }
}

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-lede { font-size: 1.15rem; max-width: 40em; margin-top: -0.4em; margin-bottom: 1.6em; }

/* The app's heading brush swipe, tinted with the brand coral at 35%. */
.swipe { position: relative; z-index: 0; display: inline; }
.swipe::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.3em;
  right: -0.3em;
  bottom: -0.12em;
  height: 0.62em;
  background: var(--action);
  opacity: 0.35;
  -webkit-mask: url("/images/brush-swipe.webp") center / 100% 100% no-repeat;
  mask: url("/images/brush-swipe.webp") center / 100% 100% no-repeat;
}

/* Feature cards: each wears the colour of its section in the app. */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}
.card {
  --accent: var(--library);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 8px;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--accent);
}
.card img { width: 104px; height: 104px; margin: -6px 0 6px -6px; }
.card h3 { color: var(--accent); }
@media (max-width: 480px) {
  .card { display: grid; grid-template-columns: 76px 1fr; column-gap: 12px; padding: 16px 18px 6px; }
  .card img { grid-row: span 2; width: 76px; height: 76px; margin: 0; }
}
.card.create { --accent: var(--create); }
.card.photo { --accent: var(--photo); }
.card.play { --accent: var(--play); }
.card.story { --accent: var(--story); }

/* Sample pages taped up like the Library's wall. */
.strip-title { margin-top: 2.6em; text-align: center; color: var(--muted); }
.pages {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 32px);
}
.pages li {
  position: relative;
  background: var(--paper);
  padding: 10px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
}
.pages li:nth-child(2n) { transform: rotate(1.5deg); }
.pages li::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 22px;
  margin-left: -36px;
  background: rgb(248 184 75 / 0.55);
  transform: rotate(-3deg);
  border-radius: 2px;
}
@media (max-width: 760px) {
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Parents */
.parents { background: var(--tonal); }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 18px;
  margin-bottom: 40px;
}
.facts.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); margin-top: 40px; }
.fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 8px;
}

.table-title { font-size: 1.5rem; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: 16px 20px 4px; color: var(--muted); font-weight: 600; }
th, td { text-align: left; vertical-align: top; padding: 14px 20px; border-top: 1px solid var(--line); }
thead th { color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
tbody th { font-weight: 700; width: 32%; }

/* On phones each row becomes a small card with its column names. */
@media (max-width: 640px) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, caption, tbody, tr, th, td { display: block; width: auto; }
  tbody tr { border-top: 1px solid var(--line); padding: 8px 0; }
  tbody th, tbody td { border: 0; padding: 6px 20px; width: auto; }
  tbody td::before { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  tbody td:nth-of-type(1)::before { content: "What it needs from you"; }
  tbody td:nth-of-type(2)::before { content: "What leaves the device"; }
}

.policies { margin-top: 8px; }
.policies ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 6px 24px;
}
.policies a { display: inline-block; padding: 6px 0; font-weight: 600; }

/* Questions */
details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 20px;
  margin-bottom: 12px;
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
  list-style-position: outside;
}
details[open] summary { padding-bottom: 8px; }
details p { color: var(--ink); }

/* Not-found page */
.missing { text-align: center; }
.missing img { width: 180px; margin: 0 auto 8px; }
.missing .button-tonal { display: inline-block; margin-top: 8px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 28px; color: var(--muted); font-size: 0.95rem; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot-mark { width: 104px; margin-bottom: 12px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 600; }
.foot-links a { color: var(--ink); }
.small { font-size: 0.85rem; margin-top: 24px; }
