/* reHydrate landing page.
 *
 * Tokens copied verbatim from `ui/src/styles.css` so the marketing
 * page reads as a quieter cousin of the app, not a separate brand.
 * No JavaScript, no build step, no framework — one HTML and one
 * CSS file. The whole site weighs less than the dialog box that
 * inspired it. */

:root {
  /* Surfaces */
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-sunken: #f5f5f7;
  --border: #ececef;

  /* Text */
  --text: #0f0f10;
  --muted: #6e6e76;

  /* Accent — same blue used in the app's toolbar buttons. */
  --accent: #2960e6;
  --accent-bg: #e7eefc;
  --accent-fg: #ffffff;

  /* Primary action: a near-black, the way modern docs/marketing
   * pages anchor their CTA. Brand accent is reserved for the
   * logo, links, and small flourishes. */
  --primary: #111113;
  --primary-fg: #ffffff;

  /* Spacing */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  /* Radius */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Type — read-on-paper sizing. The app is dense; the landing
   * page deliberately isn't. System fonts only; whatever the OS
   * ships looks better than any web font on the platforms the
   * app itself runs on. */
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
    system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --bg-elev: #161618;
    --bg-sunken: #1a1a1d;
    --border: #26262a;
    --text: #f2f2f4;
    --muted: #8e8e98;
    --accent: #6792f5;
    --accent-bg: #1f2c4a;
    --primary: #f2f2f4;
    --primary-fg: #0c0c0e;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =====================================================================
 * Top nav — a single thin row at the top of every page. Logo on
 * the left, two text links on the right. No background fill, no
 * border; the whitespace below it does the separating.
 * ===================================================================== */

.topnav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.topnav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.topnav__brand:hover {
  text-decoration: none;
}
.topnav__mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.topnav__name {
  font-size: 17px;
}
.topnav__links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
}
.topnav__links a {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.topnav__links a:hover {
  color: var(--muted);
  text-decoration: none;
}

/* =====================================================================
 * Hero — centred, generous whitespace. Sets the tone before the
 * reader has to scroll.
 * ===================================================================== */

.hero {
  text-align: center;
  padding: var(--space-7) var(--space-5) var(--space-8);
  max-width: 880px;
  margin: 0 auto;
}

/* Logo back at full size as the lead visual — the bottle motif
 * is the brand mark and it carries the page on its own without
 * needing a photo above it. */
.hero__logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(15, 15, 16, 0.08));
  margin-bottom: var(--space-5);
}

.hero h1 {
  margin: 0 0 var(--space-3);
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--text);
}

.hero__tagline {
  margin: 0 auto var(--space-4);
  max-width: 600px;
  font-size: 22px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.32;
}

.hero__lede {
  margin: 0 auto;
  max-width: 580px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
}

.hero__cta {
  margin-top: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}
.hero__cta-row {
  margin: 0;
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* =====================================================================
 * Buttons — match the app's primary / ghost styling.
 * ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  background: var(--primary);
  color: var(--primary-fg);
  border: 1px solid var(--primary);
  transition: background 140ms ease, transform 140ms ease,
    box-shadow 140ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn:hover {
  background: color-mix(in srgb, var(--primary), white 12%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn--ghost:hover {
  background: var(--bg-sunken);
  box-shadow: none;
  transform: none;
}

/* Platform-specific download buttons stack the OS name above a
 * smaller architecture / installer-format hint, so a glance tells
 * the reader "this is the macOS Apple Silicon build" without
 * making the button text wrap awkwardly. */
.btn .btn__platform {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.btn .btn__detail {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.2;
  margin-top: 2px;
}
#downloads .btn {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 20px;
  min-width: 140px;
  border-radius: 10px;
}

/* =====================================================================
 * Sections — single column, comfortable measure, generous gaps.
 * Each section is set off by a hairline border above it; first
 * section keeps no border so the hero flows in.
 * ===================================================================== */

main {
  flex: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Sections separate by whitespace alone — no hairline borders.
 * The page is short enough that the rhythm reads, and skipping
 * the borders makes the whole thing feel calmer. */
section {
  padding: var(--space-8) 0;
}
section:first-child {
  padding-top: var(--space-6);
}
section:last-child {
  padding-bottom: var(--space-7);
}

section h2 {
  margin: 0 0 var(--space-5);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
}

section p {
  margin: 0 0 var(--space-4);
  color: var(--text);
  font-size: 18px;
  line-height: 1.65;
}
section p:last-child {
  margin-bottom: 0;
}

section ul {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}
section ul li {
  margin-bottom: var(--space-2);
}
section ul li:last-child {
  margin-bottom: 0;
}

/* The privacy-invariants list reads as a checklist of guarantees.
 * No row borders — the dot bullet alone carries the rhythm. */
section ul.invariants {
  padding-left: 0;
  list-style: none;
}
section ul.invariants li {
  position: relative;
  padding: 10px 0 10px 32px;
  font-size: 17px;
  line-height: 1.55;
}
section ul.invariants li::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 6px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Code styling — comfortable and unflashy. Inline code uses a
 * subtle accent tint; block code is on the elevated surface. */

code {
  font-family: ui-monospace, SFMono-Regular, "Menlo", "Consolas",
    "DejaVu Sans Mono", monospace;
  font-size: 0.92em;
  background: var(--bg-sunken);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  border: 1px solid var(--border);
}

pre {
  margin: var(--space-3) 0;
  padding: var(--space-4);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: var(--text);
}

/* Links — inherit colour by default, use the accent only on
 * hover so the body text stays calm. */

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.muted {
  color: var(--muted);
}

strong, em {
  color: var(--text);
}

em {
  font-style: italic;
}

/* =====================================================================
 * Footer — single line, subdued.
 * ===================================================================== */

footer {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-7);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
footer p {
  margin: 0;
}

/* =====================================================================
 * Story sections — the narrative arc that walks the reader from
 * "you write on the tablet" to "and here's what reHydrate does
 * with it." Visually identical to a plain section, with a few
 * affordances for embedded images.
 * ===================================================================== */

/* Generic figure inside a story section. Images run no borders
 * and no shadows — they sit on the page background and let their
 * own framing carry them. The photos already have soft edges in
 * the composition; layering a CSS frame on top muddies that. */
.story__figure {
  margin: var(--space-6) 0;
  text-align: center;
}
.story__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* Screenshots: no frame at all. The window chrome inside the
 * screenshot already reads as a window; a CSS border would just
 * double-frame it. */
.story__figure--screenshot {
  margin: var(--space-6) auto;
}
.story__figure--screenshot img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* The Ollama section uses a two-column layout: llama on the left,
 * prose on the right. Falls back to stacked on mobile. */
.story__split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  align-items: center;
  margin: var(--space-5) 0;
}
/* Even-split modifier — used in "Why this exists" where the
 * accompanying image is a photo of equal visual weight to the
 * prose column, not a small inline mascot. */
.story__split--even {
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.story__split--even .story__figure img {
  border-radius: var(--radius-lg);
}
.story__figure--inline {
  margin: 0;
}
.story__llama {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Small caption-style text under an inline figure. */
section .small {
  font-size: 15px;
  color: var(--muted);
  margin-top: calc(var(--space-3) * -1);
}

/* =====================================================================
 * Mobile — narrower padding, slightly smaller hero type. The page
 * is so vertical that mobile mostly just inherits the desktop
 * layout; only the type scale and gutters need tuning.
 * ===================================================================== */

@media (max-width: 640px) {
  :root {
    font-size: 17px;
  }
  .topnav {
    padding: 16px var(--space-4);
  }
  .topnav__links {
    gap: var(--space-4);
  }
  .hero {
    padding: var(--space-6) var(--space-4) var(--space-6);
  }
  .hero h1 {
    font-size: 44px;
    letter-spacing: -0.035em;
  }
  .hero__tagline {
    font-size: 20px;
  }
  .hero__lede {
    font-size: 17px;
  }
  .hero__logo {
    width: 96px;
    height: 96px;
  }
  main, footer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  section {
    padding: var(--space-7) 0;
  }
  section h2 {
    font-size: 26px;
  }
  section p {
    font-size: 17px;
  }
  /* Collapse the OCR section's two-column layout to stacked. The
   * llama still gets a centred max-width so it doesn't dominate
   * the column. */
  .story__split {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    text-align: center;
  }
  .story__split > div {
    text-align: left;
  }
  .story__llama {
    max-width: 160px;
  }
  pre code {
    font-size: 13px;
  }
}
