/* =========================================================
   OUIJA CTF — Reset, typography, layout primitives
   ========================================================= */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--brass-600) var(--void-800);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* The eternal darkness beneath every page: a cold void with a
   single warm pool of candlelight breathing at the horizon. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 108%, rgba(210, 87, 15, 0.14) 0%, transparent 58%),
    radial-gradient(90% 60% at 50% -12%, rgba(127, 212, 193, 0.07) 0%, transparent 60%),
    radial-gradient(60% 50% at 12% 20%, rgba(163, 35, 29, 0.07) 0%, transparent 70%),
    linear-gradient(180deg, var(--void-800) 0%, var(--void-900) 45%, #020103 100%);
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--brass-200);
}

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(217, 169, 74, 0.3);
  color: var(--parchment-100);
}

/* ---------------- Scrollbar ---------------- */
::-webkit-scrollbar {
  width: 11px;
}

::-webkit-scrollbar-track {
  background: var(--void-900);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brass-600), var(--wood-700));
  border-radius: var(--r-full);
  border: 2px solid var(--void-900);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--brass-400), var(--wood-600));
}

/* ---------------- Headings ---------------- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-bright);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}
h4 {
  font-size: var(--fs-md);
}

p {
  text-wrap: pretty;
}

/* ---------------- Layout primitives ---------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(var(--sp-4), 4vw, var(--sp-7));
}

.wrap--narrow {
  max-width: var(--wrap-narrow);
}

.stack > * + * {
  margin-top: var(--flow, var(--sp-4));
}

.section {
  position: relative;
  z-index: var(--z-content);
  padding-block: clamp(var(--sp-7), 9vh, var(--sp-9));
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
}

.center {
  text-align: center;
}

/* ---------------- Shared type treatments ---------------- */

/* Small caps label, like a stencil on the board's edge */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-type);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--brass-400);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: clamp(18px, 5vw, 44px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-600), transparent);
}

.lead {
  font-size: var(--fs-md);
  color: var(--text-dim);
  line-height: var(--lh-loose);
  max-width: 62ch;
}

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

.typewriter-note {
  font-family: var(--font-type);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  color: var(--parchment-500);
}

/* Gold foil gradient text */
.gilt {
  background: linear-gradient(
    172deg,
    var(--brass-200) 0%,
    var(--brass-400) 34%,
    var(--brass-600) 62%,
    var(--brass-300) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Text that looks lit from within by spirit-light */
.spectral-text {
  color: var(--spectre-300);
  text-shadow: 0 0 10px rgba(127, 212, 193, 0.55), 0 0 30px rgba(127, 212, 193, 0.28);
}

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

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brass-300);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-veil);
  padding: var(--sp-2) var(--sp-4);
  background: var(--void-600);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}

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