/* No Sum Too Small — shared styles
   Identity: 1885 broadsheet newsprint + verdigris copper + torch gold */

:root {
  --paper: #f4eddc;
  --paper-2: #ebe1c8;
  --paper-3: #e2d5b6;
  --ink: #1c1914;
  --muted: #5a5144;
  --line: #c4b48f;
  --verd: #2a7566;
  --verd-2: #3f9583;
  --verd-soft: #cfe5dc;
  --copper: #a8562a;
  --copper-soft: #f1d8c4;
  --gold: #a87508;
  --gold-bright: #e9a92a;
  --red: #9b2d1c;
  --shadow: 0 1px 0 rgba(0,0,0,.05), 0 6px 18px rgba(60,40,10,.12);
  --radius: 10px;
  --statue: #6fae9b;
  --font-display: "Old Standard TT", "Times New Roman", Georgia, serif;
  --font-body: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-gothic: "UnifrakturMaguntia", "Old Standard TT", Georgia, serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0e1a21;
  --paper-2: #15262f;
  --paper-3: #1d323d;
  --ink: #ece4d0;
  --muted: #a8b4ae;
  --line: #2d4552;
  --verd: #7cc9b4;
  --verd-2: #5fb39d;
  --verd-soft: #193a35;
  --copper: #e79a68;
  --copper-soft: #3a2619;
  --gold: #f2c25a;
  --gold-bright: #f6c24e;
  --red: #ff8f78;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 8px 22px rgba(0,0,0,.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.35), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(120,90,40,.06), transparent 50%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(124,201,180,.08), transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(242,194,90,.06), transparent 50%);
}

main { flex: 1; }

img, svg, canvas { max-width: 100%; }

a { color: var(--verd); text-underline-offset: 3px; }
a:hover { color: var(--copper); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: .5em 1em; z-index: 100;
}
.skip-link:focus { left: 0; }

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

.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }
.wrap-narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 3px double var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 0;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  white-space: nowrap;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { margin-left: auto; display: flex; gap: .15rem; align-items: center; }
.nav a {
  text-decoration: none; color: var(--ink);
  padding: .4rem .6rem; border-radius: 6px; font-size: .92rem; font-weight: 500;
}
.nav a[aria-current="page"] { background: var(--verd-soft); color: var(--verd); }
.nav a:hover { background: var(--paper-2); }
.icon-btn {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: inline-grid; place-items: center; font-size: 1.05rem; flex: none;
}
.icon-btn:hover { border-color: var(--verd); }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 3px double var(--line);
    flex-direction: column; align-items: stretch; padding: .5rem 1rem 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .6rem; font-size: 1rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 600 1rem/1.2 var(--font-body);
  padding: .75rem 1.2rem; border-radius: 999px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; min-height: 44px;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); color: var(--ink); background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--verd); border-color: var(--verd); color: #fff; }
[data-theme="dark"] .btn-primary { color: #08201b; }
.btn-primary:hover { background: var(--verd-2); border-color: var(--verd-2); color: #fff; }
[data-theme="dark"] .btn-primary:hover { color: #08201b; }
.btn-gold { background: var(--gold-bright); border-color: var(--gold-bright); color: #2a1d00; }
.btn-gold:hover { background: #f5bd45; color: #2a1d00; }
.btn-small { padding: .45rem .85rem; font-size: .88rem; min-height: 36px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------- Cards / layout ---------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.section { padding: 2.5rem 0; }
.section + .section { border-top: 1px solid var(--line); }

.kicker {
  font: 700 .74rem/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase;
  color: var(--copper); margin-bottom: .6rem; display: block;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }

.badge {
  display: inline-block; font: 700 .68rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase;
  padding: .3rem .5rem; border-radius: 4px; background: var(--copper-soft); color: var(--copper);
}
.badge-verd { background: var(--verd-soft); color: var(--verd); }
.badge-ink { background: var(--ink); color: var(--paper); }

.rule { border: 0; border-top: 3px double var(--line); margin: 1.5rem 0; }

/* ---------- Newspaper styles ---------- */
.masthead {
  font-family: var(--font-gothic); font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 4rem); line-height: 1; text-align: center; margin: 0;
}
.dateline {
  display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
  border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink);
  padding: .3rem 0; margin: .5rem 0 1rem;
  font: 600 .72rem/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase;
}
.newsprint {
  background: #f7f0de; color: #1c1914;
  border: 1px solid #c4b48f; box-shadow: var(--shadow);
  padding: 1rem;
}
[data-theme="dark"] .newsprint { background: #efe6cf; color: #1c1914; }
.newsprint a { color: #2a7566; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 3px double var(--line);
  padding: 1.5rem 0 2rem; margin-top: 3rem;
  font-size: .88rem; color: var(--muted);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.footer-links a { color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(150%);
  background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 999px;
  font-weight: 600; z-index: 200; transition: transform .25s ease; max-width: calc(100% - 2rem); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Forms ---------- */
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: .3rem; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; font: 1rem var(--font-body); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px; padding: .65rem .75rem; min-height: 44px;
}
input:focus, select:focus, textarea:focus { border-color: var(--verd); outline: none; box-shadow: 0 0 0 3px var(--verd-soft); }
input[type="range"] { width: 100%; accent-color: var(--verd); }
.field { margin-bottom: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: .4rem .8rem; cursor: pointer; font: 600 .9rem var(--font-body); min-height: 38px;
}
.chip[aria-pressed="true"] { background: var(--verd); color: #fff; border-color: var(--verd); }
[data-theme="dark"] .chip[aria-pressed="true"] { color: #08201b; }

/* ---------- Statue svg ---------- */
.statue-svg .st-body { fill: var(--statue); transition: fill .4s ease; }
.statue-svg .st-fold { stroke: rgba(0,0,0,.22); fill: none; stroke-width: 2; stroke-linecap: round; }
.statue-svg .st-flame { fill: var(--gold-bright); }
.statue-svg .st-ped { fill: var(--paper-3); stroke: var(--line); }
.statue-svg .st-tablet { fill: var(--statue); stroke: rgba(0,0,0,.25); stroke-width: 1.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
