/* Abyssal Escape — component layer.
   Colour/type tokens are declared twice on purpose:
   - in :root here, so plain CSS below can reference them without Tailwind running
   - in a <style type="text/tailwindcss"> @theme block in each page, so the Tailwind
     runtime can generate bg-void / text-bone / border-mist utilities.
   Keep the two lists in sync. */
:root {
  --color-void: #07060a;
  --color-void-2: #100d14;
  --color-void-3: #19141f;
  --color-bone: #ece7f1;
  --color-ash: #b7aec2;
  --color-mute: #8a8194;
  --color-mist: #e23b4a;
  --color-ring: #f6c445;
  --color-ok: #4fd18b;

  --font-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  --container-sm: 24rem;
  --radius-xl: 0.75rem;
  --blur-md: 12px;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-relaxed: 1.625;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --spacing: 0.25rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-void);
  color: var(--color-ash);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ---- layout ---- */
.wrap {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
.wrap-narrow {
  max-width: 46rem;
  /* Self-sufficient: pairs with .wrap but also centres when used alone. */
  margin-inline: auto;
}
@media (width >= 640px) {
  .wrap {
    padding-inline: 1.5rem;
  }
}

/* ---- surfaces ---- */
.panel {
  background: linear-gradient(#19141ff0, #100d14f5);
  border: 1px solid #e23b4a29;
  border-radius: 0.75rem;
  box-shadow: inset 0 1px #ffffff09, 0 12px 32px #0006;
}

.eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-mist);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---- buttons ---- */
.btn {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0.45rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
}
.btn-mist {
  color: #fff;
  background: linear-gradient(#f0505e, #b81f2e);
  box-shadow: inset 0 0 0 1px #ff8a94, 0 8px 26px #e23b4a59;
}
.btn-mist:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px #ffb0b6, 0 10px 32px #e23b4a80;
}
.btn-ghost {
  color: var(--color-bone);
  background: #07060a66;
  border: 1px solid #ece7f138;
}
.btn-ghost:hover {
  border-color: var(--color-ring);
  color: var(--color-ring);
}

/* ---- chips + tiers ---- */
.chip {
  color: var(--color-ash);
  background: #07060a8c;
  border: 1px solid #ece7f129;
  border-radius: 999px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  display: inline-flex;
}

.tier {
  width: 3rem;
  height: 3rem;
  font-family: var(--font-display);
  border-radius: 0.5rem;
  flex: none;
  place-items: center;
  font-size: 1.7rem;
  font-weight: 900;
  display: inline-grid;
}
.tier-S { color: #fff; background: linear-gradient(#ff6b78, #b81f2e); }
.tier-A { color: #2a1a00; background: linear-gradient(#ffd66e, #d39a12); }
.tier-B { color: #fff; background: linear-gradient(#a9a1ff, #5a4fd1); }
.tier-C { color: #fff; background: linear-gradient(#8f8899, #4b4552); }

/* ---- prose ---- */
.prose-ae { color: var(--color-ash); }
.prose-ae > * + * { margin-top: 1rem; }
.prose-ae h2 {
  color: var(--color-bone);
  margin-top: 2.75rem;
  scroll-margin-top: 5rem;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
}
.prose-ae h3 { color: var(--color-bone); margin-top: 1.75rem; font-size: 1.35rem; }
.prose-ae strong { color: var(--color-bone); }
.prose-ae a { color: var(--color-ring); text-underline-offset: 3px; }
.prose-ae a:hover { color: #ffe08f; }
.prose-ae ul { padding-left: 1.3rem; list-style: outside; }
.prose-ae ol { padding-left: 1.3rem; list-style: decimal; }
.prose-ae li + li { margin-top: 0.35rem; }
.prose-ae li::marker { color: var(--color-mist); }

/* ---- tables ---- */
.table-ae { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table-ae th {
  text-align: left;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-bone);
  white-space: nowrap;
  border-bottom: 1px solid #e23b4a59;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
}
.table-ae td {
  vertical-align: top;
  color: var(--color-ash);
  border-bottom: 1px solid #ece7f114;
  padding: 0.65rem 0.75rem;
}
.table-ae tr:hover td { background: #e23b4a0a; }
.table-scroll { -webkit-overflow-scrolling: touch; overflow-x: auto; }

/* ---- callouts ---- */
.note {
  border-left: 3px solid var(--color-ring);
  color: var(--color-ash);
  background: #f6c4450f;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.85rem 1rem;
}
.note-mist { border-left-color: var(--color-mist); background: #e23b4a12; }

/* ---- pips (difficulty meters) ---- */
.pips { gap: 3px; display: inline-flex; }
.pips i { background: #ece7f11f; border-radius: 2px; width: 0.6rem; height: 0.6rem; }
.pips i.on { background: var(--color-mist); }

/* ---- hero fx ---- */
.hero-fx { pointer-events: none; z-index: 0; position: absolute; inset: 0; overflow: hidden; }
.mist-blob {
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
  border-radius: 50%;
  position: absolute;
}
.mist-a {
  background: radial-gradient(closest-side, #e23b4a8c, #0000);
  width: 46rem; height: 30rem;
  animation: 22s ease-in-out infinite alternate mist-drift-a;
  top: -10rem; right: -12rem;
}
.mist-b {
  background: radial-gradient(closest-side, #7a1520b3, #0000);
  width: 34rem; height: 26rem;
  animation: 28s ease-in-out infinite alternate mist-drift-b;
  top: 12rem; left: -14rem;
}
.mist-c {
  background: radial-gradient(closest-side, #f6c44529, #0000);
  width: 24rem; height: 18rem;
  animation: 34s ease-in-out infinite alternate-reverse mist-drift-a;
  bottom: -8rem; right: 18%;
}
.ring-fx {
  opacity: 0.22; width: 30rem; height: 30rem;
  position: absolute; top: 50%; right: -6rem; transform: translateY(-50%);
}
@media (width >= 1024px) {
  .ring-fx { opacity: 0.18; right: 2%; }
}
.ring-fx .spin { transform-origin: 50%; animation: 40s linear infinite ring-spin; }
.ring-fx .pulse { transform-origin: 50%; animation: 4.5s ease-in-out infinite ring-pulse; }
.flicker { animation: 7s step-end infinite flicker; }
.hero-grain {
  background-image: radial-gradient(#ffffff09 1px, #0000 1px);
  background-size: 3px 3px;
  position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(#000, #0000 85%);
  mask-image: linear-gradient(#000, #0000 85%);
}

@keyframes mist-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4rem, 3rem, 0) scale(1.12); }
}
@keyframes mist-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(5rem, -3rem, 0) scale(0.95); }
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  42% { opacity: 1; }
  43% { opacity: 0.62; }
  44% { opacity: 1; }
  71% { opacity: 1; }
  72% { opacity: 0.78; }
  73% { opacity: 1; }
}

/* ---- hover lift ---- */
.lift { transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.lift:hover {
  border-color: #e23b4a80;
  transform: translateY(-3px);
  box-shadow: 0 16px 40px #00000073, 0 0 0 1px #e23b4a40, 0 0 28px #e23b4a2e;
}

/* ---- clock / escape timer ---- */
.clock { font-variant-numeric: tabular-nums; }
.clock-bar {
  background: #ece7f114;
  border-radius: 99px;
  height: 6px;
  position: relative;
  overflow: hidden;
}
.clock-bar > i {
  background: linear-gradient(90deg, var(--color-mist), #ff8a94);
  border-radius: 99px;
  position: absolute;
  inset: 0 auto 0 0;
}
.clock-mark { background: #ece7f166; width: 2px; height: 12px; position: absolute; top: -3px; }

/* ---- phase pills ---- */
.phase-pill { transition: background 0.3s, color 0.3s; }
.phase-pill[data-on="1"] { color: #fff; background: #b81f2e; border-color: #0000; }
.phase-pill[data-ring="1"] { background: var(--color-ring); color: #2a1a00; border-color: #0000; }

/* ---- video facade: thumbnail only until clicked, so no YouTube script at page load ---- */
.video-facade {
  display: block;
  position: relative;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid #e23b4a29;
  aspect-ratio: 16 / 9;
  /* Thumbnails are hotlinked from ytimg; this keeps the tile readable if one fails. */
  background: linear-gradient(135deg, #19141f, #100d14);
}
.video-facade img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.25s, filter 0.25s;
}
.video-facade:hover img {
  transform: scale(1.03);
  filter: brightness(0.8);
}
.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.video-play::before {
  content: "";
  width: 3.6rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  background: #b81f2e;
  box-shadow: 0 6px 22px #00000080, inset 0 0 0 1px #ff8a94;
  transition: background 0.15s, transform 0.15s;
}
.video-play::after {
  content: "";
  position: absolute;
  border-left: 0.7rem solid #fff;
  border-top: 0.44rem solid transparent;
  border-bottom: 0.44rem solid transparent;
  margin-left: 0.12rem;
}
.video-facade:hover .video-play::before {
  background: #e23b4a;
  transform: scale(1.06);
}
.video-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- reveal on scroll ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}
/* Keep content visible for users who never get a JS-driven .in */
html:not(.js-ready) [data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---- ad slot (Adsterra 468x60) ---- */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0.85rem;
}
.ad-slot-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-mute);
}
/* The band keeps its height before a creative arrives so a fill cannot push the hero down, but a
   caption over empty space reads as a broken page while the request is pending or blocked. */
.ad-slot:not(:has(iframe)) .ad-slot-label { visibility: hidden; }
.ad-slot-frame {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  overflow-x: auto;
}
.ad-slot-frame iframe {
  flex: none;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
