/* ==========================================================================
   KrakenTheMeta — design system ("The Descent")
   Tokens, base, and shared components. Every future page builds on this file;
   page-specific layout lives in its own stylesheet (see landing.css).
   ========================================================================== */

:root {
  /* Water, surface to hadal. The hero painting fades to #010408 at its base. */
  --abyss-0: #010307;
  --abyss-1: #030a12;
  --abyss-2: #061524;
  --abyss-3: #0a2034;
  --abyss-4: #0f2d48;
  --tide: #174463;

  /* Ink */
  --ink: #e8f2f9;
  --ink-2: #a9bccb;
  --ink-3: #71889b;
  --ink-4: #4b6275;

  /* Hairlines + glass */
  --line: rgba(150, 205, 240, 0.10);
  --line-2: rgba(150, 205, 240, 0.18);
  --line-3: rgba(150, 205, 240, 0.28);
  --glass: rgba(8, 26, 44, 0.58);
  --glass-hi: rgba(14, 40, 66, 0.72);

  /* Bioluminescence — sampled from the kraken's photophores (#41cad7) */
  --glow: #4fd9e4;
  --glow-hi: #9af4fb;
  --glow-rgb: 79, 217, 228;

  /* The lure — the only warm colour on the page, reserved for primary actions */
  --lure: #ffb547;
  --lure-hi: #ffd188;
  --lure-ink: #241500;
  --lure-rgb: 255, 181, 71;

  /* Kraken Pro */
  --gold: #f1c56c;

  /* Mana (UI tints; card symbols use the real SVGs) */
  --mana-w: #f5eecf;
  --mana-u: #8ac8f1;
  --mana-b: #b7a9c2;
  --mana-r: #f39378;
  --mana-g: #82d3a0;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Martian Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  /* Shape */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Space */
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(96px, 12vw, 168px);
  --max: 1200px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow-deep: 0 30px 80px -30px rgba(0, 0, 0, 0.75), 0 12px 30px -18px rgba(0, 0, 0, 0.6);
}

/* ---------- Base ---------- */

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--abyss-0);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--abyss-1);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

::selection { background: rgba(var(--glow-rgb), 0.28); color: #fff; }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
  border-radius: 6px;
}

.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 {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--lure); color: var(--lure-ink);
  font-weight: 700; text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}
.skip:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.display,
h1, h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.02;
  font-variation-settings: "SOFT" 30;
}

h2 { font-size: clamp(38px, 5.2vw, 66px); }

h2 em, .display em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100;
  background: linear-gradient(100deg, var(--ink) 0%, var(--glow-hi) 45%, var(--glow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em; /* italic overhang */
}

h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.005em; line-height: 1.3; }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-2); }

/* Depth tag — every section is stamped with where it sits in the dive */
.depth-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--glow);
}
.depth-tag::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow));
}

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ---------- Buttons ---------- */

.btn {
  --h: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  height: var(--h);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font: 650 15px/1 var(--font-ui);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 0.3s var(--ease-out); }
.btn:hover svg.arrow { transform: translateX(3px); }
.btn:active { transform: translateY(1px) scale(0.99); }

/* The lure: warm, lit from within — the one thing on the page that asks to be clicked */
.btn--lure {
  background: linear-gradient(180deg, #ffc868 0%, #ffab37 100%);
  color: var(--lure-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 210, 0.7),
    inset 0 0 0 1px rgba(255, 196, 100, 0.55),
    0 10px 30px -10px rgba(var(--lure-rgb), 0.6),
    0 0 50px -12px rgba(var(--lure-rgb), 0.45);
  animation: lure-breathe 4.8s ease-in-out infinite;
}
.btn--lure:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 210, 0.8),
    inset 0 0 0 1px rgba(255, 210, 130, 0.7),
    0 14px 36px -10px rgba(var(--lure-rgb), 0.75),
    0 0 70px -8px rgba(var(--lure-rgb), 0.6);
}
@keyframes lure-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.07); }
}

.btn--ghost {
  background: rgba(150, 205, 240, 0.06);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn--ghost:hover { background: rgba(150, 205, 240, 0.1); border-color: var(--line-3); }

.btn--gold {
  background: linear-gradient(180deg, #f7d58c, #e7b353);
  color: #251600;
  box-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.7), 0 10px 30px -12px rgba(241, 197, 108, 0.6);
}
.btn--gold:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.8), 0 14px 34px -10px rgba(241, 197, 108, 0.75); }

.btn--sm { --h: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn--lg { --h: 56px; padding: 0 26px; font-size: 16px; border-radius: 14px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 3px;
  transition: border-color 0.25s, color 0.25s;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-out); }
.link-arrow:hover { color: var(--glow-hi); border-color: rgba(var(--glow-rgb), 0.6); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Brand lockup (mark + wordmark) ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__mark {
  width: 30px; height: 30px;
  filter: drop-shadow(0 0 10px rgba(var(--glow-rgb), 0.35));
  transition: transform 0.6s var(--ease-spring), filter 0.4s;
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); filter: drop-shadow(0 0 14px rgba(var(--glow-rgb), 0.7)); }
.brand__word {
  font: 600 20px/1 var(--font-display);
  letter-spacing: -0.012em;
  font-variation-settings: "SOFT" 50;
}
.brand__word span { font-weight: 400; font-style: italic; color: var(--ink-2); font-variation-settings: "SOFT" 100; }

/* ---------- Mana pips (real symbol SVGs) ---------- */

.pips { display: inline-flex; align-items: center; gap: 3px; }
.pip {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.pip--lg { width: 20px; height: 20px; }

/* ---------- Icons ---------- */

.i {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Scroll reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
