/* ============================================================
   Chess Notation Pad — site styles
   Depends on chess-pad-tokens.css (v3, locked). Every colour here
   comes from a semantic alias, never a numbered brand stop.
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background-color: var(--bg);

  /* Ruled-paper ground, straight off the icon's card. Very low
     contrast on purpose — texture, not pattern. */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 47px,
    var(--divider) 47px,
    var(--divider) 48px
  );
  background-position: 0 -1px;
}

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 40px;
}

.wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

/* ---------- Logo ---------- */

.logo {
  display: inline-block;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 10px 28px -12px rgba(20, 29, 15, 0.42);
  transition: transform 0.22s ease;
}
.logo img { border-radius: 26px; }
.logo:hover { transform: translateY(-3px); }

/* ---------- Type ---------- */

h1 {
  margin: 26px 0 0;
  font-size: clamp(2.05rem, 7.2vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.06;
  color: var(--ink-deep);
}

.tagline {
  margin: 16px 0 0;
  font-size: clamp(1.18rem, 4.1vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.014em;
  color: var(--action);
}

.lede {
  margin: 18px auto 0;
  max-width: 46ch;
  font-size: clamp(1rem, 2.6vw, 1.09rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---------- Scoresheet (signature element) ---------- */

.scoresheet {
  margin: 40px auto 0;
  max-width: 386px;
  padding: 18px 22px 16px;
  text-align: left;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 34px -20px rgba(20, 29, 15, 0.4);
  transform: rotate(-1.4deg);   /* echoes the tilted card in the icon */
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

.sheet-event {
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--text-secondary);
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.chip-win {
  color: var(--result-win);
  background-color: var(--result-win-bg);
}

.moves {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.97rem;
}
.moves li {
  display: grid;
  grid-template-columns: 2.3rem 1fr 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--divider);
}
.moves li:last-child { border-bottom: 0; }
.moves .no {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}
.moves .mv {
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-foot {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--divider);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.eco {
  display: inline-block;
  margin-right: 7px;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--fill-pale-ink);
  background-color: var(--fill-pale);
}

/* ---------- Store row ---------- */

.stores {
  margin: 34px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.stores img { height: 40px; width: auto; }

.soon {
  margin: 34px 0 0;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--accent-icon);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover {
  color: var(--action);
  border-color: var(--action);
}
.theme-toggle svg { width: 21px; height: 21px; }
.theme-toggle .ico-moon { fill: currentColor; }
.theme-toggle .ico-sun  { display: none; fill: currentColor; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.theme-toggle .ico-sun path { fill: none; }

[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
[data-theme="dark"] .theme-toggle .ico-sun  { display: block; }

/* ---------- Responsive ---------- */

@media (max-width: 420px) {
  .hero { padding: 44px 18px 32px; }
  .logo img { width: 94px; height: 94px; }
  .scoresheet { max-width: 100%; padding: 16px 18px 14px; }
  .moves li { grid-template-columns: 2rem 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .logo:hover { transform: none; }
}
