/* Money Moves — calm, premium minimalism (Apple-style). Vanilla CSS, mobile-first, no dependencies. */
:root {
  /* Palette: calm neutral base, ONE accent — brand green, used sparingly */
  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-muted: #f1f4f6;
  --surface-tint: #fbfcfd;
  --text: #23272c;
  --text-strong: #111417;
  --muted: #68737d;
  --faint: #9aa4ad;
  --border: #e2e7eb;
  --border-soft: #eceff2;

  --accent: #0b6b43;          /* brand green — primary actions & key highlights only */
  --accent-hover: #095c38;
  --accent-soft: #e9f3ed;
  --accent-line: #c6e2d1;

  --up: #0b7a45;
  --up-soft: #e3f2e9;
  --down: #b3261e;
  --down-soft: #fbe7e4;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 44, .04), 0 6px 20px rgba(16, 32, 44, .05);
  --maxw: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: "tnum" 1, "lnum" 1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214;
    --surface: #1a1d20;
    --surface-muted: #22262a;
    --surface-tint: #1e2225;
    --text: #e4e7ea;
    --text-strong: #ffffff;
    --muted: #a6b0b9;
    --faint: #7c868f;
    --border: #2e3338;
    --border-soft: #262b30;

    --accent: #45c98a;
    --accent-hover: #58d498;
    --accent-soft: #152b21;
    --accent-line: #25553c;

    --up: #45c98a;
    --up-soft: #152b21;
    --down: #ff8a80;
    --down-soft: #3a1a15;

    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 22px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
img, svg { max-width: 100%; }

h1, h2, h3 { color: var(--text-strong); line-height: 1.22; letter-spacing: -.015em; }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.65rem); margin: 0 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
  border-radius: 0 0 8px 0; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1rem;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--text-strong);
  font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em;
}
.brand svg { flex: 0 0 auto; }
.brand span { white-space: nowrap; }
.brand .wordmark em { font-style: normal; color: var(--accent); }
.main-nav ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: .5rem .85rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { background: var(--surface-muted); color: var(--text-strong); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

/* ---------- Hero: calm, light, airy ---------- */
.hero {
  background: var(--bg);
  color: var(--text);
  padding: clamp(2.5rem, 6vw, 4rem) 1rem clamp(1.75rem, 4vw, 2.25rem);
}
.hero-kicker {
  margin: 0 0 1rem;
  font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
}
.hero h1 { margin: 0 0 .9rem; font-size: clamp(2rem, 5.4vw, 3rem); max-width: 22ch; letter-spacing: -.03em; }
.hero p { margin: 0 0 1.75rem; color: var(--muted); max-width: 44rem; font-size: 1.1rem; }
.hero .cta-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .72rem 1.6rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-text {
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 700; font-size: 1rem; color: var(--accent); text-decoration: none;
}
.btn-text:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Live status bar: quiet, flat ---------- */
.data-status {
  display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; align-items: center;
  padding: 1rem 0 0; margin: 0 0 .5rem;
  font-size: .9rem;
}
.data-status > span {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; color: var(--muted);
}
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; flex: 0 0 auto; }
.dot.live { background: var(--accent); }
.dot.stale { background: #c98a00; }
.dot.down { background: var(--down); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Sections & cards ---------- */
section.block { margin: 3rem 0; scroll-margin-top: 84px; }
.card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(1.75rem, 5vw, 3rem);
  position: relative;
}
.eyebrow {
  display: block;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 .6rem;
}
.lede { color: var(--muted); max-width: 52rem; margin-top: 0; }

/* ---------- Converter form ---------- */
.converter-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 720px) {
  .converter-grid { grid-template-columns: 1fr 1fr auto 1fr; gap: 1rem; }
}
.field label {
  display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem;
  color: var(--text-strong); letter-spacing: .01em;
}
.field input, .field select, .field textarea {
  width: 100%; padding: .72rem .85rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1.05rem; font-family: inherit;
  background: var(--surface-tint); color: var(--text-strong);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  font-variant-numeric: var(--num);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  outline: none;
}
.field select { cursor: pointer; }
.swap-btn {
  justify-self: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.swap-btn:hover { background: var(--surface-muted); border-color: var(--faint); color: var(--text-strong); }

.convert-actions { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; margin-top: 1.2rem; }
.btn-convert {
  background: var(--accent);
  color: #fff; border: none;
  padding: .8rem 2.1rem; font-size: 1.05rem;
}
.btn-convert:hover { background: var(--accent-hover); }
.updated-stamp { font-size: .88rem; color: var(--muted); }
/* Freshness hook: the converter's "rates as of" line stays visible so returning
   visitors can tell the data is current. */
#converter .updated-stamp { font-size: 1rem; font-weight: 600; color: var(--text); }

.result-box {
  margin-top: 1.4rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  padding: clamp(1.4rem, 4vw, 2rem);
}
.result-figure {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  color: var(--text-strong);
  font-variant-numeric: var(--num);
  overflow-wrap: anywhere;
}
.result-caption {
  margin-top: .5rem;
  font-size: .95rem; color: var(--muted);
  font-variant-numeric: var(--num);
}
.rate-line {
  margin: .7rem 0 0; font-size: .95rem; color: var(--muted);
  font-variant-numeric: var(--num);
}
.rate-line strong { color: var(--text-strong); font-weight: 700; }
.rate-line[hidden] { display: none; }

/* ---------- Quick tiles: popular rates (pastels here only) ---------- */
.quick-tiles {
  display: grid; gap: .85rem; grid-template-columns: repeat(2, 1fr);
  margin-top: 1.25rem;
}
@media (min-width: 640px) { .quick-tiles { grid-template-columns: repeat(3, 1fr); } }
.quick-tile {
  border-radius: 18px;
  padding: 1.05rem 1.15rem;
  border: 1px solid transparent;
}
button.quick-tile {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-align: left;
  display: block;
  width: 100%;
  cursor: pointer;
}
button.quick-tile:hover { filter: brightness(.96); }
button.quick-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quick-label {
  font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.quick-value {
  margin-top: .35rem;
  font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--text-strong);
  font-variant-numeric: var(--num);
}
.quick-sub { margin-top: .15rem; font-size: .82rem; color: var(--muted); }
.tint-0 { background: #e9f3ed; } .tint-1 { background: #e9f0fa; } .tint-2 { background: #fdf1e2; }
.tint-3 { background: #efeafa; } .tint-4 { background: #fbf3d6; } .tint-5 { background: #fbe9ee; }
@media (prefers-color-scheme: dark) {
  .tint-0 { background: #152b21; } .tint-1 { background: #16202e; } .tint-2 { background: #2b2214; }
  .tint-3 { background: #221d2e; } .tint-4 { background: #2b2513; } .tint-5 { background: #2e1a20; }
}
.quick-loading { color: var(--muted); font-size: .95rem; grid-column: 1 / -1; }

/* ---------- Crypto: row list with thin 1px dividers ---------- */
.coin-list { margin-top: 1.1rem; }
.cross-link { margin-top: 1.1rem; font-size: .95rem; }
.coin-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center;
  padding: .9rem .1rem;
  border-bottom: 1px solid var(--border-soft);
}
.coin-row:first-child { border-top: 1px solid var(--border-soft); }
.coin-badge {
  width: 2.35rem; height: 2.35rem; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-muted);
  color: var(--muted); font-weight: 800; font-size: .95rem;
}
.coin-meta { min-width: 0; }
.coin-name { font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-symbol { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.coin-right { text-align: right; }
.coin-price {
  font-weight: 800; font-size: 1.15rem; color: var(--text-strong);
  font-variant-numeric: var(--num); letter-spacing: -.015em;
}
.chg {
  display: inline-block; margin-top: .3rem; padding: .16rem .6rem; border-radius: 999px;
  font-weight: 700; font-size: .8rem; font-variant-numeric: var(--num);
}
.chg.up { color: var(--up); background: var(--up-soft); }
.chg.down { color: var(--down); background: var(--down-soft); }
.chg.flat { color: var(--muted); background: var(--surface-muted); }

/* ---------- Notice boxes ---------- */
.notice {
  border-radius: var(--radius-sm); padding: .9rem 1.05rem; margin: 1rem 0; font-size: .95rem;
  border: 1px solid var(--border); background: var(--surface-muted); color: var(--text);
}
.notice.error { border-color: var(--down); background: var(--down-soft); color: var(--text-strong); border-left-width: 4px; }
.notice.warn { border-color: #d19a00; background: #fff6df; color: #5f4400; border-left-width: 4px; }
@media (prefers-color-scheme: dark) {
  .notice.error { background: #3a1712; color: #ffc9bd; }
  .notice.warn { background: #33270a; color: #ffd97a; }
}
.notice[hidden] { display: none; }

/* ---------- Explainer ---------- */
.explainer h3 { color: var(--text-strong); }
.explainer ol { padding-left: 0; list-style: none; counter-reset: force; margin: 1rem 0; }
.explainer ol > li {
  counter-increment: force; position: relative;
  padding: .7rem 0 .7rem 3rem; border-bottom: 1px solid var(--border-soft);
}
.explainer ol > li:last-child { border-bottom: none; }
.explainer ol > li::before {
  content: counter(force);
  position: absolute; left: 0; top: .7rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--surface-muted); color: var(--muted);
  font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.faq { margin-top: 1.5rem; }
.faq details {
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  margin: .6rem 0; background: var(--surface-tint);
  transition: border-color .15s ease;
}
.faq details[open] { border-color: var(--border); background: var(--surface); }
.faq summary {
  padding: .85rem 1rem; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  color: var(--text-strong);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: 0 0 auto;
  color: var(--faint);
  font-size: 1.25rem; font-weight: 400; line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 1rem 1rem; color: var(--muted); }

/* ---------- Footer: calm, light ---------- */
.site-footer {
  background: var(--surface-muted);
  color: var(--muted); margin-top: 4rem; padding: 2.5rem 1rem 1.5rem;
  border-top: 1px solid var(--border-soft);
}
.site-footer h2, .site-footer h3 { color: var(--text-strong); font-size: 1rem; margin: 0 0 .6rem; }
.site-footer p { font-size: .94rem; }
.footer-grid { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .35rem 0; font-size: .94rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text-strong); text-decoration: underline; }
.footer-bottom {
  margin-top: 1.75rem; padding-top: 1.1rem; border-top: 1px solid var(--border-soft);
  color: var(--faint); font-size: .84rem;
  display: flex; gap: .75rem 1.5rem; flex-wrap: wrap; justify-content: space-between;
}

/* ---------- Contact form ---------- */
.contact-form { display: grid; gap: 1.05rem; max-width: 42rem; margin-top: 1.2rem; }
.btn-submit { background: var(--accent); color: #fff; border: none; }
.btn-submit:hover { background: var(--accent-hover); }
.form-note { font-size: .88rem; color: var(--muted); }

/* ---------- Misc ---------- */
.updated-stamp { font-size: .88rem; color: var(--muted); }
.spinner {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.refresh-btn {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px;
  padding: .5rem 1.1rem; cursor: pointer; color: var(--text-strong); font-weight: 600; font-size: .92rem;
  transition: border-color .15s ease, background .15s ease;
}
.refresh-btn:hover { border-color: var(--faint); background: var(--surface-muted); }
.disclaimer {
  font-size: .86rem; color: var(--muted);
  border-top: 1px solid var(--border-soft);
  padding: .9rem 0 0; margin-top: 1.75rem;
}

/* Sub-page prose cards */
.card h1 { font-size: clamp(1.7rem, 4.5vw, 2.2rem); margin: 0 0 .8rem; }
.card ul:not(.footer-grid ul) { padding-left: 1.25rem; }
.card li { margin: .35rem 0; }
.card li::marker { color: var(--accent); }
