/* Ghost Town Coin Co. — public site */

/* Palette: hemlock & pine, holler fog, lichen, rusted tin, barn wood, mason-jar glass. */
:root {
  --bg: #e8e9de;              /* lichen-tinted fog */
  --surface: #f5f6ef;
  --surface-2: #dce1d3;
  --ink: #1b231f;
  --ink-2: #43504a;
  --muted: #65716a;
  --line: #c6cdbd;
  --accent: #2f5a36;          /* hemlock */
  --accent-ink: #f2f5ee;
  --rust: #9a4526;            /* rusted tin roof */
  --hemlock: #2e4f33;

  --good: #1b7a36;
  --good-bg: #dcefdc;
  --good-solid: #1b7a36;
  --bad-solid: #b3261e;
  --warn-solid: #a86a00;
  --bad: #9e2b1f;
  --bad-bg: #f3dfd9;
  --warn: #855a12;
  --warn-bg: #f2e6cc;

  --t-fading_apparition: #8a9095;  /* holler fog */
  --t-well_traveled: #7a5a3c;      /* barn wood */
  --t-lightly_traveled: #56703f;   /* moss */
  --t-mason_jar_stash: #377f8f;    /* jar glass */
  --t-white_lightning: #ad8628;    /* lantern light */

  /* header/footer night sky + ridges (same in both themes) */
  --sky-top: #0d170f;
  --sky-bottom: #233a25;
  --moon: #ece6cf;
  --night-ink: #ece7da;

  --radius: 8px;
  --shadow: 0 1px 2px rgb(30 35 38 / 0.06), 0 4px 14px rgb(30 35 38 / 0.06);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-label: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-type: 'Courier Prime', 'Courier New', Courier, monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111814;
    --surface: #18211c;
    --surface-2: #222c26;
    --ink: #e6eae2;
    --ink-2: #bfc8be;
    --muted: #8e9b91;
    --line: #2e3a33;
    --accent: #8fc48f;
    --accent-ink: #0f1712;
    --rust: #e0956b;
    --hemlock: #9cc09a;

    --good: #7fd68f;
    --good-bg: #183323;
    --good-solid: #2f9a4c;
    --bad-solid: #c8382d;
    --warn-solid: #b97a10;
    --bad: #ef8b7d;
    --bad-bg: #3a201c;
    --warn: #e2b55e;
    --warn-bg: #362c17;

    --t-fading_apparition: #a2a8ac;
    --t-well_traveled: #b58c62;
    --t-lightly_traveled: #8fae74;
    --t-mason_jar_stash: #62b2c2;
    --t-white_lightning: #ddb54f;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grain), var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; }
p { margin: 0 0 0.8em; }
a { color: var(--accent); }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0)); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.75rem; color: var(--hemlock); margin: 0 0 0.4em; }

/* ── header / footer: night sky over Blue Ridge ridgelines ── */
.site-header { background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); color: var(--night-ink); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 0; flex-wrap: wrap; position: relative; z-index: 1; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--night-ink); }
.wordmark img { width: 42px; height: 42px; }
.wm-text { display: flex; flex-direction: column; line-height: 1; }
.wm-top { font-family: var(--font-display); font-weight: 650; text-transform: uppercase; font-size: 1.2rem; letter-spacing: 0.1em; }
.wm-sub { font-family: var(--font-display); font-style: italic; font-size: 0.95rem; letter-spacing: 0.02em; color: #bfcdb5; margin-top: 2px; }
.header-search { display: flex; gap: 6px; }
.header-search input { width: 8.5em; background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.22); color: var(--night-ink); }
.header-search input::placeholder { color: #a7b99d; }
.ridges { position: relative; height: 64px; margin-top: -4px; }
.ridges svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.moon {
  position: absolute; right: 14%; bottom: 30px; width: 22px; height: 22px; border-radius: 50%;
  box-shadow: 7px -3px 0 0 var(--moon); filter: drop-shadow(0 0 6px rgb(236 230 207 / 0.4));
}
.site-footer { margin-top: 64px; background: var(--sky-bottom); color: #bcc8b3; font-size: 0.875rem; }
.site-footer .ridges { height: 56px; margin: 0; }
.site-footer .wrap { padding-block: 8px 32px; }
.site-footer strong { color: var(--night-ink); font-family: var(--font-label); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.1em; }

/* ── form controls ── */
input {
  font: inherit; font-family: var(--font-mono); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  text-transform: uppercase; min-width: 0;
}
input::placeholder { color: var(--muted); opacity: 0.7; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
button {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 8px 14px;
}
button:hover { filter: brightness(1.08); }

/* ── home ── */
.hero { padding-block: 40px 16px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 6vw, 2.7rem); letter-spacing: 0.01em; }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 36em; }
.big-search { margin-top: 24px; }
.big-search label { font-weight: 600; display: block; margin-bottom: 6px; }
.big-search__row { display: flex; gap: 8px; }
.big-search input { flex: 1; font-size: 1.35rem; padding: 12px 14px; letter-spacing: 0.04em; }
.big-search button { font-size: 1.05rem; padding: 12px 20px; }
.field-help { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.field-error { color: var(--bad); font-weight: 600; font-size: 0.95rem; margin-top: 8px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 24px; box-shadow: var(--shadow); }
.panel h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; }
.features { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.features h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.features p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }

.tier-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.tier-list li { display: flex; gap: 14px; align-items: flex-start; }
.tier-list h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin-bottom: 2px; }
.tier-list p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.tier-list .range { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.tier-chip {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font: 700 0.9rem var(--font-type); color: #fff; background: var(--tier);
  box-shadow: inset 0 0 0 3px var(--tier), inset 0 0 0 4px rgb(255 255 255 / 0.45); /* scrip-token rim */
}

/* tier colors */
.t-fading_apparition { --tier: var(--t-fading_apparition); }
.t-well_traveled { --tier: var(--t-well_traveled); }
.t-lightly_traveled { --tier: var(--t-lightly_traveled); }
.t-mason_jar_stash { --tier: var(--t-mason_jar_stash); }
.t-white_lightning { --tier: var(--t-white_lightning); }

/* ── record page ── */
.record { padding-top: 28px; }
.record-head { margin-bottom: 20px; }
.serial { font-family: var(--font-type); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.06em; color: var(--rust); margin: 0 0 4px; }
.record-head h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 6vw, 2.4rem); margin-bottom: 6px; }
.variety { color: var(--ink-2); margin: -2px 0 10px; }
.verdict {
  display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 7px 16px 7px 8px; border-radius: 999px;
  font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; color: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}
.verdict-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(255 255 255 / 0.22); flex: none; }
.verdict-icon svg { width: 17px; height: 17px; }
.verdict--good { background: var(--good-solid); }
.verdict--bad { background: var(--bad-solid); }
.verdict--warn { background: var(--warn-solid); }

.alert { border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; border-left: 5px solid; }
.alert--bad { background: var(--bad-bg); border-color: var(--bad); }
.alert--warn { background: var(--warn-bg); border-color: var(--warn); }

.section-label {
  font-family: var(--font-label); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.16em; color: var(--hemlock);
  margin: 34px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-label .hint { font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0; font-weight: 400; text-transform: none; color: var(--muted); }

.tier-overall { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--tier); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tier-overall__label, .tier-side__label { font-family: var(--font-label); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; color: var(--muted); margin: 0; letter-spacing: 0.14em; }
.tier-overall__name { font-family: var(--font-display); font-weight: 650; font-size: clamp(2rem, 8vw, 2.5rem); color: var(--tier); margin: 2px 0 10px; line-height: 1.1; }
.tier-overall__desc { color: var(--ink-2); margin: 10px 0 0; font-size: 0.95rem; }
.tier-sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.tier-side { border-top: 3px solid var(--tier) !important; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tier-side__name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.15; margin: 2px 0 8px; color: var(--tier); }

.tier-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tier-step {
  text-align: center; font: 700 0.75rem var(--font-mono); padding: 6px 0; border-radius: 4px;
  background: var(--surface-2); color: var(--muted);
}
.tier-step.is-on { background: var(--tier); color: #fff; }
.tier-scale--sm .tier-step { font-size: 0.65rem; padding: 3px 0; }

.problems { margin-top: 14px; }
.problems__label { font-family: var(--font-label); font-weight: 600; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; margin-bottom: 6px; color: var(--bad); }
.problems ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.problem-chip { background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: 0.875rem; padding: 4px 10px; border-radius: 999px; }

.gallery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.photo { margin: 0; }
.photo a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #15191c; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.2s; }
.photo a:hover img { transform: scale(1.02); }
.photo figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }

.table-scroll { overflow-x: auto; }
.measure { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.measure th, .measure td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.measure thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.measure tbody th { font-weight: 600; }
.measure tbody th, .measure td { vertical-align: top; }
.measure .delta { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.checks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.checks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.checks h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: 0 0 2px; }
.checks p { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.result { flex: none; display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 0.85rem; padding: 4px 12px 4px 9px; border-radius: 999px; }
.result svg { width: 14px; height: 14px; }
.result--pass { color: var(--good); background: var(--good-bg); }
.result--fail { color: var(--bad); background: var(--bad-bg); }
.result--none { color: var(--muted); background: var(--surface-2); }

.notes { white-space: pre-line; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }

.record-meta dl { margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.record-meta dt { font-size: 0.8rem; color: var(--muted); }
.record-meta dd { margin: 0; font-weight: 600; }
.record-meta dd.mono { font-family: var(--font-type); font-weight: 700; }
.amendments { margin-top: 14px; font-size: 0.9rem; }
.amendments summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.amendments ol { padding-left: 1.2em; color: var(--ink-2); }
.match-tip { margin-top: 32px; }
.match-tip h2 { font-size: 1.4rem; }
.match-tip p { margin: 0; color: var(--ink-2); }

/* ── reserved / void / not found ── */
.state { padding-block: 48px 8px; max-width: 36em; }
.state h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.state-badge { display: inline-block; font-weight: 700; font-size: 0.9rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px; }
.state-badge--warn { color: var(--warn); background: var(--warn-bg); }
.state-badge--bad { color: var(--bad); background: var(--bad-bg); }

@media (max-width: 480px) {
  .header-search { width: 100%; }
  .moon { right: 9%; }
  .header-search input { flex: 1; width: auto; }
  .big-search__row { flex-direction: column; }
  .gallery { gap: 8px; }
  .measure th, .measure td { padding: 8px 6px; font-size: 0.875rem; }
}

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

/* ridge fills that track the theme (inline styles are blocked by the CSP) */
.ridge-page { fill: var(--bg); }
.ridge-sky { fill: var(--sky-bottom); }
.ridges--footer { background: var(--bg); }

/* Header search button: rust stands out against the green night. */
.header-search button { background: var(--rust); color: #fbf6ec; }



/* Grade range shown beside tier names, e.g. "Well Traveled G–F" */
.grades {
  font-family: var(--font-type); font-weight: 700; font-size: 0.5em; letter-spacing: 0.02em;
  color: var(--ink-2); background: var(--surface-2); padding: 0.15em 0.45em; border-radius: 4px;
  vertical-align: middle; white-space: nowrap;
}
.tier-side__name .grades { font-size: 0.62em; }
.tier-list .range .grades { font-size: 0.95em; padding: 0.05em 0.4em; }

/* ── mail-in orders ── */
.hero--compact { padding-block: 32px 4px; }
.price-line { font-size: 1.05rem; margin: 0.5em 0 0; }
.order-form h2 { margin-top: 1.2em; font-size: 1.35rem; }
.order-form h2:first-of-type { margin-top: 0; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; }
.form-field--wide { grid-column: 1 / -1; }
.order-form > .form-field { margin-top: 18px; }
.form-field label, .form-field legend { font-weight: 600; }
fieldset.form-field { border: 0; padding: 0; }
.form-field .field-help, .form-field .field-error { margin: 0; }
.order-form input, .order-form textarea { text-transform: none; font-family: var(--font-body); font-size: 1rem; padding: 10px 12px; width: 100%; }
.order-form textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; resize: vertical;
}
.order-form [aria-invalid='true'] { border-color: var(--bad); }
.order-form label.radio {
  display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px;
}
.order-form label.radio input { width: auto; accent-color: var(--accent); }
.order-form label.radio:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.order-form .muted { margin-left: auto; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.actions { margin: 20px 0 8px; }
.btn { display: inline-block; text-decoration: none; font-weight: 600; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px 14px; }
.btn:hover { filter: brightness(1.08); }
.btn-big { font-size: 1.1rem; padding: 13px 24px; }

.notice { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); margin: 12px 0; }
.notice--good { background: var(--good-bg); color: var(--good); }
.notice--bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.order-steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 0.85rem; }
.order-steps li { border-top: 4px solid var(--line); padding-top: 6px; color: var(--muted); }
.order-steps li.is-done { border-color: var(--accent); color: var(--ink-2); }
.order-steps li.is-current { border-color: var(--rust); color: var(--ink); font-weight: 700; }
.order-total { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.order-total td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.order-total td:last-child { text-align: right; font-family: var(--font-mono); white-space: nowrap; padding-left: 12px; }
.order-total__sum td { font-weight: 700; border-bottom: 0; font-size: 1.1rem; }
.steps-list { padding-left: 1.3em; }
.steps-list li { margin-bottom: 4px; }
.mail-to { display: flex; flex-direction: column; font-style: normal; font-weight: 600; background: var(--surface-2); border-radius: 8px; padding: 12px 16px; }
.plain-links { padding: 0; list-style: none; }
.plain-links li { padding: 4px 0; }
.break { overflow-wrap: anywhere; }

/* packing slip: shown on screen as a preview, and the only thing printed */
.slip { margin-top: 24px; background: #fff; color: #111; border: 1px dashed #999; border-radius: 6px; padding: 20px; font-size: 0.95rem; }
.slip__head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #2e4f33; padding-bottom: 6px; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.slip__brand { font-family: var(--font-display); font-weight: 600; }
.slip__id { font-size: 1.5rem; font-weight: 700; color: #9a4526; }
.slip__grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.slip__grid dt { font-weight: 600; color: #444; }
.slip__grid dd { margin: 0; }
.slip__addr { white-space: pre-line; }
.slip__list-label { margin: 14px 0 4px; color: #444; }
.slip__list { margin: 0; padding-left: 1.6em; columns: 2; column-gap: 24px; }
.slip__list li { border-bottom: 1px solid #bbb; height: 1.9em; }
.slip__foot { margin: 12px 0 0; font-size: 0.8rem; color: #666; }
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .slip { border: 0; margin: 0; padding: 0; }
}
.send-panel { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.send-panel h2 { margin: 0 0 4px; }
.send-panel p { margin: 0; }
