/* ── lotterypzl.org · v2 design ─────────────────────────────── */
/* Design tokens ── dark-first, light via prefers-color-scheme */

:root {
  --bg:        #0a0e17;
  --bg-soft:   #0d1220;
  --surface:   #131a2b;
  --surface-2: #1a2238;
  --border:    #1e2940;
  --border-soft:#15203a;
  --fg:        #e6edf3;
  --fg-soft:   #c4d0e0;
  --muted:     #8b96a8;
  --muted-2:   #5f6b80;
  --accent:    #fbbf24;
  --accent-2:  #f59e0b;
  --accent-glow: rgba(251, 191, 36, 0.12);
  --accent-line: rgba(251, 191, 36, 0.35);
  --code-bg:   #060810;
  --code-fg:   #c4d0e0;
  --code-border:#1a1f30;
  --warn:      #f59e0b;
  --warn-bg:   rgba(245, 158, 11, 0.08);
  --good:      #4ade80;
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow:     0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-sm:  0 2px 12px rgba(0, 0, 0, 0.2);
  --mono:       ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", monospace;
  --sans:       system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f8fafc;
    --bg-soft:   #f1f5f9;
    --surface:   #ffffff;
    --surface-2: #f8fafc;
    --border:    #e2e8f0;
    --border-soft:#edf2f7;
    --fg:        #0f172a;
    --fg-soft:   #334155;
    --muted:     #64748b;
    --muted-2:   #94a3b8;
    --accent:    #f59e0b;
    --accent-2:  #d97706;
    --accent-glow: rgba(245, 158, 11, 0.08);
    --accent-line: rgba(245, 158, 11, 0.25);
    --code-bg:   #1e293b;
    --code-fg:   #e2e8f0;
    --code-border:#334155;
    --warn-bg:   rgba(245, 158, 11, 0.06);
    --shadow:     0 8px 32px rgba(15, 23, 42, 0.08);
    --shadow-sm:  0 2px 8px rgba(15, 23, 42, 0.04);
  }
}

/* ── Reset ──────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--fg-soft);
}

.muted { color: var(--muted); font-size: 0.9rem; }
.mt-2 { margin-top: 1rem; }

/* ── Navigation ─────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: light) {
  .nav { background: rgba(248, 250, 252, 0.85); }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg);
}

.nav-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.05em;
}

.nav-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--fg); }

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-gh {
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  color: var(--fg) !important;
  background: var(--surface);
}
.nav-gh:hover { border-color: var(--accent-line); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72vh;
  padding: 64px 24px 80px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-glow), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none'%3E%3Cpath d='M40 0H0v40' stroke='%231e2940' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent 75%);
}

@media (prefers-color-scheme: light) {
  .hero-bg::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none'%3E%3Cpath d='M40 0H0v40' stroke='%23e2e8f0' stroke-width='0.5' opacity='0.5'/%3E%3C/svg%3E");
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  animation: hero-fade 0.6s ease-out;
}

@keyframes hero-fade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--fg) 0%, var(--fg-soft) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 auto 28px;
  max-width: 38ch;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  color: var(--bg);
  box-shadow: 0 6px 28px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
  50%      { transform: translateX(-50%) translateY(8px); opacity: 0.8; }
}

/* ── Content sections ──────────────────────────────────────── */

.content {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border-soft);
}

.section:last-child { border-bottom: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-line);
}

.section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.lead {
  font-size: 1.05rem;
  color: var(--fg-soft);
  margin: 0 0 24px;
}

/* ── Cards ─────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.card-grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Math card ─────────────────────────────────────────────── */

.math-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px 0 20px;
}

.math-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.math-row:last-of-type { border-bottom: none; }

.math-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.math-value {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
}

.math-example {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--fg-soft);
}

.math-example strong { color: var(--accent); }

/* ── Callouts ──────────────────────────────────────────────── */

.callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0;
}

.callout-warn {
  background: var(--warn-bg);
  border-color: var(--accent-line);
}

.callout-reality {
  background: var(--surface);
  border-color: var(--border);
}

.callout-icon {
  flex-shrink: 0;
  color: var(--warn);
  margin-top: 2px;
}

.callout-body {
  font-size: 0.92rem;
  color: var(--fg-soft);
  line-height: 1.6;
}

.callout-warn .callout-body strong { color: var(--accent); }

/* ── Terminal block (install) ───────────────────────────────── */

.term-block {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: var(--shadow-sm);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--code-border);
}

.term-dots { display: flex; gap: 6px; }
.term-dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: block;
}
.term-dots i:nth-child(1) { background: #f0506e; }
.term-dots i:nth-child(2) { background: #fbbf24; }
.term-dots i:nth-child(3) { background: #4ade80; }

.term-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1;
}

.term-block pre {
  margin: 0;
  padding: 18px 20px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* syntax highlight tokens */
.t-cmd     { color: #fbbf24; font-weight: 600; }
.t-str     { color: #94d3ff; }
.t-comment { color: #5f6b80; font-style: italic; }

/* ── Command cards ─────────────────────────────────────────── */

.cmd-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0 16px;
}

@media (min-width: 560px) {
  .cmd-grid { grid-template-columns: 1fr 1fr; }
}

.cmd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color var(--transition);
}

.cmd-card:hover { border-color: var(--accent-line); }

.cmd-card-span2 { grid-column: 1 / -1; }

.cmd-card-full {
  margin-top: 12px;
}

.cmd-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-soft);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.cmd-block {
  position: relative;
}

.cmd-block pre {
  margin: 0;
  padding: 12px 16px;
  padding-right: 64px;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--code-border);
}

/* ── Copy buttons ──────────────────────────────────────────── */

.copy {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--sans);
  letter-spacing: 0.01em;
}

.copy:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-glow);
}

.copy.copy-sm {
  position: absolute;
  top: 7px;
  right: 7px;
}

.term-bar .copy {
  margin-left: auto;
}

/* ── Puzzle table ──────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.puzzle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.puzzle-table th,
.puzzle-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.puzzle-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-2);
}

.puzzle-table tbody tr:last-child td { border-bottom: none; }

.puzzle-table tbody tr:hover { background: var(--surface-2); }

.puzzle-table .puzzle-id {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
}

.puzzle-table .engine {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg-soft);
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: capitalize;
}

.status-unsolved {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
  border: 1px solid var(--accent-line);
}

.status-solved {
  background: rgba(74, 222, 128, 0.12);
  color: var(--good);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.puzzle-table .note {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Link cards ────────────────────────────────────────────── */

.link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

@media (min-width: 560px) {
  .link-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 840px) {
  .link-grid { grid-template-columns: repeat(3, 1fr); }
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}

.link-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.link-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

.link-desc {
  font-size: 0.82rem;
  color: var(--muted);
}

.link-arrow {
  position: absolute;
  top: 18px;
  right: 20px;
  color: var(--muted);
  font-size: 1.1rem;
  transition: color var(--transition);
}

.link-card:hover .link-arrow { color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 48px 24px 24px;
}

.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a, .footer-col span {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent); }

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-soft);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  font-size: 1.2rem;
}

.footer-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  margin-top: 4px;
}

.footer-tag {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
  max-width: 24ch;
}

.footer-bottom {
  max-width: 880px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted-2);
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 540px) {
  .hero { min-height: 60vh; padding: 40px 20px 60px; }
  .hero-title { font-size: 2.8rem; }
  .hero-tagline { font-size: 1.05rem; }
  .content { padding: 0 16px; }
  .section { padding: 40px 0; }
  .section h2 { font-size: 1.35rem; }
  .card { padding: 18px; }
  .term-block pre { font-size: 0.78rem; padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-scroll { display: none; }
}

/* ── Hero stats ────────────────────────────────────────────── */

.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 28px 0 32px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--fg);
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 540px) {
  .hero-stats { gap: 20px; }
  .hero-stat-num { font-size: 1.4rem; }
}

/* ── Info cards (2-col) ────────────────────────────────────── */

.card-grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .card-grid-2 { grid-template-columns: 1fr 1fr; }
}

.card-info h3 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.card-info p {
  font-size: 0.9rem;
  color: var(--fg-soft);
  margin: 0 0 12px;
  line-height: 1.7;
}

.card-info p:last-child { margin-bottom: 0; }

/* ── Timeline ──────────────────────────────────────────────── */

.timeline {
  margin: 32px 0;
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--fg);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
}

.timeline-item-current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.timeline-body {
  font-size: 0.9rem;
  color: var(--fg-soft);
  line-height: 1.6;
}

.timeline-body strong { color: var(--fg); }
.timeline-body em { color: var(--muted); }

/* ── Table controls ────────────────────────────────────────── */

.table-controls {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
  align-items: center;
}

.filter-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover {
  border-color: var(--accent-line);
  color: var(--fg);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

.filter-count {
  font-size: 0.7rem;
  opacity: 0.7;
  font-family: var(--mono);
}

.puzzle-search {
  flex: 1;
  min-width: 180px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 0.85rem;
  font-family: var(--sans);
  transition: border-color var(--transition);
}

.puzzle-search:focus {
  outline: none;
  border-color: var(--accent);
}

.puzzle-search::placeholder { color: var(--muted-2); }

/* ── Puzzle table extensions ───────────────────────────────── */

.puzzle-table .puzzle-num {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

.puzzle-table .puzzle-addr {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-soft);
}

.puzzle-table .reward {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--fg);
}

.puzzle-table .solver {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.puzzle-table .solved-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.puzzle-table .pubkey-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--accent);
  margin-left: 4px;
}

.puzzle-table tr.hidden { display: none; }

.mt-1 { margin-top: 0.5rem; }

/* ── Page header ───────────────────────────────────────────── */

.page-header {
  padding: 80px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.page-header-inner {
  max-width: 640px;
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  color: var(--fg);
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ── Card link ─────────────────────────────────────────────── */

a.card-link {
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

a.card-link:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

a.card-link h3 {
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0 0 8px;
}

/* ── Tag ───────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 6px;
}

.tag-ours {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.tag-reference {
  background: rgba(74, 222, 128, 0.1);
  color: var(--good);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.tag-private {
  background: rgba(139, 150, 168, 0.1);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Stats grid ────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ── Bar chart ─────────────────────────────────────────────── */

.chart-container {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-bar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

.chart-bar-track {
  flex: 1;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 24px;
  transition: width 0.3s ease;
}

.chart-bar-good {
  background: var(--good);
}

.chart-bar-empty {
  background: var(--surface-2);
}

.chart-bar-value {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg);
}

.chart-bar-empty .chart-bar-value {
  color: var(--muted);
}

/* ── Quote block ───────────────────────────────────────────── */

.quote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--fg-soft);
  line-height: 1.6;
}

/* ── Step list ─────────────────────────────────────────────── */

.step-list {
  padding-left: 20px;
  margin: 8px 0;
}

.step-list li {
  font-size: 0.88rem;
  color: var(--fg-soft);
  margin-bottom: 6px;
  line-height: 1.6;
}

.step-list li strong { color: var(--fg); }

/* ── FAQ accordion ─────────────────────────────────────────── */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover { border-color: var(--accent-line); }

.faq-item[open] { border-color: var(--accent-line); }

.faq-item summary {
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--muted);
  transition: transform var(--transition), color var(--transition);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}

.faq-answer {
  padding: 0 20px 16px;
  font-size: 0.9rem;
  color: var(--fg-soft);
  line-height: 1.7;
}

.faq-answer p { margin: 0 0 10px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer ul { padding-left: 18px; margin: 4px 0; }
.faq-answer li { margin-bottom: 4px; }
.faq-answer a { color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  z-index: 1;
}

.modal-close:hover {
  color: var(--fg);
  background: var(--surface);
}

.modal-header {
  padding: 24px 24px 16px;
  padding-right: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.modal-status {
  flex-shrink: 0;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-loading {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}

.modal-field {
  margin-bottom: 18px;
}

.modal-field:last-child { margin-bottom: 0; }

.modal-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

.modal-field-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--code-fg);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  word-break: break-all;
  line-height: 1.5;
  position: relative;
}

.modal-field-value.with-copy {
  padding-right: 56px;
}

.modal-field-value .modal-copy {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-field-value .modal-copy:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.modal-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.modal-stat-value {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
}

.modal-stat-value.live {
  color: var(--accent);
}

.modal-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--good);
  margin-left: 6px;
}

.modal-live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-soft);
  text-decoration: none;
  transition: all var(--transition);
}

.modal-link:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

@media (max-width: 540px) {
  .modal { max-height: 90vh; }
  .modal-stats { grid-template-columns: 1fr; }
}

/* ── Selection ─────────────────────────────────────────────── */

::selection {
  background: var(--accent);
  color: var(--bg);
}
