/* =========================================================
   Psychosis — Horde guild (psychosis.rip)
   Clean, flat, modern. Plain CSS, no build step.
   Artwork: the Horde logo (assets/horde-logo.webp, hero + favicon) is
   Blizzard Entertainment property, owner-supplied, used on this
   non-commercial fan page only (see README.md). The page background is a
   plain CSS gradient stack; no images, textures or noise.
   Body text: system font stack.
   Display font (hero title "PSYCHOSIS" + hero tagline + dictionary
   headword + section headings + closing CTA): Friz Quadrata
   (Ernst Friz / ITC, Linotype), self-hosted from /fonts.
   Optimus Princeps (Manfred Klein, 2004, free for personal use) is still
   registered and shipped in /fonts as the alternative hero-title face
   (see .guild-name for the one-line switch). Neither is an open-licensed
   font; both are used here for a non-commercial fan page only (see
   README.md).
   ========================================================= */

/* Friz Quadrata TT Regular only (no bold cut is shipped); nothing on the
   page asks for a bolder weight, so the browser never synthesises one. */
@font-face {
  font-family: "Friz Quadrata";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/FrizQuadrata.woff2") format("woff2"),
       url("fonts/FrizQuadrata.ttf") format("truetype");
}

/* Optimus Princeps ships Regular (OS/2 weight 500) and SemiBold (600).
   Both are registered so the browser never has to synthesise bold. Not
   used by default any more (the hero title is set in Friz Quadrata), but
   kept so the title can be flipped back; see .guild-name. */
@font-face {
  font-family: "Optimus Princeps";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/OptimusPrinceps.woff2") format("woff2"),
       url("fonts/OptimusPrinceps.ttf") format("truetype");
}

@font-face {
  font-family: "Optimus Princeps";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/OptimusPrincepsSemiBold.woff2") format("woff2"),
       url("fonts/OptimusPrincepsSemiBold.ttf") format("truetype");
}

:root {
  --bg: #0f0f12;
  --bg-footer: #0a0a0d;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --red: #c8102e;          /* primary / accent */
  --red-deep: #8c1c13;     /* hover / depth */
  --red-dim: #b30e29;      /* --red's hue, ~10% darker: the darkest that keeps black text at 3:1 (3.01:1) */
  --red-rgb: 200, 16, 46;  /* --red as channels, for rgba(var(--red-rgb), a) */
  --red-deep-rgb: 140, 28, 19;
  --on-red: #fff;          /* text on a --red / --red-deep fill */
  --red-text: #ff5a6e;     /* accent-coloured text on the dark page */
  --link: #9a9aa6;         /* small inline link buttons (.link-btn) */
  --gold: #c9a449;         /* tiny trim only, never text */
  --text: #f3f1ee;
  --muted: #9a9aa6;
  --glow-red: 0 0 24px rgba(var(--red-rgb), 0.35);
  /* Danger buttons (.btn-danger: Delete application, its Delete confirm, Delete
     draft, Withdraw) stay crimson in every portal theme: no body.theme-* block
     overrides these, so their hover/focus glow matches their red border instead
     of the theme's --glow-red (blue on the Applicant Portal, gold for officers).
     Same size and alpha as --glow-red. The channels are the error red #ff7a85,
     and the danger border reads the same variable, so border and glow match. */
  --danger-rgb: 255, 122, 133;
  --glow-danger: 0 0 24px rgba(var(--danger-rgb), 0.35);
  --focus: #ffffff;
  /* Applicant form accents (apply.css): a selected toggle tile gets a light
     blue 2px border and a faint 14% tint of it, never a solid fill
     (#5aa9e6 vs the card ~#191a1d = 6.84:1; --text on the 14% tint #222e39 =
     12.27:1, on the 18% hover tint #253441 = 11.32:1). The --cta values here
     are the crimson defaults (#fff on #c8102e = 5.88:1, on the #8c1c13 hover =
     9.17:1); the apply and officer pages always carry a portal theme class
     (body.theme-applicant / body.theme-officer below) that replaces them. */
  --selected: #5aa9e6;
  --selected-rgb: 90, 169, 230;
  --cta: #c8102e;
  --cta-hover: #8c1c13;
  --on-cta: #fff;
  /* Accent lines (card top borders, character-card left edges, focus and
     hover borders) and the toggle hover border. Crimson on the homepage;
     each portal theme below sets its own. */
  --accent-line: #c8102e;
  --toggle-hover: #c8102e;
  /* Page background glow channels (top-right glow, fainter bottom-left one). */
  --bg-glow-rgb: 200, 16, 46;
  --bg-glow-deep-rgb: 140, 28, 19;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Friz Quadrata is a sturdy, slightly flared glyphic serif (the WoW UI face);
     the fallbacks are wide old-style serifs so the layout holds if it fails. */
  --font-display: "Friz Quadrata", "Friz Quadrata TT", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  /* Alternative hero-title stack, currently unused: .guild-name points at
     --font-display. Optimus Princeps is a Trajan-style Roman capital face,
     so the fallbacks are the same inscriptional-serif family. */
  --font-title: "Optimus Princeps", "Trajan Pro", Cinzel, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

/* Officer sessions (body.theme-officer, set by apply.js / officer.js from the
   /api/me role): every crimson accent becomes the Officer Login gold. Only the
   accent variables change; every rule reads them, so no rule is duplicated.
   Variables composed from others (--glow-red) are re-declared here because a
   custom property resolves where it is declared (:root), not where it is used.
   Contrast: #0f0f12 on #c9a227 = 7.91:1, on the #b38e1f hover = 6.2:1;
   #c9a227 text on the page #0f0f12 = 7.91:1, on the card surface (~#191a1d)
   = 7.19:1; the white focus ring is unchanged. The page background glow is
   gold at the same alphas (--muted on the brightest point #292315 = 5.56:1). */
body.theme-officer {
  --red: #c9a227;
  --red-deep: #b38e1f;
  --red-rgb: 201, 162, 39;
  --red-deep-rgb: 179, 142, 31;
  --on-red: #0f0f12;
  --red-text: #c9a227;
  --link: #c9a227;
  --glow-red: 0 0 24px rgba(201, 162, 39, 0.35);
  /* Selected tiles: gold border + gold tint (border vs card 7.19:1, --text on
     the 14% tint 12.18:1); primary buttons solid gold with near-black text. */
  --selected: #c9a227;
  --selected-rgb: 201, 162, 39;
  --cta: #c9a227;
  --cta-hover: #b38e1f;
  --on-cta: #0f0f12;
  --accent-line: #c9a227;
  --toggle-hover: #c9a227;
  --bg-glow-rgb: 201, 162, 39;
  --bg-glow-deep-rgb: 179, 142, 31;
}

/* Applicant portal (body.theme-applicant: static on apply/index.html, kept by
   apply.js for signed-out visitors and applicants, set by officer.js for an
   applicant session on the officer page): every crimson accent becomes the
   Battle.net blue family. Fills (primary buttons, Log out, skip link, Back)
   are #006bd1 with white text (5.22:1), #0074e0 on hover (4.59:1). Accent
   text, links and lines are the lighter #4da3ff: on the page #0f0f12 7.29:1,
   on the card ~#191a1d 6.63:1, on the brightest glow point #0d1c2d 6.55:1,
   on the strongest portal strip tint #0d1e31 6.41:1. Selected toggles keep
   the :root light blue #5aa9e6 (6.84:1 vs the card), which is 1.03:1 against
   #4da3ff, so the toggle hover border is a neutral light grey #b8b8c2 (8.84:1
   vs the card) and selected stays distinct from hover. The page background
   glow is #006bd1 / #004a91 at the crimson alphas (--muted on the brightest
   point #0d1c2d = 6.18:1, --text 15.25:1). The white focus ring is unchanged
   (17.4:1 on the card, 5.22:1 against a #006bd1 fill). */
body.theme-applicant {
  --red: #006bd1;
  --red-deep: #0074e0;
  --red-rgb: 0, 107, 209;
  --red-deep-rgb: 0, 116, 224;
  --on-red: #fff;
  --red-text: #4da3ff;
  --link: #4da3ff;
  --glow-red: 0 0 24px rgba(77, 163, 255, 0.35);
  --cta: #006bd1;
  --cta-hover: #0074e0;
  --on-cta: #fff;
  --accent-line: #4da3ff;
  --toggle-hover: #b8b8c2;
  --bg-glow-rgb: 0, 107, 209;
  --bg-glow-deep-rgb: 0, 74, 145;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg-footer);
  scroll-behavior: smooth;
}

/* Page background: smooth CSS-only gradients, no images, no noise.
   A soft accent glow sits top-right and a fainter deeper one bottom-left
   (crimson on the homepage, blue on applicant pages, gold on officer pages,
   via --bg-glow-rgb / --bg-glow-deep-rgb),
   both fading into the opaque near-black base. The glows are sized in px
   (not %) so they never stretch with document height, and each one carries
   several stops with slowly decaying alpha so dark browsers do not band.
   The whole stack is fixed to the viewport (see the mobile fallback
   further down).
   Contrast: at the brightest point (top-right, ~14% crimson over #0f0f12
   = ~#290f16) white text is ~18:1 and --muted (#9a9aa6) is ~6.4:1, so every
   AA ratio on the page is unchanged. */
body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 760px at 88% -8%,
      rgba(var(--bg-glow-rgb), 0.14) 0%,
      rgba(var(--bg-glow-rgb), 0.11) 18%,
      rgba(var(--bg-glow-rgb), 0.075) 36%,
      rgba(var(--bg-glow-rgb), 0.045) 54%,
      rgba(var(--bg-glow-rgb), 0.02) 72%,
      rgba(var(--bg-glow-rgb), 0.006) 88%,
      rgba(var(--bg-glow-rgb), 0) 100%),
    radial-gradient(900px 620px at 10% 108%,
      rgba(var(--bg-glow-deep-rgb), 0.10) 0%,
      rgba(var(--bg-glow-deep-rgb), 0.075) 20%,
      rgba(var(--bg-glow-deep-rgb), 0.05) 40%,
      rgba(var(--bg-glow-deep-rgb), 0.028) 58%,
      rgba(var(--bg-glow-deep-rgb), 0.012) 76%,
      rgba(var(--bg-glow-deep-rgb), 0.004) 90%,
      rgba(var(--bg-glow-deep-rgb), 0) 100%),
    linear-gradient(180deg, #0f0f12 0%, #0e0e11 50%, #0c0c0f 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Mobile fallback: background-attachment: fixed repaints on every scroll
   tick on many touch browsers (and iOS Safari ignores it or jitters), so
   let the gradient scroll with the page there. The px-sized glows stay
   anchored to the top-right / bottom-left corners of the document. */
@media (hover: none) and (pointer: coarse), (max-width: 600px) {
  body {
    background-attachment: scroll;
  }
}

body > * {
  position: relative;
  z-index: 1;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--red);
  color: var(--on-red);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

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

/* Top nav */
.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 40px;
}

.nav-pill {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 8px 20px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(var(--red-rgb), 0.1);
}

/* Sign in / account utilities, right of the pill. Every .nav-util (link,
   button or name chip) shares one height, font and padding; only the hover
   tint differs from the resting state. */
.nav-utils {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
}

/* [hidden] must always win in the nav: .nav-utils is flex and every .nav-util
   (Sign in, the name chip, Officer Portal, Sign out) is inline-flex, which
   beat the browser's own [hidden] { display: none } on the FAQ page once. */
.nav-utils[hidden],
.nav-utils [hidden],
.nav-util[hidden] { display: none !important; }

.nav-util {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 30px;
  margin: 0;
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.nav-util svg {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: 0.7;
}

a.nav-util:hover,
button.nav-util:hover {
  color: var(--text);
  border-color: rgba(var(--red-rgb), 0.45);
  background: rgba(var(--red-rgb), 0.1);
}

a.nav-util:hover svg,
button.nav-util:hover svg { opacity: 1; }

/* A failed sign out ("Sign out failed. Try again."), next to the buttons. */
.nav-status { font-size: 12px; color: rgb(var(--danger-rgb)); }
.nav-status:empty { display: none; }

/* The signed-in name: same box as the buttons, not interactive. */
.nav-user {
  cursor: default;
  color: var(--text);
  max-width: 180px;
}

.nav-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero */
.hero {
  padding: 48px 40px 32px;
  text-align: center;
}

.hero-content {
  max-width: 640px;
  margin: 0 auto;
}

/* Horde logo (recessed, brushed-red version). The file is a transparent
   WebP cut to the crest silhouette only (no baked halo or shadow, see
   README); the width/height attributes on the <img> reserve the box, CSS
   sets the rendered size. No glow, drop-shadow or filter of any kind: a
   blurred shadow on this near-black background quantises into visible
   stepped rings, and the artwork's own bevel already gives it depth. */
.crest {
  display: block;
  width: auto;
  height: 120px;
  margin: 0 auto 20px;
}

.guild-name {
  /* Hero title in Friz Quadrata, the same face and @font-face as the
     tagline and headings (var(--font-display)).
     TO SWITCH BACK to Optimus Princeps SemiBold: change the next line to
     `font-family: var(--font-title);`, set `font-weight: 600;`,
     `font-size: clamp(46px, 12vw, 104px);` and `letter-spacing: 0.06em;`.
     The Optimus @font-face rules, --font-title and the /fonts files are
     all still in place. */
  font-family: var(--font-display);
  /* Friz Quadrata ships Regular only (registered above as 400). Asking for
     anything heavier would make the browser smear a faux bold over the
     outline, so the weight stays at 400. */
  font-weight: 400;
  /* Friz Quadrata "PSYCHOSIS" is 5.58em of glyph advances (measured from
     fonts/FrizQuadrata.ttf, kerning not counted); with 0.05em tracking on
     9 letters it is ~6.03em wide. 100px (~603px) is the ceiling that still
     fits the 640px hero column on one line; 44px (~265px) fits the 280px of
     content width on a 320px phone. */
  font-size: clamp(44px, 12vw, 100px);
  letter-spacing: 0.05em;
  /* Stays uppercase: the tracked caps keep the title reading as a title. */
  text-transform: uppercase;
  line-height: 1;
  color: #fff;
  margin-bottom: 14px;
  /* Black outline + shadow so the white title lifts off the crimson glow.
     Built from text-shadow only, because a centred -webkit-text-stroke eats
     the letterforms and paint-order is not honoured for HTML text
     everywhere. The outline is a solid ~3px black band drawn OUTSIDE the
     glyphs by stacking unblurred black copies in three rings: 8 offsets at
     1px, 16 at 2px and 24 at 3px (every 15 degrees). The dense rings keep
     the band round at corners and gap-free along diagonals, and the white
     fill paints on top so no counter or serif is lost. After the rings a
     hard 4px drop and two wide dark blurs push the whole word off the
     crimson glow. Colour and size are unchanged. */
  text-shadow:
    /* ring 1: 1px, 8 directions */
    -1px   -1px   0 #000,   1px   -1px   0 #000,
    -1px    1px   0 #000,   1px    1px   0 #000,
    -1px    0     0 #000,   1px    0     0 #000,
     0     -1px   0 #000,   0      1px   0 #000,
    /* ring 2: 2px, 16 directions (every 22.5 degrees) */
     2px    0     0 #000,   1.8px  0.8px 0 #000,
     1.4px  1.4px 0 #000,   0.8px  1.8px 0 #000,
     0      2px   0 #000,  -0.8px  1.8px 0 #000,
    -1.4px  1.4px 0 #000,  -1.8px  0.8px 0 #000,
    -2px    0     0 #000,  -1.8px -0.8px 0 #000,
    -1.4px -1.4px 0 #000,  -0.8px -1.8px 0 #000,
     0     -2px   0 #000,   0.8px -1.8px 0 #000,
     1.4px -1.4px 0 #000,   1.8px -0.8px 0 #000,
    /* ring 3: 3px, 24 directions (every 15 degrees) */
     3px    0     0 #000,   2.9px  0.8px 0 #000,
     2.6px  1.5px 0 #000,   2.1px  2.1px 0 #000,
     1.5px  2.6px 0 #000,   0.8px  2.9px 0 #000,
     0      3px   0 #000,  -0.8px  2.9px 0 #000,
    -1.5px  2.6px 0 #000,  -2.1px  2.1px 0 #000,
    -2.6px  1.5px 0 #000,  -2.9px  0.8px 0 #000,
    -3px    0     0 #000,  -2.9px -0.8px 0 #000,
    -2.6px -1.5px 0 #000,  -2.1px -2.1px 0 #000,
    -1.5px -2.6px 0 #000,  -0.8px -2.9px 0 #000,
     0     -3px   0 #000,   0.8px -2.9px 0 #000,
     1.5px -2.6px 0 #000,   2.1px -2.1px 0 #000,
     2.6px -1.5px 0 #000,   2.9px -0.8px 0 #000,
    /* depth: hard drop, tight dark halo, wide soft shadow */
     0      4px   4px rgba(0, 0, 0, 0.9),
     0      0    18px rgba(0, 0, 0, 0.85),
     0     10px  40px rgba(0, 0, 0, 0.7);
  /* Single word, so it should never need to break; this is the last resort
     if a fallback font is much wider than measured. */
  overflow-wrap: anywhere;
}

.tagline {
  /* "Lok'tar Ogar" in Friz Quadrata, the same display face as the section
     headings. Mixed case on purpose (the Horde greeting is a phrase, not a
     label) with light 0.06em tracking so it sits as a subtitle under the
     tracked PSYCHOSIS title without competing with it. Weight 400 is the
     only Friz Quadrata cut shipped, so no faux bold is ever synthesised.
     ~7.6em of glyphs tracked: 26px (~200px) on desktop, 20px (~150px) on
     a 320px phone, both far inside the hero column. The hero has no buttons
     (Apply / Discord live in the top nav and the closing CTA); the tagline
     carries no bottom margin, the dictionary card below sets its own top
     margin and the hero's bottom padding sets the gap to About. */
  font-family: var(--font-display);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: none;
  color: var(--red);
  margin-bottom: 0;
}

/* Dictionary excerpt under the tagline (Google / Oxford style entry).
   Deliberately small and quiet: a little subtitle under "Lok'tar Ogar",
   not a second hero card. Same flat surface as the other cards (4% white,
   the same neutral 1px 8% border on all four sides, no accent rule), 8px
   radius, no hover lift, no glow, it is not interactive. Left-aligned text
   inside a centered 360px column. Contrast on the card surface (~#191a1d):
   --text ~14:1, --muted ~5.6:1, both AA (>= 4.5:1) at the 11-13px sizes
   used here. The 18px top margin plus the hero's 32px bottom padding keeps
   the tagline -> card -> About rhythm even; About's own padding is
   unchanged, so no extra gap opens above it. */
.dict {
  max-width: 360px;
  margin: 18px auto 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}

/* Headword in Friz Quadrata. The font ships U+00B7 (middle dot), so the
   syllable breaks render in the display face, not a fallback. <dfn>
   defaults to italic; reset so the glyphic serif keeps its upright shape.
   ~5.6em of glyphs: 20px (~112px) desktop, 18px (~101px) on a 320px phone,
   inside the 250px content width (320 - 2*20 hero padding - 2*14 card
   padding at <= 600px - 2px border) with room to spare. */
.dict-word {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 20px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--text);
}

.dict-word dfn {
  font-style: normal;
}

/* Respelling. Friz Quadrata has no ī (U+012B) or ˈ (U+02C8), so this line
   uses a sans stack that carries those marks on every platform: Segoe UI
   (Windows), Noto Sans (Android / most Linux), DejaVu Sans (Linux), then
   system-ui (San Francisco on Apple). No web font request. */
.dict-pron {
  margin-top: 2px;
  font-family: "Segoe UI", "Noto Sans", "DejaVu Sans", system-ui, -apple-system, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* Part of speech: small italic serif, the dictionary convention. */
.dict-pos {
  margin-top: 4px;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  font-style: italic;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.dict-def {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

.dict-example {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  font-style: italic;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Visually hidden, still read by assistive tech (used for the spoken
   pronunciation in the dictionary card). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Buttons (closing CTA) */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 160px;
  padding: 16px 32px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
}

.btn-primary {
  background: var(--red);
  border-color: rgba(var(--red-rgb), 0.6);
  color: var(--on-red);
}

.btn-primary:hover {
  background: var(--red-deep);
  transform: translateY(-2px);
  box-shadow: var(--glow-red);
}

/* Homepage "Ready to Join?" Apply CTA: exactly the tagline's crimson at rest
   (var(--red) #c8102e) with a BLACK label. Black on #c8102e is 3.57:1, so the
   label is WCAG large text (24px regular, the display font as on the tagline),
   where 3:1 is enough. Hover and keyboard focus keep the lift and glow and dim
   the fill to --red-dim #b30e29 (same hue, ~10% darker; black 3.01:1). A
   visible white focus ring. */
.cta-section .btn-primary {
  background: var(--red);
  border-color: rgba(var(--red-rgb), 0.6);
  color: #000;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
}

.cta-section .btn-primary:hover,
.cta-section .btn-primary:focus-visible {
  background: var(--red-dim);
  color: #000;
  transform: translateY(-2px);
  box-shadow: var(--glow-red);
}

.cta-section .btn-primary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent-line);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--glow-red);
}

/* Homepage "Ready to Join?" Discord CTA: same type as the Apply CTA beside it
   (display font, 24px regular, line-height 1.2), so with the shared .btn
   padding and 1px border both buttons are the same height. Colours stay the
   .btn-secondary ones (off-white #f3f1ee on the faint card tint, well above
   3:1). Hover and keyboard focus lift and glow like Apply, with the same
   visible focus ring. */
.cta-section .btn-secondary {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
}

.cta-section .btn-secondary:hover,
.cta-section .btn-secondary:focus-visible {
  border-color: var(--accent-line);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--glow-red);
}

.cta-section .btn-secondary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Sections */
.section {
  padding: 32px 40px;
  text-align: center;
}

.section-label {
  font-family: var(--font-display);
  /* Friz Quadrata has solid strokes and wide caps, so small labels can drop to
     22px and still read clearly. Caps + 0.08em tracking keep them label-like
     and distinct from the mixed-case CTA below. "RAID SCHEDULE" is ~8.9em
     tracked (~195px), well inside a 320px phone. */
  font-size: 22px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 24px;
}

.prose {
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
  color: var(--muted);
}

.prose p + p {
  margin-top: 14px;
}

/* Card */
.card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent-line);
  border-radius: 12px;
  padding: 8px 24px 20px;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  border-color: rgba(var(--red-rgb), 0.4);
  border-top-color: var(--accent-line);
  box-shadow: var(--glow-red);
  transform: translateY(-3px);
}

.raid-list {
  list-style: none;
}

.raid-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.raid-row:last-child {
  border-bottom: none;
}

.raid-day {
  font-weight: 600;
  color: var(--text);
}

.raid-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Small subtext under the schedule rows: same quiet 11-12px lettering as the
   footer legal line, left-aligned to match the raid rows. --muted (#9a9aa6)
   on the card surface (#0f0f12 + 4% white, ~#191a1d) measures ~6.3:1, above
   AA 4.5:1 even at this size. No media query overrides it. */
.raid-note {
  margin-top: 10px;
  font-size: 0.72rem; /* 11.5px at the 16px root */
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: left;
  color: var(--muted);
}

/* Closing CTA. Sits directly on the page gradient, no backdrop art. */
.cta-section {
  padding-top: 56px;
  padding-bottom: 64px;
}

.cta-title {
  font-family: var(--font-display);
  /* Mixed case on purpose: Friz Quadrata's lowercase is its signature look (it
     is how WoW sets its own headers) and "Ready to Join?" reads warmer and
     clearer than tracked caps at this size. ~6.9em wide at 0.02em tracking:
     44px (~300px) on desktop, 28px (~195px) on a 320px phone. */
  font-size: clamp(28px, 5.5vw, 44px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: none;
  color: #fff;
  margin-bottom: 12px;
}

.cta-copy {
  font-size: 14px;
  color: var(--muted);
  max-width: 450px;
  margin: 0 auto 24px;
}

/* Footer */
footer {
  padding: 32px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  background: var(--bg-footer);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

footer .footer-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
footer .footer-link:hover { color: var(--text); }
footer .footer-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The privacy and contact page (/privacy/): readable left-aligned text. */
.privacy { max-width: 720px; margin: 0 auto; text-align: left; line-height: 1.6; }
/* Privacy page only (body.privacy-page): the heading sits right under the nav,
   the apply page's rhythm: nav bottom padding (16px; 12px under 600px) + 24px
   = 40px (36px on a phone). It used to be 96px here (112px of dead space). The
   two-class selector also beats the phone .section padding below. */
.privacy-page .privacy { padding-top: 24px; }
.privacy-title { font-family: var(--font-display); font-size: 32px; line-height: 1.2; color: #fff; margin-bottom: 12px; }
.privacy-lead { color: var(--text); margin-bottom: 8px; }
.privacy h2 { font-size: 18px; color: #fff; margin: 24px 0 6px; }
.privacy p, .privacy li { color: var(--text); font-size: 15px; }
.privacy ul { padding-left: 20px; }
.privacy li + li { margin-top: 4px; }
.privacy a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

footer p + p {
  margin-top: 6px;
}

/* Blizzard trademark notice: quiet but still readable.
   #85858f on the #0a0a0d footer is ~5.1:1 (WCAG AA for body text). */
footer .legal {
  max-width: 640px;
  margin: 12px auto 0;
  font-size: 11px;
  line-height: 1.55;
  color: #85858f;
}

/* Portal bar (apply + officer pages): a full-width strip right under the nav,
   shown only while signed in. [hidden] must win over display:block. */
.portal-bar {
  display: block;
  width: 100%;
  background: linear-gradient(90deg, rgba(var(--red-rgb), 0.16), rgba(var(--red-rgb), 0.04) 60%, rgba(255, 255, 255, 0.02));
  border-top: 1px solid rgba(var(--red-rgb), 0.45);
  border-bottom: 1px solid rgba(var(--red-rgb), 0.45);
}

.portal-bar[hidden] { display: none; }

.portal-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 40px;
  font-size: 14px;
  color: var(--text);
}

.portal-label {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red-text);
  white-space: nowrap;
}

.portal-user { color: var(--muted); overflow-wrap: anywhere; }
.portal-user strong { color: var(--text); font-weight: 600; }

/* The two portal-bar buttons: Switch (officers only) beside Log Out, pushed
   right; on narrow screens they wrap onto their own line (see Responsive). */
.portal-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

/* Log Out and Switch share one box (13px at 600 on a 1.3 line, 6px 16px,
   1px border, 6px radius); only their colours differ. */
.portal-logout {
  padding: 6px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-red);
  background: var(--red);
  border: 1px solid rgba(var(--red-rgb), 0.6);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.portal-logout:hover { background: var(--red-deep); }
.portal-logout:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.portal-logout[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Officer sessions (set by apply.js / officer.js from the session role): the
   strip takes the Officer Login gold instead of crimson. Label #c9a227 on the
   darkest strip tint (#2d2715) = 6.15:1; Log out #0f0f12 on #c9a227 = 7.91:1,
   on the #b38e1f hover = 6.2:1; the white focus ring on the strip = 14.87:1. */
.portal-bar.is-officer {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.16), rgba(201, 162, 39, 0.04) 60%, rgba(255, 255, 255, 0.02));
  border-top-color: rgba(201, 162, 39, 0.45);
  border-bottom-color: rgba(201, 162, 39, 0.45);
}

.portal-bar.is-officer .portal-label { color: #c9a227; }

.portal-bar.is-officer .portal-logout {
  color: #0f0f12;
  background: #c9a227;
  border-color: #8a6d14;
}

.portal-bar.is-officer .portal-logout:hover { background: #b38e1f; color: #0f0f12; }
.portal-bar.is-officer .portal-logout:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Switch to the other portal (officers with live rights only). It wears the
   OTHER portal's colours: on the Applicant Portal the officer gold (#0f0f12 on
   #c9a227 = 7.91:1, on the #b38e1f hover = 6.2:1), on the Officer Portal the
   Battle.net blue (#fff on #006bd1 = 5.22:1, on the #0074e0 hover = 4.59:1).
   The white focus ring is offset onto the strip (14.87:1 on gold's, 3:1+ on a
   blue fill). */
.portal-switch {
  padding: 6px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}

.portal-switch[hidden] { display: none; }
.portal-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.portal-switch-officer { color: #0f0f12; background: #c9a227; border: 1px solid #8a6d14; }
.portal-switch-officer:hover { color: #0f0f12; background: #b38e1f; }

.portal-switch-applicant { color: #fff; background: #006bd1; border: 1px solid #00509e; }
.portal-switch-applicant:hover { color: #fff; background: #0074e0; }

/* Responsive */
@media (max-width: 600px) {
  .portal-inner { flex-wrap: wrap; gap: 6px 14px; padding: 10px 20px; }
  .portal-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .portal-switch, .portal-logout { white-space: normal; text-align: center; }
  .top-nav { padding: 12px 20px; flex-wrap: wrap; row-gap: 8px; }
  .nav-link { font-size: 12px; padding: 6px 14px; }
  /* The utilities wrap onto their own centred row under the pill. */
  .nav-utils { margin-left: 0; width: 100%; justify-content: center; gap: 8px; }
  .hero { padding: 32px 20px 24px; }
  .dict { margin-top: 16px; padding: 10px 14px; }
  .section { padding: 24px 20px; }
  .cta-group { gap: 10px; }
  .btn { padding: 14px 24px; font-size: 14px; min-width: 140px; }
  .card { padding: 4px 18px 16px; }
}

/* Narrow phones: the pill links tighten and the utility buttons with an icon
   collapse to the icon (the label stays for screen readers). */
@media (max-width: 400px) {
  nav.top-nav { padding: 10px 12px; }
  .nav-link { padding: 6px 10px; }
  .nav-util-icon .nav-util-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .nav-user { max-width: 140px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  /* Same selectors as the lifts themselves (same specificity, later in the
     file), so every one is cancelled; the homepage CTA's are more specific than .btn:hover. */
  .btn:hover, .card:hover,
  .btn-primary:hover, .btn-secondary:hover,
  .cta-section .btn-primary:hover, .cta-section .btn-primary:focus-visible { transform: none; }
  .cta-section .btn-secondary:hover, .cta-section .btn-secondary:focus-visible { transform: none; }
}

/* Idle timeout dialog (apply + officer pages). Colours come from the page's
   theme variables: Battle.net blue on the Applicant Portal, gold on the
   Officer Portal, crimson anywhere else. */
/* Native <dialog> (showModal: the page behind is inert, focus stays inside). */
.idle-dialog::backdrop { background: rgba(5, 5, 8, 0.78); }

/* The global `* { margin: 0 }` reset strips the UA's `margin: auto` that centres a
   modal dialog in the top layer, so it is restored here explicitly. */
.idle-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  height: fit-content;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  text-align: center;
  color: var(--text);
  background: #16161a;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent-line);
  border-radius: 12px;
  box-shadow: var(--glow-red);
}

.idle-title { margin: 0 0 10px; font-family: var(--font-display); font-size: 22px; color: var(--red-text); }
.idle-text { margin: 0 0 18px; line-height: 1.6; }
.idle-countdown { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.idle-dialog .idle-stay { background: var(--cta); border-color: var(--cta); color: var(--on-cta); cursor: pointer; }
.idle-dialog .idle-stay:hover { background: var(--cta-hover); }
.idle-dialog .idle-stay:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
