/* Glaze — the test-tile bench */
:root {
  --bg: #F7F2EA;
  --text: #2B1D14;
  --accent: #A3321F;
  --primary: #2F5F4F;
  --surface: #EFE6D8;
  --on-primary: #FFFFFF;
  --muted: #5E5047;
  --line: #8C7B6E;
  --line-soft: #E2D6C6;
  --tint: #DCE8DF;
  --risk-low: #2F6B50;
  --risk-mod: #8A5A00;
  --risk-high: #A3321F;
  --focus: #2F5F4F;
  --font-h: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-b: "Karla", "Segoe UI", Arial, sans-serif;
  --radius: 6px;
  --max: 1200px;
  --gutter: clamp(16px, 5vw, 32px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E1712;
    --text: #F2EADF;
    --accent: #F08A73;
    --primary: #9CC7B2;
    --surface: #2A211A;
    --on-primary: #1E1712;
    --muted: #BFB2A5;
    --line: #9A8A7C;
    --line-soft: #3D3128;
    --tint: #23342D;
    --risk-low: #9CC7B2;
    --risk-mod: #E8B84A;
    --risk-high: #F08A73;
    --focus: #9CC7B2;
  }
}
@media (prefers-contrast: more) {
  :root { --muted: var(--text); --line: var(--text); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
input, select, textarea, button { font: inherit; color: inherit; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-h); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.35rem); }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
.container { width: min(100%, var(--max)); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: 999px; z-index: 50; text-decoration: none; }
.skip:focus { top: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; border-radius: 8px; background: #F7F2EA; }
.brand img { width: 150px; height: 40px; object-fit: cover; border-radius: 8px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.main-nav a { display: inline-block; padding: 10px 10px; color: var(--text); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; min-height: 44px; }
.main-nav a:hover { border-bottom-color: var(--line-soft); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--primary); }
@media (max-width: 720px) {
  .main-nav { width: 100%; }
  .main-nav ul { gap: 0; }
  .main-nav a { padding: 8px 8px; font-size: .95rem; }
}

/* Glaze rule: section divider */
.rule { height: 0; border: 0; border-top: 4px solid var(--primary); margin: 0; opacity: .85; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px; border: 2px solid var(--primary); background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { filter: brightness(.92); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 8px 4px; color: var(--primary); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Test-tile card */
.tile { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 40px 22px 22px; min-width: 0; }
.tile::before { content: ""; position: absolute; top: 12px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.tile h3 { margin-top: 0; }
.tile > :last-child { margin-bottom: 0; }

/* Page head */
.page-head { padding-block: clamp(28px, 5vw, 56px) 20px; }
.page-head .lead { font-size: 1.15rem; max-width: 62ch; }
.section { padding-block: clamp(40px, 7vw, 88px); }
.section-tight { padding-block: clamp(28px, 4vw, 48px); }

/* Home hero */
.hero { padding-block: clamp(24px, 4vw, 48px) 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "tool" "copy"; gap: 20px; }
.hero-h { grid-area: h; }
.hero-h h1 { margin: 0; }
.hero-tool { grid-area: tool; min-width: 0; }
.hero-copy { grid-area: copy; min-width: 0; }
.hero-copy .lead { font-size: 1.15rem; }
.hero-copy .actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 8px 0 12px; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "h tool" "copy tool"; grid-template-rows: auto 1fr; gap: 24px 40px; align-items: start; }
}
.mt { margin-top: 16px; }
@media (min-width: 520px) { .ea-btn { margin-top: 33px; } }
.hero-band { margin-top: 28px; }
.hero-band img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 70% 50%; border-radius: var(--radius); border: 1px solid var(--line-soft); }
@media (min-width: 700px) { .hero-band img { aspect-ratio: 21 / 8; } }

/* Checklist sections */
.check { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.check-num { font-family: var(--font-h); font-weight: 700; font-size: 2rem; color: var(--muted); line-height: 1; display: flex; align-items: center; gap: 10px; }
.check-num::after { content: ""; width: 14px; height: 8px; border-left: 3px solid var(--primary); border-bottom: 3px solid var(--primary); transform: rotate(-45deg) translateY(-3px); }
@media (min-width: 860px) {
  .check { grid-template-columns: 96px minmax(0, 1fr); gap: 24px; }
  .check-num { flex-direction: column; align-items: flex-start; padding-top: 6px; font-size: 2.6rem; }
}
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 760px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tools-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 860px) { .tools-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); } }
.tools-grid .tile { display: flex; flex-direction: column; min-height: 240px; }
.tools-grid .tile .go { margin-top: auto; font-weight: 700; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { counter-increment: s; }
.steps li .tile::after { content: counter(s); position: absolute; top: 6px; right: 14px; font-family: var(--font-h); font-size: 1.6rem; color: var(--muted); }
.audience { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .audience { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.audience li { border-left: 3px solid var(--primary); padding: 6px 0 6px 14px; }

/* Plans */
.plans { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.badge { display: inline-block; font-size: .85rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 10px; }
.badge.now { background: var(--tint); border-color: var(--primary); color: var(--text); }
.plan-list { padding-left: 1.1em; }

/* Roadmap shelf */
.shelf { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: grid; gap: 14px; }
.shelf::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; border-left: 3px solid var(--line); }
.shelf li { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 16px; }
.shelf li::before { content: ""; position: absolute; left: -26px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--primary); }

/* Early access band */
.ea-band { background: var(--tint); border-radius: var(--radius); border: 1px solid var(--line-soft); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); }
.ea-body { padding: clamp(20px, 4vw, 40px); }
.ea-art img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 900px) { .ea-band { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } .ea-art img { aspect-ratio: auto; min-height: 100%; } }

/* Forms */
.field { margin-bottom: 16px; min-width: 0; }
.field label, .label { display: block; font-weight: 700; margin-bottom: 6px; }
.help { font-size: .9rem; color: var(--muted); margin: 4px 0 0; }
input[type="text"], input[type="email"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text);
}
textarea { min-height: 140px; resize: vertical; }
[aria-invalid="true"] { border: 2px solid var(--risk-high) !important; }
.err { color: var(--risk-high); font-size: .92rem; font-weight: 700; margin: 6px 0 0; }
.err:empty { display: none; }
.status { font-weight: 700; margin-top: 12px; }
.status:empty { display: none; }
.status.ok { color: var(--text); background: var(--bg); border-left: 4px solid var(--primary); padding: 10px 14px; border-radius: 4px; }
.status.bad { color: var(--risk-high); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.inline-form .field { flex: 1 1 240px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }

/* Tool panel */
.tool { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: clamp(16px, 3vw, 28px); min-width: 0; position: relative; }
.tool h2.tool-title { font-size: 1.5rem; }
.step-label { font-family: var(--font-h); font-size: 1.3rem; font-weight: 700; margin: 4px 0 10px; display: block; }
.rows { display: grid; gap: 8px; margin-bottom: 10px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 44px; gap: 8px; align-items: end; }
.row label { font-size: .85rem; font-weight: 700; display: block; margin-bottom: 2px; }
.row.unknown input.mat { border-left: 4px dashed var(--risk-mod); }
.row .rm { width: 44px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.row .rm svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .row { grid-template-columns: minmax(0, 1fr) 76px 44px; } }
.row-head { display: none; }
.total { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; font-variant-numeric: tabular-nums; font-weight: 700; }
.total .bar { flex: 1; height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.total .bar span { display: block; height: 100%; background: var(--primary); width: 0; }
.paste { margin-top: 10px; }
.paste[hidden] { display: none; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }

/* Cone picker */
.cones { display: flex; gap: 4px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.cone { flex: 0 0 auto; position: relative; }
.cone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cone label { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 50px; padding: 6px 2px 6px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--bg); font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; }
.cone label .shape { width: 16px; height: 22px; background: var(--line); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: rotate(8deg); }
.cone label small { font-weight: 400; font-size: .68rem; color: var(--muted); line-height: 1.1; text-align: center; }
.cone input:checked + label { border: 2px solid var(--primary); background: var(--tint); }
.cone input:checked + label .shape { background: var(--primary); transform: rotate(32deg) translateX(3px); }
.cone input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip label { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); cursor: pointer; font-weight: 500; }
.chip input:checked + label { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Result panel */
.result { margin-top: 18px; }
.result-card { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 40px 20px 20px; position: relative; }
.result-card::before { content: ""; position: absolute; top: 12px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.risk-head { display: flex; align-items: center; gap: 14px; margin: 0 0 6px; }
.risk-head h2, .risk-head h3 { margin: 0; font-size: clamp(1.9rem, 4.5vw, 3rem); }
.risk-head .word { color: var(--rc, var(--text)); }
.risk-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.risk-low { --rc: var(--risk-low); }
.risk-moderate { --rc: var(--risk-mod); }
.risk-high { --rc: var(--risk-high); }
.drip { display: block; width: 100%; height: 72px; margin: 4px 0 10px; }
.drip .glaze { fill: var(--rc, var(--primary)); }
.drip-grow { transform-origin: top; animation: grow .9s ease-out 1; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .drip-grow { animation: none; } }
.result .sub { font-family: var(--font-b); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 6px; }
.result ul { margin: 0; padding-left: 1.2em; }
.result li { margin-bottom: 6px; }
.disclaimer { font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 10px; }
.indicators { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.indicators div { background: var(--surface); border-radius: var(--radius); padding: 8px 10px; font-variant-numeric: tabular-nums; }
.indicators b { display: block; font-size: 1.25rem; }
.indicators span { font-size: .82rem; color: var(--muted); }
.empty-note { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); margin: 10px 0; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: .9rem; color: var(--muted); padding: 8px 10px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.num, th.num { text-align: right; }
thead th { background: var(--surface); font-size: .9rem; }
tbody th { font-weight: 700; }
tr.group th { background: var(--surface); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chg-up { color: var(--risk-high); font-weight: 700; }
.chg-down { color: var(--primary); font-weight: 700; }
.chg-same { color: var(--muted); }
details.umf summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 44px; display: flex; align-items: center; }

/* Tool page layout */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 980px) {
  .tool-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .tool-layout .sticky { position: sticky; top: 16px; }
}
.media-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 860px) { .media-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.media-split img, .figure img { border-radius: var(--radius); border: 1px solid var(--line-soft); width: 100%; }
.figure img.sq { aspect-ratio: 1; object-fit: cover; }
.tips { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); list-style: none; padding: 0; }
@media (min-width: 700px) { .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Defect guide */
.defect-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 760px) { .defect-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.defect-pick .chip label { width: 100%; justify-content: center; border-radius: var(--radius); min-height: 56px; font-weight: 700; }
.ticks fieldset { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.ticks legend { float: left; width: 100%; margin-bottom: 6px; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ticks legend.step-label { font-size: 1.3rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.defect-pick { clear: both; }
.h3 { font-size: 1.35rem; }
.tick { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; clear: both; }
.tick input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 22px; accent-color: var(--primary); }
.causes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .causes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.causes .tile p { margin-bottom: .6em; }
.match { font-size: .85rem; color: var(--muted); }
.defect-section { border-top: 1px solid var(--line-soft); padding-top: 28px; margin-top: 28px; }
.dg-table td:first-child { width: 38%; font-weight: 700; }
@media (max-width: 640px) {
  .dg-table thead { position: absolute; left: -9999px; }
  .dg-table tr, .dg-table td { display: block; width: 100% !important; }
  .dg-table td { border: 0; padding: 4px 10px; }
  .dg-table tr { border-bottom: 1px solid var(--line-soft); padding: 8px 0; }
  .dg-table td:last-child::before { content: "Test to confirm: "; font-weight: 700; }
}

/* Swap */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; margin: 6px 0; }

/* About */
.why { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .why { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); } }
.addr { display: grid; gap: 12px; }

/* Legal */
.legal { max-width: 72ch; }
.legal h2 { font-size: 1.6rem; margin-top: 1.4em; }

/* 404 */
.nf-links { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .nf-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nf-links a { display: block; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); font-weight: 700; text-decoration: none; }

/* Footer */
.site-footer { background: var(--surface); border-top: 4px solid var(--primary); margin-top: clamp(40px, 6vw, 80px); padding-block: 36px 28px; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); } }
.site-footer h2 { font-family: var(--font-b); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; }
.site-footer a { color: var(--text); }
.foot-lines { border-top: 1px solid var(--line-soft); margin-top: 24px; padding-top: 16px; color: var(--muted); }
.foot-lines p { margin: 0 0 4px; }
