/* Bitcoin is fun — shared styles. No build step.
   Look: printed paper, ink rules, one orange. Archivo for words, JetBrains Mono for numbers and labels.
   Shapes are square-ish with hard offset shadows (blocks), never soft blur. */
:root {
  --bg: #f4f1ea;          /* paper */
  --bg-2: #ebe6da;        /* sunken paper */
  --card: #fbf9f4;        /* raised paper */
  --ink: #15130f;
  --ink-2: #57524a;       /* 6.9:1 on --bg */
  --line: #d8d1c2;        /* hairline */
  --rule: #15130f;        /* strong rule */
  --orange: #f7931a;
  --orange-ink: #9a4d00;  /* orange text on paper, 5.6:1 */
  --green: #17803d;
  --yellow: #a86f00;
  --red: #c42f2f;
  --blue: #2457c5;
  --on-orange: #15130f;
  --shadow: none;
  --hard: 4px 4px 0 var(--rule);
  --radius: 6px;
  --r-sm: 4px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100f0d;
    --bg-2: #1b1915;
    --card: #161411;
    --ink: #f1ece2;
    --ink-2: #a9a194;
    --line: #2f2b24;
    --rule: #f1ece2;
    --orange: #f7931a;
    --orange-ink: #ffac4a;
    --green: #4ccb7c;
    --yellow: #f0bf45;
    --red: #ff7070;
    --blue: #7ea4ff;
    --hard: 4px 4px 0 var(--orange);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--orange); color: var(--on-orange); }
img, svg { max-width: 100%; }
a { color: var(--orange-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -0.02em; font-weight: 800; font-stretch: 112%; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); margin: 0 0 0.35em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin: 1.8em 0 0.6em; }
h3 { font-size: 1.12rem; margin: 0 0 0.35em; font-stretch: 105%; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead, .hero p.lead { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 600px; }

/* Mono labels: the "bits" voice of the site */
.kicker, .tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2);
  margin-bottom: 10px; background: none; padding: 0; border-radius: 0;
}
.kicker::before, .tag::before { content: ""; width: 7px; height: 7px; background: var(--orange); flex: none; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo img { display: block; }
.logo .wordmark { height: 22px; width: auto; }
.logo:hover img:first-child { transform: rotate(-12deg); }
.logo img:first-child { transition: transform .35s var(--ease); }
@media (max-width: 380px) { .logo .wordmark { height: 18px; } }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); text-decoration: none; padding: 10px 12px; font-weight: 600; font-size: 0.95rem;
  position: relative; min-height: 44px; display: inline-flex; align-items: center;
}
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .2s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 600px) {
  .site-head { position: static; }
  .site-head .wrap { gap: 4px; padding-top: 8px; }
  .nav { margin-left: -12px; width: calc(100% + 12px); }
  .nav a { padding: 8px 12px; font-size: 0.92rem; }
}

/* Footer */
.site-foot { border-top: 1px solid var(--rule); margin-top: 96px; padding: 28px 0 44px; color: var(--ink-2); font-size: 0.88rem; }
.site-foot .wrap { display: flex; gap: 16px 28px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-foot a { color: var(--ink-2); }
.site-foot a:hover { color: var(--ink); }
.site-foot { position: relative; }
.site-foot::before {
  /* the halving: each block half the width of the last */
  content: ""; position: absolute; top: -5px; left: max(20px, calc((100% - 1120px) / 2 + 20px)); width: 150px; height: 9px;
  background:
    linear-gradient(var(--orange), var(--orange)) 0 0 / 64px 9px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 68px 0 / 32px 9px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 104px 0 / 16px 9px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 124px 0 / 8px 9px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 136px 0 / 4px 9px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 144px 0 / 2px 9px no-repeat;
}

/* Page furniture */
main { padding-top: 36px; }
.page-head { padding: 24px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.page-head h1 { margin-bottom: 0.25em; }
.page-head .lead { margin: 0; }
.hero { padding: 40px 0 8px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Section heads: 01  Games ———— All games → */
.sec { margin-top: 72px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; margin-bottom: 20px; }
.sec-head h2 { margin: 0; }
.sec-n { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--orange-ink); }
.sec-sub { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.1em; }
.sec-more { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--ink); text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 0; }
.sec-more:hover { color: var(--orange-ink); }

/* Tiles: a block you can pick up */
.tiles { display: grid; gap: 14px; }
.tiles-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tiles-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.tile:hover, .tile:focus-visible { transform: translate(-3px, -3px); box-shadow: var(--hard); border-color: var(--rule); }
.tile:active { transform: translate(0, 0); box-shadow: none; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; color: var(--ink); }
.tile-n { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); }
.tile h3 { font-size: 1.2rem; }
.tile p { color: var(--ink-2); margin: 0 0 18px; font-size: 0.96rem; }
.tile-go { margin-top: auto; font-family: var(--mono); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.tile:hover .tile-go { color: var(--orange-ink); }
.tile .emoji { font-size: 2rem; display: block; margin-bottom: 6px; }
.px { display: block; image-rendering: pixelated; }
a.card.tile { display: flex; }

/* Live numbers: a ruled strip, like a ticker */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { padding: 14px 16px 16px; border-left: 1px solid var(--line); background: none; border-radius: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .label { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.stat .value { font-family: var(--mono); font-size: clamp(1.1rem, 4.6vw, 1.45rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(even) { border-left: 1px solid var(--line); padding-left: 14px; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
}
.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); margin-right: 2px; animation: blink 1.2s steps(2, jump-none) infinite; vertical-align: middle; }
.tag .live-dot, .kicker .live-dot { margin: 0; }
.tag:has(.live-dot)::before, .kicker:has(.live-dot)::before { display: none; }
@keyframes blink { 50% { opacity: 0.2; } }

/* Forms */
label { font-weight: 600; display: block; margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-bottom: 2px solid var(--rule); border-radius: var(--r-sm); padding: 11px 12px; min-height: 44px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { font-family: var(--mono); font-size: 0.95rem; min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rule); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 45%, transparent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
input[type="range"] { width: 100%; accent-color: var(--orange); }

/* Buttons: blocks that press in */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border: 2px solid var(--rule); border-radius: var(--r-sm);
  padding: 10px 18px; min-height: 44px; background: var(--orange); color: var(--on-orange); box-shadow: 3px 3px 0 var(--rule);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .12s var(--ease);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--rule); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--rule); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--rule); }
.btn.ghost { background: var(--card); color: var(--ink); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--card); font-weight: 600; cursor: pointer; font-size: 0.95rem; transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.choice span:hover { border-color: var(--rule); }
.choice input:checked + span { border-color: var(--rule); background: var(--orange); color: var(--on-orange); box-shadow: 2px 2px 0 var(--rule); }
.choice input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 3px; }

.notice { border-radius: var(--r-sm); padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--rule); background: var(--card); }
.notice.warn { border-left-color: var(--yellow); }
.notice.bad { border-left-color: var(--red); }
.notice.good { border-left-color: var(--green); }
.ok { color: var(--green); font-weight: 700; }
.bad-text { color: var(--red); font-weight: 700; }

.hashbox { font-family: var(--mono); font-size: 0.85rem; word-break: break-all; background: var(--bg-2); border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid var(--line); }
.hashbox .zeros { color: var(--green); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; border-bottom-color: var(--rule); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; background: var(--orange); }
.timeline .date { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.timeline li.today::before { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 30%, transparent); }

.share { white-space: pre-wrap; font-family: var(--mono); font-size: 0.95rem; background: var(--bg-2); border: 1px dashed var(--ink-2); border-radius: var(--r-sm); padding: 12px; }
.pill-score { font-family: var(--mono); font-weight: 800; font-size: 2.6rem; color: var(--orange-ink); letter-spacing: -0.03em; }
.bar { height: 12px; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 0; overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 0;
  background: repeating-linear-gradient(90deg, var(--orange) 0 8px, color-mix(in srgb, var(--orange) 70%, var(--bg)) 8px 10px);
}
legend.q { font-weight: 600; margin-bottom: 6px; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
details > summary { cursor: pointer; }

/* Home hero: headline left, the die right, on a faint bit grid */
.hero-split { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; position: relative; }
.hero-split::before {
  content: ""; position: absolute; inset: -40px -20px -10px 45%; z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 22%, transparent) 1px, transparent 1.5px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 50%, #000 30%, transparent 72%);
          mask-image: radial-gradient(ellipse at 70% 50%, #000 30%, transparent 72%);
}
.hero h1 em { font-style: normal; color: var(--orange); -webkit-text-stroke: 0; }
.hero-cube { display: block; }
.hero-cube img { display: block; width: clamp(170px, 24vw, 290px); height: auto; transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.hero-cube:hover img, .hero-cube:focus-visible img { transform: rotate(-12deg) scale(1.04); }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-meta span::before { content: "■ "; color: var(--orange); }
@media (max-width: 700px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-split::before { inset: -30px -20px auto 30%; height: 220px; }
  .hero-cube { order: -1; }
  .hero-cube img { width: 112px; }
}

/* Halving card on the home page */
.halving-strip { display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.halving-strip h3 { margin: 0; }
.halving-strip p { margin: 0; grid-column: 1 / -1; }
.halving-strip .bar { grid-column: 1 / -1; }
@media (max-width: 520px) { .halving-strip { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* The hidden attribute must win over component display rules (.btn etc.) */
[hidden] { display: none !important; }
