/* ============================================================================
   Gladius™ — Stylesheet
   ----------------------------------------------------------------------------
   Table of contents
     1. Design tokens (CSS custom properties)
     2. Reset & base
     3. Accessibility helpers (skip link, sr-only, focus, reduced motion)
     4. Layout primitives (container, section, grid)
     5. Typography helpers
     6. Buttons
     7. Header / navigation
     8. Hero
     9. Philosophy
    10. Services (cards)
    11. Legio network
    12. Assessment form
    13. Footer
    14. Reveal-on-scroll animations
    15. Responsive breakpoints
   ----------------------------------------------------------------------------
   Conventions:
     - BEM-style class names: block__element--modifier
     - All colours/spacing come from the tokens in section 1 so the theme can be
       retuned in one place.
     - Mobile-first: base rules target small screens; media queries enhance up.
   ========================================================================== */

/* 0. ------------------------------------------------------------ WEB FONTS */
/* Self-hosted brand fonts (no third-party requests).
   Display: PP Monument Extended (wide, technical).  Body: Zalando Sans.
   font-display:swap shows fallback text immediately, then swaps in. */
@font-face {
  font-family: "Monument Extended";
  src: url("../assets/fonts/MonumentExtended-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Monument Extended";
  src: url("../assets/fonts/MonumentExtended-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Monument Extended";
  src: url("../assets/fonts/MonumentExtended-Semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Monument Extended";
  src: url("../assets/fonts/MonumentExtended-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Monument Extended";
  src: url("../assets/fonts/MonumentExtended-Heavy.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("../assets/fonts/ZalandoSans-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("../assets/fonts/ZalandoSans-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("../assets/fonts/ZalandoSans-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("../assets/fonts/ZalandoSans-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* 1. ----------------------------------------------------------------- TOKENS */
:root {
  /* Tell the browser this is a dark UI so native controls (scrollbars,
     form widgets, autofill) render in their dark variants. */
  color-scheme: dark;

  /* Brand & surface palette (dark, security-focused) */
  --color-bg:            #141316; /* page background (brand near-black base) */
  --color-bg-alt:        #1C1B1D; /* alternating section background (brand)  */
  --color-surface:       #232226; /* cards / raised surfaces                */
  --color-surface-2:     #2B2A2F; /* hover / nested surfaces                 */
  --color-border:        #333136; /* hairline borders                       */
  --color-border-strong: #47444D;

  /* Text */
  --color-text:        #EDEDED; /* primary text (brand light)              */
  --color-text-muted:  #B8B8B8; /* secondary text (brand grey)             */
  --color-text-faint:  #8B8791; /* tertiary / captions (from brand #5F5C66, lifted for AA on dark) */

  /* Accent — brand red (from the Gladius logo), tuned for AA contrast on dark.
     To retheme the entire site, change these four values (and the matching
     ACCENT rgb constant in js/main.js used by the background mesh). */
  --color-accent:        #ED3348; /* brand red #CE1225, lifted just enough for AA on dark */
  --color-accent-strong: #F4576A; /* brighter — hovers / highlights         */
  --color-accent-deep:   #CE1225; /* the exact brand red — gradients / pressed */
  --color-accent-glow:   rgba(206, 18, 37, 0.4);
  --color-accent-rgb:    237, 51, 72; /* channels for inline rgba() usage    */

  /* Typography — brand fonts with system fallbacks */
  --font-sans:    "Zalando Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Monument Extended", "Zalando Sans", system-ui, sans-serif;

  /* Fluid type scale (clamp = min, preferred, max).
     Tuned for the wide Monument Extended display face so headings don't overflow. */
  --fs-eyebrow: 0.8125rem;
  --fs-body:    1.0625rem;
  --fs-lead:    clamp(1.1rem, 0.95rem + 0.7vw, 1.3rem);
  --fs-h3:      clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  --fs-h2:      clamp(1.5rem, 1.2rem + 1.5vw, 2.3rem);
  --fs-h1:      clamp(1.9rem, 1.3rem + 3vw, 3.4rem);

  /* Spacing & layout */
  --space-section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --container-max: 1180px;
  --container-pad: clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  --radius:    14px;
  --radius-sm: 10px;

  /* Effects */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --transition:  220ms cubic-bezier(0.4, 0, 0.2, 1);
  --header-h:    72px;
}

/* 2. ------------------------------------------------------------- RESET/BASE */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Offset in-page anchors so the sticky header never covers headings */
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-strong); }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* 3. ------------------------------------------------------ ACCESSIBILITY */
/* Visually hidden but available to screen readers */
.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;
}

/* Skip link appears on keyboard focus */
.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--transition);
}
.skip-link:focus { top: 0; outline: 2px solid #fff; }

/* Consistent, highly visible focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 4. ------------------------------------------------------- LAYOUT PRIMITIVES */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--space-section); position: relative; }
.section--alt { background: rgba(28, 27, 29, 0.66); }

.section__head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section__title { font-size: var(--fs-h2); position: relative; }
/* Accent underline that draws in when the title is revealed on scroll */
.section__title.reveal::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.55em;
  height: 3px;
  width: 64px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
.section__title.reveal.is-visible::after { transform: scaleX(1); }

/* 5. ------------------------------------------------------ TYPOGRAPHY HELPERS */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}
.eyebrow__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-glow);
}
/* Short accent rule used to flank section eyebrows (the "— LABEL —" look). */
.eyebrow__line {
  width: 30px; height: 1px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
}
.text-accent { color: var(--color-accent); }
/* Gradient text for key phrases. Has a solid fallback colour for browsers
   that don't support background-clip:text. */
.text-gradient {
  color: var(--color-accent);
  background: linear-gradient(120deg,
    var(--color-accent-strong), var(--color-accent-deep), var(--color-accent-strong));
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Slow shimmer sweeping across the phrase */
  animation: gradient-shift 7s ease-in-out infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* 6. ----------------------------------------------------------------- BUTTONS */
.btn {
  --btn-pad-y: 0.8rem;
  --btn-pad-x: 1.5rem;
  position: relative;
  overflow: hidden; /* clips the shine sweep */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
              background-color var(--transition), border-color var(--transition);
  will-change: transform;
}
/* Diagonal light sweep on hover (primary + ghost) */
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn:hover::after { left: 150%; }
.btn > * { position: relative; z-index: 1; }
.btn--sm { --btn-pad-y: 0.55rem; --btn-pad-x: 1rem; font-size: 0.9rem; }
.btn--lg { --btn-pad-y: 1rem; --btn-pad-x: 2rem; font-size: 1.05rem; }

.btn--primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-deep));
  color: #ffffff;
  box-shadow: 0 8px 24px -8px var(--color-accent-glow);
}
.btn--primary:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -6px var(--color-accent-glow);
}
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn--ghost:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
  background: rgba(237, 51, 72, 0.06);
  transform: translateY(-2px);
}

/* Gentle glow pulse on the header call-to-action to draw the eye */
.site-header .btn--primary { animation: cta-pulse 2.8s ease-in-out infinite; }
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 8px 24px -8px var(--color-accent-glow); }
  50%      { box-shadow: 0 10px 30px -4px rgba(var(--color-accent-rgb), 0.6); }
}

/* Reading-progress bar — sits above the sticky header */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--color-accent-deep), var(--color-accent), var(--color-accent-strong));
  z-index: 200;
  pointer-events: none;
  will-change: transform;
}

/* 7. ------------------------------------------------------- HEADER / NAV */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(20, 19, 22, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
/* JS toggles data-elevated once the user scrolls */
.site-header[data-elevated="true"] {
  background: rgba(20, 19, 22, 0.92);
  border-bottom-color: var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--color-text); }
.brand__mark { color: var(--color-text); } /* platinum body; red accent baked into SVG */
/* Real brand lockup image (header). Sized by height; width stays proportional. */
.brand__logo { height: 30px; width: auto; display: block; }
.brand__tm { font-size: 0.6em; vertical-align: super; color: var(--color-text-muted); }

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.primary-nav a:not(.btn) {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-block: 0.25rem;
  white-space: nowrap; /* nav labels never wrap into two lines */
  transition: color var(--transition);
}
/* Mid-width viewports: keep the nav on one line — tighten gaps. */
@media (min-width: 760px) and (max-width: 1099px) {
  .primary-nav__list { gap: clamp(0.7rem, 1.4vw, 1.5rem); }
}
.primary-nav a:not(.btn):hover { color: var(--color-text); }
/* Animated underline */
.primary-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.primary-nav a:not(.btn):hover::after { transform: scaleX(1); }
/* Scroll-spy: JS marks the link for the section currently in view */
.primary-nav a:not(.btn).is-active { color: var(--color-text); }
.primary-nav a:not(.btn).is-active::after { transform: scaleX(1); }

/* Language switcher — a single toggle button (current flag + code) opens a
   dropdown menu of the other languages. Lives in the header nav (and
   floating top-right on the login page). */
.lang-switch {
  position: relative;
  display: inline-flex;
}
.lang-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.6rem;
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  cursor: pointer;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: border-color var(--transition), color var(--transition),
              background-color var(--transition);
}
.lang-switch__toggle:hover { color: var(--color-text); border-color: var(--color-accent); }
.lang-switch__toggle[aria-expanded="true"] {
  color: var(--color-text);
  border-color: var(--color-accent);
  background: rgba(var(--color-accent-rgb), 0.1);
}
.lang-switch__chevron {
  width: 9px; height: 9px;
  color: var(--color-text-faint);
  transition: transform var(--transition);
}
.lang-switch__toggle[aria-expanded="true"] .lang-switch__chevron { transform: rotate(180deg); color: var(--color-accent); }
.lang-switch__flag { width: 18px; height: 12px; border-radius: 2px; display: block; flex-shrink: 0; }

/* Dropdown panel */
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 150px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 0.4rem;
  z-index: 60;
  display: grid;
  gap: 0.15rem;
  /* Entrance transition; JS toggles [hidden] so this never traps focus or
     intercepts clicks while closed. */
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top right;
}
.lang-switch__menu:not([hidden]) { opacity: 1; transform: none; }
.lang-switch__menu[hidden] { display: grid; pointer-events: none; } /* keep the transition, just non-interactive */
.lang-switch__btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  transition: background-color var(--transition), color var(--transition);
}
.lang-switch__btn:hover,
.lang-switch__btn:focus-visible { background: var(--color-surface-2); color: var(--color-text); }
li[aria-selected="true"] > .lang-switch__btn { color: var(--color-accent); font-weight: 600; }

/* Login page: float the switcher in the top-right of the form panel */
.lang-switch--floating {
  position: absolute;
  top: clamp(1rem, 2.5vw, 1.5rem);
  right: clamp(1rem, 2.5vw, 1.5rem);
  z-index: 5;
}

/* Mobile toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 20px; height: 2px;
  background: var(--color-text);
  transform: translateX(-50%);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle__bar { top: 50%; transform: translate(-50%, -50%); }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after  { top: 7px; }
/* Animate into an X when open */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateX(-50%) translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateX(-50%) translateY(-7px) rotate(-45deg); }

/* 8. ----------------------------------------------------------------- HERO */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  padding-block: clamp(5rem, 12vh, 9rem);
  overflow: hidden;
  background:
    radial-gradient(1100px 540px at 75% -10%, rgba(14, 165, 233, 0.16), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(34, 211, 238, 0.08), transparent 55%),
    transparent; /* transparent so the global background mesh shows through */
}
/* Veil keeps text readable over the animated mesh */
.hero__veil {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,14,20,0.25) 0%, rgba(10,14,20,0.55) 70%, var(--color-bg) 100%);
}
.hero__inner { position: relative; z-index: 2; max-width: 900px; }

/* Rotating-verb line: "We [find/verify/fix/protect] what others miss" */
.hero__rotator {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-text);
  font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.5rem);
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}
/* Force "We [verb]" onto its own line, "what others miss" onto the next —
   a fixed 2-line layout so the tail text never reflows/shifts line as the
   verb's width changes (short "fix" vs long "protect"). */
.hero__rotator-line { display: block; }
/* All verbs stack in one grid cell. JS sets the slot width to the CURRENT
   word (not the widest) so short verbs like "fix" never leave a wide gap;
   the width change itself animates. Without JS it falls back to auto width. */
.hero__rotator-words {
  display: inline-grid;
  justify-items: center;   /* keep each word at its natural width */
  text-align: center;
  vertical-align: baseline;
  margin: 0 0.15em;
  /* No overflow clipping: the JS sequences the swap (word out → resize →
     word in), so nothing ever renders in a wrong-sized slot, and glyph ink
     that naturally extends past the advance width (the "x" in fix) is never
     shaved off. */
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__rotator-words > span {
  grid-area: 1 / 1;
  white-space: nowrap;
  min-width: 0; /* let the grid column shrink below the widest word — without
                   this the column stays at max min-content (the widest verb)
                   and every word centres in that phantom width, overlapping
                   the sentence when JS narrows the slot */
  color: var(--color-accent);
  font-weight: 700;
  opacity: 0;
  transform: translateY(0.45em);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__rotator-words > span.is-current { opacity: 1; transform: none; }
/* Verbs leaving slide upward — FAST (0.22s), so the exit completes before the
   slot starts resizing (JS waits 260ms). A slow exit here would leave a
   half-visible word riding the shrinking slot into the neighbouring text. */
.hero__rotator-words > span.is-leaving {
  opacity: 0;
  transform: translateY(-0.45em);
  transition-duration: 0.22s, 0.22s;
}
/* Sequential "scan" that lights each verb in turn, reinforcing
   find → verify → fix → protect. Disabled under reduced motion (section 16). */
.hero__sequence > span:not(.hero__sequence-tail) {
  animation: seq-scan 6s ease-in-out infinite;
}
.hero__sequence > span:nth-child(1) { animation-delay: 0s; }
.hero__sequence > span:nth-child(2) { animation-delay: 0.5s; }
.hero__sequence > span:nth-child(3) { animation-delay: 1s; }
.hero__sequence > span:nth-child(4) { animation-delay: 1.5s; }
.hero__sequence > span:not(.hero__sequence-tail)::before {
  /* arrow lights with the word */
  animation: seq-scan-arrow 6s ease-in-out infinite;
  animation-delay: inherit;
}
@keyframes seq-scan {
  0%, 28%, 100% { color: var(--color-text-muted); }
  9%, 16%       { color: var(--color-accent); }
}
@keyframes seq-scan-arrow {
  0%, 28%, 100% { border-color: var(--color-accent); opacity: 0.6; }
  9%, 16%       { border-color: var(--color-accent-strong); opacity: 1; }
}

.hero__title {
  font-size: var(--fs-h1);
  margin: 0 0 2rem;
  max-width: 16ch;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Scroll cue */
.hero__scroll {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px; height: 42px;
  border: 2px solid var(--color-border-strong);
  border-radius: 14px;
  display: flex; justify-content: center;
}
.hero__scroll-line {
  width: 3px; height: 8px;
  margin-top: 7px;
  background: var(--color-accent);
  border-radius: 2px;
  animation: scroll-bob 1.8s ease-in-out infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(10px); opacity: 0.3; }
}

/* 9. ---------------------------------------------------------- THE REALITY */
/* Translucent so the animated background mesh subtly shows through.
   Alpha kept high enough to preserve text contrast (WCAG AA). */
.reality { background: rgba(28, 27, 29, 0.66); }
.reality__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.reality__statement {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin: 0.25rem 0 1.75rem;
}
.reality__body {
  font-size: var(--fs-lead);
  color: var(--color-text);
  max-width: 56ch;
  margin-bottom: 1.5rem;
}
.reality__mesh {
  color: var(--color-text-muted);
  max-width: 52ch;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-accent);
}

/* The Reality visual: glowing logo mark over the particle field. All rings
   and orbit circles were removed at client request — the mesh IS the visual. */
.reality__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
}
/* Glowing logo mark at the centre, gently floating */
.reality__logo {
  position: relative;
  z-index: 1;
  width: 130px;
  height: auto;
  filter: drop-shadow(0 0 26px rgba(var(--color-accent-rgb), 0.55));
  animation: float 5s ease-in-out infinite, logo-glow 3.2s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
/* Pulsing drop-shadow makes the mark feel lit */
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(var(--color-accent-rgb), 0.4)); }
  50%      { filter: drop-shadow(0 0 34px rgba(var(--color-accent-rgb), 0.75)); }
}
/* Soft radial halo behind the mark */
.reality__halo {
  position: absolute;
  width: 230px; height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--color-accent-rgb), 0.28), transparent 65%);
  animation: halo-pulse 3.2s ease-in-out infinite;
}
@keyframes halo-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50%      { opacity: 0.9; transform: scale(1.06); }
}

/* 9b. ------------------------------------------------- GLADIUS MATRIX */
/* Hover/focus/tap on the glowing mark "breaks it apart" into the Matrix: a
   rotating particle-mesh sphere (drawn on the canvas by initMatrixParticles)
   whose four labelled nodes carry the service-depth layers (G1 Entry,
   G2 Access, G3 Control, G4 Respond — from the corporate deck). Reduced
   motion → static pinned chips instead (see below). */
.matrix {
  cursor: pointer;
  min-height: clamp(300px, 88vw, 460px);
  container-type: inline-size;
}
.matrix .reality__logo { transition: opacity 0.45s ease, scale 0.55s cubic-bezier(0.22, 1, 0.36, 1); }

/* Ambient particle field: idle dots that flow together into the planet +
   orbit system on hover (see initMatrixParticles in js/main.js). Sits
   behind everything else in the visual — plain paint order, first child,
   no z-index needed. Hidden entirely under reduced-motion (JS also skips
   drawing, but this keeps a blank canvas element from taking up a paint
   layer for nothing). */
.matrix__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .matrix__particles { display: none; }
}

.matrix__system {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.5s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none; /* purely visual; interaction stays on .matrix */
}

/* Exploded state: the core mark condenses and the mesh sphere takes over */
.matrix:hover .matrix__system,
.matrix:focus-visible .matrix__system,
.matrix.is-exploded .matrix__system { opacity: 1; transform: none; }
.matrix:hover .reality__logo,
.matrix:focus-visible .reality__logo,
.matrix.is-exploded .reality__logo { scale: 0.7; }

/* The pinned compass-point chips are no longer displayed — the G1-G4 layer
   names and their sub-descriptions now ride the rotating sphere nodes on the
   canvas instead. The elements STAY in the markup as the (translated) text
   source the canvas reads its labels from; they're inside an aria-hidden
   container, so hiding them changes nothing for assistive tech (the wrapper's
   aria-label carries the full text). */
.matrix__chip { display: none; }

/* EXCEPT under reduced motion: the particle canvas is disabled there, so the
   static chips come back as the visible G1-G4 layer breakdown. */
@media (prefers-reduced-motion: reduce) {
  .matrix__chip {
    position: absolute;
    display: grid;
    justify-items: center;
    text-align: center;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    background: rgba(35, 34, 38, 0.94);
    border: 1px solid rgba(var(--color-accent-rgb), 0.45);
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text);
  }
  .matrix__chip b { color: var(--color-accent); font-weight: 700; margin-right: 0.4em; }
  .matrix__chip i {
    display: block;
    font-style: normal;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: none;
    color: var(--color-text-muted);
    margin-top: 2px;
  }
  .matrix__chip--top    { top: 2%;    left: 50%; transform: translateX(-50%); }
  .matrix__chip--right  { top: 17%;   right: 0; }
  .matrix__chip--bottom { bottom: 2%; left: 50%; transform: translateX(-50%); }
  .matrix__chip--left   { bottom: 17%; left: 0; }
  .matrix { min-height: 560px; }
}

.matrix__title {
  position: absolute;
  top: calc(50% + 90px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.15rem 0.7rem;
  background: rgba(20, 19, 22, 0.72);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* 10. --------------------------------------------------------- SERVICES/CARDS */
/* 4 pillars: 1 column on mobile, 2×2 on tablet, 4 across on desktop.
   Explicit breakpoints avoid an unbalanced 3+1 row. */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  /* Without this, CSS Grid stretches every card in a row to match the
     tallest sibling — so hovering ONE card (making its description pop
     down) silently grows its unhovered row-mates too, even though their
     own text stays hidden. align-items:start lets each card size to its
     own content, independent of its neighbours. */
  align-items: start;
}
.card {
  /* Tilt vars set by JS on pointer move; lift on hover. */
  --rx: 0deg; --ry: 0deg; --lift: 0px;
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transform-style: preserve-3d;
  transition: transform 120ms ease, border-color var(--transition),
              box-shadow var(--transition), background-color var(--transition);
}
/* Accent sheen that sweeps in on hover */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 200px at var(--mx, 50%) -10%, rgba(237, 51, 72,0.12), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.card:hover {
  --lift: -6px;
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-card);
}
.card:hover::before { opacity: 1; }
/* Icon badge at the top of each service card */
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(237, 51, 72, 0.1);
  border: 1px solid rgba(237, 51, 72, 0.22);
  color: var(--color-accent);
  margin-bottom: 1.25rem;
  transition: background-color var(--transition), transform var(--transition);
}
.card__icon svg { width: 24px; height: 24px; }
.card:hover .card__icon { background: rgba(237, 51, 72, 0.18); transform: translateY(-2px); }
/* Faint oversized index watermark in the corner */
.card__index {
  position: absolute;
  top: 1rem; right: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.5;
  letter-spacing: 0.1em;
}
.card__title { font-size: var(--fs-h3); margin: 0 0 0.75rem; }
.card__text { color: var(--color-text-muted); }

/* Hover-reveal descriptions (What We Do): headers stay, the description pops
   down on hover / keyboard focus / tap. Collapse is gated behind the
   .cards-interactive class that JS adds, so without JS every description is
   simply visible. Screen readers always get the text (it's clipped, not
   display:none). */
.cards-interactive .card__text {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.cards-interactive .card:hover .card__text,
.cards-interactive .card:focus-within .card__text,
.cards-interactive .card.is-open .card__text {
  max-height: 14em;
  opacity: 1;
  transform: none;
}
/* A small accent caret hints that the card expands */
.cards-interactive .card__title::after {
  content: "";
  display: inline-block;
  margin-left: 0.5em;
  width: 7px; height: 7px;
  border-right: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity var(--transition);
}
.cards-interactive .card:hover .card__title::after,
.cards-interactive .card:focus-within .card__title::after,
.cards-interactive .card.is-open .card__title::after {
  transform: rotate(225deg) translateY(2px);
  opacity: 1;
}

/* CTA centred beneath the service cards */
.whatwedo__cta { margin-top: clamp(2rem, 4vw, 3rem); text-align: center; }

/* 11. ------------------------------------------------ OPERATING PHILOSOPHY */
/* The signature RED band — "think like the threat". A deep oxblood gradient
   with a red glow, framed by accent hairlines. Internal text is warmed up so
   it stays high-contrast on the red field. */
.philosophy {
  position: relative;
  background:
    radial-gradient(900px 520px at 82% -10%, rgba(var(--color-accent-rgb), 0.28), transparent 60%),
    linear-gradient(165deg, rgba(158, 14, 28, 0.62) 0%, rgba(40, 10, 14, 0.86) 55%, rgba(20, 19, 22, 0.92) 100%);
  border-block: 1px solid rgba(var(--color-accent-rgb), 0.28);
  overflow: hidden;
}
/* Animated sheen drifting across the red band */
.philosophy::before {
  content: "";
  position: absolute;
  inset: -20% -12%;
  background: radial-gradient(560px 280px at 30% 0%, rgba(255, 120, 130, 0.14), transparent 62%);
  animation: philo-sheen 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes philo-sheen {
  0%, 100% { transform: translateX(-12%); opacity: 0.65; }
  50%      { transform: translateX(12%);  opacity: 1; }
}
.philosophy > .container { position: relative; z-index: 1; }
/* Decorative Legio operator figure: a darkened, red-lit presence on the right
   that fades into the section and drifts. Sits behind the content. */
.philosophy__operator {
  position: absolute;
  right: clamp(-30px, 0vw, 40px);
  bottom: 0;
  height: 94%;
  width: auto;
  max-width: 48%;
  object-fit: contain;
  object-position: bottom right;
  opacity: 0.62;
  /* Radial mask vignettes the figure so its edges dissolve into the section. */
  -webkit-mask-image: radial-gradient(64% 80% at 68% 56%, #000 38%, transparent 84%);
          mask-image: radial-gradient(64% 80% at 68% 56%, #000 38%, transparent 84%);
  pointer-events: none;
  z-index: 0;
  animation: operator-float 7s ease-in-out infinite;
}
@keyframes operator-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-14px) scale(1.02); }
}
@media (max-width: 720px) { .philosophy__operator { opacity: 0.22; max-width: 70%; } }
.philosophy__head { max-width: 760px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.philosophy__head .section__title { margin-bottom: 1.5rem; max-width: 24ch; }
.philosophy__body { font-size: var(--fs-lead); color: #f0dadd; max-width: 64ch; }
.philosophy .eyebrow { color: #ffc9cf; }
/* Operator cards tuned to sit on the red field */
.philosophy .operator {
  background: rgba(18, 11, 14, 0.74);
  border-color: rgba(var(--color-accent-rgb), 0.22);
}
.philosophy .operator:hover { background: rgba(26, 14, 18, 0.85); }

/* "Elite Operators · Invite-Only" badge */
.operators__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(237, 51, 72, 0.08);
  border: 1px solid rgba(237, 51, 72, 0.22);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  margin-bottom: 1.75rem;
}
.operators__badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--color-accent-glow); }
  50%      { box-shadow: 0 0 0 7px rgba(var(--color-accent-rgb), 0); }
}

.operators__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.operator {
  --rx: 0deg; --ry: 0deg; --lift: 0px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transform-style: preserve-3d;
  transition: transform 120ms ease, border-color var(--transition),
              background-color var(--transition), box-shadow var(--transition);
}
.operator:hover {
  --lift: -6px;
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-card);
}
.operator__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(237, 51, 72, 0.1);
  border: 1px solid rgba(237, 51, 72, 0.22);
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}
.operator__icon svg { width: 26px; height: 26px; }
.operator__title { font-size: var(--fs-h3); margin: 0 0 0.6rem; }
.operator__text { color: var(--color-text-muted); }

/* 12. -------------------------------------------------------- ASSESSMENT FORM */
.assessment__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
}
.assessment__lead { color: var(--color-text-muted); font-size: var(--fs-lead); margin: 1.25rem 0; max-width: 46ch; }
.assessment__contact { color: var(--color-text-muted); }

.assessment__form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.field { display: block; margin-bottom: 1.25rem; }
.field__label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text); }
.field__req { color: var(--color-text-faint); font-weight: 400; font-size: 0.82em; }
.field__input {
  width: 100%;
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field__input::placeholder { color: var(--color-text-faint); }
.field__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}
.field__input--area { resize: vertical; min-height: 120px; }
/* Invalid state set by JS via [aria-invalid] */
.field__input[aria-invalid="true"] {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}
.field__error {
  display: block;
  min-height: 1.1em;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #fca5a5;
}

/* GDPR consent checkboxes — custom box for a consistent dark-theme look.
   The real <input> is visually hidden but kept fully operable/focusable. */
.consent {
  border: 0;
  margin: 0 0 0.5rem;
  padding: 1.25rem 0 0;
  display: grid;
  gap: 0.9rem;
}
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
/* Hide native control without removing it from the accessibility tree */
.check__input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.check__box {
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background: var(--color-bg);
  position: relative;
  transition: border-color var(--transition), background-color var(--transition);
}
.check__box::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition);
}
.check__input:checked + .check__box {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.check__input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
/* Keyboard focus ring on the custom box */
.check__input:focus-visible + .check__box {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
}
/* Invalid state (set by JS) */
.check__input[aria-invalid="true"] + .check__box { border-color: #f87171; }
.check__label a { text-decoration: underline; }

/* Honeypot — hidden from humans, off-screen (not display:none so bots fill it) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.assessment__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.form-status { font-size: 0.95rem; font-weight: 500; }
.form-status[data-state="success"] { color: #4ade80; }
.form-status[data-state="error"]   { color: #fca5a5; }
.assessment__privacy { margin-top: 1.25rem; font-size: 0.85rem; color: var(--color-text-faint); }

/* 13. -------------------------------------------------------------- FOOTER */
.site-footer { background: rgba(28, 27, 29, 0.72); border-top: 1px solid var(--color-border); }
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.site-footer__brand .brand__logo { height: 26px; }
.site-footer__tagline { color: var(--color-text-muted); margin-top: 1rem; max-width: 36ch; }
.site-footer__nav ul { display: grid; gap: 0.7rem; }
.site-footer__nav a { color: var(--color-text-muted); transition: color var(--transition); }
.site-footer__nav a:hover { color: var(--color-accent); }
.site-footer__label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-faint); margin-bottom: 0.5rem; }
.site-footer__bar {
  border-top: 1px solid var(--color-border);
  padding-block: 1.5rem;
  color: var(--color-text-faint);
  font-size: 0.875rem;
}

/* 14. ------------------------------------------------------ REVEAL ANIMATIONS */
/* Elements tagged [data-reveal] start hidden and animate in when JS adds
   .is-visible (via IntersectionObserver). Staggered with --reveal-delay. */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* 15. ---------------------------------------------------------- RESPONSIVE */
/* Tablet and up: two-column form rows + richer layouts */
@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1080px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 880px) {
  /* The Reality: text left, decorative graphic right */
  .reality__inner { grid-template-columns: 1.4fr 0.9fr; }
  .assessment__inner { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  .site-footer__inner { grid-template-columns: 2fr 1fr 1fr; }
}

/* Below 760px: collapse nav into a slide-down panel */
@media (max-width: 759px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 19, 22, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    /* Collapsed by default; JS sets [data-open] */
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition);
  }
  .primary-nav__list {
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
  }
  .primary-nav[data-open="true"] { grid-template-rows: 1fr; }
  .primary-nav__list > li { border-top: 1px solid var(--color-border); }
  .primary-nav__list > li:first-child { border-top: 0; }
  .primary-nav a:not(.btn) { display: block; padding: 1rem var(--container-pad); }
  .primary-nav a:not(.btn)::after { display: none; }
  .primary-nav .btn { margin: 1rem var(--container-pad); }
  .primary-nav .lang-switch { display: flex; padding: 1rem var(--container-pad); }
}

/* 15b. -------------------------------------------------------- LEGAL PAGES */
/* Readable long-form prose used by privacy-policy.html & cookie-policy.html */
.legal { padding-block: calc(var(--header-h) + 2rem) var(--space-section); }
.legal__inner { max-width: 760px; }
.legal h1 { font-size: var(--fs-h2); margin-bottom: 0.5rem; }
.legal__updated { color: var(--color-text-faint); font-size: 0.9rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: var(--fs-h3); margin: 2.5rem 0 0.75rem; }
.legal p, .legal li { color: var(--color-text-muted); }
.legal p { margin-bottom: 1rem; }
.legal ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1rem; display: grid; gap: 0.4rem; }
.legal a { text-decoration: underline; }
.legal__back { display: inline-block; margin-top: 2.5rem; }

/* 15c. ------------------------------------------------ ANIMATED BACKGROUND */
/* Fixed, full-viewport decorative layers behind all content.
   z-index:-1 keeps them above the page background colour but below every
   in-flow element, so no content stacking changes are needed. */
.bg-mesh,
.bg-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none; /* never intercept clicks/scroll */
}
/* The canvas node-mesh; opacity tuned so it reads as texture, not noise. */
.bg-mesh { opacity: 0.6; }

/* Soft glow that trails the cursor. Positioned via JS (transform: translate),
   with a short transition for a smooth, slightly-lagging follow. */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 460px; height: 460px;
  margin: -230px 0 0 -230px;        /* centre the glow on the cursor origin */
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--color-accent-rgb), 0.12), transparent 62%);
  pointer-events: none;
  z-index: -1;                       /* same layer as the background        */
  opacity: 0;
  transition: opacity 400ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
.cursor-glow.is-active { opacity: 1; }

/* Pure-CSS technical grid. Masked with a radial gradient so it is strongest
   toward the top and dissolves at the edges — a subtle "HUD" feel. */
.bg-grid {
  background-image:
    linear-gradient(rgba(237, 51, 72, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 51, 72, 0.06) 1px, transparent 1px);
  background-size: 58px 58px;
  will-change: transform; /* JS applies a subtle scroll parallax */
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 70%);
  /* Slow continuous drift gives the grid a subtle sense of life. */
  animation: grid-drift 45s linear infinite;
}
@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 58px 58px; }
}

/* 15d. ------------------------------------------------------- INTRO LOADER */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--color-bg);
  /* Fades out when <html class="is-loaded"> is set by JS. */
  transition: opacity 600ms ease, visibility 600ms ease;
}
.preloader__inner { display: grid; justify-items: center; gap: 1.1rem; }
/* Platinum logo body (currentColor); the red accent is baked into the SVG. */
.preloader__mark {
  color: var(--color-text);
  animation: mark-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both,
             glow 1.8s ease-in-out 0.6s infinite;
}
@keyframes mark-in {
  from { opacity: 0; transform: scale(0.82) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes glow {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.preloader__word {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* compensate for trailing letter-spacing */
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* Indeterminate scan bar */
.preloader__bar {
  width: 160px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-border-strong);
  overflow: hidden;
}
.preloader__bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  animation: scan 1.1s ease-in-out infinite;
}
@keyframes scan {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* Loaded state: fade the splash out and disable interaction. */
.is-loaded .preloader { opacity: 0; visibility: hidden; pointer-events: none; }

/* 15e. ----------------------------------------------------- MARQUEE BAND */
/* Infinite horizontal ticker of capabilities. The track holds the list twice
   so a -50% translate loops seamlessly. Edges fade via a mask. */
.marquee {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border-block: 1px solid var(--color-border);
  background: rgba(28, 27, 29, 0.6);
  padding-block: 1.05rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 2.75rem;
  padding-left: 2.75rem;
  animation: marquee 30s linear infinite;
  will-change: transform;
  /* JS glides the paused band under the cursor via the independent
     `translate` property (composes with the keyframe's `transform`), lerping
     every animation frame — no CSS transition here, since restarting one on
     every pointermove is what caused the old jerky/shaky glide. */
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  /* Magnet-glow: JS sets --glow (0..1) by cursor proximity while the band
     is paused on hover and glides under the cursor. The nearest word lights
     up like the logo mark; words never leave the line. */
  --glow: 0;
  text-shadow: 0 0 calc(var(--glow) * 18px) rgba(var(--color-accent-rgb), calc(var(--glow) * 0.85));
  /* Progressive enhancement: tint toward brand red with proximity. Browsers
     without color-mix() keep the muted grey + text-shadow glow above. */
  color: color-mix(in srgb, var(--color-accent-strong) calc(var(--glow) * 100%), var(--color-text-muted));
}
.marquee__sep { color: var(--color-accent); font-size: 0.7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 15f. -------------------------------------------------------- BUTTON RIPPLE */
/* JS appends a .ripple span at the click point; it expands and fades. */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  animation: ripple 0.6s ease-out forwards;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* 15g. ------------------------------------------------------- LOGIN PAGE */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
/* Brand panel — red, with the operator and assurances */
.auth__brand {
  position: relative;
  overflow: hidden;
  display: none; /* hidden on mobile; form is primary there */
  flex-direction: column;
  justify-content: center; /* group content in the vertical middle */
  gap: 1.6rem;
  padding: clamp(2.5rem, 5vw, 4.5rem);
  background:
    radial-gradient(700px 480px at 80% -10%, rgba(var(--color-accent-rgb), 0.3), transparent 60%),
    linear-gradient(165deg, rgba(158, 14, 28, 0.65) 0%, rgba(40, 10, 14, 0.9) 55%, rgba(20, 19, 22, 0.96) 100%);
  border-right: 1px solid rgba(var(--color-accent-rgb), 0.25);
}
.auth__brand-logo { align-self: flex-start; position: relative; z-index: 2; }
.auth__brand-body { position: relative; z-index: 2; max-width: 30ch; }
/* Gradient overlay over the operator so the copy stays readable */
.auth__brand-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(18, 6, 9, 0.88) 0%, rgba(18, 6, 9, 0.55) 46%, rgba(18, 6, 9, 0.1) 72%, transparent 88%),
    radial-gradient(700px 480px at 85% -10%, rgba(var(--color-accent-rgb), 0.3), transparent 60%);
  pointer-events: none;
}
.auth__brand-title {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
  margin: 0.75rem 0 1rem;
}
.auth__brand-text { color: #f0dadd; margin-bottom: 1.75rem; }
.auth__assurances { display: grid; gap: 0.75rem; }
.auth__assurances li { display: flex; align-items: center; gap: 0.7rem; color: #ffd9dd; font-weight: 500; }
.auth__check {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
}
.auth__check::after {
  content: ""; position: absolute; left: 7px; top: 4px;
  width: 4px; height: 8px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.auth__check--sm { width: 16px; height: 16px; }
.auth__check--sm::after { left: 5px; top: 3px; width: 3px; height: 6px; }
/* Full-height operator figure on the right of the brand panel */
.auth__operator {
  position: absolute;
  bottom: 0; right: -3%;
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: bottom right;
  opacity: 0.92;
  -webkit-mask-image: linear-gradient(to left, #000 48%, transparent 96%);
          mask-image: linear-gradient(to left, #000 48%, transparent 96%);
  animation: operator-float 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Form panel */
.auth__main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2.5rem);
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 450px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-card), 0 0 60px -20px var(--color-accent-glow);
  animation: auth-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Soft animated gradient border */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    rgba(var(--color-accent-rgb), 0.7), transparent 38%,
    transparent 62%, rgba(var(--color-accent-rgb), 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
  animation: card-border 5s ease-in-out infinite;
}
@keyframes card-border { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Two-step indicator dots */
.auth-steps { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.auth-steps__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-border-strong);
  transition: background-color var(--transition), width var(--transition), border-radius var(--transition);
}
.auth-steps__dot.is-active { background: var(--color-accent); width: 22px; border-radius: 5px; }

/* Step containers + slide-in transition */
.auth-step { animation: step-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.auth-step[hidden] { display: none; }
@keyframes step-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}
.auth-step__back {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 0; padding: 0; margin-bottom: 1rem;
  color: var(--color-text-muted); font: inherit; cursor: pointer;
  transition: color var(--transition);
}
.auth-step__back:hover { color: var(--color-accent); }

/* 2FA */
.auth-twofa__lead { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 1.1rem; }
.auth-twofa__resend { text-align: center; color: var(--color-text-muted); font-size: 0.9rem; margin-top: 0.85rem; }
.otp { display: flex; gap: 0.55rem; justify-content: space-between; margin-bottom: 0.4rem; }
.otp__box {
  width: 100%; max-width: 56px;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.otp__box:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-glow); }
.otp__box.is-filled { border-color: var(--color-accent); transform: translateY(-2px); }
@keyframes auth-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.auth-card__head { text-align: center; margin-bottom: 1.5rem; }
.auth-card__lock {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: 1rem;
  border-radius: 14px;
  color: var(--color-accent);
  background: rgba(var(--color-accent-rgb), 0.1);
  border: 1px solid rgba(var(--color-accent-rgb), 0.25);
  animation: lock-glow 3s ease-in-out infinite;
}
.auth-card__lock svg { width: 26px; height: 26px; }
@keyframes lock-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-accent-rgb), 0.0); }
  50%      { box-shadow: 0 0 22px -2px rgba(var(--color-accent-rgb), 0.55); }
}
.auth-card__title { font-size: var(--fs-h2); }
.auth-card__sub { color: var(--color-text-muted); margin-top: 0.4rem; }

.auth-form { display: grid; gap: 0.95rem; }
.auth-form .field { margin: 0; } /* grid gap handles spacing — avoid doubling */
/* Password field with reveal toggle */
.auth-pass { position: relative; display: block; }
.auth-pass .field__input { padding-right: 3rem; }
.auth-pass__toggle {
  position: absolute;
  right: 0.4rem; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer;
  color: var(--color-text-faint);
  border-radius: 8px;
  transition: color var(--transition), background-color var(--transition);
}
.auth-pass__toggle:hover { color: var(--color-text); background: rgba(255,255,255,0.05); }
.auth-pass__toggle svg { width: 20px; height: 20px; }
.auth-pass__toggle[aria-pressed="true"] { color: var(--color-accent); }

.auth-form__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.check--inline { padding: 0; margin: 0; }
.auth-form__forgot { font-size: 0.9rem; }
.auth-form__submit { width: 100%; margin-top: 0.25rem; }
.auth-form__note {
  display: flex; align-items: center; gap: 0.5rem;
  justify-content: center;
  font-size: 0.82rem; color: var(--color-text-faint);
  margin-top: 0.25rem;
}
.auth-form__note .auth__check--sm { background: rgba(var(--color-accent-rgb), 0.12); border-color: rgba(var(--color-accent-rgb), 0.4); }
.auth-form__note .auth__check--sm::after { border-color: var(--color-accent); }
.auth-card__foot {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.92rem;
}
.auth__back { color: var(--color-text-muted); font-size: 0.9rem; }
.auth__back:hover { color: var(--color-accent); }

@media (min-width: 900px) {
  .auth { grid-template-columns: 1fr 1fr; }
  .auth__brand { display: flex; }
}

/* 15g2. ------------------------------------------------- BACK TO TOP */
.back-to-top {
  position: fixed;
  right: clamp(1rem, 2vw, 1.75rem);
  bottom: clamp(1rem, 2vw, 1.75rem);
  z-index: 250;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-deep));
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px var(--color-accent-glow);
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -6px var(--color-accent-glow); }
.back-to-top svg { width: 22px; height: 22px; }

/* 15h. -------------------------------------------------- COOKIE CONSENT */
/* GDPR banner injected by js/main.js when no choice is stored yet. No
   non-essential cookies/analytics load until the user opts in. */
.cookie-consent {
  position: fixed;
  left: 50%;
  bottom: clamp(1rem, 3vw, 2rem);
  transform: translateX(-50%) translateY(160%);
  z-index: 300;
  width: min(680px, calc(100% - 2rem));
  background: rgba(35, 34, 38, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), 0 0 40px -16px var(--color-accent-glow);
  padding: 1.2rem 1.4rem;
  display: grid;
  gap: 1rem;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.cookie-consent.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.cookie-consent__text { color: var(--color-text-muted); font-size: 0.92rem; line-height: 1.55; }
.cookie-consent__text strong { color: var(--color-text); font-family: var(--font-display); font-weight: 600; }
.cookie-consent__text a { text-decoration: underline; }
.cookie-consent__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
@media (min-width: 640px) {
  .cookie-consent { grid-template-columns: 1fr auto; align-items: center; }
}

/* 16. ---------------------------------------------------- REDUCED MOTION */
/* Respect users who prefer reduced motion: disable transitions, reveals,
   smooth scroll and looping animations. JS also reads this preference. */
@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;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__scroll-line { animation: none; }
  /* Hide the animated splash immediately; JS also skips it. */
  .preloader { display: none !important; }
  /* No cursor glow or grid drift when reduced motion is requested. */
  .cursor-glow { display: none !important; }
  .bg-grid { animation: none !important; }
  /* The canvas mesh is not drawn under reduced motion; keep the static grid
     for texture but calm it down. */
  .bg-grid { opacity: 0.5; }
}
