/* ═══════════════════════════════════════════════════════════════════════════
   Grin Landing Page — Cyberpunk / Coder Theme
   Font: JetBrains Mono (monospace throughout)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────────── */
/*
 * Design tokens — single source of truth for colours, sizing, and spacing.
 * Cyberpunk palette: near-black backgrounds + neon green / cyan / magenta / yellow.
 * --text-dim / --text / --text-bright form a 3-step readability hierarchy.
 * All colours are referenced via var() so changing one token propagates everywhere.
 */
:root {
  --bg:           #0a0a0a;
  --bg-dark:      #060606;
  --bg-surface:   #0d0d0d;
  --bg-card:      #111111;
  --bg-card-hover:#141414;
  --border:       #1e1e1e;
  --border-bright:#2a2a2a;

  --green:        #00ff41;
  --green-dim:    #00b32d;
  --green-glow:   rgba(0, 255, 65, 0.15);
  --cyan:         #00e5ff;
  --cyan-dim:     #0099b3;
  --cyan-glow:    rgba(0, 229, 255, 0.15);
  --magenta:      #ff007f;
  --magenta-dim:  #b30059;
  --magenta-glow: rgba(255, 0, 127, 0.15);
  --yellow:       #ffd700;
  --yellow-glow:  rgba(255, 215, 0, 0.15);

  --text:         #999999;
  --text-bright:  #dddddd;
  --text-dim:     #666666;
  --text-code:    #b0b0b0;

  --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;

  --radius:       4px;
  --radius-lg:    8px;
  --transition:   0.2s ease;
  --max-w:        1100px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green); }

ul { list-style: none; }

/* ── Matrix canvas ───────────────────────────────────────────────────────────── */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
}

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.section-dark {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text);
  max-width: 100%;
  margin-bottom: 3rem;
  font-size: 0.9rem;
}

.accent-green   { color: var(--green); }
.accent-cyan    { color: var(--cyan); }
.accent-magenta { color: var(--magenta); }
.accent-yellow  { color: var(--yellow); }

.green   { color: var(--green); }
.cyan    { color: var(--cyan); }
.magenta { color: var(--magenta); }
.yellow  { color: var(--yellow); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch; /* both columns grow to the taller side's height */
}
/* Make direct children fill the full grid row height */
.grid-2 > * { height: 100%; }

/* ── Scroll reveal ───────────────────────────────────────────────────────────── */
/*
 * Two-state reveal: elements start invisible (opacity:0, shifted 20px down).
 * JS (IntersectionObserver) adds .visible when an element enters the viewport,
 * which triggers the CSS transition. The observer calls unobserve() immediately
 * after — so scrolling back up does not replay the animation a second time.
 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
/*
 * Fixed to the top; backdrop-filter blur creates a frosted-glass depth effect.
 * Three flex children in .nav-inner: .nav-logo | .nav-block-live | .nav-links.
 * On mobile (<600px): .nav-links becomes an absolute dropdown activated by
 * .nav-toggle (hamburger button); .nav-block-live is hidden to free up space.
 */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(6, 6, 6, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-logo {
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.1em;
}
.nav-logo .bracket { color: var(--text-dim); }
.nav-logo:hover { color: var(--green); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover {
  color: var(--green);
  background: var(--green-glow);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* ── Terminal window ─────────────────────────────────────────────────────────── */
/*
 * Reusable component that imitates a macOS/Linux terminal.
 * .terminal-bar — top bar with three coloured dots and a title.
 * .terminal-body — monospaced output area with coloured token spans:
 *   .prompt  green  "$"    .cmd  bright  command text
 *   .kw      cyan   key:   .comment  dim  italic inline notes
 * Used across Protocol, Missions, Talents, and Get Started sections.
 */
.terminal-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.05);
}

.terminal-bar {
  background: #161616;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.terminal-title {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.8;
}

.terminal-line { display: flex; align-items: center; gap: 0.5rem; }
.terminal-line.out { color: var(--text-code); }

.prompt { color: var(--green); font-weight: 700; }
.cmd    { color: var(--text-bright); }
.kw     { color: var(--cyan); min-width: 70px; display: inline-block; }
.comment{ color: var(--text-dim); font-style: italic; }
.out-line { color: var(--text-code); font-size: 0.8rem; line-height: 1.8; }

.cursor-blink {
  color: var(--green);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-content {
  width: 100%;
  max-width: 680px;
}

.hero-content .terminal-window {
  text-align: left;
  margin-bottom: 2rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.tag {
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.tag-green   { background: var(--green-glow);   color: var(--green);   border: 1px solid var(--green-dim); }
.tag-cyan    { background: var(--cyan-glow);    color: var(--cyan);    border: 1px solid var(--cyan-dim); }
.tag-magenta { background: var(--magenta-glow); color: var(--magenta); border: 1px solid var(--magenta-dim); }

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--green-glow);
  color: var(--green);
  border-color: var(--green-dim);
}
.btn-primary:hover {
  background: rgba(0, 255, 65, 0.25);
  color: var(--green);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-bright);
}
.btn-ghost:hover {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: var(--cyan-glow);
}

.btn-prefix { color: var(--text-dim); }

/* ── Hero stats ──────────────────────────────────────────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
  margin-top: 3rem;
  padding: 1.25rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-divider { color: var(--border-bright); font-size: 1.5rem; }

.scroll-hint {
  margin-top: 2.5rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  animation: float 2s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* ── Protocol section ────────────────────────────────────────────────────────── */
.terminal-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.feature-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.feature-icon {
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
  margin-top: 0.15rem;
}
.feature-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.2rem;
}
.feature-desc {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── How it works ────────────────────────────────────────────────────────────── */
.process-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.process-step {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}
.process-step:hover { border-color: var(--green-dim); }

.step-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--border-bright);
  line-height: 1;
  min-width: 2.5rem;
  padding-top: 0.1rem;
}

.step-cmd {
  color: var(--green);
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
  font-weight: 500;
}
.step-desc {
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* ── Missions ────────────────────────────────────────────────────────────────── */
.missions-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.missions-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.mission-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transition: background var(--transition);
  cursor: default;
}
.mission-item:hover { background: rgba(0,255,65,0.03); }

.mission-item:nth-child(even) { border-right: none; }
.mission-item:nth-last-child(-n+2) { border-bottom: none; }

.flag { color: var(--green); font-size: 0.78rem; font-weight: 500; }
.desc { color: var(--text); font-size: 0.73rem; }

/* ── Roadmap / Git log ───────────────────────────────────────────────────────── */
.git-log {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.git-graph-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.git-cmd { color: var(--text-dim); font-size: 0.78rem; }

.git-entries { padding: 0.5rem 0; }

.git-entry {
  display: flex;
  align-items: flex-start;
  padding: 0.6rem 1.5rem;
  gap: 0;
  transition: background var(--transition);
  position: relative;
}
.git-entry:hover { background: rgba(255,255,255,0.02); }

.git-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border-bright);
  border: 2px solid var(--bg-card);
  flex-shrink: 0;
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}
.git-dot.active { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.git-dot.origin { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }

.git-line {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 9px;
  margin-top: -0.35rem;
}
.git-line.hidden { background: transparent; }

.git-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  padding-left: 0.75rem;
  padding-bottom: 0.25rem;
}

.git-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 500;
}
.tag-cyan    { background: var(--cyan-glow);    color: var(--cyan);    border: 1px solid var(--cyan-dim); }
.tag-green   { background: var(--green-glow);   color: var(--green);   border: 1px solid var(--green-dim); }
.tag-magenta { background: var(--magenta-glow); color: var(--magenta); border: 1px solid var(--magenta-dim); }
.tag-dim     { background: rgba(255,255,255,0.03); color: var(--text-dim); border: 1px solid var(--border); }

.git-msg { color: var(--text-bright); font-size: 0.8rem; }
.git-entry.active .git-msg { color: var(--cyan); }
.git-entry.origin .git-msg { color: var(--magenta); }

/* NOTE: The old Toolkit section was replaced by the Ecosystem grid.
   All .toolkit-* and .tk-* rules have been removed. */

/* ── Get started ─────────────────────────────────────────────────────────────── */
.started-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.started-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.started-step {
  font-size: 2rem;
  font-weight: 700;
  color: var(--border-bright);
  margin-bottom: 0.75rem;
}

.started-card h3 {
  font-size: 1rem;
  color: var(--text-bright);
  margin-bottom: 1.25rem;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all var(--transition);
}
a.wallet-item:hover {
  color: var(--green);
  border-color: var(--green-dim);
  background: var(--green-glow);
}
.wallet-item.subtle { cursor: default; }
.wallet-item.subtle:hover { color: var(--text); border-color: transparent; background: transparent; }

.wallet-icon { color: var(--green); }
.wallet-icon.cyan { color: var(--cyan); }

.badge {
  margin-left: auto;
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid var(--green-dim);
}
.badge-dim {
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  border-color: var(--border);
}
.badge-cyan {
  background: var(--cyan-glow);
  color: var(--cyan);
  border-color: var(--cyan-dim);
}

.terminal-mini {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.mini-line {
  display: flex;
  gap: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.9;
  color: var(--text-code);
}
.prompt-mini { color: var(--green); }
.out-mini    { color: var(--text-dim); }

/* ── Hall of Fame ────────────────────────────────────────────────────────────── */
.hof-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto;
}

.hof-header {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.hof-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.hof-row:last-child { border-bottom: none; }
.hof-row:hover { background: rgba(255,255,255,0.02); }

.hof-row.gold   .col-name { color: var(--yellow); }
.hof-row.silver .col-name { color: #aaaaaa; }
.hof-row.bronze .col-name { color: #cd7f32; }

.col-rank   { color: var(--text-dim); font-size: 0.72rem; }
.col-name   { color: var(--text-bright); }
.col-amount { color: var(--green); font-weight: 500; }

/* ── Community ───────────────────────────────────────────────────────────────── */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.community-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: all var(--transition);
  cursor: pointer;
}
.community-card:hover {
  border-color: var(--green-dim);
  background: var(--bg-card-hover);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 255, 65, 0.06);
}
.community-card.accent-card:hover {
  border-color: var(--magenta-dim);
  box-shadow: 0 8px 24px rgba(255, 0, 127, 0.06);
}

.comm-icon {
  font-size: 1.4rem;
  color: var(--green);
  margin-bottom: 0.25rem;
}
.comm-icon.magenta { color: var(--magenta); }

.comm-name  { font-size: 0.9rem; font-weight: 600; color: var(--text-bright); }
.comm-desc  { font-size: 0.75rem; color: var(--text); line-height: 1.4; flex: 1; }
.comm-cmd   { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.5rem; }

.community-card:hover .comm-cmd { color: var(--green); }
.community-card.accent-card:hover .comm-cmd { color: var(--magenta); }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
#footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.75rem;
}
.footer-logo .bracket { color: var(--text-dim); }

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-hash { font-variant-numeric: tabular-nums; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
/*
 * Two breakpoints:
 *   900px (tablet) — 3-column grids collapse to 2-col; prose-heavy grids
 *                    (process, started) collapse to 1-col for readability.
 *   600px (mobile) — full mobile layout: nav becomes hamburger dropdown,
 *                    hero stats stack vertically, all grids go 1-col,
 *                    clock cursor hidden (touch devices have no pointer),
 *                    .nav-block-live hidden to give the toggle button room.
 */
@media (max-width: 900px) {
  .grid-2              { grid-template-columns: 1fr; }
  .process-grid        { grid-template-columns: 1fr; }
  .started-grid        { grid-template-columns: 1fr; }
  .community-grid      { grid-template-columns: 1fr 1fr; }
  .community-grid-3    { grid-template-columns: 1fr 1fr; }
  .missions-body       { grid-template-columns: 1fr; }
  .mission-item        { border-right: none; }
  .why-grid            { grid-template-columns: 1fr 1fr; }
  .eco-grid            { grid-template-columns: 1fr 1fr; }
  .live-stats-grid     { grid-template-columns: 1fr 1fr; }
  .hof-cols            { grid-template-columns: 1fr; }
  .footer-simple       { gap: 2rem; }
  .nav-block-live      { display: none; }
  .section-label,
  .section-title,
  .section-subtitle    { text-align: center; }
}

@media (max-width: 600px) {
  .section             { padding: 4rem 0; }
  .slogan-section      { padding: 2.5rem 0; }
  .nav-links           { display: none; flex-direction: column; position: absolute; top: 52px; left: 0; right: 0; background: var(--bg-dark); border-bottom: 1px solid var(--border); padding: 1rem; }
  .nav-links.open      { display: flex; }
  .nav-links a         { padding: 0.75rem 1rem; font-size: 0.875rem; }
  .nav-toggle          { display: block; padding: 0.75rem 1rem; }

  /* All grids collapse to single column */
  .why-grid,
  .eco-grid,
  .live-stats-grid,
  .community-grid,
  .community-grid-3,
  .hof-cols            { grid-template-columns: 1fr; }

  /* Hero */
  .hero-stats          { flex-direction: column; gap: 1rem; }
  .stat-divider        { display: none; }
  .hero-cta            { flex-direction: column; align-items: center; }

  /* Terminals: prevent long lines from blowing out the viewport */
  .terminal-window,
  .terminal-block,
  .missions-terminal,
  .talents-terminal,
  .git-log,
  .hof-terminal,
  .terminal-mini       { overflow-x: auto; }

  .terminal-body,
  .out-line            { font-size: 0.8125rem; overflow-wrap: break-word; word-break: break-word; }

  /* Flag / command text in mission & talent panels */
  .flag                { font-size: 0.8125rem; white-space: normal; word-break: break-word; }
  .mini-line           { font-size: 0.8125rem; white-space: normal; word-break: break-all; }
  .step-cmd            { white-space: normal; word-break: break-word; }

  /* Card text */
  .desc,
  .eco-desc,
  .comm-desc,
  .feature-desc,
  .step-desc,
  .why-desc            { font-size: 0.875rem; }

  /* Hall of Fame tables */
  .hof-header,
  .hof-row             { grid-template-columns: 40px 1fr auto; padding: 0.6rem 1rem; }
  .col-date            { display: none; }
  .hof-col-label       { text-align: center; }
  .hof-coder-header,
  .hof-coder-row       { padding: 0.55rem 1rem; }

  /* Missions border cleanup for single column */
  .mission-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .mission-item:last-child           { border-bottom: none; }

  /* Talents CTA */
  .talents-cta         { flex-direction: column; align-items: center; text-align: center; }

  /* Footer */
  .footer-bottom       { flex-direction: column; gap: 0.5rem; text-align: center; }
  .footer-simple       { flex-direction: column; gap: 2rem; align-items: center; text-align: center; }
  .footer-noobvie-quote{ border-left: none; border-top: 1px solid var(--border-bright); padding-left: 0; padding-top: 1.5rem; }

  /* Hide canvas clock cursor on touch devices */
  #clock-cursor        { display: none; }
}

/* Extra small phones (≤430px — iPhone 16 Pro and similar) */
@media (max-width: 430px) {
  .container           { padding: 0 1rem; }
  .section             { padding: 3rem 0; }

  /* Reinforce 1-column for all grids at very small widths */
  .why-grid,
  .eco-grid,
  .live-stats-grid,
  .community-grid,
  .community-grid-3,
  .hof-cols,
  .process-grid,
  .started-grid        { grid-template-columns: 1fr; }

  /* Scale down large text values in stat cards */
  .ls-value            { font-size: 1.35rem; }
  .stat-value          { font-size: 1.3rem; }

  /* Keep terminal content from overflowing */
  .terminal-body       { padding: 1rem; }
  .hof-header,
  .hof-row             { font-size: 0.72rem; padding: 0.5rem 0.75rem; }
  .hof-coder-header,
  .hof-coder-row       { padding: 0.5rem 0.75rem; font-size: 0.72rem; }

  /* Eco & why cards: more breathing room vertically */
  .eco-card,
  .why-card            { padding: 1.1rem; }
  .live-stat-card      { padding: 1.1rem 1rem; }
}

/* ── Clock cursor ────────────────────────────────────────────────────────────── */
/*
 * Hides the native OS cursor and replaces it with a canvas-drawn clock.
 * Security note: the .js-cursor class is added to <html> by JS on init,
 * so if JS fails to load the native cursor is never hidden.
 */
.js-cursor *, .js-cursor *::before, .js-cursor *::after { cursor: none !important; }

#clock-cursor {
  position: fixed;
  pointer-events: none;  /* never blocks clicks */
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: filter 0.15s ease;
  display: none;         /* hidden until JS initialises it */
}
.js-cursor #clock-cursor { display: block; }

#clock-cursor.hover {
  filter: drop-shadow(0 0 6px var(--cyan));
}

/* ── Nav block live counter ──────────────────────────────────────────────────── */
.nav-block-live {
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-block-live span {
  color: var(--green);
  font-weight: 500;
}

/* ── Grin logo — inline left of nav brand text ───────────────────────────────── */
.nav-hero-logo {
  height: 30px;
  width: auto;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.4rem;
  animation: logo-pulse 3.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.2), 0 0 20px rgba(255, 215, 0, 0.06); }
  50%       { box-shadow: 0 0 16px rgba(255, 215, 0, 0.5), 0 0 36px rgba(255, 215, 0, 0.18); }
}

/* ── Tag yellow ──────────────────────────────────────────────────────────────── */
.tag-yellow { background: var(--yellow-glow); color: var(--yellow); border: 1px solid rgba(255,215,0,0.4); }

/* ── Terminal link ───────────────────────────────────────────────────────────── */
.term-link {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--cyan-dim);
  transition: color var(--transition), border-color var(--transition);
}
.term-link:hover { color: var(--green); border-color: var(--green-dim); }

/* ── Founder quote / slogan ──────────────────────────────────────────────────── */
.slogan-section {
  padding: 3.5rem 0;
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.founder-quote {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 0 1rem;
}
.quote-mark {
  font-size: 4rem;
  line-height: 1;
  color: var(--green);
  opacity: 0.35;
  font-family: Georgia, serif;
  margin-bottom: -1rem;
}
.quote-text {
  font-size: clamp(0.88rem, 1.8vw, 1.05rem);
  color: var(--text-bright);
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-weight: 300;
}
.quote-author {
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 0.1em;
}

/* ── Why Grin ────────────────────────────────────────────────────────────────── */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.why-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.why-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 255, 65, 0.05);
}
.why-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}
.why-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.why-desc {
  font-size: 0.76rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── Talents ─────────────────────────────────────────────────────────────────── */
.talents-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}
.talents-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.talents-cta-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
}

/* ── Ecosystem grid ──────────────────────────────────────────────────────────── */
/*
 * Two card variants share the same base .eco-card shell:
 *   <a class="eco-card">       — single-link card; entire surface is clickable.
 *                                Hover lifts (+translateY) and glows cyan.
 *   <div class="eco-card eco-card-multi"> — multi-link card; card itself is not
 *                                clickable (cursor:default, no lift) — each child
 *                                .eco-sublink handles its own hover state instead.
 */
.eco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.eco-card {
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.eco-card:hover {
  border-color: var(--cyan-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.08);
  color: var(--text);
}
.eco-card-multi { cursor: default; }
.eco-card-multi:hover { transform: none; }

.eco-number {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}
.eco-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}
.eco-desc {
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 0.75rem;
}
.eco-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.eco-tag {
  font-size: 0.62rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: rgba(0,229,255,0.06);
  color: var(--cyan-dim);
  border: 1px solid rgba(0,229,255,0.15);
  letter-spacing: 0.05em;
}
.eco-tag-recommended {
  background: var(--green-glow);
  color: var(--green);
  border-color: var(--green-dim);
}
.eco-url {
  font-size: 0.68rem;
  color: var(--cyan-dim);
  margin-top: auto;
  padding-top: 0.5rem;
}
.eco-card:hover .eco-url { color: var(--cyan); }

.eco-multi-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.eco-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
}
.eco-sublink:hover { color: var(--green); border-color: var(--green-dim); background: var(--green-glow); }
.eco-sublink-name { flex: 1; }
.eco-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 500;
}
.eco-badge-green { background: var(--green-glow); color: var(--green); border: 1px solid var(--green-dim); }
.eco-badge-dim   { background: rgba(255,255,255,0.03); color: var(--text-dim); border: 1px solid var(--border); }
.eco-sublink-sm {
  font-size: 0.73rem;
  padding: 0.25rem 0.5rem;
}

/* ── Global stats — live API cards ───────────────────────────────────────────── */
/*
 * Six cards in a 3×2 grid; each is populated by initGlobalStats() in main.js
 * via three parallel fetches to the world.grin.money public REST API.
 * Colour-modifier classes (.ls-green / .ls-cyan / .ls-yellow) only set the
 * .ls-value colour — the card layout itself is identical for all six cards.
 * .ls-change.up / .ls-change.down colour the 24 h price-delta directionally.
 * .stats-footer-links sits below the grid with a live timestamp and source link.
 */
.live-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.live-stat-card {
  padding: 1.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.live-stat-card:hover { border-color: var(--border-bright); }

.ls-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
}
.ls-value {
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-bright);
}
.ls-unit {
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ls-change {
  font-size: 0.7rem;
  font-weight: 500;
}
.ls-change.up   { color: var(--green); }
.ls-change.down { color: var(--magenta); }

.ls-green  .ls-value { color: var(--green); }
.ls-cyan   .ls-value { color: var(--cyan); }
.ls-yellow .ls-value { color: var(--yellow); }

.stats-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0 0.25rem;
}
.stats-footer-links a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}
.stats-footer-links a:hover { color: var(--green); }
.stats-updated { font-size: 0.65rem; color: var(--text-dim); }

/* ── HoF — two-column layout ────────────────────────────────────────────────── */
/*
 * .hof-cols: 2-col grid — donors (left) vs contributors (right).
 * Each column has a .hof-col-label, then a .hof-terminal card.
 * .hof-col overrides .hof-terminal's standalone max-width so both columns
 * share equal width inside the grid.
 */
.hof-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch; /* both columns grow to the taller side's height */
}
.hof-col {
  display: flex;
  flex-direction: column;
}
.hof-col-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}
/* Remove standalone centering; stretch terminal to fill the column */
.hof-col .hof-terminal {
  max-width: none;
  margin: 0;
  flex: 1; /* fills remaining height so both terminals are equal */
}

/* Donors column: 4-col header/row grid (rank / name / year / amount) */
.hof-header,
.hof-row {
  grid-template-columns: 50px 1fr 60px auto;
}
.col-date {
  color: var(--text-dim);
  font-size: 0.72rem;
}

/* Coders leaderboard (top 10): 3-col grid (rank / name / commits) */
.hof-coder-header,
.hof-coder-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 1rem;
  padding: 0.55rem 1.5rem;
  font-size: 0.8rem;
}
.hof-coder-header {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.hof-coder-row {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.hof-coder-row:hover { background: rgba(255, 255, 255, 0.02); }

/* Compact name-tag cloud for contributors #11–50 */
.hof-contrib-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
}
/* Default tag: faint grey — GitHub code contributors */
.hof-contrib-tag {
  font-size: 0.67rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
/* Cyan tint — forum & community volunteer tags */
.hof-tag-forum {
  background: var(--cyan-glow);
  color: var(--cyan-dim);
  border-color: rgba(0, 229, 255, 0.2);
}
/* Dim italic — "+ many anonymous volunteers" note */
.hof-tag-dim {
  font-style: italic;
  color: var(--text-dim);
  border-color: transparent;
  background: transparent;
}

/* Full-width forum panel that sits below the 2-col grid */
.hof-forum-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.hof-forum-panel .hof-col-label { margin-bottom: 0.75rem; }
.hof-forum-panel .hof-contrib-tags {
  border-top: none;
  padding: 0;
}

/* Shared footer row used in both terminals */
.hof-footer-row {
  padding: 0.7rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.hof-more-link {
  font-size: 0.74rem;
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}
.hof-more-link:hover { color: var(--green); }

/* ── Community grid — 3 up ───────────────────────────────────────────────────── */
.community-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
  margin: 0 auto;
}

/* ── Footer — simplified ─────────────────────────────────────────────────────── */
/*
 * Two flex children side by side: .footer-brand (logo + tagline) on the left,
 * .footer-noobvie-quote (pull-quote) on the right, separated by a left border.
 * At 600px the flex wraps to a column and the left border becomes a top border.
 */
.footer-simple {
  display: flex;
  align-items: flex-start;
  gap: 4rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.footer-brand { flex: 0 0 auto; }
.footer-noobvie-quote {
  flex: 1;
  border-left: 2px solid var(--border-bright);
  padding-left: 2rem;
}
.footer-quote-mark {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--green);
  opacity: 0.3;
  font-family: Georgia, serif;
  margin-bottom: -0.5rem;
}
.footer-quote-text {
  font-size: 0.82rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 0.6rem;
}
.footer-quote-author {
  font-size: 0.72rem;
  color: var(--green);
  letter-spacing: 0.08em;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Selection ───────────────────────────────────────────────────────────────── */
::selection { background: var(--green-glow); color: var(--green); }

/* ── Toolkit CTA banner (index.html) ─────────────────────────────────────────── */
.toolkit-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.toolkit-cta-headline {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}
.toolkit-cta-desc {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 560px;
  line-height: 1.6;
}
.toolkit-cta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.toolkit-cta-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .toolkit-cta-inner  { flex-direction: column; }
  .toolkit-cta-actions { width: 100%; }
}

/* ── Interactive terminal demo (grin-node-toolkit.html) ──────────────────────── */
.tk-interactive-terminal .terminal-body {
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
}
.tk-menu-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  padding: 0.15rem 0;
  cursor: pointer;
  color: var(--text);
  transition: color 0.15s;
}
.tk-menu-btn:hover { color: var(--green); }
.tk-output-line { color: var(--text); margin: 0.05rem 0; }
.tk-output-line.success { color: var(--green); }
.tk-output-line.info    { color: var(--cyan); }
.tk-back-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-bright);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  background: none;
  transition: color 0.15s, border-color 0.15s;
}
.tk-back-btn:hover { color: var(--green); border-color: var(--green); }

