/* RoomFigure — web styles. SHARED BASE.
   Tokens mirror ios/AIRemodel/Core/Theme.swift (Palette/Radius/Space/Size) and
   design-system/design-tokens.md so the site reads as the same product as the
   app: near-white page, near-black buttons, no shadows, 12–16pt radii,
   exactly one accent.

   This file is loaded by EVERY page — privacy.html, terms.html, support.html
   and index.html. It owns tokens, type, and the document-page components.
   Anything that exists only for the marketing page lives in landing.css.
   Change things here only if you are willing to re-read the three legal pages,
   which App Store review depends on. Additions are safe; edits are not. */

:root {
  /* -- Colour. Theme.swift `Palette`, light halves, verbatim. ------------- */
  --ink: #1C1B19;
  --stone: #6E6A64;
  --paper: #FBF9F6;
  --card: #FFFFFF;
  --line: #E3DED6;
  --accent: #2F5D50;
  --accent-soft: #EDF1EE;
  --on-ink: #FBF9F6;

  /* Badge fill and NOTHING else. Not a second accent. */
  --discount: #D8232F;
  --on-discount: #FFFFFF;
  /* Placeholder behind an image that has not loaded yet. */
  --image-well: #EFEDEA;
  --disabled: #C9C5BF;
  --on-disabled: #FFFFFF;
  /* Bottom-up scrim for light type over a full-bleed photo. */
  --scrim: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.30) 60%, rgba(0,0,0,0.55) 100%);

  /* -- Radius. Theme.swift `Radius`. Nothing is 0. ------------------------ */
  --radius-button: 16px;
  --radius-card: 14px;
  --radius-tile: 14px;
  --radius-image: 16px;
  --radius-sheet: 24px;
  --radius-pill: 999px;

  /* -- Space. Theme.swift `Space`, 4pt base. ------------------------------ */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 20px;
  --s-xl: 24px;
  --s-xxl: 32px;
  --s-xxxl: 48px;

  /* -- Size. Theme.swift `Size`. ------------------------------------------ */
  --button-height: 56px;
  --tap-target: 44px;

  --page-margin: 20px;   /* Space.page = 20 */
  --measure: 46rem;      /* reading measure — document pages */
  --measure-wide: 64rem; /* marketing measure — landing only */
}

/* Dark mode is a WEB-ONLY affordance for the document pages.
   The iOS app is light-only — `INFOPLIST_KEY_UIUserInterfaceStyle = Light` on
   both configurations, and Theme.swift's `dark:` halves are dormant. These are
   those sampled dark halves, used here because privacy/terms/support are long
   text people read at night, and because they have shipped this way since
   2026-08-09 and are cited in an App Store submission.
   The marketing page opts OUT of this — see landing.css. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F5F3F0;
    --stone: #A7A29A;
    --paper: #141312;
    --card: #201E1C;
    --line: #3A3733;
    --accent: #7FB3A2;
    --accent-soft: #1E2A26;
    --on-ink: #141312;

    --discount: #FF5A5F;
    --on-discount: #FFFFFF;
    --image-well: #232120;
    --disabled: #4A4642;
    --on-disabled: #8E8A84;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Nothing may push the page wider than the viewport, at any width. */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 40px var(--page-margin) 96px;
}

/* ---- Masthead ---- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.masthead nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
}

.masthead nav a {
  color: var(--stone);
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--ink); }

/* ---- Type ---- */

h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 44px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
}

p, ul, ol { margin: 0 0 16px; }

ul, ol { padding-left: 22px; }

li { margin-bottom: 8px; }

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

strong { font-weight: 600; }

.lede {
  font-size: 19px;
  color: var(--stone);
  margin-bottom: 8px;
}

.meta {
  font-size: 13px;
  color: var(--stone);
  margin-bottom: 32px;
}

.small { font-size: 15px; color: var(--stone); }

/* ---- Cards, callouts, tables ---- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 0 0 12px;
}

.card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 0 0 20px;
}

.callout > :last-child { margin-bottom: 0; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 15px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

/* ---- Buttons / link tiles ---- */

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-button);
  padding: 15px 28px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ink);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .tiles { grid-template-columns: 1fr 1fr 1fr; }
}

.tiles li { margin: 0; }

.tile {
  display: block;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
}

.tile:hover { border-color: var(--accent); }

.tile b { display: block; font-weight: 600; margin-bottom: 4px; }
.tile span { display: block; font-size: 15px; color: var(--stone); line-height: 1.45; }

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

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--stone);
}

footer a { color: var(--stone); }

footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ---- Utilities ---- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-xs);
  top: var(--s-xs);
  z-index: 100;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 10px 16px;
  font-size: 15px;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }
