/* Chess — an Istahdith project
   Palette: obsidian, deep teal, ivory, gold. */

@font-face {
  font-family: "Orbitron";
  src: url("fonts/Orbitron.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #030a09;
  --ink-2: #06110f;
  --ink-3: #081714;
  --teal: #0a3a32;
  --teal-2: #0e5046;
  --gold: #d9b45b;
  --gold-2: #b7860b;
  --ivory: #f4eddc;
  --muted: #97aaa3;
  --neon: #5cf0c0;
  --line: rgba(217, 180, 91, 0.18);
  --line-soft: rgba(244, 237, 220, 0.08);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --display: "Orbitron", "Space Grotesk", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 600px at 82% -8%, rgba(14, 80, 70, 0.55), transparent 62%),
    radial-gradient(700px 500px at 8% 8%, rgba(183, 134, 11, 0.12), transparent 60%),
    radial-gradient(1200px 900px at 50% 120%, rgba(10, 58, 50, 0.4), transparent 65%);
}

canvas#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

.wrap {
  width: min(1240px, calc(100% - 56px));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

svg { display: block; }

.pc {
  width: 100%;
  height: 100%;
  fill: url(#gW);
  stroke: #171207;
  stroke-width: 1.4;
  stroke-linejoin: round;
  color: var(--gold-2);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}
.pc.b {
  fill: url(#gB);
  stroke: var(--gold);
  stroke-width: 1.6;
  color: var(--ivory);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.65));
}
.pc .detail { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 14px 0;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding: 9px 0;
  background: rgba(3, 10, 9, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--gold);
  fill: currentColor;
}
.brand-word {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.34em;
  line-height: 1.25;
  font-weight: 600;
}
.brand-word small {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.5em;
  color: var(--gold);
  font-weight: 500;
}
.nav-links {
  display: flex;
  gap: 30px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links a { position: relative; padding: 6px 0; transition: color 0.25s; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover { color: var(--ivory); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--gold-2), var(--neon));
  opacity: 0.85;
}

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

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--btn-bg);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, color 0.3s, background 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, #e8c97c, var(--gold), var(--gold-2));
  color: #120d04;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 12px 34px -14px rgba(217, 180, 91, 0.8);
}
.btn-gold::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: sheen 4.6s 1.4s infinite;
}
.btn-gold:hover { transform: translateY(-2px); }
.btn-ghost { color: var(--ivory); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-small { padding: 10px 16px; font-size: 10px; }
.arrow { font-size: 15px; line-height: 1; }

@keyframes sheen {
  0%, 55% { left: -80%; }
  75%, 100% { left: 130%; }
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  min-height: 100svh;
  padding: 150px 0 90px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}
.eyebrow, .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
  animation: blink 2.4s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.hero-title {
  margin: 22px 0 0;
  position: relative;
  line-height: 0.82;
}
.title-line {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(64px, 12vw, 176px);
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff9e8 4%, #eed699 38%, var(--gold) 62%, #7d5a0e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 30px 80px rgba(217, 180, 91, 0.16);
  animation: titleIn 1.2s var(--ease) both;
}
.title-line::selection { color: var(--ink); }
.title-script {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 62px);
  color: var(--ivory);
  margin-top: -0.06em;
  margin-left: 0.2em;
  letter-spacing: 0.01em;
  transform: rotate(-3.5deg);
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: scriptIn 1.1s 0.35s var(--ease) both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(36px); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes scriptIn {
  from { opacity: 0; transform: translateY(20px) rotate(-3.5deg) rotateX(40deg); }
  to { opacity: 1; transform: translateY(0) rotate(-3.5deg); }
}

.hero-lede {
  max-width: 46ch;
  margin: 30px 0 0;
  color: #c4d2cb;
  font-size: 17px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}
.hero-stats {
  display: flex;
  gap: 34px;
  margin: 46px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.hero-stats div { min-width: 72px; }
.hero-stats dt {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  color: var(--ivory);
}
.hero-stats dt sup { font-size: 0.45em; color: var(--gold); }
.hero-stats dd {
  margin: 8px 0 0;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-art {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  perspective: 1300px;
}
.hero-board {
  position: relative;
  width: min(540px, 100%);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  transform: rotateX(46deg) rotateZ(-24deg) translateZ(0);
  transform-style: preserve-3d;
  border: 1px solid rgba(217, 180, 91, 0.5);
  box-shadow:
    0 60px 90px -30px rgba(0, 0, 0, 0.85),
    0 0 0 10px rgba(217, 180, 91, 0.04),
    0 0 90px -20px rgba(92, 240, 192, 0.28);
  background: #061310;
  animation: boardFloat 9s ease-in-out infinite;
}
@keyframes boardFloat {
  0%, 100% { transform: rotateX(46deg) rotateZ(-24deg) translateY(0); }
  50% { transform: rotateX(46deg) rotateZ(-24deg) translateY(-14px); }
}
.hero-board .sq3 {
  position: relative;
  display: grid;
  place-items: center;
}
.hero-board .sq3.light { background: linear-gradient(135deg, #efe6d0, #d8cba9); }
.hero-board .sq3.dark { background: linear-gradient(135deg, #0f4a40, #072a25); }
.hero-board .pc { width: 82%; height: 82%; opacity: 0.96; }
.hero-board .sq3.hot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(92, 240, 192, 0.5), transparent 70%);
  animation: hot 3s ease-in-out infinite;
}
@keyframes hot {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.8; }
}
.hero-board::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.14) 48%, transparent 60%);
  background-size: 280% 280%;
  animation: swipe 7s linear infinite;
  pointer-events: none;
}
@keyframes swipe {
  0% { background-position: 120% 0; }
  100% { background-position: -60% 0; }
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(217, 180, 91, 0.28);
  pointer-events: none;
}
.orbit-a {
  width: 560px;
  height: 560px;
  animation: spin 50s linear infinite;
}
.orbit-b {
  width: 720px;
  height: 720px;
  border-color: rgba(92, 240, 192, 0.12);
  animation: spin 80s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-knight {
  position: absolute;
  right: -6%;
  top: 2%;
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 26px rgba(217, 180, 91, 0.35));
  animation: knightFloat 6s ease-in-out infinite;
  z-index: 3;
}
.hero-knight .pc { stroke-width: 1; }
@keyframes knightFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-18px) rotate(3deg); }
}

.chip {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(6, 17, 15, 0.72);
  border: 1px solid var(--line);
  border-radius: 2px;
  backdrop-filter: blur(10px);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cfe0d8;
  box-shadow: 0 18px 40px -18px #000;
}
.chip b { color: var(--gold); font-family: var(--serif); font-size: 15px; letter-spacing: 0; }
.chip-1 { top: 16%; left: -4%; animation: chipFloat 7s ease-in-out infinite; }
.chip-2 { bottom: 12%; right: -2%; animation: chipFloat 8s 1.2s ease-in-out infinite; }
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-pedestal {
  position: absolute;
  width: 70%;
  height: 60px;
  bottom: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(92, 240, 192, 0.18), transparent 65%);
  filter: blur(12px);
  animation: pulseGlow 6s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 3;
}
.scroll-cue span {
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--gold), transparent);
  animation: cue 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------------------------------------------------------------- marquee */
.marquee {
  border-block: 1px solid var(--line);
  background: rgba(6, 17, 15, 0.55);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee span {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  padding: 15px 26px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #a9bdb4;
  white-space: nowrap;
}
.marquee span b { color: var(--gold); font-weight: 500; }
.marquee span i {
  font-style: normal;
  color: var(--gold-2);
  font-size: 8px;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------- sections */
.section {
  padding: 130px 0;
  position: relative;
}
.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 1.02;
  margin: 18px 0 0;
  letter-spacing: -0.01em;
}
.h2 em { font-style: italic; color: var(--gold); }
.lede {
  color: var(--muted);
  max-width: 56ch;
  margin: 20px 0 0;
}
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- arena */
.arena {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 46px;
  align-items: start;
}
.board-wrap { position: relative; }
.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 1px solid rgba(217, 180, 91, 0.45);
  border-radius: 2px;
  box-shadow:
    0 50px 90px -40px #000,
    0 0 0 8px rgba(217, 180, 91, 0.03),
    0 0 100px -40px rgba(92, 240, 192, 0.35);
  overflow: hidden;
  touch-action: manipulation;
}
.sq {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  aspect-ratio: 1;
  cursor: default;
  background: transparent;
  transition: background 0.2s;
}
.sq.light { background: linear-gradient(150deg, #efe7d3, #dcd0b1); }
.sq.dark { background: linear-gradient(150deg, #0f4b41, #08312b); }
.sq.has-move { cursor: pointer; }
.sq .pc {
  width: 88%;
  height: 88%;
  pointer-events: none;
  transition: transform 0.18s var(--ease), filter 0.2s;
}
.sq.has-move:hover .pc { transform: translateY(-2px) scale(1.04); }
.sq.sel { background: linear-gradient(150deg, #f3d98d, #c99a2e); }
.sq.sel .pc { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(217, 180, 91, 0.9)); }
.sq.last::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(92, 240, 192, 0.18);
  box-shadow: inset 0 0 0 2px rgba(92, 240, 192, 0.55);
  pointer-events: none;
}
.sq.dot::after {
  content: "";
  position: absolute;
  width: 24%;
  height: 24%;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(217, 180, 91, 0.8);
  animation: dotPop 0.25s var(--ease);
  pointer-events: none;
}
.sq.cap::after {
  width: 82%;
  height: 82%;
  border-radius: 50%;
  background: transparent;
  border: 3px solid var(--gold);
  box-shadow: 0 0 18px rgba(217, 180, 91, 0.5), inset 0 0 18px rgba(217, 180, 91, 0.2);
}
@keyframes dotPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.sq.check {
  background: radial-gradient(circle, #c2412c 0%, #6b1d12 60%, #3a0f09 100%);
}
.sq.check .pc { animation: shake 0.5s ease-in-out 2; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
.sq.moved .pc { animation: land 0.35s var(--ease); }
@keyframes land {
  0% { transform: translateY(-8px) scale(1.08); }
  100% { transform: none; }
}
.coord {
  position: absolute;
  z-index: 3;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.55;
  pointer-events: none;
  font-family: var(--sans);
}
.coord.f { bottom: 3px; right: 5px; }
.coord.r { top: 3px; left: 5px; }
.sq.light .coord { color: #6b5a32; }
.sq.dark .coord { color: #cbbd97; }

.board-badge {
  position: absolute;
  top: -34px;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.board-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}

.arena-panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(8, 23, 20, 0.85), rgba(4, 12, 10, 0.9));
  padding: 26px;
  box-shadow: 0 30px 70px -40px #000;
  position: sticky;
  top: 92px;
}
.status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 14px var(--neon);
  flex: none;
  animation: blink 2.2s infinite;
}
.status.danger .status-dot { background: #ff7043; box-shadow: 0 0 14px #ff7043; }
.status.over .status-dot { background: var(--gold); box-shadow: 0 0 14px var(--gold); animation: none; }
.label {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
#statusText {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
  color: var(--ivory);
}
#statusSub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.panel-block { margin-top: 24px; }
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  padding: 4px;
  border-radius: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 9px 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-radius: 1px;
  transition: background 0.25s, color 0.25s;
}
.seg button:hover { color: var(--ivory); }
.seg button.on {
  background: rgba(217, 180, 91, 0.14);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(217, 180, 91, 0.35);
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.label-row span { font-size: 10px; color: var(--gold); }
.moves {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  max-height: 168px;
  overflow-y: auto;
  font-variant-numeric: tabular-nums;
  scrollbar-width: thin;
}
.moves li {
  display: grid;
  grid-template-columns: 26px 1fr 1fr;
  gap: 8px;
  padding: 5px 4px;
  font-size: 12px;
  color: #c9d7d1;
  border-bottom: 1px dashed rgba(244, 237, 220, 0.06);
  animation: rowIn 0.3s var(--ease);
}
.moves li:last-child { border-bottom: 0; }
.moves .n { color: var(--muted); }
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}
.moves .cur { color: var(--gold); }
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.panel-actions .btn { padding: 10px 14px; font-size: 9px; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.fine {
  margin: 18px 0 0;
  font-size: 11px;
  color: #6f857d;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- pieces */
.piece-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.piece-card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(14, 80, 70, 0.22), transparent 55%),
    rgba(6, 17, 15, 0.55);
  padding: 26px;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.5s var(--ease), background 0.4s;
}
.piece-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), rgba(217, 180, 91, 0.12), transparent 65%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.piece-card:hover { border-color: rgba(217, 180, 91, 0.45); transform: translateY(-6px); }
.piece-card:hover::before { opacity: 1; }
.piece-stage {
  height: 170px;
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 10px;
}
.piece-stage::after {
  content: "";
  position: absolute;
  bottom: 11px;
  width: 90px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.65), transparent 70%);
  filter: blur(4px);
}
.piece-stage .pc {
  width: 120px;
  height: 120px;
  position: relative;
  z-index: 2;
  transition: transform 0.5s var(--ease);
  animation: idleFloat 6s ease-in-out infinite;
}
.piece-card:nth-child(2) .pc { animation-delay: 0.4s; }
.piece-card:nth-child(3) .pc { animation-delay: 0.8s; }
.piece-card:nth-child(4) .pc { animation-delay: 1.2s; }
.piece-card:nth-child(5) .pc { animation-delay: 1.6s; }
.piece-card:nth-child(6) .pc { animation-delay: 2s; }
.piece-card:hover .pc { transform: scale(1.12) rotate(-5deg); }
@keyframes idleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.piece-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
}
.piece-tag {
  margin: 2px 0 12px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.piece-card p.desc { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.65; }
.piece-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7f948c;
}
.piece-meta b { color: var(--ivory); font-weight: 500; }

/* ---------------------------------------------------------------- openings */
.opening-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.opening {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(8, 23, 20, 0.7), rgba(4, 12, 10, 0.85));
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.35s, transform 0.5s var(--ease);
}
.opening:hover { border-color: rgba(217, 180, 91, 0.4); transform: translateY(-5px); }
.mini {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}
.mini .m {
  position: relative;
  display: grid;
  place-items: center;
}
.mini .m.light { background: #e3d8bd; }
.mini .m.dark { background: #0c3b33; }
.mini .pc { width: 94%; height: 94%; }
.mini .pc { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.mini .m.mv { box-shadow: inset 0 0 0 2px var(--gold); }
.opening-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.opening-body .num {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.opening-body h3 {
  margin: 8px 0 2px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}
.opening-body .line {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--neon);
  margin: 0 0 10px;
}
.opening-body p.desc { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.tag {
  display: inline-block;
  margin-top: auto;
  padding: 5px 9px;
  align-self: flex-start;
  border: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------------------------------------------------------------- numbers */
.numbers {
  border-block: 1px solid var(--line);
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(183, 134, 11, 0.08), transparent 70%),
    rgba(5, 14, 12, 0.6);
  padding: 64px 0;
  position: relative;
  z-index: 2;
}
.number-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.number-grid b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
  background: linear-gradient(180deg, #fff6df, var(--gold) 60%, #8f6a14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.number-grid b sup { font-size: 0.4em; vertical-align: super; }
.number-grid span {
  display: block;
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- timeline */
.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-2) 12%, var(--teal-2) 70%, transparent);
  opacity: 0.6;
}
.t-item {
  position: relative;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 30px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
}
.t-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 36px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 180, 91, 0.06);
  transition: background 0.3s, box-shadow 0.3s;
}
.t-item:hover::before { background: var(--gold); box-shadow: 0 0 18px rgba(217, 180, 91, 0.7); }
.t-year {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--gold);
  padding-top: 5px;
}
.t-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}
.t-item p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }

/* ---------------------------------------------------------------- ask */
.ask { position: relative; overflow: hidden; }
.ask::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  right: -220px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 80, 70, 0.5), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.ask-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 60px;
  align-items: center;
}
.email-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line);
  background: rgba(6, 17, 15, 0.7);
  border-radius: 2px;
  max-width: 430px;
}
.email-box .email {
  flex: 1;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  padding: 9px 14px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.copy-btn:hover { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.ask-cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chips button {
  border: 1px solid var(--line-soft);
  background: rgba(6, 17, 15, 0.5);
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 11px;
  color: #b8c9c1;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}
.chips button:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }

.mail-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(9, 27, 23, 0.92), rgba(4, 12, 10, 0.96));
  box-shadow: 0 40px 90px -40px #000, 0 0 80px -30px rgba(92, 240, 192, 0.2);
  overflow: hidden;
  animation: cardFloat 8s ease-in-out infinite;
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-10px) rotate(0.4deg); }
}
.mail-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(3, 10, 9, 0.6);
}
.mail-head i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2c4a42;
}
.mail-head i:first-child { background: var(--gold-2); }
.mail-head span {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.mail-meta {
  padding: 16px 22px 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.mail-meta b { color: var(--gold); font-weight: 500; }
.mail-body {
  padding: 18px 22px 26px;
  min-height: 250px;
  font-size: 14px;
  line-height: 1.7;
  color: #cfded7;
}
.mail-body .q {
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  color: var(--ivory);
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
}
.mail-body .a { white-space: pre-wrap; }
.caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--neon);
  vertical-align: -2px;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.mail-foot {
  border-top: 1px solid var(--line-soft);
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6f857d;
}
.mail-foot em { color: var(--neon); font-style: normal; }

/* ---------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 46px 0 40px;
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer .brand-mark { width: 30px; height: 30px; }
.footer-note { font-size: 11px; color: #6f857d; letter-spacing: 0.08em; }
.footer-links { display: flex; gap: 22px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.footer-links a:hover { color: var(--gold); }

/* ---------------------------------------------------------------- fx */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(217, 180, 91, 0.65);
  border-radius: 50%;
  pointer-events: none;
  z-index: 90;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
  mix-blend-mode: screen;
}
.cursor.hot { width: 44px; height: 44px; background: rgba(217, 180, 91, 0.1); border-color: var(--gold); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  background: var(--gold);
  color: #120d04;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.win-banner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 10, 9, 0.72);
  backdrop-filter: blur(4px);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.win-banner.show { opacity: 1; pointer-events: auto; }
.win-inner { text-align: center; padding: 24px; }
.win-inner b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 54px);
  color: var(--gold);
  font-weight: 400;
}
.win-inner span { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.win-inner button { margin-top: 20px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1360px) {
  .title-line { font-size: clamp(60px, 10.6vw, 150px); }
  .hero-board { width: min(480px, 100%); }
  .hero-knight { width: 120px; height: 120px; }
}
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero { padding-top: 130px; }
  .hero-art { min-height: 480px; order: 2; margin-top: 10px; }
  .hero-title { font-size: clamp(64px, 16vw, 150px); }
  .arena { grid-template-columns: 1fr; }
  .arena-panel { position: static; }
  .ask-grid { grid-template-columns: 1fr; gap: 40px; }
  .piece-grid { grid-template-columns: repeat(2, 1fr); }
  .opening-grid { grid-template-columns: 1fr; }
  .number-grid { grid-template-columns: repeat(2, 1fr); gap: 34px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 36px); }
  .nav-links { display: none; }
  .nav .btn-small { display: none; }
  .hero { padding-top: 118px; }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .hero-art { min-height: 380px; }
  .hero-knight { width: 108px; height: 108px; right: -2%; }
  .chip { display: none; }
  .orbit-a { width: 380px; height: 380px; }
  .orbit-b { width: 480px; height: 480px; }
  .section { padding: 90px 0; }
  .section-head { margin-bottom: 36px; }
  .piece-grid { grid-template-columns: 1fr; }
  .piece-stage { height: 150px; }
  .t-item { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .t-year { padding-top: 0; }
  .number-grid b { font-size: 42px; }
  .mail-body { min-height: 220px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .cursor { display: none; }
}
@media (max-width: 420px) {
  .title-line { font-size: clamp(56px, 19vw, 96px); }
  .hero-art { min-height: 330px; }
  .arena-panel { padding: 20px; }
  .moves { max-height: 132px; }
  .email-box { flex-direction: column; align-items: stretch; padding: 10px; }
  .email-box .email { text-align: center; }
  .copy-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
