:root {
  --ink: #10202a;
  --muted: #58666e;
  --paper: #f4f0e7;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --line: #d9d3c7;
  --dark: #0d1b24;
  --dark-soft: #172a35;
  --gold: #8a620e;
  --gold-light: #f2c761;
  --gold-soft: #f2dfad;
  --copper: #8f4529;
  --silver: #506b79;
  --platinum: #416b7b;
  --palladium: #695770;
  --green: #17654a;
  --red: #9d3838;
  --max: 1180px;
  --reading: 760px;
  --shadow: 0 18px 50px rgba(15, 29, 37, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: #155a72;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #0d4054;
  text-decoration-thickness: 0.13em;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid #006fd6;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 1000;
  background: #fff;
  color: #111;
  padding: 10px 14px;
  border-radius: 4px;
}

.skip-link:focus {
  top: 12px;
}

.utility-bar {
  background: #071219;
  color: #b9c6cc;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.utility-inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
}

.utility-inner a {
  color: #e2e9ec;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 27, 36, 0.97);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(var(--max), calc(100% - 36px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid #d4a74a;
  color: #efc96f;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  border-radius: 50%;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-nav a {
  color: #dce5e9;
  padding: 9px 11px;
  border-radius: 5px;
  font-size: 0.91rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.container {
  width: min(var(--max), calc(100% - 36px));
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 20%, rgba(201, 149, 43, 0.18), transparent 27rem),
    linear-gradient(135deg, #0d1b24 0%, #142d3a 58%, #10222c 100%);
  color: #fff;
  padding: clamp(72px, 10vw, 132px) 0 82px;
}

.hero::after {
  content: "Au  Ag  Cu  Pt  Pd";
  position: absolute;
  right: -18px;
  bottom: -24px;
  color: rgba(255, 255, 255, 0.035);
  font-family: Georgia, serif;
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: clamp(44px, 8vw, 100px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow,
.page-hero .eyebrow,
.section.dark .eyebrow {
  color: var(--gold-light);
}

.hero h1,
.page-hero h1,
.article-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.hero h1 {
  max-width: 850px;
  font-size: clamp(3rem, 7vw, 6.8rem);
}

.hero .lede {
  max-width: 720px;
  margin: 26px 0 0;
  color: #ced9de;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.42rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--dark);
  border-radius: 5px;
  background: var(--dark);
  color: #fff;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: #1d3542;
  color: #fff;
}

.button.gold {
  border-color: #d4a33f;
  background: #d4a33f;
  color: #1b1b17;
}

.button.gold:hover {
  background: #e3b958;
  color: #111;
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
}

.button.secondary {
  border-color: #aab4b9;
  background: transparent;
  color: var(--ink);
}

.hero-note {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
}

.hero-note strong {
  display: block;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.hero-note p {
  margin: 7px 0 0;
  color: #b9c8cf;
  font-size: 0.92rem;
}

.section {
  padding: clamp(58px, 8vw, 96px) 0;
}

.section.white {
  background: var(--surface);
}

.section.dark {
  background: var(--dark);
  color: #fff;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.section-header h2,
.content-heading {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.section-header p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.section.dark .section-header p {
  color: #b9c7cd;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-strong);
  padding: 25px;
  box-shadow: 0 7px 24px rgba(20, 34, 42, 0.045);
}

.card:hover {
  border-color: #b9b1a2;
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.card .symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.symbol.gold-tone { color: var(--gold); }
.symbol.silver-tone { color: var(--silver); }
.symbol.copper-tone { color: var(--copper); }
.symbol.platinum-tone { color: var(--platinum); }
.symbol.palladium-tone { color: var(--palladium); }

.card h2,
.card h3 {
  margin: 20px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.18;
}

.card h2 { font-size: 1.55rem; }
.card h3 { font-size: 1.32rem; }

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card .card-link {
  display: inline-block;
  margin-top: 17px;
  font-weight: 760;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 99px;
  background: #ede7da;
  color: #4f554f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #324650;
  border-radius: 9px;
  background: #324650;
}

.feature-item {
  background: var(--dark-soft);
  padding: 28px;
}

.feature-item span {
  color: #e6bb5a;
  font-family: Georgia, serif;
  font-size: 1.75rem;
}

.feature-item h3 {
  margin: 7px 0 7px;
  font-size: 1.08rem;
}

.feature-item p {
  margin: 0;
  color: #bac8ce;
  font-size: 0.91rem;
}

.page-hero {
  background:
    linear-gradient(115deg, rgba(13, 27, 36, 0.98), rgba(21, 52, 65, 0.95)),
    var(--dark);
  color: #fff;
  padding: clamp(54px, 7vw, 88px) 0;
}

.breadcrumbs {
  margin-bottom: 18px;
  color: #b9c6cc;
  font-size: 0.82rem;
}

.breadcrumbs a {
  color: #e2eaed;
}

.breadcrumbs span {
  margin-inline: 7px;
  color: #778992;
}

.page-hero h1 {
  max-width: 920px;
  font-size: clamp(2.5rem, 6vw, 5rem);
}

.page-hero .lede {
  max-width: 780px;
  margin: 20px 0 0;
  color: #c9d5da;
  font-family: Georgia, serif;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, var(--reading)) minmax(220px, 1fr);
  gap: clamp(40px, 7vw, 86px);
  align-items: start;
}

.prose {
  min-width: 0;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.18;
  letter-spacing: -0.025em;
  scroll-margin-top: 100px;
}

.prose h2 {
  margin: 2.25em 0 0.55em;
  font-size: clamp(1.75rem, 3.3vw, 2.55rem);
}

.prose h3 {
  margin: 1.75em 0 0.5em;
  font-size: 1.4rem;
}

.prose p,
.prose li {
  font-size: 1.02rem;
}

.prose p {
  margin: 0 0 1.18em;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin: 0 0 1.4em;
}

.prose li {
  margin: 0.38em 0;
}

.prose blockquote,
.answer-box,
.notice {
  margin: 28px 0;
  padding: 20px 22px;
  border-left: 5px solid var(--gold);
  background: #f7edd3;
}

.notice.neutral {
  border-left-color: var(--silver);
  background: #edf2f4;
}

.notice.warning {
  border-left-color: var(--copper);
  background: #f8ece6;
}

.notice p:last-child,
.answer-box p:last-child {
  margin-bottom: 0;
}

.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-box {
  border-top: 4px solid var(--gold);
  background: #ece6d9;
  padding: 21px;
}

.sidebar-box + .sidebar-box {
  margin-top: 18px;
}

.sidebar-box h2,
.sidebar-box h3 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.sidebar-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-box li + li {
  margin-top: 8px;
}

.sidebar-box a {
  font-size: 0.91rem;
  font-weight: 680;
}

.table-scroll {
  overflow-x: auto;
  margin: 25px 0 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

caption {
  padding: 14px 16px;
  text-align: left;
  font-weight: 800;
  color: var(--ink);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e1d8;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eee9df;
  color: #34434a;
  font-size: 0.79rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.calculator {
  margin: 28px 0 34px;
  border: 1px solid #bfc7ca;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.calculator-head {
  padding: 22px 24px;
  border-bottom: 1px solid #dce1e3;
  background: #f2f5f5;
}

.calculator-head h2,
.calculator-head h3 {
  margin: 0;
  font-family: Georgia, serif;
}

.calculator-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.91rem;
}

.calculator-body {
  padding: 24px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: block;
}

.field.full {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: #34434a;
  font-size: 0.82rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 47px;
  border: 1px solid #60727a;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.77rem;
}

.calculator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  border: 1px solid #d4d9db;
  border-radius: 7px;
  overflow: hidden;
  background: #d4d9db;
}

.result {
  min-width: 0;
  background: #f5f7f6;
  padding: 17px;
}

.result span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-family: Georgia, serif;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
}

.formula-output {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.formula {
  display: block;
  overflow-wrap: anywhere;
  margin: 16px 0;
  padding: 15px 17px;
  border: 1px solid #ccd3d5;
  border-radius: 5px;
  background: #edf1f1;
  color: #243640;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88rem;
  white-space: normal;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
}

.link-list a {
  display: block;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 14px 16px;
  font-weight: 750;
  text-decoration: none;
}

.link-list a:hover {
  border-color: #aeb6b8;
  background: #f9fbfa;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 23px;
  color: #b8c7cd;
  font-size: 0.84rem;
}

.article-header {
  max-width: 940px;
  padding: 58px 0 36px;
}

.article-header h1 {
  font-size: clamp(2.5rem, 6vw, 5.1rem);
}

.article-header .lede {
  max-width: 780px;
  font-family: Georgia, serif;
  font-size: 1.24rem;
  color: var(--muted);
}

.site-footer {
  background: #071219;
  color: #b8c5cb;
  padding: 54px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(140px, 0.7fr));
  gap: 40px;
}

.footer-brand p {
  max-width: 360px;
  margin: 14px 0 0;
  color: #9fb0b8;
  font-size: 0.9rem;
}

.footer-column h2 {
  margin: 0 0 13px;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.footer-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-column li + li {
  margin-top: 8px;
}

.footer-column a {
  color: #c8d3d8;
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-column a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid #263943;
  font-size: 0.79rem;
}

.footer-bottom p {
  margin: 0;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legal-nav a {
  color: #b8c5cb;
}

@media (max-width: 1040px) {
  .card-grid.five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.2fr repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 820px) {
  .utility-inner > :last-child {
    display: none;
  }

  /* Keep core navigation available even when JavaScript is unavailable. */
  .nav-toggle {
    display: none;
  }

  .nav-shell {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .site-nav,
  .site-nav[data-open="false"],
  .site-nav[data-open="true"] {
    position: static;
    display: flex;
    flex: 1 0 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .hero-grid,
  .content-shell {
    grid-template-columns: 1fr;
  }

  .hero-note {
    max-width: 520px;
  }

  .card-grid,
  .card-grid.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 580px) {
  .container,
  .nav-shell,
  .utility-inner {
    width: min(100% - 28px, var(--max));
  }

  .brand {
    font-size: 0.82rem;
    letter-spacing: 0.095em;
  }

  .hero {
    padding-top: 62px;
  }

  .section-header,
  .footer-bottom {
    display: block;
  }

  .section-header p {
    margin-top: 12px;
  }

  .card-grid,
  .card-grid.five,
  .card-grid.two,
  .feature-list,
  .field-grid,
  .results,
  .link-list,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .field.full,
  .footer-brand {
    grid-column: auto;
  }

  .legal-nav {
    margin-top: 12px;
  }

  .calculator-body,
  .calculator-head {
    padding: 19px;
  }
}

@media print {
  .utility-bar,
  .site-header,
  .site-footer,
  .sidebar,
  .hero-actions,
  .calculator-actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .section,
  .page-hero {
    padding: 20px 0;
  }

  .page-hero {
    background: #fff;
    color: #000;
  }

  .page-hero .lede,
  .breadcrumbs {
    color: #333;
  }

  .content-shell {
    display: block;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
