/* Rep — site styles. One stylesheet for every page.

   Layout follows Sage's homepage hero (Goblit/hosting/public/index.html): a header with the icon, a two-column
   splash with the copy on the left and a real iPhone screenshot in a CSS bezel on the right, and a quiet footer.
   On a phone the copy is centred above a smaller phone. Sage's scroll story is deliberately not copied: Rob wanted
   the hero and nothing else (28 Oct). The privacy, support and 404 pages share the header, footer and tokens, and
   keep a single long-form column.

   Colours are the app's own tokens (app/Rep/Sources/Theme.swift), so the site and the app read as one thing. Two
   deliberate departures, both for contrast: the app's `inkTertiary` (#8A8A8A) measures 3.22:1 on #F7F7F7 and so
   is never used for text here (captions use #6B6B6B, 4.97:1), and the dark palette is new, because the app is
   light-only while a page opened from a phone at night is not. Measured ratios are in web/README.md.

   The headline is the system serif, as the app's own display type is (`Theme.display`, design .serif). Fonts are
   system stacks only: nothing is loaded from a third party, because a page that phoned home while hosting Rep's
   privacy policy would be contradicting it. */

:root {
  --bg: #f7f7f7;
  --card: #ffffff;
  --ink: #111111;
  --ink-2: #525252;
  --ink-3: #6b6b6b;
  --accent: #436f4c;
  --accent-deep: #324e36;
  --accent-tint: #e8efe9;
  --line: #e4e4e4;
  --bezel: #0b0b0b;
  --bezel-ring: rgba(17, 17, 17, 0);
  /* The captures are light mode, so the phone's screen stays light in both themes. */
  --screen: #f7f7f7;
  --shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 18px 40px rgba(17, 17, 17, .12);
  --card-shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 8px 24px rgba(17, 17, 17, .04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131513;
    --card: #1c1f1c;
    --ink: #f2f3f1;
    --ink-2: #c3c7c1;
    --ink-3: #a2a7a0;
    --accent: #9cc4a4;
    --accent-deep: #9cc4a4;
    --accent-tint: #232823;
    --line: #2c302c;
    --bezel-ring: rgba(242, 243, 241, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .45);
    --card-shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }

/* Keyboard users get a visible target everywhere; :focus-visible keeps it off mouse clicks. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus {
  left: 20px; top: 12px; z-index: 10; position: fixed;
  background: var(--card); color: var(--ink); padding: 10px 16px; border-radius: 20px;
  box-shadow: var(--card-shadow); text-decoration: none;
}

/* 20px gutters match Theme.inset; the frame is Sage's 1120px. */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
/* The long-form pages keep a reading measure inside the same frame. */
.prose { max-width: 44rem; }

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

.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.brand { display: block; border-radius: 9px; }
/* The app icon (the serif "Rep" on black) is the wordmark. The ring keeps its edge visible on the dark page. */
.brand img { width: 40px; height: 40px; border-radius: 22.5%; box-shadow: 0 0 0 1px var(--bezel-ring); }
.site-nav { display: flex; gap: 20px; font-size: 15px; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- Hero: copy left, a real screenshot in an iPhone right ---------- */

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 48px;
  align-items: center;
  padding-block: 32px 88px;
}
.hero-copy { min-width: 0; display: grid; gap: 22px; align-content: start; }
/* The app's label voice: tracked caps, as on its section headers. */
.eyebrow { font: 600 12.5px/1.2 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.hero h1 {
  font: 600 clamp(40px, 6vw, 68px)/1.04 var(--font-display);
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}
.sub {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  max-width: 30em;
  text-wrap: pretty;
}
/* A note, not a button: there is no App Store listing to send anyone to yet. */
.soon {
  justify-self: start;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 600;
}
.visual { min-width: 0; display: grid; justify-items: center; }
/* Sage's bezel: the screen keeps the capture's exact shape (1206 x 2622), the frame is a fixed share of it. */
.phone {
  width: min(100%, 300px);
  aspect-ratio: 1206 / 2622;
  border-radius: 15% / 6.9%;
  background: var(--bezel);
  padding: 2.6%;
  box-shadow: var(--shadow), 0 0 0 1px var(--bezel-ring);
}
.phone .screen { width: 100%; height: 100%; border-radius: 12.8% / 5.9%; overflow: hidden; background: var(--screen); }
.phone .screen img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Long-form pages ---------- */

main.page { padding-bottom: 32px; }
.page h1 {
  font: 600 clamp(34px, 5vw, 46px)/1.1 var(--font-display);
  letter-spacing: -.015em;
  margin: 20px 0 0;
}
h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -.012em; font-weight: 600; margin: 2.5rem 0 .5rem; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.75rem 0 .35rem; }
p { margin: .75rem 0; }
.lede { font-size: 1.1875rem; line-height: 1.5; color: var(--ink-2); margin-top: .75rem; }
.dateline { font-size: .875rem; color: var(--ink-3); margin-top: .5rem; }
.caption { font-size: .875rem; color: var(--ink-3); }
ul, ol { margin: .75rem 0; padding-left: 1.3rem; }
li { margin: .4rem 0; }
li > strong { font-weight: 600; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  margin: 1rem 0;
}
.card h2, .card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.steps { list-style: none; padding: 0; margin: 1.25rem 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.5rem; margin: 1.1rem 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .1em;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--accent); color: var(--card);
  display: grid; place-items: center;
  font-size: .875rem; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .steps > li::before { color: var(--bg); } }
.steps > li > strong { display: block; }

/* Definition-style rows, used for "what is stored". */
.rows { margin: 1rem 0; border-top: 1px solid var(--line); }
.rows > div { border-bottom: 1px solid var(--line); padding: 12px 0; }
.rows dt { font-weight: 600; font-size: .9375rem; }
.rows dd { margin: .2rem 0 0; color: var(--ink-2); font-size: .9375rem; }

/* `anywhere` rather than `break-all`: a short address never wraps, a long one breaks only when it must. */
.contact-email { font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }

/* The unlisted /review page's clips. */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; margin: 1.5rem 0; padding: 0; list-style: none; }
.clips li { margin: 0; display: grid; gap: 8px; align-content: start; }
.clips video { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; background: #000; }
.clips .meta { font-size: .9375rem; color: var(--ink-2); margin: 0; }

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

.site-foot { border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; padding-block: 28px 40px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: var(--ink-2); }
.site-foot p { margin: 0; }

@media (min-width: 40rem) {
  main.page { font-size: 18px; }
}

/* ---------- Tablet and below: one column ---------- */
/* One column from here down, so the copy centres above the phone as Sage's does on a phone. */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 12px 64px; }
  .hero-copy { justify-items: center; text-align: center; }
  .sub { margin-inline: auto; }
  .soon { justify-self: center; }
}

/* ---------- Phone: a smaller phone under the copy ---------- */
@media (max-width: 767px) {
  .phone { width: min(72vw, 250px); }
}
@media (max-width: 480px) {
  .site-head .wrap { padding-block: 16px; }
  .site-nav { gap: 16px; }
}
