/*
  ═══════════════════════════════════════════════════════════════════════════
  LEGAL PAGES — shared stylesheet
  ═══════════════════════════════════════════════════════════════════════════
  The four legal documents (legal notice, privacy policy, terms, US medical
  privacy) are plain .html files in public/, served verbatim and outside the
  React bundle. They each carried their own inline <style> in the outgoing green
  theme, so after the redesign they looked like a different website.

  One stylesheet now governs all four. It is deliberately self-contained — it
  cannot import src/styles/variables.css, because that is bundled by Vite under a
  hashed filename these static pages cannot reference. The token values below are
  copies of the --aw-* set and must be kept in step with it.

  It covers BOTH class vocabularies in use, so no legal text had to be touched to
  restyle these pages:
    • the three short pages: .container .back .subtitle .divider .hipaa-badge
    • us-medical-privacy:    .page-wrap .page-hero .toc .section .info-box
                             .penalty-grid .compare-table .page-footer

  All four share one .legal-header. us-medical-privacy previously had its own
  .top-nav with the back link and brand in the opposite order, and a brand that
  was not a link — so the four pages disagreed with each other and with the app.
*/

:root {
  --bg:          #0A0C0B;
  --bg-alt:      #0D100E;
  --text:        #EDE7DC;
  --text-2:      #C3BDB1;
  --prose:       #B9B3A7;
  --text-3:      #8E897E;
  --cinnabar:    #C1452B;
  --link:        #D4553A;
  --hover:       #E8836B;
  --bronze:      #9A6F4A;
  --on-cinnabar: #FFF6EE;

  --line:        rgba(237, 231, 220, 0.10);
  --line-panel:  rgba(237, 231, 220, 0.14);
  --line-title:  rgba(237, 231, 220, 0.16);
  --line-soft:   rgba(237, 231, 220, 0.08);
  --line-grid:   rgba(237, 231, 220, 0.12);

  --display: 'Marcellus', Georgia, serif;
  --ui:      'Jost', system-ui, -apple-system, sans-serif;
  --prose-f: 'Spectral', Georgia, serif;
  --cjk:     'Noto Serif SC', serif;

  --max:    880px;
  --pad-x:  clamp(20px, 4vw, 40px);
}

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

html { background: var(--bg); scroll-behavior: smooth; }
:target { scroll-margin-top: 90px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--cinnabar); color: var(--on-cinnabar); }

a { color: var(--link); text-decoration: none; transition: color .4s ease; }
a:hover { color: var(--hover); }
ul, ol { list-style: none; }

:where(a, button):focus-visible {
  outline: 2px solid var(--hover);
  outline-offset: 3px;
}

/* ═══ Header band ═════════════════════════════════════════════════════════ */

/*
  Matches the app's sticky header: full-bleed band, translucent, one hairline
  along the bottom. The wordmark is a link home so these pages are not dead ends.
*/
.legal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 16px var(--pad-x);
  background: rgba(10, 12, 11, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.legal-header__mark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
}
.legal-header__mark:hover { color: var(--text); }
.legal-header__zh {
  font-family: var(--cjk);
  font-size: 18px;
  letter-spacing: 1.5px;
  color: var(--cinnabar);
}
.legal-header__en {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
}

/* The existing back link in all four pages. */
.back {
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text-3);
}
.back:hover { color: var(--hover); }


/* ═══ Page shell ══════════════════════════════════════════════════════════ */

.container, .page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--pad-x) clamp(64px, 8vw, 110px);
}

/* ═══ Type ════════════════════════════════════════════════════════════════ */

h1, .page-hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.8px;
  color: var(--text);
  text-wrap: balance;
}

.subtitle, .page-hero__subtitle {
  margin-top: 26px;
  font-family: var(--prose-f);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.7;
  color: var(--prose);
  max-width: 70ch;
}

/* Small-caps meta row under the title. */
.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 34px;
  margin-top: 30px;
  font-size: 11.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--text-3);
}

h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-top: 60px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-title);
}

h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.3;
  color: var(--text);
  margin-top: 38px;
  margin-bottom: 12px;
}

p {
  font-family: var(--prose-f);
  font-weight: 300;
  font-size: 17.5px;
  line-height: 1.8;
  color: var(--prose);
  margin-bottom: 20px;
}
p strong, li strong { color: var(--text-2); font-weight: 400; }

/* Cinnabar dot bullets, matching the Conditions lists on the homepage. */
ul li, ol li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-3);
  border-bottom: 1px solid var(--line-soft);
}
ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 18px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cinnabar);
  opacity: 0.75;
}
ul, ol { margin-bottom: 24px; }

ol { counter-reset: legal-ol; }
ol > li { counter-increment: legal-ol; padding-left: 30px; }
ol > li::before {
  content: counter(legal-ol);
  position: absolute;
  left: 0;
  top: 8px;
  font-family: var(--display);
  font-size: 14px;
  color: var(--bronze);
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 52px 0;
}

/* ═══ Badges & panels ═════════════════════════════════════════════════════ */

/* Square, hairline-bordered — no pill, no glow. */
.hipaa-badge, .page-hero__badge {
  display: inline-block;
  padding: 9px 15px;
  margin-bottom: 24px;
  border: 1px solid var(--line-panel);
  border-radius: 0;
  background: none;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--bronze);
}

.info-box {
  border: 1px solid var(--line-panel);
  border-left: 2px solid var(--cinnabar);
  background: var(--bg-alt);
  padding: 26px 28px 8px;
  margin: 34px 0;
}
.info-box--warn { border-left-color: var(--bronze); }
.info-box__label {
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 12px;
}
.info-box p:last-child { margin-bottom: 20px; }

/* ═══ Contents rail ═══════════════════════════════════════════════════════ */

.toc {
  border: 1px solid var(--line-panel);
  padding: 30px 30px 12px;
  margin: 44px 0 12px;
  background: var(--bg-alt);
}
.toc__title {
  font-size: 11px;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}
.toc__list { margin: 0; }
.toc__item {
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
}
.toc__item::before { display: none; }
.toc__item a {
  display: block;
  padding: 12px 0;
  font-family: var(--display);
  font-size: 17px;
  color: var(--text-2);
}
.toc__item a:hover { color: var(--hover); }

.section { scroll-margin-top: 90px; }
.section__anchor { display: block; height: 0; visibility: hidden; }

/* ═══ Penalty cards ═══════════════════════════════════════════════════════ */

.penalty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin: 32px 0;
}
.penalty-card {
  background: var(--bg-alt);
  box-shadow: 0 0 0 1px var(--line-grid);
  padding: 24px 22px 26px;
}
.penalty-card__tier {
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--bronze);
}
.penalty-card__amount {
  margin-top: 12px;
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.15;
  color: var(--text);
}
.penalty-card__desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-3);
}

/* ═══ Comparison table ════════════════════════════════════════════════════ */

/*
  Wrapped in its own scroll container: a wide table must never make the page
  itself scroll sideways on a phone.
*/
.compare-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-panel);
  margin: 32px 0;
  font-size: 15px;
}
.compare-table table { border-collapse: collapse; width: 100%; }
.compare-table th, .compare-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.compare-table th {
  font-family: var(--ui);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--bronze);
  background: var(--bg-alt);
  white-space: nowrap;
}
.compare-table td { color: var(--prose); font-family: var(--prose-f); font-weight: 300; }
.compare-table tr:last-child td { border-bottom: 0; }

/* ═══ Footer ══════════════════════════════════════════════════════════════ */

.page-footer, .legal-footer {
  border-top: 1px solid var(--line);
  padding: 44px var(--pad-x) 60px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 22px 40px;
  max-width: var(--max);
  margin: 0 auto;
}
.page-footer__copy, .legal-footer__copy {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-3);
  max-width: 60ch;
}
.page-footer__links, .legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.page-footer__link, .legal-footer__links a { color: var(--text-3); }
.page-footer__link:hover, .legal-footer__links a:hover { color: var(--text); }

/*
  Build credit — the same line the app footer carries, so these four static
  pages don't disagree with it. Full basis, so it wraps below the footer's two
  columns onto its own row.
*/
.legal-credit {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
}
/* The logo link — see the app footer for the reasoning behind all of this. */
.legal-credit a {
  display: block;
  padding: 12px 4px;
  margin: -12px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .4s ease;
}
.legal-credit a:hover { border-bottom-color: var(--line-panel); }
.legal-credit img { display: block; height: 20px; width: auto; }

/* ═══ Phone ═══════════════════════════════════════════════════════════════ */

@media (max-width: 760px) {
  .legal-header { padding-top: 12px; padding-bottom: 12px; }
  .legal-header__en { font-size: 12px; letter-spacing: 1.8px; }
  .back { font-size: 11px; letter-spacing: 1.6px; }
  .legal-credit { padding-top: 18px; font-size: 11px; letter-spacing: 1.2px; gap: 8px; }
  .subtitle, .page-hero__subtitle { font-size: 17px; }
  h2 { margin-top: 46px; }
  .toc { padding: 24px 22px 8px; }
  .info-box { padding: 22px 20px 4px; }
  .page-footer, .legal-footer { padding-bottom: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}
