/* ════════════════════════════════════════════════════════════════════
   chessdroid — editorial tournament-book aesthetic, 2026
   light: warm paper, ink, amber, board-green
   dark:  deep slate, amber, mint
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..800,30..100,0..1&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─────────── Tokens ─────────── */
:root {
  /* Surfaces */
  --bg:           #f6f0e3;
  --bg-deep:      #ece4d0;
  --surface:      #fffdf8;
  --surface-2:    #faf4e6;
  --border:       #e3d8bf;
  --border-soft:  #ece2cb;
  --hairline:     #d8cbab;

  /* Ink */
  --text:         #1a1612;
  --text-soft:    #5a544a;
  --text-mute:    #948b78;

  /* Brand — robot-eye amber */
  --accent:       #c96a1f;
  --accent-deep:  #9b4f10;
  --accent-soft:  #fbe9d2;
  --accent-glow:  rgba(201, 106, 31, 0.18);

  /* Board palette */
  --board-light:  #ead7b7;
  --board-dark:   #b58863;
  --board-green:  #3a7556;
  --board-green-soft: #e2eee7;

  /* Chess classification */
  --c-brilliant:  #0e8e8e;
  --c-good:       #3a7556;
  --c-inacc:      #a47700;
  --c-mistake:    #b85a00;
  --c-blunder:    #b13838;

  /* Typography */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body:    "Manrope", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* Motion */
  --ease:         cubic-bezier(0.32, 0.72, 0.34, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadow */
  --sh-sm:  0 1px 2px rgba(45, 30, 0, 0.04);
  --sh-md:  0 4px 18px rgba(45, 30, 0, 0.06), 0 1px 3px rgba(45, 30, 0, 0.04);
  --sh-lg:  0 18px 48px rgba(45, 30, 0, 0.10), 0 4px 12px rgba(45, 30, 0, 0.06);
  --sh-accent: 0 8px 28px rgba(201, 106, 31, 0.28);
}

[data-theme="dark"] {
  --bg:           #0d1117;
  --bg-deep:      #060810;
  --surface:      #161b22;
  --surface-2:    #1c232d;
  --border:       #2a323f;
  --border-soft:  #1f2630;
  --hairline:     #353e4d;

  --text:         #e8ebef;
  --text-soft:    #a0a8b4;
  --text-mute:    #6a7280;

  --accent:       #ffa657;
  --accent-deep:  #ff8a30;
  --accent-soft:  #2a1d10;
  --accent-glow:  rgba(255, 166, 87, 0.20);

  --board-light:  #5a4d3d;
  --board-dark:   #2d2922;
  --board-green:  #7ee787;
  --board-green-soft: #14201a;

  --c-brilliant:  #80f0f0;
  --c-good:       #7ee787;
  --c-inacc:      #f0c674;
  --c-mistake:    #ffae5e;
  --c-blunder:    #ff7b72;

  --sh-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-md:  0 4px 18px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --sh-lg:  0 18px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  --sh-accent: 0 8px 28px rgba(255, 166, 87, 0.25);
}

/* ─────────── Reset ─────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

::selection { background: var(--accent); color: white; }
[data-theme="dark"] ::selection { background: var(--accent); color: #0d1117; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
[data-theme="dark"] a { color: var(--accent); }
[data-theme="dark"] a:hover { color: var(--accent-deep); }

/* ─────────── Decorative background ─────────── */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, transparent 49%, var(--hairline) 49%, var(--hairline) 51%, transparent 51%);
  background-size: 80px 80px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 70%);
}
[data-theme="dark"] .bg::before {
  opacity: 0.5;
  background-image:
    linear-gradient(45deg, transparent 49%, var(--border) 49%, var(--border) 51%, transparent 51%);
}

/* ─────────── Container ─────────── */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px 0;
}

/* ════════════════════════════════════════════════════════════════════
   TOP BAR — repurposes .app-titlebar
   ════════════════════════════════════════════════════════════════════ */
.app-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  background: transparent;
  font-weight: normal;
  color: var(--text);
}

.app-titlebar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.app-icon {
  width: 40px;
  height: 40px;
  image-rendering: auto;
  filter: drop-shadow(0 2px 6px rgba(201, 106, 31, 0.25));
  transition: transform 0.4s var(--ease-out);
}
.app-icon:hover { transform: rotate(-4deg) scale(1.05); }
[data-theme="dark"] .app-icon {
  filter: drop-shadow(0 0 12px rgba(255, 166, 87, 0.4));
}

.app-titlebar-left b {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.app-titlebar-left .sep {
  color: var(--text-mute);
  margin: 0 2px;
  font-family: var(--font-mono);
}

.app-titlebar-left .subtitle {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  font-weight: 400;
  color: var(--text-soft);
  opacity: 0.9;
}

.app-titlebar-controls { display: flex; gap: 6px; align-items: center; }

/* Hide the fake window chrome buttons; only the theme toggle remains */
.tb-btn:disabled, .win-btn { display: none !important; }

.tb-btn.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  box-shadow: var(--sh-sm);
}
.tb-btn.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.tb-btn.theme-toggle:active { transform: translateY(0); }

/* ════════════════════════════════════════════════════════════════════
   NAV — repurposes .menu-bar
   ════════════════════════════════════════════════════════════════════ */
.menu-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  font-family: var(--font-body);
  font-size: 14px;
  background: transparent;
  box-shadow: none;
  flex-wrap: wrap;
}

.menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s var(--ease);
  position: relative;
}
.menu-item::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  opacity: 0;
  border-radius: 1px;
  transform: rotate(45deg) scale(0.6);
  transition: opacity 0.2s, transform 0.2s var(--ease-out);
}
.menu-item:hover, .menu-item:focus {
  color: var(--text);
  background: var(--surface-2);
  outline: none;
}
.menu-item:hover::before, .menu-item:focus::before {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}
.menu-item u { text-decoration: none; }
[data-theme="dark"] .menu-item:hover {
  background: var(--surface);
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  color: var(--text);
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   WINDOW → SECTION CARD
   ════════════════════════════════════════════════════════════════════ */
.window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 0 22px;
  padding: 0;
  box-shadow: var(--sh-sm);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
}
.window:hover { border-color: var(--hairline); }
[data-theme="dark"] .window {
  border-color: var(--border);
  box-shadow: var(--sh-sm);
}

/* Section header — replaces window titlebar */
.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  user-select: none;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  position: relative;
}
.window-titlebar::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s;
}
.window:hover .window-titlebar::before { opacity: 1; }
[data-theme="dark"] .window-titlebar {
  background: var(--surface-2);
}

.window-titlebar .wt-left {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.window-icon {
  width: 18px; height: 18px;
  image-rendering: auto;
  opacity: 0.85;
}
.window-controls { display: none; }

.window-body {
  padding: 28px 32px;
  background: var(--surface);
}

/* "Paper" inset blocks become subtle highlighted callouts */
.paper {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
}
.paper > b {
  display: block;
  text-align: center;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.paper b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.paper p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
}

.paper + .notice,
.paper + .cta,
.notice + .cta {
  margin-top: 20px;
}

/* Group box — small caption */
.group-box {
  position: relative;
  margin-top: 22px;
  padding: 18px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.group-box > .group-label {
  position: absolute;
  top: -9px; left: 14px;
  background: var(--surface);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  user-select: none;
  position: relative;
  letter-spacing: -0.005em;
  box-shadow: var(--sh-sm);
}
.btn:hover {
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--sh-accent);
}
.btn.primary::before {
  content: "♘";
  font-size: 16px;
  line-height: 1;
  transition: transform 0.4s var(--ease-out);
}
.btn.primary:hover::before { transform: rotate(-12deg) scale(1.1); }

[data-theme="dark"] .btn.primary {
  background: var(--accent);
  color: #0d1117;
  border-color: var(--accent);
}
[data-theme="dark"] .btn.primary:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}

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

/* ════════════════════════════════════════════════════════════════════
   WELCOME / HERO
   ════════════════════════════════════════════════════════════════════ */
.welcome-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: center;
  padding: 56px 44px;
  background: var(--surface);
  position: relative;
}

.welcome-text {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.welcome-logo {
  width: 240px;
  height: auto;
  justify-self: center;
  grid-column: 2;
  grid-row: 1;
  filter: drop-shadow(0 18px 36px rgba(201, 106, 31, 0.25));
}
[data-theme="dark"] .welcome-logo {
  filter: drop-shadow(0 0 32px rgba(255, 166, 87, 0.35));
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  margin-bottom: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-transform: uppercase;
}
[data-theme="dark"] .badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(255, 166, 87, 0.2);
}

.welcome-headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.02;
  margin: 0 0 22px;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--text);
  font-variation-settings: "opsz" 96, "SOFT" 30;
}
.welcome-headline .accent {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
[data-theme="dark"] .welcome-headline .accent { color: var(--accent); }

.welcome-lead {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  max-width: 56ch;
  margin: 0 0 28px;
  color: var(--text-soft);
}

.welcome-cta { margin-top: 8px; }

/* ════════════════════════════════════════════════════════════════════
   FEATURES EXPLORER
   ════════════════════════════════════════════════════════════════════ */
.explorer-toolbar {
  display: flex;
  gap: 6px;
  padding: 12px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-soft);
}
.explorer-toolbar .crumb { padding: 2px 4px; color: var(--text-soft); }
.explorer-toolbar .crumb-active {
  color: var(--accent-deep);
  font-weight: 600;
}
[data-theme="dark"] .explorer-toolbar .crumb-active { color: var(--accent); }
.explorer-toolbar .crumb-sep { opacity: 0.5; }
.explorer-toolbar .crumb-meta { margin-left: auto; color: var(--text-mute); font-size: 11px; }

.explorer-group { margin-top: 36px; }
.explorer-group:first-child { margin-top: 0; }

.explorer-group-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 14px;
  letter-spacing: -0.02em;
  background: none;
  box-shadow: none;
  text-transform: none;
  font-variation-settings: "opsz" 96, "SOFT" 50;
}
.explorer-group-title::before {
  content: counter(group-counter, decimal-leading-zero) " / 05";
  counter-increment: group-counter;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  background: none;
  flex-shrink: 0;
}
.window-body { counter-reset: group-counter; }

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 0;
  background: none;
  box-shadow: none;
}

.feature-tile {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 22px 22px 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease);
}
.feature-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.feature-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.feature-tile:hover::after { opacity: 0.5; }
.feature-tile.is-link { cursor: pointer; }
.feature-tile.is-link::before {
  content: none;
}

.ft-icon {
  font-family: "DejaVu Sans", "Segoe UI Symbol", "Symbola", var(--font-body);
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 10px;
  flex-shrink: 0;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.ft-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
/* For chess-notation glyphs like !! and ?? — render as a deliberate
   annotation mark instead of stray punctuation. */
.ft-icon.notation {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.12em;
  padding-right: 0.12em; /* compensate for negative tracking pulling text left */
}

.ft-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.018em;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  font-variation-settings: "opsz" 60;
}

.ft-desc {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}

.ft-cta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .ft-cta { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   NOTICE / WARNING / INFO
   ════════════════════════════════════════════════════════════════════ */
.notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--c-inacc);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin: 14px 0;
  text-align: center;
}

.notice > div {
  width: 100%;
  max-width: 740px;
  text-align: left;
}

.notice-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: var(--c-inacc);
  text-shadow: none;
}
.notice-icon.warn { color: var(--c-inacc); text-shadow: none; }
.notice-icon.info { color: var(--c-brilliant); }

.notice b {
  display: inline-block;
  width: 100%;
  margin-bottom: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}
.notice a { color: var(--accent-deep); font-weight: 600; }
[data-theme="dark"] .notice a { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   FOOTER — quiet editorial line
   ════════════════════════════════════════════════════════════════════ */
.site-footer {
  max-width: 1180px;
  margin: 32px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px 32px 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
}
.footer-copy { color: var(--text-soft); }
.footer-sep { color: var(--hairline); }
.footer-link {
  color: var(--text-mute);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.footer-link:hover { color: var(--accent); }
.footer-top {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.footer-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ════════════════════════════════════════════════════════════════════
   SECTION TITLE (sub-pages)
   ════════════════════════════════════════════════════════════════════ */
.section-title {
  margin: 36px 0 14px;
  padding: 0;
  background: none;
  color: var(--text);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.section-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96, "SOFT" 50;
}
.section-title span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════════════════════════
   INLINE
   ════════════════════════════════════════════════════════════════════ */
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-deep);
  border: 1px solid var(--border-soft);
}
[data-theme="dark"] code, [data-theme="dark"] kbd {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--border);
}

.stack > * + * { margin-top: 14px; }

[id] { scroll-margin-top: 100px; }

/* ════════════════════════════════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 920px) {
  .wrap { padding: 14px 18px 60px; }
  .welcome-body {
    grid-template-columns: 1fr;
    padding: 36px 22px;
    text-align: center;
    gap: 24px;
  }
  .welcome-logo {
    width: 160px;
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 6px;
  }
  .welcome-text {
    grid-column: 1;
    grid-row: 2;
  }
  .welcome-headline { font-size: clamp(34px, 9vw, 48px); }
  .welcome-lead { margin-left: auto; margin-right: auto; }
  .welcome-cta.cta { justify-content: center; }

  .window-body { padding: 22px 20px; }
  .window-titlebar { padding: 12px 18px; font-size: 12px; }
  .explorer-grid { grid-template-columns: 1fr; }
  .explorer-group-title { font-size: 22px; }

  .nav-toggle { display: inline-block; margin-left: auto; }
  .menu-bar { padding-bottom: 16px; margin-bottom: 24px; gap: 0; }
  .menu-bar .menu-item { display: none; }
  .menu-bar.nav-open {
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
  }
  .menu-bar.nav-open .menu-item {
    display: flex;
    padding: 10px 12px;
  }
  .nav-toggle { order: -1; align-self: flex-end; }

  .app-titlebar-left .subtitle { display: none; }
  .app-titlebar-left .sep { display: none; }
}

@media (max-width: 540px) {
  .welcome-headline { font-size: 34px; }
  .section-title h2 { font-size: 22px; }
  .section-title { flex-wrap: wrap; gap: 6px; }
  .site-footer { gap: 8px; font-size: 11px; }
}

/* ════════════════════════════════════════════════════════════════════
   ENTRANCE ANIMATION (light touch)
   ════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .window {
    animation: rise 0.6s var(--ease-out) backwards;
  }
  .window:nth-of-type(1) { animation-delay: 0.05s; }
  .window:nth-of-type(2) { animation-delay: 0.12s; }
  .window:nth-of-type(3) { animation-delay: 0.20s; }
  .window:nth-of-type(4) { animation-delay: 0.28s; }
  .window:nth-of-type(5) { animation-delay: 0.36s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
