/* Breeze — shared stylesheet for the landing page and the legal documents.
   The palette is lifted straight from lib/theme/app_colors.dart so the site and
   the app read as one product; the category colours below are the same ones the
   scan screen and the home-screen widget draw their segments in. */

:root {
  /* Surfaces and text — AppColors light mode. */
  --bg:        #FAFAFA;
  --surface:   #FFFFFF;
  --surface-2: #F3F4F6;
  --ink:       #111111;
  --ink-muted: #5C6270;
  --rule:      #E5E7EB;

  /* Brand and status — fixed across both themes, exactly as in the app. */
  --success: #22C55E;
  --photos:  #8B5CF6;
  --apps:    #F59E0B;
  --cache:   #EF4444;
  --other:   #06B6D4;
  --premium: #111111;

  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 12px 32px -16px rgba(17, 17, 17, .22);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0F1115;
    --surface:   #1A1D23;
    --surface-2: #21252C;
    --ink:       #F3F4F6;
    --ink-muted: #9096A1;
    --rule:      #2A2F38;
    --premium:   #000000;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px -16px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  --bg:        #0F1115;
  --surface:   #1A1D23;
  --surface-2: #21252C;
  --ink:       #F3F4F6;
  --ink-muted: #9096A1;
  --rule:      #2A2F38;
  --premium:   #000000;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px -16px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--success);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.05; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
p  { margin: 0; }

.mono {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.label {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.shell { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; }

/* ---------- site header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-head .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  text-decoration: none;
}
.mark {
  width: 26px; height: 26px;
  border-radius: 6px;          /* close to the iOS icon mask at this size */
  display: block;
  object-fit: cover;
  flex: none;                  /* the flex wordmark must not squash it */
}
.nav { display: flex; gap: 22px; font-size: .92rem; }
.nav a { color: var(--ink-muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */

.hero { padding: 96px 0 72px; }
.hero .stack { gap: 26px; max-width: 44ch; }
.hero .dek { font-size: 1.22rem; color: var(--ink-muted); max-width: 46ch; }

.claim {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
  color: color-mix(in srgb, var(--success) 78%, var(--ink));
  font-size: .86rem;
  font-weight: 500;
}
.claim .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--success); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .96rem;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: .88; }
.btn-ghost { border-color: var(--rule); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-muted); }

/* ---------- sections ---------- */

section.band { padding: 72px 0; border-top: 1px solid var(--rule); }
section.band > .shell > .stack { gap: 32px; }
.sec-head { display: flex; flex-direction: column; gap: 10px; max-width: 76ch; }
.sec-head p { color: var(--ink-muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow);
}
.card p { font-size: .93rem; color: var(--ink-muted); }
.card .swatch {
  width: 34px; height: 34px;
  border-radius: 10px;
  margin-bottom: 6px;
  display: grid; place-items: center;
  font-size: 1rem;
}
.sw-photos { background: color-mix(in srgb, var(--photos) 16%, transparent); }
.sw-apps   { background: color-mix(in srgb, var(--apps) 18%, transparent); }
.sw-cache  { background: color-mix(in srgb, var(--cache) 15%, transparent); }
.sw-other  { background: color-mix(in srgb, var(--other) 16%, transparent); }
.sw-ok     { background: color-mix(in srgb, var(--success) 16%, transparent); }

.plat {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 6px;
  align-self: flex-start;
}

/* ---------- pricing ---------- */

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
/* A single tier would otherwise stretch the full shell width and read as a
   banner rather than a price card. */
.tiers.one { max-width: 480px; margin-inline: auto; }
.tier { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.tier.free { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.tier.premium { background: var(--premium); border-color: var(--premium); color: #FFFFFF; }
.tier.premium .price-note, .tier.premium li { color: rgba(255,255,255,.72); }
.tier.premium h3 { color: #FFFFFF; }
.tier .price { font-family: "DM Mono", ui-monospace, monospace; font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; }
.tier .price-note { font-size: .84rem; color: var(--ink-muted); }
.tier ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tier li { font-size: .93rem; line-height: 1.45; padding-left: 24px; position: relative; color: var(--ink-muted); }
.tier li::before {
  content: "";
  position: absolute; left: 0; top: .5em;
  width: 12px; height: 2px; border-radius: 2px;
  background: var(--success);
}
.tier.premium li::before { background: var(--apps); }
.tier li b { color: var(--ink); font-weight: 600; }
.tier.premium li b { color: #FFFFFF; }

.plan-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.plan-table th, .plan-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.plan-table th { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); font-family: "DM Mono", ui-monospace, monospace; }
.plan-table tbody tr:last-child td { border-bottom: 0; }
.plan-table td.amount { font-family: "DM Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--rule); padding: 44px 0 64px; margin-top: 24px; }
.site-foot .shell { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: .9rem; }
.foot-links a { color: var(--ink-muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-note { font-size: .82rem; color: var(--ink-muted); max-width: 78ch; }

/* ---------- legal documents ---------- */

.doc { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; }
.doc-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: "DM Mono", ui-monospace, monospace; font-size: .76rem; color: var(--ink-muted); }

.toc { margin: 32px 0 8px; padding: 20px 24px; background: var(--surface-2); border-radius: var(--radius); }
.toc ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: .92rem; }
.toc a { color: var(--ink-muted); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

.doc h2 { font-size: 1.18rem; margin: 44px 0 12px; scroll-margin-top: 88px; }
.doc h2 .num { font-family: "DM Mono", ui-monospace, monospace; font-weight: 400; color: var(--ink-muted); margin-right: 10px; font-size: .95rem; }
.doc h3 { margin: 24px 0 8px; font-size: 1rem; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.doc li { line-height: 1.55; }
.doc strong { font-weight: 600; }
.doc code { font-family: "DM Mono", ui-monospace, monospace; font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.callout {
  border-left: 3px solid var(--cache);
  background: color-mix(in srgb, var(--cache) 7%, transparent);
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  margin: 0 0 20px;
}
.callout.good { border-left-color: var(--success); background: color-mix(in srgb, var(--success) 8%, transparent); }
.callout p:last-child { margin-bottom: 0; }

/* Unfilled details that only the publisher can supply. Deliberately loud —
   these must not reach production unnoticed. */
.todo {
  background: color-mix(in srgb, var(--apps) 26%, transparent);
  border-bottom: 2px solid var(--apps);
  padding: 0 4px;
  font-weight: 600;
  border-radius: 3px;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 64px 0 52px; }
  section.band { padding: 56px 0; }
  .nav { gap: 14px; font-size: .86rem; }
  .doc { padding: 44px 20px 72px; }
}

/* ---------- legal hub ---------- */

.hub-group { display: flex; flex-direction: column; gap: 14px; }
.hub-group + .hub-group { margin-top: 40px; }
.hub-head { display: flex; align-items: center; gap: 12px; }
.hub-head .swatch { margin-bottom: 0; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.hub-card {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
}
.hub-card:hover { border-color: var(--ink-muted); }
.hub-card strong { font-size: .97rem; font-weight: 600; }
.hub-card span { font-size: .84rem; color: var(--ink-muted); line-height: 1.4; }
.hub-card.disabled { opacity: .55; pointer-events: none; }

/* ---------- definitions ---------- */

.defs { display: flex; flex-direction: column; gap: 14px; margin: 0 0 18px; }
.defs div { display: flex; flex-direction: column; gap: 2px; }
.defs dt { font-weight: 600; font-size: .97rem; }
.defs dd { margin: 0; color: var(--ink-muted); font-size: .95rem; line-height: 1.55; }

/* A "we do not do this" answer, so a reader scanning headings sees it at once. */
.none {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--success) 72%, var(--ink));
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
