@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0d0c0a;
  --bg-2: #141210;
  --bg-3: #1a1714;
  --text: #f4efe6;
  --text-2: rgba(244, 239, 230, 0.7);
  --text-3: rgba(244, 239, 230, 0.55);
  --text-4: rgba(244, 239, 230, 0.4);
  --gold: #d9a441;
  --gold-soft: rgba(217, 164, 65, 0.4);
  --silver: #c3cbd4;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.08);
  --green: #4ade80;
  --red: #f87171;
  --radius: 0.75rem;
  --maxw: 72rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: "Fraunces", Georgia, serif; line-height: 1.15; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.15rem; font-family: "Inter", sans-serif; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 4px; }
strong { color: var(--text); font-weight: 600; }
ul, ol { margin: 0 0 1rem 1.25rem; padding: 0; }
li { margin-bottom: 0.4rem; }
img { max-width: 100%; display: block; }

::selection { background: rgba(217, 164, 65, 0.35); color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 48rem; }
.wide { max-width: 90rem; }

.eyebrow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.25em; color: var(--gold); margin: 0 0 0.75rem; font-weight: 600; }
.lead { font-size: 1.05rem; color: var(--text-2); max-width: 40rem; }
.muted { color: var(--text-3); }
.gold { color: var(--gold); }
.silver { color: var(--silver); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 12, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { font-family: "Fraunces", serif; font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-suffix { color: var(--gold); }
.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a { color: var(--text-2); font-size: 0.92rem; font-weight: 500; }
.site-nav a:hover { color: var(--gold); text-decoration: none; }
.site-nav a.active { color: var(--gold); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.75rem 0; border-bottom: 1px solid var(--line-2); }
  .site-nav a:last-child { border-bottom: 0; }
}

/* ---------- Layout sections ---------- */
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.stack > * + * { margin-top: 1rem; }
.prose { max-width: 48rem; }
.prose p, .prose li { color: var(--text-2); }
.prose h2 { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose h3 { margin-top: 1.75rem; margin-bottom: 0.5rem; color: var(--text); }
.prose ul, .prose ol { color: var(--text-2); }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 3rem; }
.hero h1 { max-width: 36rem; }
.hero h1 .gold, .hero h1 .silver { font-style: italic; }
.hero .lead { margin-top: 1.5rem; }
.hero-underline { display: block; margin-top: 0.5rem; width: 12rem; height: 10px; }

.spot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; max-width: 30rem; margin-top: 2.5rem; }
.spot-card {
  display: block; border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  border-radius: var(--radius); padding: 1rem; transition: border-color .2s, transform .2s;
}
.spot-card:hover { border-color: rgba(255,255,255,0.25); text-decoration: none; }
.spot-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-4); }
.spot-arrow { font-size: 0.7rem; }
.spot-arrow.up { color: var(--green); }
.spot-arrow.down { color: var(--red); }
.spot-price { font-family: "Fraunces", serif; font-size: 1.6rem; font-weight: 600; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
.spot-price.gold { color: var(--gold); }
.spot-price.silver { color: var(--silver); }
.spot-gram { font-size: 0.8rem; color: var(--text-4); margin-top: 0.25rem; }

@media (max-width: 420px) { .spot-grid { grid-template-columns: 1fr; } }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(0,0,0,0.3); padding: 0.75rem 0; }
.ticker-track { display: flex; width: max-content; gap: 2.5rem; white-space: nowrap; animation: marquee 38s linear infinite; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-3); }
.ticker-track span { font-variant-numeric: tabular-nums; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ---------- Price section ---------- */
.price-block { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center; }
.price-block.reverse { grid-template-columns: 0.9fr 1.1fr; }
.price-block.reverse .price-meta { order: 2; }
.price-meta h2 { margin-bottom: 0.5rem; }
.price-meta .lead { margin-bottom: 1.5rem; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 1.25rem 0; }
.stat { border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.75rem; background: var(--bg-2); }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-4); }
.stat-value { font-family: "Fraunces", serif; font-size: 1.15rem; font-weight: 600; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.price-chart { height: 260px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); position: relative; overflow: hidden; }
.price-chart svg { width: 100%; height: 100%; display: block; }
.chart-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.chart-tab { font-size: 0.78rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 0.4rem; background: transparent; color: var(--text-3); cursor: pointer; }
.chart-tab.active { color: var(--gold); border-color: var(--gold-soft); }
@media (max-width: 760px) {
  .price-block, .price-block.reverse { grid-template-columns: 1fr; }
  .price-block.reverse .price-meta { order: 0; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Card grids ---------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); background: rgba(20,18,16,0.6);
  border-radius: var(--radius); padding: 1.25rem; transition: border-color .2s, transform .2s; color: var(--text);
}
a.card:hover { border-color: var(--gold-soft); text-decoration: none; transform: translateY(-2px); }
.card .card-icon { color: var(--gold); margin-bottom: 0.75rem; }
.card h3 { color: var(--text); margin-bottom: 0.5rem; }
.card p { color: var(--text-3); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }
.card .card-meta { font-size: 0.75rem; color: var(--text-4); }
.card .card-cta { color: var(--gold); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.card .card-cta::after { content: "\2192"; transition: transform .2s; }
a.card:hover .card-cta::after { transform: translateX(3px); }
.card-tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gold); margin-bottom: 0.6rem; }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-head .lead { margin: 0.75rem 0 0; }
.section-link { color: var(--gold); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.section-link::after { content: "\2192"; transition: transform .2s; }
.section-link:hover::after { transform: translateX(3px); }

/* ---------- Methodology / feature band ---------- */
.feature-band { border: 1px solid var(--line); background: rgba(20,18,16,0.6); border-radius: 1rem; padding: 2rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; }
.feature-band .fb-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gold-soft); background: rgba(217,164,65,0.1); border-radius: 1rem; color: var(--gold); }
@media (max-width: 760px) { .feature-band { grid-template-columns: 1fr; text-align: left; } }

/* ---------- Disclaimer ---------- */
.disclaimer { border: 1px solid var(--gold-soft); background: rgba(217,164,65,0.04); border-radius: 1rem; padding: 1.5rem; }
.disclaimer-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.disclaimer-icon { flex: 0 0 auto; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gold-soft); background: rgba(217,164,65,0.1); border-radius: 0.5rem; color: var(--gold); }
.disclaimer h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.disclaimer p { color: var(--text-3); font-size: 0.9rem; margin-bottom: 0.6rem; }
.disclaimer p:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0.6rem 1.25rem; border-radius: 0.5rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .2s, transform .1s, border-color .2s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-gold { background: var(--gold); color: #1a1408; }
.btn-gold:hover { background: #e5b45a; color: #1a1408; }
.btn-outline { border-color: var(--gold-soft); color: var(--gold); background: transparent; }
.btn-outline:hover { background: rgba(217,164,65,0.1); color: var(--gold); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.25rem; border: 1px solid var(--line); background: rgba(20,18,16,0.7); border-radius: 1rem; padding: 1.5rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-4); }
.input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(0,0,0,0.3);
  border-radius: 0.5rem; padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--text);
  font-family: inherit; outline: none; transition: border-color .2s;
}
.input:focus, select:focus, textarea:focus { border-color: var(--gold-soft); }
textarea { resize: vertical; min-height: 140px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-note { font-size: 0.78rem; color: var(--text-4); display: flex; align-items: center; gap: 0.4rem; }
.alert { border-radius: 1rem; padding: 2rem; text-align: center; }
.alert-success { border: 1px solid rgba(74,222,128,0.3); background: rgba(74,222,128,0.05); }
.alert-error { border: 1px solid rgba(248,113,113,0.3); background: rgba(248,113,113,0.05); color: var(--red); }

/* ---------- Calculator ---------- */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 880px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-box { border: 1px solid var(--line); background: rgba(20,18,16,0.7); border-radius: 1rem; padding: 1.5rem; }
.calc-result { margin-top: 1.25rem; border-top: 1px solid var(--line-2); padding-top: 1.25rem; }
.calc-melt-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-4); }
.calc-melt { font-family: "Fraunces", serif; font-size: 2rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; margin: 0.25rem 0; }
.calc-range { font-size: 0.88rem; color: var(--text-3); margin-top: 0.5rem; }
.calc-note { font-size: 0.85rem; color: var(--text-3); border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); border-radius: 0.6rem; padding: 1rem; margin-top: 1.25rem; }
.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.preset { border: 1px solid var(--line); background: transparent; color: var(--text-2); border-radius: 0.5rem; padding: 0.5rem 0.85rem; font-size: 0.82rem; cursor: pointer; transition: border-color .2s, color .2s; font-family: inherit; }
.preset:hover, .preset.active { border-color: var(--gold-soft); color: var(--gold); }
.preset small { display: block; font-size: 0.68rem; color: var(--text-4); }
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-4); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-4); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--text-2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line-2); }
.tag { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.6rem 1rem; font-size: 0.85rem; color: var(--text-2); }
.tag:hover { border-color: var(--gold-soft); color: var(--gold); text-decoration: none; }

/* ---------- Article ---------- */
.article-head h1 { margin-bottom: 0.75rem; }
.article-meta { font-size: 0.82rem; color: var(--text-4); margin-bottom: 1.5rem; }
.article-meta .cat { color: var(--gold); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem; }
.article-body p { color: var(--text-2); font-size: 1rem; line-height: 1.85; }
.article-body h2 { margin: 2rem 0 0.6rem; font-size: 1.4rem; }

/* ---------- Sitemap ---------- */
.sitemap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 760px) { .sitemap-grid { grid-template-columns: 1fr; } }
.sitemap-col h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.sitemap-col a { display: block; padding: 0.35rem 0; color: var(--text-2); font-size: 0.92rem; border-bottom: 1px solid var(--line-2); }
.sitemap-col a:hover { color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 3rem; padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--text-3); font-size: 0.88rem; margin-top: 0.5rem; max-width: 22rem; }
.footer-col h4 { font-family: "Inter", sans-serif; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-4); margin-bottom: 0.75rem; font-weight: 600; }
.footer-col a { display: block; color: var(--text-2); font-size: 0.88rem; padding: 0.3rem 0; }
.footer-col a:hover { color: var(--gold); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--line-2); margin-top: 2rem; padding-top: 1.5rem; }
.footer-bottom p { color: var(--text-4); font-size: 0.8rem; margin: 0; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease-out, transform .6s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.divider { height: 1px; background: var(--line-2); margin: 2.5rem 0; border: 0; }
.center { text-align: center; }
