/* ─────────────────────────────────────────────────────────
   Bard Bard portfolio — base styles
   Tokens drive 3 aesthetics: HUD (sci-fi), Editorial, Brutalist
   ───────────────────────────────────────────────────────── */

:root {
  /* Color tokens — overridden per aesthetic */
  --bg-0: #04070d;
  --bg-1: #070c16;
  --panel: rgba(10, 18, 32, 0.55);
  --panel-solid: #0a1220;
  --border: rgba(91, 227, 255, 0.18);
  --border-strong: rgba(91, 227, 255, 0.38);
  --ink: #e6eef7;
  --ink-dim: rgba(230, 238, 247, 0.62);
  --ink-faint: rgba(230, 238, 247, 0.38);
  --accent: #5be3ff;
  --accent-soft: rgba(91, 227, 255, 0.14);
  --accent-glow: rgba(91, 227, 255, 0.45);

  /* Type */
  --f-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Geist", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Density — overridden by tweak */
  --pad-card: 22px;
  --gap-grid: 18px;
  --gap-stack: 14px;
  --radius: 14px;
  --radius-sm: 8px;

  /* Hairline borders */
  --hair: 1px solid var(--border);
}

/* ── Aesthetic: Editorial ────────────────────────────────── */
[data-aesthetic="editorial"] {
  --bg-0: #060912;
  --bg-1: #0a0f1c;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-solid: #0a0f1c;
  --border: rgba(230, 238, 247, 0.12);
  --border-strong: rgba(230, 238, 247, 0.28);
  --f-display: "Newsreader", ui-serif, Georgia, serif;
  --f-body: "Newsreader", ui-serif, Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 4px;
  --radius-sm: 2px;
}

/* ── Aesthetic: Brutalist ────────────────────────────────── */
[data-aesthetic="brutalist"] {
  --bg-0: #000;
  --bg-1: #050505;
  --panel: transparent;
  --panel-solid: #000;
  --border: rgba(255, 255, 255, 0.85);
  --border-strong: rgba(255, 255, 255, 1);
  --ink: #f0f0f0;
  --ink-dim: rgba(240, 240, 240, 0.72);
  --ink-faint: rgba(240, 240, 240, 0.45);
  --f-display: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-body: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 0;
  --radius-sm: 0;
}

/* ── Density ─────────────────────────────────────────────── */
[data-density="compact"] {
  --pad-card: 14px;
  --gap-grid: 12px;
  --gap-stack: 10px;
}
[data-density="roomy"] {
  --pad-card: 32px;
  --gap-grid: 28px;
  --gap-stack: 20px;
}

/* ── Base ────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ── Layout shell ────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

[data-density="compact"] .shell { gap: 18px; padding-top: 36px; }
[data-density="roomy"] .shell { gap: 44px; padding-top: 80px; }

/* Mobile: tighter padding so cards aren't squashed by side margins */
@media (max-width: 720px) {
  .shell {
    padding: 32px 14px 0;
    gap: 18px;
  }
  [data-density="compact"] .shell { gap: 14px; padding-top: 22px; }
  [data-density="roomy"] .shell { gap: 24px; padding-top: 40px; }
  :root { --pad-card: 16px; --gap-grid: 14px; }
}
@media (max-width: 480px) {
  .shell { padding: 24px 10px 0; }
}

/* ── Section pill label ──────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
[data-aesthetic="brutalist"] .pill {
  border-radius: 0;
  background: var(--accent);
  color: #000;
  border: none;
}
[data-aesthetic="brutalist"] .pill::before { background: #000; box-shadow: none; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--panel);
  border: var(--hair);
  border-radius: var(--radius);
  padding: var(--pad-card);
  backdrop-filter: blur(8px);
}
[data-aesthetic="hud"] .card {
  background: linear-gradient(180deg, rgba(10,18,32,0.55), rgba(6,11,20,0.78));
  box-shadow: inset 0 1px 0 rgba(91,227,255,0.06);
}
[data-aesthetic="hud"] .card::before {
  /* Corner tick marks — HUD only */
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid transparent;
  border-image: linear-gradient(135deg,
    var(--accent) 0 12px, transparent 12px calc(100% - 12px), var(--accent) calc(100% - 12px) 100%) 1;
  opacity: 0.25;
  pointer-events: none;
  border-radius: var(--radius);
  display: none; /* subtle — disabled for now, but kept for tweak */
}
[data-aesthetic="brutalist"] .card {
  border: 1.5px solid var(--border);
  background: transparent;
  backdrop-filter: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* ── Type ────────────────────────────────────────────────── */
.h1, .h2, .h3 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.h1 { font-size: clamp(56px, 9vw, 132px); line-height: 0.92; letter-spacing: -0.04em; }
.h2 { font-size: clamp(28px, 3.5vw, 44px); line-height: 1.02; }
.h3 { font-size: 18px; line-height: 1.25; font-weight: 600; }

[data-aesthetic="editorial"] .h1 { font-weight: 400; font-style: italic; letter-spacing: -0.03em; }
[data-aesthetic="editorial"] .h2 { font-weight: 400; }
[data-aesthetic="brutalist"] .h1 { font-size: clamp(40px, 7vw, 92px); letter-spacing: 0; line-height: 1; }
[data-aesthetic="brutalist"] .h2 { letter-spacing: 0; }

.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
.body-lg { font-size: 18px; line-height: 1.5; color: var(--ink-dim); }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }

/* ── Buttons & icon buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: var(--hair);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-0);
  box-shadow: 0 0 24px var(--accent-glow);
}
[data-aesthetic="brutalist"] .btn { border-radius: 0; background: transparent; color: var(--ink); }
[data-aesthetic="brutalist"] .btn:hover { background: var(--ink); color: #000; box-shadow: none; }

.icon-btn {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: var(--hair);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: all 0.15s ease;
  color: var(--ink-dim);
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}
[data-aesthetic="brutalist"] .icon-btn { border-radius: 0; }

/* Social icon buttons — render brand PNGs at consistent size */
.social-btn { padding: 0; overflow: hidden; }
.social-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  transition: transform 0.15s ease;
}
.social-btn:hover .social-img { transform: scale(1.08); }
[data-aesthetic="brutalist"] .social-img { filter: grayscale(1) contrast(1.1); }

/* ── List row (for stats / featured / resources) ─────────── */
.row-list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: var(--hair);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.015);
  transition: all 0.15s ease;
}
.row:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.row-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: rgba(91,227,255,0.08);
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 20px;
  overflow: hidden;
}
.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.row-sub { font-size: 12px; color: var(--ink-dim); margin: 0; }
.row-arrow { color: var(--accent); opacity: 0.6; }

/* ── Grid ────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-grid); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-grid); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-grid); }

/* Connect + Mini Games side by side. Connect-stack column stacks
   Connect on top of About Me so the right-hand games column matches
   the visual mass of both. */
.connect-games-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--gap-grid);
  align-items: start;
}
.connect-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-grid);
  min-width: 0;
}
@media (max-width: 880px) {
  .connect-games-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Stat tile ───────────────────────────────────────────── */
.stat {
  padding: var(--pad-card);
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}
[data-aesthetic="brutalist"] .stat::after { display: none; }
.stat-value {
  font-family: var(--f-display);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
[data-aesthetic="editorial"] .stat-value { font-weight: 400; font-style: italic; }
.stat-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.stat-trend {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: auto;
}

/* ── Video thumb ─────────────────────────────────────────── */
.video-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a2638, #0d1525);
  border: var(--hair);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent 0 8px,
      rgba(91,227,255,0.04) 8px 16px);
}
.video-play {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: grid;
  place-items: center;
  color: #c00;
}
.video-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
  z-index: 2;
}

/* ── Ticker ──────────────────────────────────────────────── */
.ticker-bar {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  border-top: var(--hair);
  border-bottom: var(--hair);
  overflow: hidden;
  background: var(--bg-1);
}
.ticker-track {
  display: flex;
  gap: 48px;
  padding: 14px 0;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── Side rail (mini-games style, but for jump-nav) ──────── */
.side-rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.side-rail .btn {
  font-size: 10px;
  padding: 6px 12px;
  background: var(--panel-solid);
  border: var(--hair);
  color: var(--ink-dim);
}
.side-rail .btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: none;
}
@media (max-width: 1100px) { .side-rail { display: none; } }

/* ── Marquee name (used in TYPE hero variant) ────────────── */
.hero-type {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(80px, 16vw, 240px);
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
[data-aesthetic="editorial"] .hero-type { font-weight: 400; font-style: italic; letter-spacing: -0.04em; }
[data-aesthetic="brutalist"] .hero-type { font-size: clamp(60px, 12vw, 180px); letter-spacing: 0; }

/* ── Misc ────────────────────────────────────────────────── */
.kbd {
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink-dim);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 8px 0;
}

/* Background layer container */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Stars background */
.bg-stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(91,227,255,0.08), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(91,227,255,0.05), transparent 50%),
    var(--bg-0);
}
.bg-stars .star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.7); }
  50% { opacity: 0.9; transform: scale(1.2); }
}

/* Grid background */
.bg-grid {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 0%, var(--bg-0) 75%),
    linear-gradient(rgba(91,227,255,0.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(91,227,255,0.06) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg-0);
}
[data-animate-bg="true"] .bg-grid {
  animation: grid-drift 30s linear infinite;
  background-size: 40px 40px;
}
@keyframes grid-drift {
  to { background-position: 40px 40px; }
}

/* Fog background */
.bg-fog {
  position: absolute;
  inset: 0;
  background: var(--bg-0);
}
.bg-fog::before, .bg-fog::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.bg-fog::before {
  background: var(--accent);
  top: -20vmax;
  left: -20vmax;
  animation: float-a 24s ease-in-out infinite alternate;
}
.bg-fog::after {
  background: #5b6dff;
  bottom: -25vmax;
  right: -15vmax;
  animation: float-b 32s ease-in-out infinite alternate;
}
[data-animate-bg="false"] .bg-fog::before,
[data-animate-bg="false"] .bg-fog::after { animation: none; }
@keyframes float-a { to { transform: translate(20vmax, 10vmax) scale(1.2); } }
@keyframes float-b { to { transform: translate(-15vmax, -10vmax) scale(0.9); } }

/* None / brutalist override */
[data-bg="none"] .bg-layer { display: none; }
[data-aesthetic="brutalist"] .bg-layer { background: #000; }
[data-aesthetic="brutalist"] .bg-stars { background: #000; }
[data-aesthetic="brutalist"] .bg-grid {
  background:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    #000;
}
[data-aesthetic="brutalist"] .bg-fog::before,
[data-aesthetic="brutalist"] .bg-fog::after { display: none; }

/* ── Hero specifics ──────────────────────────────────────── */
.hero {
  position: relative;
  padding: 48px 0 24px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.hero-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, oklch(0.7 0.18 200), oklch(0.6 0.22 320));
  box-shadow: 0 0 0 6px var(--bg-0), 0 0 60px var(--accent-glow);
  flex-shrink: 0;
  overflow: hidden;
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Center on the face — image's subject sits in the upper portion */
  object-position: 50% 22%;
  display: block;
}

/* HeroAvatar layout — grid that stacks at small widths */
.hero-avatar-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 3vw, 28px);
  align-items: center;
}
.hero-avatar-card { overflow: hidden; }
.hero-avatar-card .hero-avatar {
  width: clamp(96px, 14vw, 168px);
  height: clamp(96px, 14vw, 168px);
}
.hero-avatar-name {
  /* Tightened — was clamp(40px, 9vw, 110px) which overflowed at narrow
     widths with longer names. Now caps at ~84px and allows word wrap. */
  font-size: clamp(34px, 6.4vw, 84px) !important;
  line-height: 0.96;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-wrap: balance;
  hyphens: auto;
}
.hero-avatar-tagline {
  max-width: 560px;
  margin-top: 14px;
  font-size: clamp(14px, 1.5vw, 18px);
}
.hero-avatar-text { min-width: 0; }

@media (max-width: 640px) {
  .hero-avatar-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 18px;
  }
  .hero-avatar-card .hero-avatar { margin: 0 auto; width: clamp(96px, 28vw, 140px); height: clamp(96px, 28vw, 140px); }
  .hero-avatar-name { font-size: clamp(32px, 10vw, 56px) !important; }
  .hero-avatar-tagline { margin-left: auto; margin-right: auto; font-size: 14px; }
  .hero-meta { justify-content: center; }
}

/* About Me — fluid (was a fixed 196px which broke on mobile) */
.about-me-card { height: auto !important; }
.about-me-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
[data-aesthetic="brutalist"] .hero-avatar {
  border-radius: 0;
  border-width: 2px;
  box-shadow: 8px 8px 0 var(--ink);
}
[data-aesthetic="brutalist"] .hero-avatar img {
  filter: grayscale(1) contrast(1.15);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero-meta b { color: var(--ink); font-weight: 500; }

/* Terminal hero */
.terminal {
  background: var(--panel-solid);
  border: var(--hair);
  border-radius: var(--radius);
  padding: 0;
  font-family: var(--f-mono);
  overflow: hidden;
  min-height: 360px;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: var(--hair);
  background: rgba(255,255,255,0.02);
}
.terminal-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: inline-block;
}
.terminal-bar i:first-child { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span {
  margin-left: 12px;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}
.terminal-body {
  padding: 24px 28px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-dim);
}
.terminal-body .prompt { color: var(--accent); margin-right: 8px; }
.terminal-body .cursor::after {
  content: "▊";
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.terminal-body .key { color: var(--ink); }
.terminal-body .ansi-mag { color: #ff5fb0; }
.terminal-body .ansi-amb { color: #ffb84a; }
.terminal-body .ansi-lim { color: #aef96b; }

/* ── Featured (big) cards ─────────────────────────────────── */
.feature-card {
  position: relative;
  border: var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.feature-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a2638, #0d1525);
  overflow: hidden;
  flex-shrink: 0;
}
.feature-thumb .pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(91,227,255,0.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(91,227,255,0.04) 0 1px, transparent 1px 24px);
  mix-blend-mode: screen;
}
.feature-thumb .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  background: rgba(0,0,0,0.6);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.feature-thumb .placeholder-label {
  position: absolute;
  inset: auto 0 12px 0;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* Thumbnail trigger button — fills the 16:9 slot */
.thumb-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.yt-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feature-thumb .thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.45));
  transition: background 0.2s ease;
}
.feature-thumb .thumb-play svg {
  width: 64px;
  height: 64px;
  color: #fff;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
  transition: transform 0.18s ease;
}
.thumb-trigger:hover .thumb-play { background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.2)); }
.thumb-trigger:hover .thumb-play svg { transform: scale(1.1); }

/* Embedded iframe — fills the 16:9 slot */
.yt-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Escape hatch shown over an active player — appears on hover so it
   doesn't cover playback controls, but is always reachable when YouTube
   throws Error 150/153 ("embedding disabled by owner") */
.yt-escape {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: auto;
}
.feature-thumb:hover .yt-escape { opacity: 1; }
.yt-escape:hover { background: var(--accent); color: var(--bg-0); border-color: var(--accent); }

.title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.feature-card:hover .title-link { border-bottom-color: var(--accent); }
.feature-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feature-title {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
[data-aesthetic="editorial"] .feature-title { font-weight: 400; font-style: italic; }
.feature-meta {
  display: flex;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Countdown card — Sui banner background.
   Uses high specificity selector so [data-aesthetic="hud"] .card gradient
   doesn't override it. */
[data-aesthetic] .countdown-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(91, 227, 255, 0.32);
  /* Layer a darker overlay (banner is now ~10% more muted) on top of the
     banner image. background-position pulls the logo region into the
     top-right of the card. */
  background:
    linear-gradient(180deg, rgba(4, 7, 13, 0.45) 0%, rgba(4, 7, 13, 0.65) 100%),
    url("assets/sui-banner.jpeg") top right / cover no-repeat,
    #06101e;
}
.countdown-card .countdown div {
  background: rgba(4, 7, 13, 0.62);
  backdrop-filter: blur(6px);
  border-color: rgba(255, 255, 255, 0.18);
}
[data-aesthetic="brutalist"] .countdown-card {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url("assets/sui-banner.jpeg") center / cover no-repeat,
    #000;
}
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.countdown div {
  text-align: center;
  padding: 14px 8px;
  border: var(--hair);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.countdown b {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.countdown span {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 4px;
  display: block;
}

/* ── X post cards ───────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-grid);
}
@media (max-width: 880px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex;
  flex-direction: column;
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-soft);
}

.post-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at center, rgba(91, 227, 255, 0.08), transparent 70%),
    linear-gradient(135deg, #0d1726, #050810);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.post-img::before {
  /* subtle dotted-grid backdrop so the logo plate doesn't look flat */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 14px 14px;
}
.post-logo {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
  transition: transform 0.2s ease;
}
.post-card:hover .post-logo { transform: scale(1.08); }

/* Real X-post screenshot — fills the thumb with cover + top alignment so
   the headline of the tweet stays visible. */
.post-screenshot {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}
.post-card:hover .post-screenshot { transform: scale(1.04); }
/* Soft fade at the bottom so the brand pill in the corner has contrast */
.post-img:has(.post-screenshot)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(4, 7, 13, 0.35) 0%,
    rgba(4, 7, 13, 0) 25%,
    rgba(4, 7, 13, 0) 65%,
    rgba(4, 7, 13, 0.55) 100%
  );
}
.post-img:has(.post-screenshot)::before { display: none; }

[data-aesthetic="brutalist"] .post-img {
  background: #000;
}
[data-aesthetic="brutalist"] .post-img::before { display: none; }
/* Brand chip in the top-left */
.post-brand {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  background: rgba(4, 7, 13, 0.78);
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
}
[data-aesthetic="brutalist"] .post-brand {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.post-meta {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-title {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-aesthetic="editorial"] .post-title { font-weight: 400; font-style: italic; }
.post-blurb {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-dim);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-footline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2px;
}
.post-views { color: var(--accent); }

/* Support card */
.support-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--panel);
  transition: all 0.18s ease;
}
.support-card:hover { border-color: var(--accent); }
.support-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 24px;
  overflow: hidden;
  flex-shrink: 0;
}
.wallet-icon {
  background: var(--bg-1);
  padding: 4px;
}
.wallet-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.support-body { flex: 1; min-width: 0; }
.support-title { font-size: 16px; font-weight: 600; margin: 0; }
.support-sub { font-size: 12px; color: var(--ink-dim); margin: 2px 0 0; }

.wallet-addr {
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: all;
}
.wallet-addr:hover { color: var(--accent); }

.wallet-copy-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wallet-copy-btn:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--accent-glow);
}
.wallet-copy-btn:active { transform: translateY(0); }
[data-aesthetic="brutalist"] .wallet-copy-btn { border-radius: 0; }

/* ── Mini Games launcher ───────────────────────────────── */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.game-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--game-accent) 22%, transparent);
  background: color-mix(in srgb, var(--game-accent) 6%, transparent);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.18s ease;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.game-tile:hover {
  border-color: color-mix(in srgb, var(--game-accent) 42%, transparent);
  background: color-mix(in srgb, var(--game-accent) 12%, transparent);
  transform: translateX(3px);
  box-shadow: 0 0 22px color-mix(in srgb, var(--game-accent) 18%, transparent);
}
.game-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--game-accent) 60%, transparent));
}
.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.game-title {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--game-accent);
}
.game-sub {
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.35;
}
.game-arrow {
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--ink-faint);
  transition: color 0.15s ease, transform 0.15s ease;
}
.game-tile:hover .game-arrow {
  color: var(--game-accent);
  transform: translate(2px, -2px);
}
[data-aesthetic="brutalist"] .game-tile { border-radius: 0; }

/* ── Mini-game iframe overlay ─────────────────────────── */
.game-overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 200;
  background: rgba(2, 3, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: stretch;
  animation: game-overlay-in 0.22s ease-out;
}
@keyframes game-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

/* Selection */
::selection { background: var(--accent); color: var(--bg-0); }

/* ── Wrecking-ball mascot ──────────────────────────────── */
/* Anchored to the top of the hero section (section#hero has
   position:relative). Hangs straight down + swings around the anchor.
   Visible at every screen size — sizing + offset scale fluidly so the
   ball never gets pushed off-screen by hero content. */
.mascot {
  --mascot-size: clamp(56px, 9vw, 120px);
  --mascot-chain: clamp(34px, 5vw, 60px);
  position: absolute;
  top: 8px;
  right: clamp(40px, 9vw, 170px);
  width: 0;
  height: 0;
  z-index: 5;
  pointer-events: none;
  transform-origin: 0 0;
  animation: mascot-swing 4.6s ease-in-out infinite;
}
.mascot-anchor {
  position: absolute;
  top: -4px;
  left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1a1d24;
  box-shadow:
    inset 0 -2px 2px rgba(255,255,255,0.08),
    0 0 0 2px var(--bg-0),
    0 2px 8px rgba(0,0,0,0.6);
}
.mascot-chain {
  position: absolute;
  top: 4px;
  left: -10px;
  width: 20px;
  height: var(--mascot-chain);
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.mascot-payload {
  position: absolute;
  top: calc(var(--mascot-chain) - 4px);
  left: calc(var(--mascot-size) / -2);
  width: var(--mascot-size);
  height: var(--mascot-size);
  border-radius: 50%;
  overflow: hidden;
  filter:
    saturate(1.35)
    contrast(1.08)
    drop-shadow(2px 2px 0 #0a0f1c)
    drop-shadow(-2px 2px 0 #0a0f1c)
    drop-shadow(0 12px 24px rgba(0,0,0,0.55));
  border: 3px solid #0a0f1c;
  background: #0a0f1c;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,0.04),
    0 0 0 4px var(--accent-soft);
}
.mascot-payload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 38%;
  display: block;
}
@keyframes mascot-swing {
  0%   { transform: rotate(-22deg); }
  50%  { transform: rotate(22deg); }
  100% { transform: rotate(-22deg); }
}
[data-mascot="off"] .mascot { display: none; }

/* Trim the swing arc on small screens so the ball never sails off-screen */
@media (max-width: 640px) {
  .mascot { animation-name: mascot-swing-sm; }
  @keyframes mascot-swing-sm {
    0%   { transform: rotate(-14deg); }
    50%  { transform: rotate(14deg); }
    100% { transform: rotate(-14deg); }
  }
}


/* ── Section heads (larger, easier-to-scan section titles) ─────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(18px, 2.1vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}
.section-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  flex-shrink: 0;
}
[data-aesthetic="editorial"] .section-title { font-weight: 400; font-style: italic; }
[data-aesthetic="brutalist"] .section-title { font-weight: 800; letter-spacing: 0; }
[data-aesthetic="brutalist"] .section-title::before { box-shadow: none; border-radius: 0; }
@media (max-width: 640px) {
  .section-head { gap: 10px; margin-bottom: 14px; }
  .section-title { font-size: clamp(17px, 5.2vw, 22px); }
  .section-title::before { width: 7px; height: 7px; }
}

/* ── Partnerships grid ──────────────────────────────────────
   Logo tiles for "Featured Partnerships". Compact, square-ish cards
   that read as a row of brand marks rather than full content cards. */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
}
/* Pick column counts that divide 9 cleanly so we never end with an
   awkward orphan tile: 9 → 5 (5+4) → 3 (3+3+3) → 2 on tiny phones. */
@media (max-width: 1200px) { .partner-grid { grid-template-columns: repeat(5, 1fr); gap: 9px; } }
@media (max-width: 760px)  { .partner-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
@media (max-width: 380px)  { .partner-grid { grid-template-columns: repeat(2, 1fr); } }

.partner-card {
  display: flex;
  flex-direction: column;
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
a.partner-card { cursor: pointer; }
a.partner-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-soft);
}

.partner-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(ellipse at center, rgba(91, 227, 255, 0.08), transparent 70%),
    linear-gradient(135deg, #0d1726, #050810);
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.partner-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 12px 12px;
}
.partner-logo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
a.partner-card:hover .partner-logo { transform: scale(1.06); }
/* Hide the dotted grid backdrop when a real logo fills the thumb */
.partner-thumb:has(.partner-logo)::before { display: none; }

.partner-mono {
  position: relative;
  z-index: 1;
  font-family: var(--f-mono);
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 600;
  color: var(--accent);
  opacity: 0.55;
  letter-spacing: -0.02em;
}
.partner-placeholder-label {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  z-index: 1;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.partner-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  min-height: 30px;
}
.partner-name {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.15;
  /* Wrap to a second line instead of truncating with an ellipsis */
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.partner-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.55;
  transition: opacity 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
  margin-top: 1px;
}
a.partner-card:hover .partner-arrow { opacity: 1; transform: translate(2px, -2px); }

/* On mobile, hide the arrow so the name has the full row width to wrap into. */
@media (max-width: 760px) {
  .partner-arrow { display: none; }
  .partner-body { padding: 6px 8px; min-height: 28px; }
  .partner-name { font-size: 10.5px; }
}
/* Hide the "brands i've worked with" caption on phones so the section
   header is just the title and reads cleanly */
@media (max-width: 560px) {
  .partner-caption { display: none; }
}

[data-aesthetic="brutalist"] .partner-thumb { background: #000; }
[data-aesthetic="brutalist"] .partner-thumb::before { display: none; }

/* Post thumbnail (themed SVG) — fills the 16:9 slot like the screenshot
   did, but composed from vector primitives. */
.post-thumb-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}
.post-img--thumb { background: #04070d; }
.post-img--thumb::before { display: none; }
.post-img--thumb::after { display: none; }
