/* 8bit.money: an 8-bit arcade skin over site.css. Loaded after it, so it only changes the look;
   every page, calculator and chart is the same as on the main site.
   Fonts: Press Start 2P (headings, logo, buttons) and VT323 (big numbers), both SIL Open Font
   Licence, see assets/fonts/. Body text stays in the system font so long guides read easily. */
@font-face { font-family: "Press Start 2P"; src: url("../fonts/press-start-2p.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("../fonts/vt323.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #0f0e24;
  --surface: #1c1a3d;
  --text: #f4f1e6;
  --muted: #b3aed6;
  --line: #45408a;
  --accent: #ffcc33;
  --accent-soft: #2a2659;
  --warn: #ff9a52;
  --warn-soft: #3b2418;
  --good: #6ee67a;
  --link: #7fe3ff;
  --shadow: #06051a;
  --radius: 0;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --terminal: "VT323", ui-monospace, monospace;
  --serif: var(--pixel);
  color-scheme: dark;
}

/* Square corners everywhere: nothing is round in 8-bit. */
*, *::before, *::after { border-radius: 0 !important; }

body {
  background-color: var(--bg);
  /* faint pixel starfield */
  background-image:
    radial-gradient(#ffffff14 1px, transparent 1.5px),
    radial-gradient(#ffcc3310 1px, transparent 1.5px);
  background-size: 48px 48px, 80px 80px;
  background-position: 0 0, 24px 40px;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }

h1, h2, h3 { font-family: var(--pixel); font-weight: 400; letter-spacing: 0; line-height: 1.5; }
h1 { font-size: clamp(0.95rem, 3.4vw, 1.6rem); color: var(--accent); text-shadow: 3px 3px 0 var(--shadow), -1px -1px 0 #7a3d00; margin: 0.4em 0 0.7em; }
h2 { font-size: clamp(0.9rem, 2.4vw, 1.1rem); color: var(--text); text-shadow: 2px 2px 0 var(--shadow); }
h3 { font-size: 0.8rem; color: var(--accent); }

/* Header: logo in pixel type with a scanline screen behind it */
.site-header {
  background:
    repeating-linear-gradient(0deg, #00000030 0 1px, transparent 1px 3px),
    linear-gradient(#25205a, #17143a);
  border-bottom: 0;
  box-shadow: 0 4px 0 var(--accent), 0 8px 0 #e08a00, 0 12px 0 var(--shadow);
  margin-bottom: 12px;
}
.brand { font-family: var(--pixel); font-weight: 400; font-size: clamp(0.85rem, 3vw, 1.05rem); gap: 12px; text-shadow: 2px 2px 0 var(--shadow); }
.brand-mark {
  width: 32px; height: 32px; font-size: 0; color: transparent; background: url("../favicon.svg") center / 32px 32px no-repeat;
  image-rendering: pixelated;
}
/* "8bit.money" as one word: the template puts a space between the two halves of the logo. */
.brand-name { word-spacing: -1em; }
.brand-know { color: var(--accent); font-style: normal; border-bottom: 0; padding: 0; }
nav { gap: 6px 16px; font-family: var(--pixel); font-size: 0.6rem; text-transform: uppercase; }
nav a { color: var(--muted); padding: 4px 0; }
nav a:hover { color: var(--accent); text-decoration: none; }
nav a:hover::before { content: "\25B6\00A0"; }

.crumbs a { font-family: var(--pixel); font-size: 0.6rem; text-decoration: none; }
.lead { color: var(--muted); }
.reviewed { font-family: var(--terminal); font-size: 1.05rem; letter-spacing: 0.02em; }

/* Home page */
.wrap:has(> .hub-section) > h1::after { content: "\2588"; margin-left: 0.25em; color: var(--text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wrap:has(> .hub-section) > h1::after { animation: none; } }
.press-start { font-family: var(--pixel); font-size: 0.7rem; color: var(--good); margin: 1.6em 0 0; line-height: 1.8; }
main { counter-reset: level; }
.hub-section { counter-increment: level; }
.hub-section > h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.8em; }
.hub-section > h2::before { content: "LV" counter(level, decimal-leading-zero); font-size: 0.7em; color: var(--bg); background: var(--good); padding: 0.35em 0.5em; text-shadow: none; }

.cards { gap: 20px; }
.card { background: var(--surface); border: 3px solid var(--line); box-shadow: 6px 6px 0 var(--shadow); transition: transform 0.08s steps(2), box-shadow 0.08s steps(2); position: relative; }
.card:hover { border-color: var(--accent); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow); }
.card:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--shadow); }
.card h3 { margin: 0 0 10px; line-height: 1.6; }
.tag, .tag.new { font-family: var(--pixel); font-size: 0.55rem; text-transform: uppercase; background: #ff4f8b; color: #fff; border: 0; padding: 4px 6px; box-shadow: 2px 2px 0 var(--shadow); }

/* Panels, forms and buttons */
.panel, .author-box { border: 3px solid var(--line); box-shadow: 6px 6px 0 var(--shadow); }
.panel h2 { color: var(--accent); font-size: 0.85rem; }
.field > label, .field > .label { font-weight: 600; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  border: 2px solid var(--line); background: #0a0920; color: var(--text); box-shadow: inset 3px 3px 0 #00000066;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.money::before { color: var(--accent); }
.seg { border: 2px solid var(--line); background: #0a0920; }
.seg label { font-family: var(--pixel); font-size: 0.58rem; line-height: 1.6; padding: 10px 6px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; }
.seg label + label { border-left: 2px solid var(--line); }
.seg label:has(input:checked) { background: var(--accent); color: var(--bg); }
.btn, button { font-family: var(--pixel); font-size: 0.65rem; text-transform: uppercase; background: var(--accent); color: var(--bg); border: 0; padding: 12px 16px; box-shadow: inset -3px -3px 0 #e08a00, 4px 4px 0 var(--shadow); cursor: pointer; }
.btn:hover, button:hover { background: #ffe066; }
.btn:active, button:active { transform: translate(3px, 3px); box-shadow: inset -3px -3px 0 #e08a00, 1px 1px 0 var(--shadow); }
.readonly-box { border: 2px dashed var(--line); }

/* Results: big numbers in a terminal font */
.headline div { background: #0a0920; border: 2px solid var(--line); }
.headline span { font-size: 0.78rem; }
.headline strong { font-family: var(--terminal); font-weight: 400; font-size: 1.9rem; line-height: 1.1; color: var(--accent); }
.headline .big strong { font-size: 2.8rem; color: var(--good); text-shadow: 2px 2px 0 var(--shadow); }
.breakdown tr.total td { border-bottom: 3px solid var(--accent); }
.note { border-left: 6px solid var(--accent); }
.note.warn { border-left-color: var(--warn); }
.split, .split.tall { border: 2px solid var(--shadow); }
.legend i { width: 12px; height: 12px; }

/* The tax receipt keeps its white paper, printed by a dot-matrix till */
.receipt { font-family: var(--terminal); font-size: 1.15rem; line-height: 1.25; }
.receipt th { font-size: 0.95rem; }
.receipt .hint, .receipt .r-foot, .receipt .r-thanks { font-size: 1rem; }

/* Charts */
svg { shape-rendering: crispEdges; }
svg path, svg polyline, svg circle { shape-rendering: auto; }

.site-footer { background: var(--surface); border-top: 0; box-shadow: 0 -4px 0 var(--line); margin-top: 24px; }
.footer-links { font-family: var(--pixel); font-size: 0.58rem; line-height: 2.2; }

@media (max-width: 480px) {
  nav { font-size: 0.55rem; gap: 4px 12px; }
  .seg label { font-size: 0.5rem; padding: 10px 3px; }
  .headline strong { font-size: 1.6rem; }
  .headline .big strong { font-size: 2.3rem; }
}
