/* ===========================================================================
   AnimeFFA — 1/5 · Tokens, reset & base
   Design tokens, element resets, typography, rich-text from Tebex, utilities.
   Must load first: every other AnimeFFA stylesheet consumes these variables.
   =========================================================================== */

:root {
  /* Surfaces */
  --bg:            #080607;
  --bg-2:          #0d0809;
  --bg-3:          #13090b;
  --surface-1:     #151012;
  --surface-2:     #1b1013;
  --surface-3:     #241418;

  /* Brand */
  --crimson:       #b7192f;
  --crimson-2:     #d3253f;
  --accent:        #ef334f;
  --muted-red:     #6d1724;
  --gold:          #d9a441;

  /* Text */
  --text:          #f5eeee;
  --text-dim:      #a99498;
  --text-faint:    #73646a;

  /* Lines */
  --line:          rgba(245, 238, 238, .08);
  --line-strong:   rgba(245, 238, 238, .14);
  --line-red:      rgba(211, 37, 63, .38);

  /* Effects */
  --glow-red:      0 0 0 1px rgba(211, 37, 63, .45), 0 10px 34px -14px rgba(211, 37, 63, .55);
  --shadow-1:      0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 28px -18px rgba(0, 0, 0, .9);
  --shadow-2:      0 20px 44px -24px rgba(0, 0, 0, .95);

  /* Geometry — restrained, Minecraft-ish radii (3–10px) */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Rhythm */
  --shell:   1240px;
  --gutter:  clamp(1rem, 4vw, 2rem);
  --section: clamp(3.5rem, 7vw, 6rem);

  /* Type */
  --font-display: "Archivo Black", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.2, .7, .3, 1);

  /* Tebex's mandatory legal footer — restyled to match the theme, never hidden. */
  --tebex-legal-footer-background-color: #060405;
  --tebex-legal-footer-text-color: #8b7c80;
  --tebex-legal-footer-border-color: rgba(245, 238, 238, .08);
  --tebex-legal-footer-max-width: 1240px;
  --tebex-legal-footer-logo-color: #a99498;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

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

/* Faint seigaiha-inspired wave texture across the page. Pure CSS, no image. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 100%, transparent 9px, rgba(211, 37, 63, .05) 9.5px, transparent 10.5px),
    radial-gradient(circle at 50% 100%, transparent 15px, rgba(211, 37, 63, .035) 15.5px, transparent 16.5px);
  background-size: 44px 22px, 44px 22px;
  background-position: 0 0, 22px 11px;
}

.site { position: relative; z-index: 1; }

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; border: 0; }
svg { display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .18s var(--ease);
}

button { font: inherit; color: inherit; }

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-red), transparent);
  margin: 2rem 0;
}

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

::selection { background: var(--crimson); color: #fff; }

/* ---------------------------------------------------------- Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  margin: 0 0 .6em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; color: var(--text); }

/* -------------------------------------------------------------- Layout */
.shell {
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.section { padding-block: var(--section); position: relative; }

.section-dark {
  background: linear-gradient(180deg, rgba(19, 9, 11, .9), rgba(8, 6, 7, .9));
  border-block: 1px solid var(--line);
}

/* ------------------------------- Rich text authored inside the Tebex panel */
.rich-text { color: var(--text-dim); }
.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4 { color: var(--text); margin-top: 1.6em; }
.rich-text h1:first-child,
.rich-text h2:first-child,
.rich-text h3:first-child { margin-top: 0; }
.rich-text a { color: var(--crimson-2); text-decoration: underline; text-underline-offset: 3px; }
.rich-text a:hover { color: var(--accent); }
.rich-text ul,
.rich-text ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.rich-text li { margin-bottom: .35rem; }
.rich-text img { border-radius: var(--r-md); margin: 1rem 0; }
.rich-text table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.rich-text th,
.rich-text td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; }
.rich-text blockquote {
  margin: 1rem 0;
  padding: .6rem 1rem;
  border-left: 3px solid var(--crimson);
  background: rgba(211, 37, 63, .06);
  color: var(--text);
}
.rich-text code {
  background: var(--surface-2);
  padding: .1em .35em;
  border-radius: var(--r-xs);
  font-size: .9em;
}

/* ----------------------------------------------------------- Utilities */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: .7rem 1.1rem;
  background: var(--crimson);
  color: #fff;
  font-weight: 700;
  border-radius: var(--r-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Zero-impact marker the header's IntersectionObserver watches. */
#scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 64px;
  pointer-events: none;
}

.stack { display: grid; gap: 1rem; }
.center { text-align: center; }
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }
.mb-lg { margin-bottom: clamp(1.25rem, 3vw, 1.75rem); }

.note {
  margin: 0;
  padding: .75rem .9rem;
  border: 1px solid var(--line-red);
  border-radius: var(--r-sm);
  background: rgba(183, 25, 47, .08);
  font-size: .85rem;
  color: #f0c3ca;
}

/* Scroll reveal — inert until animeffa.js marks the document as JS-capable. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

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