/* ==========================================================================
   ThickEarth design tokens, reset, and base typography
   Dark analytical direction: ink/charcoal surfaces, warm paper text,
   amber/jade/violet/crimson seat accents.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --ink-0: #07090a;
  --ink-1: #0b0e10;
  --ink-2: #101416;
  --ink-3: #151a1d;
  --ink-4: #1b2125;
  --ink-5: #232a2f;
  --ink-6: #2c343a;

  /* Text */
  --paper: #ece7db;
  --text-strong: #f3efe5;
  --text: #dcd6c9;
  --text-muted: #aca597;
  --text-faint: #837d71;
  --text-ghost: #5f5a51;

  /* Lines */
  --line: rgba(236, 231, 219, 0.08);
  --line-strong: rgba(236, 231, 219, 0.14);
  --line-bright: rgba(236, 231, 219, 0.22);
  --line-amber: rgba(227, 160, 67, 0.34);

  /* Seat accents */
  --amber: #e3a043;
  --amber-bright: #f4bc6b;
  --amber-deep: #8a5a1d;
  --amber-soft: rgba(227, 160, 67, 0.13);
  --jade: #4cb894;
  --jade-bright: #7adbb9;
  --jade-deep: #1f6e59;
  --jade-soft: rgba(76, 184, 148, 0.13);
  --violet: #9d8cf0;
  --violet-bright: #c4b6ff;
  --violet-deep: #5b4aa8;
  --violet-soft: rgba(157, 140, 240, 0.13);
  --crimson: #e26474;
  --crimson-bright: #f58b99;
  --crimson-deep: #8e2f3f;
  --crimson-soft: rgba(226, 100, 116, 0.13);

  --accent: var(--amber);
  --accent-bright: var(--amber-bright);
  --accent-deep: var(--amber-deep);
  --accent-soft: var(--amber-soft);
  --ok: var(--jade);
  --warn: var(--amber);
  --danger: var(--crimson);

  /* Typography */
  --font-sans: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", Georgia, serif;

  /* Geometry */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 32px 90px -40px rgba(0, 0, 0, 0.85);
  --glow-amber: 0 0 0 1px rgba(227, 160, 67, 0.32), 0 12px 40px -18px rgba(227, 160, 67, 0.55);

  /* Layout */
  --header-h: 64px;
  --page-max: 1560px;
  --page-pad: 28px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 320ms;
}

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

html {
  height: 100%;
  background: var(--ink-0);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(227, 160, 67, 0.075), transparent 62%),
    radial-gradient(820px 480px at 4% 2%, rgba(76, 184, 148, 0.05), transparent 62%),
    radial-gradient(900px 520px at 60% 110%, rgba(157, 140, 240, 0.045), transparent 65%),
    linear-gradient(180deg, #0d1113 0%, #0a0d0e 52%, #07090a 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(236, 231, 219, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 231, 219, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 78%);
}

::selection {
  background: rgba(227, 160, 67, 0.28);
  color: var(--text-strong);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-strong);
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--amber-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font-family: inherit;
}

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

svg {
  display: block;
}

ul, ol {
  margin: 0;
  padding: 0;
}

strong {
  color: var(--text-strong);
  font-weight: 600;
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--ink-3);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(236, 231, 219, 0.16);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(236, 231, 219, 0.26);
  background-clip: padding-box;
  border: 2px solid transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* Utilities ---------------------------------------------------------------- */

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--amber);
  color: #1a1004;
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--text-muted);
}

.faint {
  color: var(--text-faint);
}

.nowrap {
  white-space: nowrap;
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.text-strong {
  color: var(--text-strong);
}

.text-danger {
  color: var(--crimson-bright);
}

.text-ok {
  color: var(--jade-bright);
}

.text-amber {
  color: var(--amber-bright);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flex-1 {
  flex: 1;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.noscript-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 300;
  padding: 16px 24px;
  background: var(--ink-3);
  border-top: 1px solid var(--line-bright);
  color: var(--text);
  text-align: center;
}

.boot-loading {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* Loading spinner ---------------------------------------------------------- */

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(236, 231, 219, 0.14);
  border-top-color: var(--amber);
  animation: te-spin 900ms linear infinite;
  flex: none;
}

.spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

@keyframes te-spin {
  to { transform: rotate(360deg); }
}

@keyframes te-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes te-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes te-shimmer {
  0% { background-position: -420px 0; }
  100% { background-position: 420px 0; }
}

@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;
  }
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

@media (max-width: 720px) {
  :root {
    --page-pad: 16px;
  }
}
