/* SmokeFree pages: the app's look. White (near-black in dark mode), gray cards, bold Google Sans Flex titles,
   one red accent, teal while smoking is allowed. Shared by every page in this folder. */

@font-face {
  /* Google Sans Flex (SIL OFL) from the app, pinned at roundness 70 and subset to Latin */
  font-family: "SmokeFree Title";
  src: url("fonts/google-sans-flex-r70.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;          /* background */
  --fg: #121212;          /* onSurface, 18.7:1 */
  --muted: #5E5E5E;       /* onSurfaceVariant, 6.5:1 on bg, 5.7:1 on card */
  --card: #F0F0F0;        /* surfaceContainerHighest */
  --line: #E6E6E6;        /* outlineVariant */
  --outline: #767676;     /* outline, 4.5:1 */
  --other: #8C8C8C;       /* other series in charts, 3.4:1 */
  --accent: #CC3036;      /* primary, Red45, 5.2:1 */
  --on-accent: #FFFFFF;
  --accent-soft: #F4C9CB; /* accent behind dark text */
  --teal: #00756A;        /* tertiary: smoking allowed, 5.6:1 */
  --inverse: #2B2B2B;     /* inverseSurface */
  --on-inverse: #F3F3F3;
  --font-title: "SmokeFree Title", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --space-tiny: 2px;
  --space-small: 4px;
  --space: 8px;
  --space-big: 12px;
  --space-screen: 16px;
  --space-huge: 24px;
  --space-section: 64px;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F0F;
    --fg: #EDEDED;
    --muted: #ABABAB;
    --card: #262626;
    --line: #333333;
    --outline: #8C8C8C;
    --other: #8C8C8C;
    --accent: #FF8A84;
    --on-accent: #680A10;
    --accent-soft: #5A2427;
    --teal: #6ED9C6;
    --inverse: #E6E6E6;
    --on-inverse: #1A1A1A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0F0F;
  --fg: #EDEDED;
  --muted: #ABABAB;
  --card: #262626;
  --line: #333333;
  --outline: #8C8C8C;
  --other: #8C8C8C;
  --accent: #FF8A84;
  --on-accent: #680A10;
  --accent-soft: #5A2427;
  --teal: #6ED9C6;
  --inverse: #E6E6E6;
  --on-inverse: #1A1A1A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 40px 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}
.page.narrow { max-width: 880px; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: 44px; line-height: 52px; letter-spacing: -0.025em; }
h2 { font-size: 28px; line-height: 36px; letter-spacing: -0.02em; }
h3 { font-size: 20px; line-height: 26px; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.title-font { font-family: var(--font-title); font-weight: 700; }
.small { font-size: 14px; line-height: 21px; }
.tiny { font-size: 12px; line-height: 18px; letter-spacing: 0.03em; }
.stack { display: flex; flex-direction: column; }
code { font-family: var(--font-mono); font-size: 0.9em; letter-spacing: 0; }

/* Header */
.intro { display: flex; flex-direction: column; gap: var(--space-big); max-width: 760px; }
.eyebrow { font-family: var(--font-title); font-weight: 700; font-size: 16px; line-height: 20px; letter-spacing: -0.01em; color: var(--accent); }
a.eyebrow { text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-small); align-self: flex-start; }
a.eyebrow:hover { text-decoration: underline; text-underline-offset: 3px; }
.lede { font-size: 18px; line-height: 28px; color: var(--muted); max-width: 64ch; }
.lede strong, .lede em { color: var(--fg); font-style: normal; font-weight: 600; }

/* Sections */
.section { display: flex; flex-direction: column; gap: var(--space-big); }
.section-head { display: flex; flex-direction: column; gap: var(--space); max-width: 70ch; }
.section-head p { color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius-md); padding: var(--space-screen); min-width: 0; }
.chart-card { background: var(--card); border-radius: var(--radius-md); padding: var(--space-screen); overflow-x: auto; }

/* Number tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space); }
.stat { background: var(--card); border-radius: var(--radius-md); padding: var(--space-screen); display: flex; flex-direction: column; gap: var(--space-small); min-width: 0; }
.stat-label { font-family: var(--font-title); font-weight: 700; font-size: 14px; line-height: 20px; letter-spacing: -0.01em; color: var(--muted); }
.stat-value { font-family: var(--font-title); font-weight: 700; font-size: 28px; line-height: 36px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value.accent { color: var(--accent); }
.stat-sub { font-size: 14px; line-height: 21px; color: var(--muted); }

/* Chart keys and tooltips */
.key { display: flex; flex-wrap: wrap; gap: var(--space-tiny) var(--space-screen); font-size: 13px; line-height: 20px; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.key span, .key li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--inverse); color: var(--on-inverse);
  border-radius: var(--radius-sm); padding: var(--space-big); font-size: 13px; line-height: 19px; max-width: 280px;
  font-variant-numeric: tabular-nums;
}
.tip[hidden] { display: none; }
.tip-title { font-family: var(--font-title); font-weight: 700; font-size: 14px; letter-spacing: -0.01em; margin-bottom: var(--space-small); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.data th, .data td { padding: 10px var(--space-big); border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; vertical-align: middle; }
.data th:first-child, .data td:first-child { text-align: left; padding-left: var(--space); }
.data thead th { font-family: var(--font-title); font-weight: 700; font-size: 13px; line-height: 18px; letter-spacing: -0.005em; color: var(--muted); vertical-align: bottom; white-space: normal; }
.data td.wrap, .data th.wrap { white-space: normal; text-align: left; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-top: var(--space-huge); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-screen) 48px; color: var(--muted); font-size: 14px; line-height: 21px; }
.foot h3 { font-size: 15px; line-height: 20px; color: var(--fg); margin-bottom: var(--space-small); }

/* Legal pages: a contents list beside long-form text */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: max(24px, env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: var(--space-small); }
.toc-title { font-family: var(--font-title); font-weight: 700; font-size: 14px; line-height: 20px; letter-spacing: -0.01em; color: var(--muted); margin-bottom: var(--space-small); }
.toc a { font-size: 14px; line-height: 20px; color: var(--muted); text-decoration: none; padding: var(--space-small) 0; }
.toc a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.prose { display: flex; flex-direction: column; gap: 40px; max-width: 70ch; }
.prose section { display: flex; flex-direction: column; gap: var(--space-big); scroll-margin-top: 24px; }
.prose h2 { font-size: 24px; line-height: 30px; }
.prose h3 { font-size: 17px; line-height: 24px; letter-spacing: -0.01em; margin-top: var(--space); }
.prose p, .prose li { color: var(--fg); }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--space); }
.prose li::marker { color: var(--muted); }
.prose a { text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.summary-card { background: var(--card); border-radius: var(--radius-md); padding: var(--space-huge); display: flex; flex-direction: column; gap: var(--space-big); }
.summary-card h2 { font-size: 20px; line-height: 26px; }
.summary-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--space); }
.data-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.data-list > div { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--space) var(--space-huge); padding: var(--space-big) 0; border-bottom: 1px solid var(--line); }
.data-list dt { font-family: var(--font-title); font-weight: 700; letter-spacing: -0.01em; }
.data-list dd { margin: 0; color: var(--muted); }
.meta-line { font-size: 14px; line-height: 21px; color: var(--muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: var(--space) var(--space-huge); }
@media (max-width: 860px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: var(--space-huge); }
  .toc { position: static; display: none; }
}
@media (max-width: 560px) {
  .data-list > div { grid-template-columns: minmax(0, 1fr); gap: var(--space-small); }
}

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .page { padding-block: 28px 56px; gap: 48px; }
  h1 { font-size: 34px; line-height: 42px; }
  h2 { font-size: 24px; line-height: 32px; }
  .lede { font-size: 17px; line-height: 26px; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 24px; line-height: 32px; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
}
