/* Pearl Mining Calculator — static styles. Zero dependencies. */
:root {
  --bg: #070a12;
  --panel: rgba(18, 24, 38, 0.72);
  --panel-2: #0d1320;
  --line: #233154;
  --text: #e9effc;
  --muted: #94a2c0;
  --accent: #7dd3fc;
  --accent-2: #c4b5fd;
  --accent-3: #6ee7b7;
  --gold: #fcd34d;
  --bad: #fca5a5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.25rem; position: relative; z-index: 1; }
.mono { font-family: var(--mono); }
code, pre { font-family: var(--mono); }
a { color: var(--accent); }

/* animated aurora background */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; }
.blob.b1 { width: 560px; height: 560px; left: -140px; top: -160px;
  background: radial-gradient(circle, #1d4ed8 0%, transparent 70%);
  animation: drift1 26s ease-in-out infinite alternate; }
.blob.b2 { width: 520px; height: 520px; right: -120px; top: 24%;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  animation: drift2 32s ease-in-out infinite alternate; }
.blob.b3 { width: 640px; height: 640px; left: 28%; bottom: -320px;
  background: radial-gradient(circle, #0e7490 0%, transparent 70%);
  animation: drift1 38s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(90px,60px) scale(1.12); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1.05); } to { transform: translate(-70px,80px) scale(0.94); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10;
  background: rgba(7, 10, 18, 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 1.25rem; padding: 0.7rem 1.25rem; flex-wrap: wrap; }
.brand { color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.nav a:hover { color: var(--accent); }
.conn { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line);
  padding: 0.25rem 0.7rem; border-radius: 999px; white-space: nowrap; }
.conn.ok { color: var(--accent-3); border-color: rgba(110,231,183,0.4); }
.conn.bad { color: var(--bad); border-color: rgba(252,165,165,0.4); }

/* hero */
.hero { padding: 3.5rem 0 2rem; text-align: center; }
.eyebrow { color: var(--accent-2); letter-spacing: 0.22em; text-transform: uppercase;
  font-size: 0.75rem; margin: 0 0 0.75rem; font-weight: 700; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin: 0 0 1rem; letter-spacing: -0.02em;
  background: linear-gradient(100deg, #fff 20%, var(--accent) 55%, var(--accent-2) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--muted); max-width: 44rem; margin: 0 auto 1.75rem; font-size: 1.02rem; }
.lede.small { font-size: 0.92rem; text-align: left; margin: 0 0 1.25rem; }
.lede em { color: var(--text); font-style: normal; font-weight: 600; }
.hero-stats { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.6rem 1.1rem; display: flex; flex-direction: column; min-width: 8.5rem;
  backdrop-filter: blur(6px); }
.hs-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.hs-value { font-size: 1.05rem; font-weight: 700; color: var(--gold); font-family: var(--mono); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; margin-bottom: 1.5rem; backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.card.glow { border-color: rgba(125,211,252,0.35);
  box-shadow: 0 0 0 1px rgba(125,211,252,0.08), 0 18px 60px rgba(56,130,246,0.12); }
.card h2 { margin: 0 0 1.1rem; font-size: 1.35rem; letter-spacing: -0.01em; }
.card h3 { font-size: 1.05rem; margin: 1.5rem 0 0.6rem; color: var(--accent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

/* buttons + inputs */
.btn { background: rgba(125,211,252,0.08); color: var(--accent); border: 1px solid rgba(125,211,252,0.35);
  border-radius: 10px; padding: 0.55rem 1.1rem; font-size: 0.9rem; cursor: pointer; font-weight: 600; }
.btn:hover { background: rgba(125,211,252,0.16); }
.btn.primary { background: linear-gradient(100deg, #2563eb, #7c3aed); color: #fff; border: none; }
.btn.primary:hover { filter: brightness(1.12); }
.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.95rem; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125,211,252,0.15); }
select.input { appearance: none; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field > span { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.field small { font-size: 0.75rem; color: var(--muted); }
.opt { font-style: normal; font-weight: 400; opacity: 0.7; }
.field-row { display: grid; grid-template-columns: 1fr 7.5rem; gap: 0.75rem; }
.field.unit select { height: 100%; }
.note { font-size: 0.82rem; color: var(--muted); background: rgba(125,211,252,0.05);
  border-left: 3px solid var(--accent); padding: 0.6rem 0.9rem; border-radius: 0 8px 8px 0; }
.disclaimer { font-size: 0.75rem; color: var(--muted); opacity: 0.85; }
.err { color: var(--bad); font-size: 0.85rem; background: rgba(252,165,165,0.07);
  border: 1px solid rgba(252,165,165,0.3); padding: 0.6rem 0.9rem; border-radius: 8px; }

/* calculator layout */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; margin-top: 1.25rem; }
@media (max-width: 820px) { .calc-grid { grid-template-columns: 1fr; } }
.out-main { background: linear-gradient(135deg, rgba(37,99,235,0.22), rgba(124,58,237,0.18));
  border: 1px solid rgba(125,211,252,0.3); border-radius: 14px; padding: 1.25rem 1.4rem;
  margin-bottom: 1rem; text-align: center; }
.out-main .label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.out-main .big { display: block; font-size: 2.1rem; font-weight: 800; color: var(--gold);
  text-shadow: 0 0 24px rgba(252,211,77,0.35); }
.out-main .sub { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.out-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.out-grid.usd { margin-top: 0.6rem; }
.ostat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ostat .label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ostat .value { font-size: 0.98rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.ostat.profit .value { color: var(--accent-3); }
@media (max-width: 520px) { .out-grid { grid-template-columns: repeat(2, 1fr); } }

/* tabs + chart */
.tabs { display: flex; gap: 0.4rem; }
.tab { background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.82rem; cursor: pointer; font-weight: 600; }
.tab.active { background: rgba(125,211,252,0.12); color: var(--accent); border-color: rgba(125,211,252,0.45); }
.chart-wrap { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.75rem; margin-bottom: 1rem; }
#chart { width: 100%; display: block; }

/* milestone table */
.mtable { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.milestones { overflow-x: auto; } /* wide milestone table scrolls on small screens instead of breaking layout */
.mtable th, .mtable td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
.mtable th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; }
.mtable td.mono { color: var(--gold); }
.mtable tr:last-child td { border-bottom: none; }
.mtable tbody tr:hover { background: rgba(125,211,252,0.04); }

/* node card */
.node-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }
@media (max-width: 700px) { .node-grid { grid-template-columns: 1fr; } }
.node-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin: 1rem 0; }
@media (max-width: 700px) { .node-stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.stat .label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-size: 0.95rem; font-weight: 700; overflow-wrap: anywhere; }

/* how-it-works */
.how-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .how-grid { grid-template-columns: 1fr; } }
.how { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; }
.how h3 { margin-top: 0; font-size: 0.98rem; color: var(--accent-2); }
.how p { font-size: 0.88rem; color: var(--muted); margin: 0.4rem 0 0; }
.how p strong { color: var(--text); }
pre.code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1.1rem; overflow-x: auto; font-size: 0.8rem; color: var(--muted); white-space: pre-wrap; }

/* donate + footer */
.donate { text-align: center; border-color: rgba(252,211,77,0.3); }
.donate h2 { color: var(--gold); }
.donate-row { display: flex; gap: 0.6rem; justify-content: center; align-items: center;
  flex-wrap: wrap; margin-top: 0.75rem; }
.donate-row code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.5rem 0.8rem; font-size: 0.78rem; overflow-wrap: anywhere; }
.footer { border-top: 1px solid var(--line); padding: 1.25rem 0 2rem; color: var(--muted);
  font-size: 0.82rem; text-align: center; position: relative; z-index: 1; }

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Skip link: the first Tab stop on the page — parked off-screen until keyboard focus reveals it (fleet skip-link pass). */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border: 2px solid var(--accent); border-radius: 8px; background: #0b0e14; color: var(--accent); font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }

/* Reduced motion: when the OS asks for reduced motion, animations and transitions finish near-instantly and scrolling is not smoothed (fleet reduced-motion pass). Near-zero durations — not animation: none — so fade-ins still land on their end state and no content can be stranded invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Touch targets (fleet WCAG 2.5.8 pass): standalone nav links measured 22-24px tall in the fleet probe — pad them past the 24px minimum. */
.nav a { padding: 4px 6px; }
