/* Aisleful — design system.
   Derived from the Sai vs. Reality parent system (warm neutrals, one accent,
   deliberate light and dark, mobile first). Two departures, both on purpose:
   a teal accent so the brand never competes with the verdict colours, and an
   editorial display face so the page reads as a document with an instrument
   in it rather than as another app landing page. */

:root {
  --bg:            #fffdfb;
  --surface:       #f6f2ec;
  --surface-2:     #efe9e1;
  --fg:            #17140f;
  --fg-muted:      #5b544c;
  --fg-faint:      #837a71;
  --border:        #e5dfd6;
  --border-strong: #cec6bb;

  --accent:        #14646d;
  --accent-hover:  #0d474e;
  --accent-weak:   #e6f1f1;
  --on-accent:     #ffffff;

  /* Tri-state verdict. Inherited from the parent system's status colours so
     the two sites agree about what green, amber and red mean. */
  --yes:      #1f6b3a;  --yes-bg:      #e8f4ec;  --yes-line:      #b7ddc6;
  --depends:  #7a5807;  --depends-bg:  #fbf2dd;  --depends-line:  #e7d29a;
  --no:       #8a2020;  --no-bg:       #f8eaea;  --no-line:       #e5b9b9;

  --step--1: 0.875rem;
  --step-0:  1.0625rem;
  --step-1:  1.25rem;
  --step-2:  1.5rem;
  --step-3:  1.875rem;
  --step-4:  clamp(2rem, 1.5rem + 2.2vw, 3.25rem);

  --measure: 64ch;
  --gutter: 1.25rem;
  --radius: 8px;

  --sans: "Instrument Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #131110;
    --surface:       #1c1917;
    --surface-2:     #24201d;
    --fg:            #f4f0ea;
    --fg-muted:      #aca298;
    --fg-faint:      #8b8178;
    --border:        #2e2925;
    --border-strong: #443d37;

    --accent:        #5cc3cc;
    --accent-hover:  #86dbe2;
    --accent-weak:   #12292b;
    --on-accent:     #101c1d;

    --yes:      #7ad39b;  --yes-bg:      #16301f;  --yes-line:      #2c5c3d;
    --depends:  #e5c164;  --depends-bg:  #322813;  --depends-line:  #5e4c1f;
    --no:       #f09090;  --no-bg:       #331818;  --no-line:       #63302f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.wrap { width: 100%; max-width: 44rem; margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 58rem; }

h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.12; font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-family: var(--display); font-size: var(--step-4); }
h2 { font-family: var(--display); font-size: var(--step-3); margin-top: 2em; }
h3 { font-family: var(--sans); font-size: var(--step-1); font-weight: 600; margin-top: 1.9em; letter-spacing: -0.005em; }

p, ul, ol { margin: 0 0 1.15em; max-width: var(--measure); }
li { margin-bottom: 0.4em; }
strong { font-weight: 600; }
small { font-size: var(--step--1); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

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

.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; flex-wrap: wrap; }
.brand-lockup { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; flex-wrap: wrap; }
/* The wordmark no longer says what the site does, so the gloss does it instead.
   Dropped before the nav wraps, where it would cost more than it explains. */
.brand-note { font-size: var(--step--1); color: var(--fg-faint); }
@media (max-width: 44rem) { .brand-note { display: none; } }
.brand { font-family: var(--display); font-size: var(--step-1); color: var(--fg); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--accent); }
.brand .dot { color: var(--accent); }
.site-nav { display: flex; gap: 1.1rem; font-size: var(--step--1); flex: none; flex-wrap: wrap; }
.site-nav a { color: var(--fg-muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding-block: 2rem 3rem; color: var(--fg-faint); font-size: var(--step--1); }
.site-footer p { max-width: var(--measure); }
.site-footer a { color: var(--fg-muted); }

.crumbs { font-size: var(--step--1); color: var(--fg-faint); padding-block: 1.25rem 0; }
.crumbs a { color: var(--fg-muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- the verdict card: the one thing above the fold ---------- */

.verdict {
  border: 1px solid var(--line, var(--border-strong));
  background: var(--tint, var(--surface));
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0 0 1.75rem;
  max-width: none;
}
.verdict[data-state="yes"]     { --line: var(--yes-line);     --tint: var(--yes-bg);     --ink: var(--yes); }
.verdict[data-state="depends"] { --line: var(--depends-line); --tint: var(--depends-bg); --ink: var(--depends); }
.verdict[data-state="no"]      { --line: var(--no-line);      --tint: var(--no-bg);      --ink: var(--no); }

.verdict-head { display: flex; align-items: center; gap: 0.7rem; }
.verdict-head svg { flex: none; width: 28px; height: 28px; color: var(--ink); }
.verdict-label { font-family: var(--display); font-size: var(--step-3); line-height: 1.05; color: var(--ink); }

.verdict-figure { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.9rem; }
.verdict-figure .num { font-size: var(--step-4); line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.verdict-figure .unit { color: var(--fg-muted); font-size: var(--step-0); }
.verdict-sub { margin: 0.45rem 0 0; color: var(--fg-muted); font-size: var(--step--1); max-width: 48ch; }

/* the limit control — the reason this is a tool and not an article */
.limit {
  margin-top: 1.25rem; padding-top: 1.1rem;
  border-top: 1px solid var(--line, var(--border));
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.limit label { font-size: var(--step--1); color: var(--fg-muted); }
.limit select {
  font: inherit; font-size: var(--step--1);
  min-height: 44px; padding: 0 2.2rem 0 0.75rem;
  color: var(--fg); background-color: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 6px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 1rem center, right 0.7rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.limit .recalc { font-size: var(--step--1); color: var(--fg-faint); }

.math {
  margin: 0; padding: 0.9rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: var(--step--1); color: var(--fg-muted);
}
.math b { color: var(--fg); font-weight: 600; }

/* ---------- data table ---------- */

.facts { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: var(--step--1); }
.facts caption { text-align: left; color: var(--fg-faint); padding-bottom: 0.6rem; }
.facts th, .facts td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
.facts th { font-weight: 500; color: var(--fg-muted); }
.facts td { text-align: right; font-variant-numeric: tabular-nums; }
.facts tr[data-decisive="1"] { background: var(--surface); }
.facts tr[data-decisive="1"] th, .facts tr[data-decisive="1"] td { color: var(--fg); font-weight: 600; }

.scroller { overflow-x: auto; margin-bottom: 1.5rem; }
.compare { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: var(--step--1); }
.compare th, .compare td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { color: var(--fg-muted); font-weight: 600; border-bottom: 1px solid var(--border-strong); }
.compare tbody th { font-weight: 500; color: var(--fg-muted); }
.compare.hl td:last-child { background: var(--accent-weak); }

/* ---------- ingredient scan ---------- */

.ing { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: 1px; max-width: none; }
.ing li { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.7rem 0.85rem; background: var(--surface); margin: 0; }
.ing li:first-child { border-radius: 6px 6px 0 0; }
.ing li:last-child { border-radius: 0 0 6px 6px; }
.ing svg { flex: none; width: 18px; height: 18px; margin-top: 3px; }
.ing .n { font-weight: 600; }
.ing .note { display: block; color: var(--fg-muted); font-size: var(--step--1); }
.ing li[data-f="ok"] svg { color: var(--yes); }
.ing li[data-f="watch"] svg { color: var(--depends); }

/* ---------- capture ---------- */

.capture {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); padding: 1.5rem; margin: 2.5rem 0;
}
.capture h2 { margin-top: 0; font-size: var(--step-2); }
.capture p { color: var(--fg-muted); font-size: var(--step--1); }
.vote { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.btn {
  font: inherit; font-size: var(--step--1); font-weight: 600;
  min-height: 44px; padding: 0 1.1rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 6px; border: 1px solid var(--accent); cursor: pointer;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-weak); color: var(--accent-hover); }
.btn[aria-pressed="true"] { background: var(--yes); border-color: var(--yes); color: var(--bg); }
.btn svg { width: 18px; height: 18px; }

.field { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.field input, .field select {
  font: inherit; font-size: var(--step--1);
  min-height: 44px; padding: 0 0.75rem; flex: 1 1 14rem;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 6px;
}
.capture-note { margin: 0.9rem 0 0; font-size: var(--step--1); color: var(--fg-faint); }
.said-yes { margin: 0; color: var(--yes); font-weight: 600; font-size: var(--step--1); }

/* ---------- landing page ---------- */

.hero { padding-block: 3.5rem 1rem; }
.hero h1 { max-width: 18ch; }
.hero .lede { font-size: var(--step-1); color: var(--fg-muted); max-width: 46ch; }
.eyebrow { font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.9rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; max-width: none; }
.cards li { margin: 0; }
.card { display: block; height: 100%; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--fg); }
.card:hover { border-color: var(--accent); color: var(--fg); }
.card .k { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.card .v { display: block; color: var(--fg-muted); font-size: var(--step--1); }

.links { list-style: none; padding: 0; margin: 0 0 1.5rem; max-width: none; }
.links li { margin: 0; border-bottom: 1px solid var(--border); }
.links a { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 0.8rem 0; text-decoration: none; color: var(--fg); }
.links a:hover { color: var(--accent); }
.links .tag { font-size: var(--step--1); color: var(--fg-faint); white-space: nowrap; }
.links a:hover .tag { color: var(--accent); }

.status-note {
  border-left: 3px solid var(--accent); padding: 0.1rem 0 0.1rem 1rem;
  color: var(--fg-muted); font-size: var(--step--1); margin: 2rem 0;
}
.status-note p { margin-bottom: 0.5em; }
.status-note p:last-child { margin-bottom: 0; }

.faq dt { font-weight: 600; margin-top: 1.4rem; }
.faq dd { margin: 0.35rem 0 0; color: var(--fg-muted); max-width: var(--measure); }

.prov { font-size: var(--step--1); color: var(--fg-faint); border-top: 1px solid var(--border); padding-top: 1.1rem; margin-top: 2.5rem; }
.prov code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

@media (max-width: 30rem) {
  .site-header .wrap { padding-block: 0.7rem; }
  .verdict { padding: 1.15rem; }
  .hero { padding-block: 2.5rem 0.5rem; }
}

/* ---------- hub index table ---------- */

.index-table { min-width: 26rem; }
.index-table caption { text-align: left; color: var(--fg-faint); padding-bottom: 0.75rem; font-size: var(--step--1); }
.index-table tbody th { font-weight: 400; }
.index-table tbody th a { color: var(--fg); text-decoration: none; }
.index-table tbody th a:hover { color: var(--accent); text-decoration: underline; }
.index-table td { white-space: nowrap; }
.index-table .fig { font-weight: 600; color: var(--fg); }
.index-table .u { color: var(--fg-muted); }

.pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-weight: 600; font-size: var(--step--1); }
.pill[data-state="yes"]     { background: var(--yes-bg);     color: var(--yes);     border: 1px solid var(--yes-line); }
.pill[data-state="depends"] { background: var(--depends-bg); color: var(--depends); border: 1px solid var(--depends-line); }
.pill[data-state="no"]      { background: var(--no-bg);      color: var(--no);      border: 1px solid var(--no-line); }
