@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #070d0c;
  --bg-elevated: #0b1412;
  --surface: rgba(18, 28, 25, 0.62);
  --surface-strong: rgba(15, 24, 21, 0.88);
  --line: rgba(233, 226, 208, 0.14);
  --line-strong: rgba(233, 226, 208, 0.24);
  --line-soft: rgba(233, 226, 208, 0.075);
  --text: #f2eee3;
  --text-muted: #a3aea7;
  --text-dim: #7f8c85;
  --gold: #d8b979;
  --gold-bright: #f0d49a;
  --gold-soft: rgba(216, 185, 121, 0.12);
  --mint: #8fe3c0;
  --mint-soft: rgba(143, 227, 192, 0.12);
  --danger: #ff7b6e;
  --danger-soft: rgba(255, 123, 110, 0.12);

  --cell-hidden-top: #25332f;
  --cell-hidden-bottom: #111b18;
  --cell-revealed: #0a1210;
  --cell-gap: 4px;

  --num-1: #7dc4ff;
  --num-2: #8fe3c0;
  --num-3: #f2c66d;
  --num-4: #c3a6ff;
  --num-5: #ff9b8c;
  --num-6: #7adbd3;
  --num-7: #f2eee3;
  --num-8: #a7b1ab;

  --font-display: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-body: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', 'Cascadia Mono', monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 240ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --header-height: 72px;
  --shadow-panel: 0 32px 80px rgba(0, 0, 0, 0.48), 0 2px 0 rgba(255, 255, 255, 0.035) inset;
}

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

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: -18vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 16% 4%, rgba(67, 111, 91, 0.32), transparent 44%),
    radial-gradient(ellipse at 86% 10%, rgba(134, 104, 53, 0.18), transparent 38%),
    radial-gradient(ellipse at 62% 96%, rgba(25, 67, 56, 0.26), transparent 52%),
    linear-gradient(168deg, #08100e 0%, #070d0c 52%, #060b0a 100%);
  transform: translate3d(0, 0, 0);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

p,
h1,
h2,
h3,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(216, 185, 121, 0.32);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
