/* The website's one stylesheet: every page links it, and pages write no
   colours, fonts or sizes of their own (docs/app_styling.md).

   Colours are the app's dark theme (AppPalette.dark in
   app/lib/theme/app_colors.dart): the website is dark only, and only the
   clubhouse TV has a light theme. Keep the two in step; the app's theme test
   checks every colour here exists there. The type, spacing and radius scales
   use the app's token names (AppTypography, AppSpacing, AppRadius). */

:root {
  color-scheme: dark;

  /* ---- Colour ---- */
  --page: #000000;          /* canvas: the page */
  --surface: #161618;       /* surface: cards, notes, the contents box */
  --muted: #232326;         /* surfaceMuted: icon wells, inputs, code */
  --border: #27272a;        /* border: card outlines, dividers */
  --border-strong: #3f3f46; /* borderStrong: input outlines */
  --text: #f9fafb;          /* textPrimary: headings, body */
  --text-2: #d1d5db;        /* textSecondary: body copy, nav */
  --text-3: #9ca3af;        /* textMuted: dates, footers, labels */
  --on-hero: #ffffff;       /* onHero: the primary button, the logo outline */
  --link: #60a5fa;          /* darkLink: links */
  --error: #ff5252;         /* onHeroUnderPar: red that reads on black */
  --warning: #e08a00;       /* warning: placeholder text in a draft */

  /* ---- Type: the platform's own typeface, as in the app ---- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --type-display: 34px;     /* the landing page's headline on a phone */
  --type-title: 28px;       /* a page's title */
  --type-heading: 20px;     /* a section heading */
  --type-lead: 17px;        /* the opening paragraph */
  --type-body: 16px;        /* body text */
  --type-small: 15px;       /* notes, tables, navigation */
  --type-caption: 14px;     /* dates, footers, code, labels */
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-heavy: 800;
  --line-body: 1.6;
  --tracking-overline: .06em;

  /* ---- Spacing: the app's 4px grid ---- */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-xxxl: 32px;
  --space-xxxxl: 48px;

  /* ---- Corners ---- */
  --radius-small: 6px;
  --radius-button: 12px;
  --radius-card: 16px;
  --radius-chip: 12px;

  /* ---- Layout ---- */
  --doc-width: 760px;       /* the width of a page of text */
  --rule: 1px;              /* hairlines */
  --accent-rule: 3px;       /* a note's leading bar */
  --strong-rule: 2px;       /* the landing logo's white outline */
  --field-width: 320px;     /* a form field's widest */
  --top-logo: 40px;         /* the wordmark in the top bar */

  /* ---- The landing page: one screen, sized by the window's height ---- */
  --landing-width: 1160px;                     /* the page's widest */
  --landing-bar: clamp(40px, 6vh, 60px);       /* the top bar's height */
  --landing-nav-gap: 22px;                     /* between top-bar links */
  --landing-columns-gap: 4vw;                  /* between copy and phones */
  --landing-copy-gap: clamp(14px, 2.4vh, 24px);
  --landing-logo: clamp(112px, 21vh, 200px);   /* the app icon's height */
  --landing-logo-gap: clamp(8px, 2.4vh, 24px); /* under the app icon */
  --landing-logo-radius: 22.37%;               /* iOS's icon corner */
  --landing-headline: clamp(34px, 6.2vh, 64px);
  --landing-headline-line: 1.02;
  --landing-headline-tracking: -.035em;
  --landing-lede: clamp(15px, 2vh, 18px);
  --landing-feature: clamp(13px, 1.8vh, 15px);
  --landing-feature-row-gap: clamp(8px, 1.4vh, 12px);
  --landing-feature-column-gap: 18px;
  --landing-feature-gap: 10px;                 /* icon to text */
  --landing-icon: 32px;                        /* a feature's icon well */
  --landing-badge: 44px;                       /* the store badges' height */
  --landing-fan: 720px;                        /* the phones' tallest */
  --landing-phone: 620px;                      /* one phone's tallest */
  --landing-phone-shadow: 0 24px 60px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(255, 255, 255, .08) inset;
  --landing-footer-gap: 14px;                  /* under the footer */
  /* On a phone (max-width: 820px; a breakpoint can't be a variable): */
  --landing-phone-gap: 14px;                   /* between copy and phones */
  --landing-phone-copy-gap: var(--space-md);
  --landing-phone-logo: 100px;
  --landing-phone-icon: 26px;
  --landing-phone-fan-gap: 10px;
}

/* ---- Base ---- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-2);
  font-family: var(--font);
  font-size: var(--type-body);
  line-height: var(--line-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
img { display: block; max-width: 100%; }

h1, h2, h3 { color: var(--text); font-weight: var(--weight-semibold); }

/* ---- A page of text: privacy, terms, support, delete account ---- */

.doc {
  max-width: var(--doc-width);
  margin: 0 auto;
  padding: var(--space-xxl) var(--space-xxl) var(--space-xxxxl);
}
.doc h1 {
  font-size: var(--type-title);
  line-height: 1.2;
  margin: var(--space-sm) 0 var(--space-xs);
}
.doc h2 {
  font-size: var(--type-heading);
  margin: var(--space-xxxl) 0 var(--space-sm);
  padding-top: var(--space-md);
  border-top: var(--rule) solid var(--border);
}
.doc h3 {
  font-size: var(--type-body);
  margin: var(--space-xl) 0 var(--space-xs);
}
.doc p, .doc li { font-size: var(--type-body); }
.doc ul, .doc ol { padding-left: var(--space-xxl); }
.doc li { margin: var(--space-sm) 0; }
.doc hr {
  border: none;
  border-top: var(--rule) solid var(--border);
  margin: var(--space-xxxl) 0;
}
.doc footer {
  color: var(--text-3);
  font-size: var(--type-caption);
  margin-top: var(--space-xxl);
}

.updated {
  color: var(--text-3);
  font-size: var(--type-caption);
  margin: 0 0 var(--space-xs);
}
.lead { font-size: var(--type-lead); color: var(--text); }

/* A card: the contents box, a contact block, a "how to" box. */
.card {
  background: var(--surface);
  border: var(--rule) solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xxl) 0;
}
.card h2 { border: none; margin: 0 0 var(--space-sm); padding: 0; }
.card h2.overline {
  font-size: var(--type-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--text-3);
}
.card ol.columns { margin: 0; columns: 2; column-gap: var(--space-xxxl); }
.card a { text-decoration: none; }
.card p { margin: 0 0 var(--space-sm); }
.card p:last-child { margin-bottom: 0; }
.card .email { font-size: var(--type-heading); font-weight: var(--weight-semibold); }
.card .aside { margin-top: var(--space-md); color: var(--text-3); font-size: var(--type-small); }

/* A note: an aside within the text. */
.note {
  background: var(--surface);
  border-left: var(--accent-rule) solid var(--text-3);
  border-radius: var(--radius-small);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-size: var(--type-small);
}

/* Text still to be filled in, in a draft. */
.placeholder {
  background: var(--muted);
  border-radius: var(--radius-small);
  padding: var(--space-xxs) var(--space-sm);
  color: var(--warning);
  font-size: var(--type-caption);
  white-space: nowrap;
}

.doc table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-md) 0;
  font-size: var(--type-small);
}
.doc th, .doc td {
  border: var(--rule) solid var(--border);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  vertical-align: top;
}
.doc th { background: var(--surface); color: var(--text); font-weight: var(--weight-semibold); }
.doc code {
  background: var(--muted);
  padding: var(--space-xxs) var(--space-xs);
  border-radius: var(--radius-small);
  font-size: var(--type-caption);
}

@media (max-width: 560px) {
  .card ol.columns { columns: 1; }
}

/* ---- A short message page: the sign-in links, the 404 ---- */

.message-page {
  max-width: var(--doc-width);
  margin: 0 auto;
  padding: var(--space-xxl);
}
.message-page h1 {
  font-size: var(--type-title);
  margin: 0 0 var(--space-sm);
}
.message-page p { margin: 0 0 var(--space-xxl); }

/* ---- Forms ---- */

.field {
  display: block;
  width: 100%;
  max-width: var(--field-width);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  font: inherit;
  color: var(--text);
  background: var(--muted);
  border: var(--rule) solid var(--border-strong);
  border-radius: var(--radius-button);
  outline: none;
}
.field::placeholder { color: var(--text-3); }
.field:focus { border-color: var(--text); }

/* The app's primary button on a dark page: white, with black text. */
.button {
  display: block;
  padding: var(--space-md) var(--space-xxl);
  font: inherit;
  font-weight: var(--weight-semibold);
  color: var(--page);
  background: var(--on-hero);
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
}
.button:disabled { opacity: .5; cursor: not-allowed; }

.status { margin: var(--space-lg) 0 0; font-size: var(--type-caption); color: var(--text-3); }
.status.is-error { color: var(--error); }

/* ---- The top bar: every page ---- */
/* The landing page's links on the right; every other page also has the
   wordmark on the left, home. The open page's link is highlighted. On the
   landing page it sits in the screen; elsewhere it's as wide as the landing
   page's, with the same margins. */
body > .top { max-width: var(--landing-width); margin: 0 auto;
  padding-left: max(var(--space-xl), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-xl), env(safe-area-inset-right, 0px)); }
.top { display: flex; align-items: center; height: var(--landing-bar); }
.top nav { display: flex; gap: var(--landing-nav-gap); margin-left: auto; }
.top nav a { color: var(--text-2); text-decoration: none; font-size: var(--type-small); }
.top nav a[aria-current="page"] { color: var(--text); text-decoration: underline;
  text-decoration-thickness: var(--strong-rule); text-underline-offset: var(--space-sm); }
.top .home img { height: var(--top-logo); width: auto; }

/* ---- The landing page ---- */
/* The landing page fits one screen and never scrolls. */
html:has(body.landing), body.landing { height: 100%; overflow: hidden; }
body.landing { color: var(--text); }
.landing a { color: inherit; }

.screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; width: 100%; max-width: var(--landing-width); margin: 0 auto;
  padding-left: max(var(--space-xl), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-xl), env(safe-area-inset-right, 0px)); }
.landing main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: var(--landing-columns-gap); }

/* As wide as its widest line, so the centered logo and store buttons line
   up with the text rather than with the half of the page. */
.copy { display: flex; flex-direction: column; gap: var(--landing-copy-gap); width: fit-content; max-width: 100%; justify-self: center; }
/* The app icon, drawn as an iPhone home screen draws it (iOS's corner
   radius, 22.37% of the side), outlined in white. */
.logo { align-self: center; height: var(--landing-logo); width: auto; margin-bottom: var(--landing-logo-gap);
  border: var(--strong-rule) solid var(--on-hero); border-radius: var(--landing-logo-radius); }
.landing h1 { margin: 0; font-size: var(--landing-headline); line-height: var(--landing-headline-line); letter-spacing: var(--landing-headline-tracking); font-weight: var(--weight-heavy); color: var(--text); }
.lede { margin: 0; font-size: var(--landing-lede); color: var(--text-2); }
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--landing-feature-row-gap) var(--landing-feature-column-gap); }
.feats li { display: flex; align-items: center; gap: var(--landing-feature-gap); font-size: var(--landing-feature); font-weight: var(--weight-semibold); }
.ic { width: var(--landing-icon); height: var(--landing-icon); border-radius: 50%; background: var(--muted); display: grid; place-items: center; flex: none; }
.ic svg { width: var(--space-lg); height: var(--space-lg); }
/* Apple's and Google's official badges, unchanged. Google's PNG carries
   41px of clear space around a 168px-high badge: it's drawn larger and
   pulled in by that margin, so the two badges show at the same height. */
.badges { display: flex; gap: var(--space-md); flex-wrap: wrap; justify-content: center; align-items: center; }
.badges img { height: var(--landing-badge); width: auto; }
/* max-width: none, or WebKit caps it at its link's (margin-reduced) width and squashes it. */
.badges img.google { height: calc(var(--landing-badge) * 250 / 168); margin: calc(var(--landing-badge) * -41 / 168); max-width: none; }

/* Three phones fanned out from the middle one, each spaced .7 of a phone's
   width from the next. Sized by the fan (container units), so they always
   fit it, and the frame, its padding and corners all scale with the phone. */
.fan { position: relative; height: 100%; max-height: var(--landing-fan); container-type: size; }
.phone { --h: min(78cqh, var(--landing-phone), 40cqw * 1218 / 560); --w: calc(var(--h) * 560 / 1218);
  position: absolute; top: 50%; left: 50%; height: var(--h); width: var(--w); padding: calc(var(--w) * .03);
  border-radius: calc(var(--w) * .17); background: var(--surface); box-shadow: var(--landing-phone-shadow); }
.phone img { height: 100%; width: 100%; border-radius: calc(var(--w) * .14); }
.p1 { left: calc(50% - var(--w) * .7); transform: translate(-50%, -46%) rotate(-6deg); }
.p2 { transform: translate(-50%, -54%); z-index: 2; }
.p3 { left: calc(50% + var(--w) * .7); transform: translate(-50%, -46%) rotate(6deg); }

.landing footer { text-align: center; padding-bottom: max(var(--landing-footer-gap), env(safe-area-inset-bottom, 0px)); font-size: var(--type-caption); color: var(--text-3); }

@media (max-width: 820px) {
  .landing main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: var(--landing-phone-gap); align-items: start; }
  .copy { gap: var(--landing-phone-copy-gap); }
  .logo { height: var(--landing-phone-logo); margin-bottom: var(--space-sm); }
  .landing h1, .lede { text-align: center; }
  .landing h1 { font-size: var(--type-display); }
  .ic { width: var(--landing-phone-icon); height: var(--landing-phone-icon); }
  .fan { margin-bottom: var(--landing-phone-fan-gap); }
  .phone { --h: min(80cqh, 40cqw * 1218 / 560); top: 46%; }
}
  
