/* Revenant — internal homepage / splash
   Clean white background, black text, a single restrained red accent. No glow effects on the logo. */

:root {
  --bg-0: #ffffff;

  --ink: #111111;                 /* primary text */
  --ink-dim: #55534f;             /* secondary / meta text */
  --ink-faint: rgba(17, 17, 17, 0.55);

  --blood: #8a2a2a;                /* dried-blood red — hairline, status accent */
  --blood-bright: #a53c3c;

  /* Paired with --blood-bright for the two-series login-activity chart. Not the
     app's usual green "ok" color (#3c785a, see .dash-ok) — that pairing fails
     colorblind-safe separation (deuteranopia ΔE ~4.6, below the validator's floor).
     This blue passes cleanly (ΔE ~13) — see the dataviz skill's validate_palette.js. */
  --chart-success: #1f5a8c;

  --line: rgba(17, 17, 17, 0.12);

  --font-display: 'Cinzel', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--blood-bright);
  color: #ffffff;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6vh 6vw 3vh;
  isolation: isolate;
}

/* fine grain, layered over everything, barely there */
.stage::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

.mark {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px; /* wide enough that "EVENANT" + the logo never wrap at the wordmark's max font-size */
  margin: auto 0; /* vertically centers in whatever space is left above the footer; collapses to 0 (natural scroll, no overlap) if the viewport is too short to fit both */
}

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-wrap: balance;
}

.wordmark {
  --tracking: 0.3em; /* letter-spacing, shared with .wordmark-r so the gap after the logo matches the gap between every other letter */
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 9vw, 5.2rem);
  letter-spacing: var(--tracking);
  /* Letter-spacing adds a trailing gap after the last character too, which throws off
     visual centering — cancel it here instead of padding the opposite side (that padding
     hack was tuned for when the wordmark was plain text; it doesn't hold now that the
     first "character" is an image with its own width/margin). */
  margin-right: calc(-1 * var(--tracking));
  text-transform: uppercase; /* Cinzel's own case-swap (cap + small-caps) read inconsistently as a brand mark — force it explicitly */
  color: var(--ink);
  white-space: nowrap; /* the logo (an inline image) and "EVENANT" must stay on one line — without this, a break opportunity right after the image lets it wrap onto its own line */
}

/* The logo mark standing in for the "R" in REVENANT, wherever the wordmark appears
   (homepage, login, 2FA, dashboard header) — sized in `em` so it tracks whatever
   font-size the surrounding heading happens to use in each context. The source image
   is square, but a real capital R is narrower than it is tall, so sizing by height
   alone (width: auto) made it read as much heavier/wider than an actual letter. */
.wordmark-r {
  height: 1em;
  width: auto;
  vertical-align: -0.13em; /* nudges the mark down below the text baseline */
  /* The logo's hard square edge reads as more space than the same numeric gap between two
     letterforms (which have their own soft side-bearing), so this trims a bit off the raw
     tracking value rather than using it unmodified. */
  margin-right: calc(var(--tracking, 0.03em) - 0.05em);
}

.tagline {
  margin: 0 0 2.1rem;
  max-width: 36ch;
  font-family: var(--font-mono);
  font-size: clamp(0.92rem, 1.7vw, 1.08rem);
  line-height: 1.65;
  color: var(--ink-dim);
}

.hairline {
  width: 92px;
  height: 1.5px;
  margin: 0 0 1.7rem;
  background: linear-gradient(90deg, transparent, var(--blood-bright), transparent);
  opacity: 0.9;
}

.internal-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-wrap: balance;
}

/* ---------- call-to-action buttons ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin: 0 0 1.9rem;
}

.cta-button {
  padding: 0.65rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

a.cta-button:hover {
  background: var(--ink);
  color: #ffffff;
}

/* ---------- status bar ---------- */

.status-bar {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.9rem;
  padding: 1rem 1.25rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-align: center;
}

.status-bar__item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.status-bar__sep {
  color: var(--ink-faint);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--blood-bright);
  box-shadow: 0 0 6px rgba(165, 60, 60, 0.45);
  animation: pulse-dot 3.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

/* ---------- entrance reveal ---------- */

.reveal {
  animation: reveal 1s cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

.reveal--1 { animation-delay: 0.05s; }
.reveal--2 { animation-delay: 0.32s; }
.reveal--3 { animation-delay: 0.5s; }
.reveal--4 { animation-delay: 0.72s; }
.reveal--5 { animation-delay: 0.95s; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- motion & size preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .status-dot,
  .reveal {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 420px) {
  .status-bar {
    font-size: 0.64rem;
    gap: 0.3rem 0.6rem;
  }

  .tagline {
    max-width: 30ch;
  }

  .eyebrow {
    letter-spacing: 0.2em;
  }

  .internal-note {
    letter-spacing: 0.12em;
  }
}

@media (max-width: 360px) {
  .wordmark {
    font-size: clamp(2.1rem, 11vw, 2.6rem);
    letter-spacing: 0.22em;
  }
}

/* short viewports (common laptop window heights) — shrink instead of overlapping/clipping */
@media (max-height: 720px) {
  .stage {
    padding: 3.5vh 6vw 2vh;
  }

  .wordmark {
    font-size: clamp(1.9rem, 7vw, 3.4rem);
    margin-bottom: 0.8rem;
  }

  .tagline {
    margin-bottom: 1.2rem;
  }

  .hairline {
    margin-bottom: 1.1rem;
  }

  .status-bar {
    padding: 0.6rem 1rem 0.8rem;
  }
}
