/* Free Tier Watch — shared styles. No framework, no build step. */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --success-text: #006300;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
    --success-text: #0ca30c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --series-1: #3987e5;
  --success-text: #0ca30c;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
}

a { color: var(--series-1); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

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

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hrow {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent);
  flex: none;
}

nav.site { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }

nav.site a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14.5px;
}
nav.site a:hover { background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-primary); }
nav.site a[aria-current="page"] { color: var(--text-primary); font-weight: 600; background: color-mix(in srgb, var(--series-1) 12%, transparent); }

.theme-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
}
.theme-btn:hover { color: var(--text-primary); border-color: var(--baseline); }

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

.hero { padding: 40px 0 26px; }
.hero h1 {
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  font-weight: 680;
  max-width: 20ch;
}
.hero p.lede {
  font-size: 17.5px;
  color: var(--text-secondary);
  max-width: 68ch;
  margin: 0 0 8px;
}
.stamp {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  margin-top: 12px;
}
.stamp .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }

/* ---------- generic surfaces ---------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

section { margin: 0 0 34px; }

h2.sec {
  font-size: 20px; letter-spacing: -0.015em; margin: 0 0 4px; font-weight: 650;
}
p.sub { color: var(--text-secondary); margin: 0 0 16px; max-width: 76ch; }

/* ---------- controls ---------- */

.controls {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 0 0 18px;
}

input[type="search"], input[type="email"], input[type="number"], select {
  font-family: var(--sans);
  font-size: 14.5px;
  padding: 8px 11px;
  border-radius: 6px;
  border: 1px solid var(--baseline);
  background: var(--surface-1);
  color: var(--text-primary);
  min-width: 0;
}
input[type="search"] { min-width: 240px; flex: 1 1 240px; max-width: 380px; }
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--series-1); outline-offset: 1px;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13.5px;
  cursor: pointer;
  font-family: var(--sans);
  white-space: nowrap;
}
.chip:hover { color: var(--text-primary); border-color: var(--baseline); }
.chip[aria-pressed="true"] {
  background: var(--series-1); border-color: var(--series-1); color: #fff; font-weight: 550;
}

.count { font-family: var(--mono); font-size: 13px; color: var(--text-muted); margin-left: auto; }

/* ---------- provider cards ---------- */

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.p-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 17px 14px;
  display: flex; flex-direction: column; gap: 11px;
}
.p-card h3 { margin: 0; font-size: 16.5px; font-weight: 640; letter-spacing: -0.01em; }
.p-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.p-cat {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-top: 3px;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
  flex: none;
}
.badge svg { width: 12px; height: 12px; flex: none; }
.badge.ok    { color: var(--success-text); background: color-mix(in srgb, var(--good) 14%, transparent);    border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.badge.no    { color: var(--critical);     background: color-mix(in srgb, var(--critical) 14%, transparent); border-color: color-mix(in srgb, var(--critical) 42%, transparent); }
.badge.part  { color: var(--text-primary); background: color-mix(in srgb, var(--serious) 20%, transparent);  border-color: color-mix(in srgb, var(--serious) 50%, transparent); }
.badge.unk   { color: var(--text-secondary); background: color-mix(in srgb, var(--text-muted) 14%, transparent); border-color: var(--border); }

dl.limits { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; font-size: 14px; }
dl.limits dt { color: var(--text-secondary); min-width: 0; }
dl.limits dd { margin: 0; font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

.breaks {
  font-size: 14px; color: var(--text-secondary);
  border-left: 2px solid var(--serious); padding-left: 11px;
}
.breaks b { color: var(--text-primary); font-weight: 600; }

.gotchas { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-secondary); }
.gotchas li { margin-bottom: 4px; }

.p-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--grid);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-size: 12.5px; font-family: var(--mono); color: var(--text-muted);
}

details.more > summary {
  cursor: pointer; font-size: 13.5px; color: var(--series-1);
  list-style: none; padding: 2px 0;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more > div { padding-top: 9px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- changelog ---------- */

ol.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }

.entry {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0 20px;
  padding: 20px 0;
  border-top: 1px solid var(--grid);
}
.entry:first-child { border-top: none; }
.entry .when {
  font-family: var(--mono); font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.entry h3 { margin: 0 0 6px; font-size: 17px; font-weight: 640; letter-spacing: -0.012em; line-height: 1.3; }
.entry .meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 9px; }
.entry p { margin: 0 0 9px; color: var(--text-secondary); max-width: 78ch; }
.entry p.hurts { color: var(--text-primary); }
.entry p.hurts b { font-weight: 600; }

.tag {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-muted);
}
.tag.worse   { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.tag.better  { color: var(--success-text); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.tag.changed { color: var(--text-primary); border-color: color-mix(in srgb, var(--serious) 45%, transparent); background: color-mix(in srgb, var(--serious) 14%, transparent); }

@media (max-width: 620px) {
  .entry { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- calculator ---------- */

.calc { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 800px) { .calc { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 550; }
.field input, .field select { width: 100%; }
.field .hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.hero-num {
  font-size: clamp(30px, 5vw, 44px); font-weight: 660; letter-spacing: -0.03em;
  line-height: 1.05; margin: 0;
}
.hero-num .unit { font-size: 0.42em; font-weight: 550; color: var(--text-secondary); letter-spacing: 0; }
.hero-cap { color: var(--text-secondary); font-size: 14px; margin: 6px 0 0; }

/* chart: single-series horizontal bars, magnitude */
.chart { margin: 0; }
.chart figcaption { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.bars { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bar-row {
  display: grid; grid-template-columns: 148px 1fr 92px; align-items: center; gap: 12px;
  padding: 3px 0; position: relative; cursor: default;
}
.bar-row .name { font-size: 13.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track {
  display: block; height: 20px; position: relative;
  background: color-mix(in srgb, var(--text-muted) 8%, transparent);
  border-radius: 0 4px 4px 0;
}
.bar-row .fill {
  display: block; height: 100%; background: var(--series-1);
  border-radius: 0 4px 4px 0;
  min-width: 3px; transition: width .18s ease;
}
.bar-row .val { font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-row:hover .fill { background: color-mix(in srgb, var(--series-1) 82%, var(--text-primary)); }
.bar-row.is-picked .name { color: var(--text-primary); font-weight: 600; }

.tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--baseline); border-radius: 6px;
  padding: 8px 11px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 6px 22px rgba(0,0,0,.16);
  max-width: 280px; opacity: 0; transition: opacity .1s;
}
.tip.on { opacity: 1; }
.tip b { font-weight: 640; }
.tip .m { font-family: var(--mono); font-variant-numeric: tabular-nums; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); }
table.data th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
table.data td.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }

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

.capture {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 34px 0;
}
.capture h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.015em; font-weight: 650; }
.capture p { margin: 0 0 14px; color: var(--text-secondary); max-width: 62ch; }
.capture form { display: flex; gap: 8px; flex-wrap: wrap; max-width: 480px; }
.capture input[type="email"] { flex: 1 1 220px; }
.btn {
  background: var(--series-1); color: #fff; border: 1px solid var(--series-1);
  border-radius: 6px; padding: 8px 17px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; font-family: var(--sans); white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--series-1); }
.capture .fine { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 0; }
.form-msg { font-size: 14px; margin: 10px 0 0; }
.form-msg.ok { color: var(--success-text); }
.form-msg.err { color: var(--critical); }

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

.disclosure {
  font-size: 13px; color: var(--text-secondary);
  border: 1px solid var(--border); border-left: 3px solid var(--serious);
  border-radius: 6px; padding: 11px 14px; margin: 22px 0;
  background: var(--surface-1);
}

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 46px; padding: 26px 0 40px;
  font-size: 13.5px; color: var(--text-muted);
}
footer.site .fgrid { display: flex; gap: 26px; flex-wrap: wrap; justify-content: space-between; }
footer.site a { color: var(--text-secondary); }
footer.site p { margin: 0 0 7px; max-width: 60ch; }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface-1); padding: 8px 12px; border-radius: 6px; border: 1px solid var(--baseline); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
