/* Cupboard's design system, for every page on cupboard.bot.
 *
 * The tokens are the app's, copied from docs/design/redesign.html — the file
 * the Swift contract names as authoritative and packages/CupboardUI/Tokens.swift
 * is ported from. When the app's palette changes, change it there, then here.
 *
 * This file is the only place any of it is written down. It used to be pasted
 * into all four pages, and had drifted within a single commit: one copy lost
 * --urgent while three kept it.
 *
 * The Google Fonts <link> stays in each page's <head> rather than being
 * @imported here, deliberately: an @import inside a linked stylesheet costs an
 * extra serial round trip on the font CSS, which the landing page's LCP feels.
 * The family names themselves are tokens below, so a swap is still one edit.
 */

/* ---------- tokens ---------- */

:root {
  --ground: #e9eaec;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #e1e3e7;
  --line: #d7dadf;
  --line-strong: #bec3ca;
  --ink: #15181b;
  --ink-2: #565c63;
  --ink-3: #838a92;

  --accent: #14563a;
  --accent-hover: #0f4630;
  --on-accent: #ffffff;
  --accent-soft: #dcebe1;
  --on-accent-soft: #0f4a31;

  /* Semantic tones: have it, buy it, it is about to go off. */
  --have: #2e7d4f;
  --buy: #8a5a12;
  --urgent: #a33421;

  --shadow-1: 0 1px 2px rgba(19, 26, 21, 0.06);
  --shadow-2: 0 8px 28px -12px rgba(19, 26, 21, 0.22);

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --r-sm: 2px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-pill: 999px;

  /* How wide the page's column runs. Each page sets its own. */
  --wrap: 1080px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101315;
    --surface: #171b1e;
    --surface-2: #1d2226;
    --surface-3: #252b30;
    --line: #2b3237;
    --line-strong: #3c444b;
    --ink: #e6e9ec;
    --ink-2: #969da4;
    --ink-3: #6f767d;

    --accent: #59b685;
    --accent-hover: #6fc697;
    --on-accent: #06170e;
    --accent-soft: #16291e;
    --on-accent-soft: #9cddba;

    --have: #5ebe88;
    --buy: #d9a455;
    --urgent: #e88a75;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
a {
  color: inherit;
}

/* Vertical padding on a .wrap element goes in padding-block. A `padding`
   shorthand here silently zeroes the gutter, which is how the hero and the toy
   both ended up running edge to edge on a phone. */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- chrome ---------- */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px var(--gutter);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  text-decoration: none;
  color: inherit;
}
.mark {
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  flex: none;
}
.mark svg {
  width: 17px;
  height: 17px;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 32px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 26px;
  flex-wrap: wrap;
  gap: 14px;
}
footer .brand {
  font-size: 17px;
}
footer small {
  color: var(--ink-3);
  font-size: 13px;
}
footer small a,
footer a {
  color: var(--ink-3);
}

/* ---------- controls ---------- */

.btn {
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  transition: background .15s, border-color .15s;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.ghost:hover {
  background: var(--surface-3);
}
.btn.small {
  font-size: 14px;
  padding: 9px 15px;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- document pages ---------- */
/* The Privacy Policy and the Terms are one layout wearing two texts. */

body.doc {
  line-height: 1.6;
  --wrap: 760px;
}
.doc main {
  padding-bottom: 72px;
}
.doc header {
  padding-block: 24px 8px;
}
.doc h1 {
  font-size: clamp(32px, 5vw, 48px);
}
.doc h2 {
  font-size: 22px;
  margin: 40px 0 12px;
}
.doc p,
.doc li {
  font-size: 16px;
  margin: 0 0 14px;
}
.doc ul {
  padding-left: 22px;
  margin: 0 0 14px;
}
.doc li {
  margin-bottom: 8px;
}
.doc main a {
  color: var(--accent-hover);
}
.doc .lede {
  font-size: 18px;
  color: var(--ink-2);
  margin-top: 20px;
}
.doc .eff {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 16px;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}
.doc th,
.doc td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.doc .box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin: 0 0 18px;
}
.doc .box p:last-child {
  margin-bottom: 0;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
