/* CoinWiz website styles.
   The CSP in _headers allows styles from this file only: no <style> blocks and no style="" attributes.
   Palette from docs/WIZ_FAMILY.md. Light and dark mode follow the visitor's system setting.
   Text contrast (WCAG): body text 8.2:1 on cream and 11:1 on navy; links 12.7:1 (light) and 9.2:1 (dark). */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --navy: #1E2A63;
  --navy-deep: #141B3F;
  --indigo: #2A3A8C;
  --gold: #F4B63C;
  --gold-light: #FFD76A;
  --cream: #FFF8EC;

  /* Light (default) */
  --bg: var(--cream);
  --glow-a: rgba(244, 182, 60, 0.24);
  --glow-b: rgba(42, 58, 140, 0.10);
  --surface: #FFFFFF;
  --surface-soft: rgba(30, 42, 99, 0.045);
  --line: rgba(30, 42, 99, 0.13);
  --heading: var(--navy);
  --text: #3F4878;
  --strong: var(--navy);
  --link: var(--navy);
  --link-line: var(--gold);
  --accent: #8A5A0E;
  --focus: var(--navy);
  --chip-bg: rgba(244, 182, 60, 0.24);
  --chip-text: #6E4608;
  --callout-bg: rgba(244, 182, 60, 0.14);
  --callout-line: rgba(196, 132, 28, 0.45);
  --button-bg: var(--navy);
  --button-text: var(--cream);
  --button-edge: #0E1433;
  --badge-bg: var(--navy);
  --badge-text: var(--cream);
  --promise-bg: var(--navy);
  --promise-line: transparent;
  --promise-text: rgba(255, 248, 236, 0.86);
  --promise-strong: var(--cream);
  --spark: #E3A42F;
  --mark: rgba(244, 182, 60, 0.5);
  --shadow: 0 1px 2px rgba(30, 42, 99, 0.06), 0 10px 28px rgba(30, 42, 99, 0.07);

  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy-deep);
    --glow-a: rgba(42, 58, 140, 0.65);
    --glow-b: rgba(244, 182, 60, 0.10);
    --surface: rgba(255, 255, 255, 0.055);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 248, 236, 0.14);
    --heading: var(--cream);
    --text: #D9D3C7;
    --strong: var(--cream);
    --link: var(--gold);
    --link-line: rgba(244, 182, 60, 0.5);
    --accent: var(--gold-light);
    --focus: var(--gold);
    --chip-bg: rgba(244, 182, 60, 0.16);
    --chip-text: var(--gold-light);
    --callout-bg: rgba(244, 182, 60, 0.10);
    --callout-line: rgba(244, 182, 60, 0.38);
    --button-bg: var(--gold);
    --button-text: var(--navy-deep);
    --button-edge: #B07A18;
    --badge-bg: var(--cream);
    --badge-text: var(--navy-deep);
    --promise-bg: rgba(255, 255, 255, 0.06);
    --promise-line: var(--line);
    --promise-text: var(--text);
    --promise-strong: var(--cream);
    --spark: var(--gold-light);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(52rem 34rem at 108% -10%, var(--glow-a), transparent 62%),
    radial-gradient(44rem 30rem at -18% 104%, var(--glow-b), transparent 60%);
  background-repeat: no-repeat;
  font: 17px/1.65 var(--font-body);
}
h1, h2, h3 { color: var(--heading); font-family: var(--font-display); font-weight: 800; }
p { margin: 0 0 14px; }
strong { color: var(--strong); font-weight: 700; }
ul, ol { margin: 0 0 14px; padding-inline-start: 22px; }
li { margin: 6px 0; }
li::marker { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.wrap--wide { max-width: 1080px; }

/* ---------- Header and footer ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--heading); text-decoration: none;
  font: 800 21px/1 var(--font-display); letter-spacing: -0.01em;
}
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 3px 10px rgba(20, 27, 63, 0.28); }
.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 18px; }
.site-nav a { color: var(--text); font-size: 15px; font-weight: 600; text-decoration: none; padding: 6px 0; }
.site-nav a:hover { color: var(--heading); }
.site-nav a[aria-current="page"] {
  color: var(--heading);
  text-decoration: underline; text-decoration-color: var(--gold);
  text-decoration-thickness: 3px; text-underline-offset: 7px;
}
.site-footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 14px;
}
.site-footer a { color: var(--text); }

/* ---------- Legal and support pages ---------- */
.doc h1 { font-size: clamp(32px, 5.4vw, 46px); line-height: 1.08; letter-spacing: -0.02em; margin: 26px 0 6px; }
.meta { margin: 0 0 22px; font-size: 15px; }
.lede { font-size: 19px; margin: 0 0 22px; }
.doc h2 { font-size: 23px; line-height: 1.25; letter-spacing: -0.01em; margin: 44px 0 12px; scroll-margin-top: 20px; }
.doc h2::before {
  content: ""; display: block; width: 38px; height: 5px; border-radius: 5px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.doc h3 { font-size: 18px; line-height: 1.3; margin: 26px 0 6px; color: var(--accent); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 16px 22px 6px; margin: 18px 0; box-shadow: var(--shadow);
}
.card-title { font: 800 18px/1.3 var(--font-display); color: var(--heading); margin: 0 0 6px; }

.toc { margin: 18px 0 8px; padding: 14px 22px 8px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-soft); }
.toc-title { font-weight: 700; color: var(--heading); margin: 0 0 4px; }
.toc ol { columns: 2; column-gap: 32px; margin: 0 0 8px; }
.toc li { margin: 0; padding: 3px 0; break-inside: avoid; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--heading); text-decoration: underline; text-decoration-color: var(--gold); }

.callout {
  background: var(--callout-bg); border: 1px solid var(--callout-line); border-radius: 18px;
  padding: 14px 20px 2px; margin: 18px 0;
}
.callout p { color: var(--strong); }

.table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th, td { text-align: start; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--heading); background: var(--surface-soft); font-weight: 700; }
td:first-child { color: var(--strong); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* FAQ */
details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  margin: 10px 0; padding: 0 18px; box-shadow: var(--shadow);
}
summary {
  position: relative; cursor: pointer; list-style: none;
  padding: 16px 40px 16px 0; font-weight: 700; color: var(--heading);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; inset-inline-end: 0; top: 50%;
  width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--chip-bg); color: var(--chip-text); font-size: 20px; font-weight: 800; line-height: 1;
}
details[open] > summary::after { transform: rotate(45deg); }
details > :not(summary) { margin-top: 0; }
details > :last-child { margin-bottom: 16px; }

.contact {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin: 8px 0 30px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(135deg, rgba(244, 182, 60, 0.22), rgba(42, 58, 140, 0.12));
}
.contact p { margin: 0; color: var(--strong); }

.button {
  display: inline-block; padding: 12px 22px; border-radius: 16px;
  background: var(--button-bg); color: var(--button-text);
  font-weight: 800; text-decoration: none; line-height: 1.3;
  box-shadow: 0 4px 0 var(--button-edge);
}
.button:hover { text-decoration: none; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--button-edge); }
.button--gold { background: var(--gold); color: var(--navy-deep); box-shadow: 0 4px 0 #B07A18; }
.button--gold:active { box-shadow: 0 1px 0 #B07A18; }

/* Age note and contact form (support page) */
.age-note {
  display: inline-block; padding: 6px 14px; border-radius: 999px; margin: 0 0 18px;
  background: var(--chip-bg); color: var(--chip-text); font-size: 15px;
}
.age-note strong { color: inherit; }
.form {
  margin: 12px 0 18px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow);
}
.form label { display: block; font-weight: 700; color: var(--heading); margin: 14px 0 6px; }
.form label:first-child { margin-top: 0; }
.form .optional { color: var(--text); font-weight: 400; }
.form input, .form textarea, .form select {
  display: block; width: 100%; box-sizing: border-box; font: inherit; color: var(--strong);
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible, .form select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.form button { margin-top: 18px; border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.form button:disabled { opacity: 0.6; cursor: progress; }
.form .status { margin: 12px 0 0; min-height: 1.6em; color: var(--strong); font-weight: 600; }
.form .note { margin: 12px 0 0; font-size: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Landing page ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 40px; padding: 44px 0 56px; }
.eyebrow {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-text);
  font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(40px, 6.4vw, 66px); line-height: 1.02; letter-spacing: -0.03em; margin: 18px 0 16px; }
.hl {
  padding: 0 4px;
  background-image: linear-gradient(transparent 60%, var(--mark) 60%, var(--mark) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero .lede { max-width: 36ch; margin-bottom: 28px; }
.badge {
  display: inline-flex; flex-direction: column; margin: 0; padding: 12px 22px; border-radius: 16px;
  background: var(--badge-bg); color: var(--badge-text);
  font-weight: 800; line-height: 1.25; box-shadow: 0 10px 30px rgba(20, 27, 63, 0.22);
}
.badge small { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; opacity: 0.75; }

.hero-art { position: relative; justify-self: center; display: grid; place-items: center; width: min(300px, 72vw); aspect-ratio: 1; }
.hero-art::before {
  content: ""; position: absolute; inset: -8%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 182, 60, 0.5), rgba(244, 182, 60, 0.12) 60%, transparent);
}
.hero-art img {
  position: relative; width: 76%; aspect-ratio: 1; border-radius: 22.5%;
  box-shadow: 0 26px 60px rgba(20, 27, 63, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.spark { position: absolute; width: 22px; height: 22px; color: var(--spark); }
.spark--1 { top: 4%; left: 6%; }
.spark--2 { top: 12%; right: 2%; width: 16px; height: 16px; }
.spark--3 { bottom: 12%; left: 0; width: 14px; height: 14px; }
.spark--4 { bottom: 2%; right: 12%; width: 20px; height: 20px; }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.feature h2 { font-size: 20px; line-height: 1.25; margin: 14px 0 6px; }
.feature p { margin: 0; font-size: 16px; }
.feature-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--chip-bg); color: var(--chip-text); }

.promise {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin: 24px 0 0; padding: 22px 24px; border-radius: 24px;
  background: var(--promise-bg); border: 1px solid var(--promise-line);
}
.promise p { margin: 0; max-width: 60ch; color: var(--promise-text); }
.promise strong { color: var(--promise-strong); }

/* ---------- 404 ---------- */
.center { min-height: 72vh; display: grid; place-items: center; text-align: center; }
.center img { width: 96px; height: 96px; margin: 0 auto; border-radius: 22px; box-shadow: 0 12px 30px rgba(20, 27, 63, 0.3); }
.center h1 { font-size: 34px; line-height: 1.15; margin: 20px 0 8px; }

/* ---------- Motion (only when the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .rise--2 { animation-delay: 0.08s; }
  .rise--3 { animation-delay: 0.16s; }
  .rise--4 { animation-delay: 0.24s; }
  .rise--5 { animation-delay: 0.32s; }
  .hero-art img { animation: float 5s ease-in-out infinite; }
  .hero-art::before { animation: glow 5s ease-in-out infinite; }
  .spark { animation: twinkle 2.8s ease-in-out infinite; }
  .spark--2 { animation-delay: 0.7s; }
  .spark--3 { animation-delay: 1.4s; }
  .spark--4 { animation-delay: 2.1s; }
  .feature { transition: transform 0.2s ease, box-shadow 0.2s ease; }
  .feature:hover { transform: translateY(-3px); }
  .button { transition: transform 0.12s ease, box-shadow 0.12s ease; }
  summary::after { transition: transform 0.2s ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
  @keyframes glow { 50% { opacity: 0.7; transform: scale(1.05); } }
  @keyframes twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.1) rotate(20deg); }
  }
}

/* ---------- Dark-mode details ---------- */
@media (prefers-color-scheme: dark) {
  .hl {
    padding: 0;
    background-image: linear-gradient(90deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
  }
  .brand img, .hero-art img { box-shadow: 0 0 0 1px rgba(255, 248, 236, 0.16), 0 20px 50px rgba(0, 0, 0, 0.45); }
  .contact { background: linear-gradient(135deg, rgba(244, 182, 60, 0.16), rgba(42, 58, 140, 0.35)); }
}

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 20px 0 40px; }
  .hero-art { order: -1; width: min(220px, 60vw); }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .toc ol { columns: 1; }
  .table { border: 0; background: none; box-shadow: none; overflow: visible; }
  table { min-width: 0; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { margin-bottom: 10px; padding: 6px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  td { padding: 6px 16px; border-bottom: 0; }
  td::before {
    content: attr(data-label); display: block;
    font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent);
  }
}
@media (max-width: 480px) {
  .brand { font-size: 19px; gap: 8px; }
  .brand img { width: 32px; height: 32px; border-radius: 8px; }
  .site-nav { gap: 2px 12px; }
  .site-nav a { font-size: 14px; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #FFFFFF; --text: #1A1A1A; --heading: #000000; --strong: #000000; --link: #000000; --surface: #FFFFFF; }
  body { background: #FFFFFF; font-size: 12pt; }
  .site-nav, .toc, .button, .hero-art { display: none; }
  .card, details, .table, .feature { box-shadow: none; }
}
