/* Brimwise — brimwise.app
 *
 * Tokens are transcribed from the app's own Theme.swift so the site and the app
 * are the same object. Type is Inter rather than SF Pro: SF Pro is licensed for
 * Apple-platform app UI only and may not be used for marketing pages.
 */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces — light */
  --page: #F2F2F7;
  --card: #FFFFFF;
  --elevated: #FFFFFF;
  --label: #000000;
  /* The app's own token is 0.6 alpha. On a white card that lands at 3.4:1,
     which fails WCAG 2.2 AA for body text, so the website runs it darker.
     Deliberate divergence from Theme.swift, not a transcription slip. */
  --secondary: rgba(60, 60, 67, 0.78);
  --tertiary: rgba(60, 60, 67, 0.5);
  --separator: rgba(60, 60, 67, 0.16);

  /* The accent carries meaning rather than decoration. */
  --accent: #0B7A72;
  /* Accent text on an accent wash is only 4.1:1 at badge size; this is the
     same hue taken darker so small accented text still passes. */
  --accent-strong: #0A6B64;
  --on-accent: #FFFFFF;
  --wash: rgba(11, 122, 114, 0.10);
  --tint: rgba(11, 122, 114, 0.035);

  /* The gutter's greys. A missing figure is a fact, not an error — there is
     deliberately no traffic-light scale anywhere in this palette. */
  --severed: rgba(60, 60, 67, 0.3);

  /* Traces the edge of a screenshotted phone so it separates from the page. */
  --device-edge: rgba(60, 60, 67, 0.22);

  --radius-badge: 5px;
  --radius-field: 12px;
  --radius-card: 14px;

  --measure: 34rem;
  --gap: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --card: #1C1C1E;
    --elevated: #2C2C2E;
    --label: #FFFFFF;
    /* Dark already clears AA at the app's own 0.6, so it stays as designed. */
    --secondary: rgba(235, 235, 245, 0.6);
    --tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);

    --accent: #35C2B6;
    --accent-strong: #35C2B6;
    --on-accent: #00201E;
    --wash: rgba(53, 194, 182, 0.16);
    --tint: rgba(53, 194, 182, 0.05);

    --severed: rgba(235, 235, 245, 0.3);

    /* Stronger in dark: the phone's own screen is #000 on a #000 page, so this
       ring is the only thing separating the two. */
    --device-edge: rgba(235, 235, 245, 0.32);
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--label);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
}

/* Every figure in Brimwise is tabular. Never applied to prose. */
.fig, table, time, .stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
p, li { text-wrap: pretty; }

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

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--card);
  color: var(--label);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-field);
}

.wrap {
  width: min(68rem, 100% - 2.5rem);
  margin-inline: auto;
}

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose p, .prose ul { margin: 0.75rem 0; }
.prose ul { padding-left: 1.15rem; }
.prose li { margin: 0.35rem 0; }

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

.site-head {
  padding: 1.5rem 0;
  border-bottom: 0.5px solid var(--separator);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--label);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}
.brand svg { width: 30px; height: 30px; color: var(--accent); flex: none; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--secondary); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--label); }

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

.hero { padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero p.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--secondary);
  max-width: 32rem;
  margin: 1.25rem 0 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--wash);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-badge);
  margin-bottom: 1.5rem;
}

.tagline {
  margin: 2rem 0 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.tagline span { display: block; color: var(--secondary); font-weight: 400; }

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

section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
section > .wrap > h2 + p { color: var(--secondary); max-width: var(--measure); margin-top: 0.75rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.35rem;
}
.card h3 { margin-bottom: 0.4rem; }
.card p { margin: 0; color: var(--secondary); font-size: 0.97rem; }

/* Screenshots ------------------------------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 2.5rem;
  padding: 0;
  list-style: none;
}
.shot { text-align: center; }
/* Both themes are first-class in the app, so the site shows whichever matches
   the reader. <picture> media selection means only that one is downloaded. */
.shot img {
  width: 100%;
  max-width: 20rem;
  height: auto;
  display: block;
  margin-inline: auto;
  /* The captured PNG is the device itself, 402x874 with a 48px corner radius,
     and its corners are transparent. Expressing that radius as a percentage of
     each axis keeps the corners circular at any width, so the ring below traces
     the real edge of the phone. Without it a dark screenshot on the dark page
     has no visible boundary at all. */
  border-radius: 11.94% / 5.49%;
  box-shadow:
    0 0 0 1px var(--device-edge),
    0 18px 40px rgba(0, 0, 0, 0.18);
}
.shot figure { margin: 0; }
.shot figcaption {
  margin-top: 0.9rem;
  color: var(--secondary);
  font-size: 0.95rem;
  max-width: 22rem;
  margin-inline: auto;
}

/* The gutter diagram ------------------------------------------------------ */

.gutter-key {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.gutter-key li {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.35rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.gutter-key svg { flex: none; width: 26px; height: 72px; }
.gutter-key h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.gutter-key p { margin: 0; font-size: 0.93rem; color: var(--secondary); }

/* Callout ----------------------------------------------------------------- */

.callout {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  margin-top: 2rem;
}
.callout :is(h2, h3) { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.worked {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1.5px dotted var(--secondary);
  padding-bottom: 1px;
}

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

.site-foot {
  border-top: 0.5px solid var(--separator);
  padding: 2.5rem 0 3.5rem;
  color: var(--secondary);
  font-size: 0.9rem;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-foot a { color: var(--secondary); }
.site-foot a:hover { color: var(--label); }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Definition list used by the privacy summary ----------------------------- */

.facts {
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.5rem;
}
.facts > div {
  background: var(--card);
  border-radius: var(--radius-field);
  padding: 0.9rem 1.1rem;
}
.facts dt { font-weight: 600; }
.facts dd { margin: 0.15rem 0 0; color: var(--secondary); }

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