/* =====================================================================
   THE BALLAD OF Q-1606 — stylesheet
   Design language: Y2K futurism. White/chrome surfaces, ice-blue glass,
   thin technical grid lines, mono readouts. Inspired by the glossy
   glass-and-chrome render aesthetic (freespace/G-Loaded style wallpapers).
   ===================================================================== */

:root {
  /* -- color tokens -- */
  --ice: #f4f8fc;          /* page background */
  --chrome-1: #ffffff;     /* brightest chrome highlight */
  --chrome-2: #dde7f2;     /* mid chrome */
  --chrome-3: #aebfd4;     /* shadowed chrome */
  --steel: #5c7594;        /* secondary text, borders */
  --ink: #0d1b2a;          /* primary text, near navy-black */
  --glow: #6fd7ff;         /* cyan accent glow */
  --glow-dim: rgba(111, 215, 255, 0.35);
  --line: rgba(13, 27, 42, 0.12);
  --line-soft: rgba(13, 27, 42, 0.06);
  --glass-fill: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.8);

  /* -- type -- */
  --f-display: "Michroma", "Arial Narrow", sans-serif;
  --f-body: "Space Grotesk", "Segoe UI", sans-serif;
  --f-mono: "Space Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ice);
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--steel); }
a:hover, a:focus-visible { color: var(--ink); }

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------------
   Ambient grid overlay — fixed, low-opacity blueprint lines.
   This is the signature visual motif carried through the whole page.
--------------------------------------------------------------------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 75%);
}

/* ---------------------------------------------------------------------
   Top status strip — ticker-style system readout
--------------------------------------------------------------------- */
.status-strip {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 2rem;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  padding: 0.5rem 1.25rem;
  background: var(--ink);
  color: var(--chrome-2);
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.status-strip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 6px 1px var(--glow-dim);
  flex: none;
}

/* ---------------------------------------------------------------------
   HUD nav
--------------------------------------------------------------------- */
.hud-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.hud-nav__mark {
  font-family: var(--f-display);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.hud-nav__links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.hud-nav__links a {
  text-decoration: none;
  color: var(--steel);
  position: relative;
  padding-bottom: 2px;
}

.hud-nav__links a::before {
  content: "// ";
  color: var(--chrome-3);
}

.hud-nav__links a:hover { color: var(--ink); }

/* ---------------------------------------------------------------------
   HUD corner brackets — reusable decorative frame
--------------------------------------------------------------------- */
.hud-frame { position: relative; }

.hud-frame::before,
.hud-frame::after,
.hud-frame > .corner-tl,
.hud-frame > .corner-br {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--steel);
  opacity: 0.55;
}

.hud-frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.hud-frame::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ---------------------------------------------------------------------
   Hero
--------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 1.5rem 5rem;
  overflow: hidden;
  isolation: isolate;
}

/* This is the layer you replace with your own background photo. */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Fallback chrome/glass artwork — shows automatically if hero__bg
   fails to load (i.e. before you've added your own image). */
.hero__fallback {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, #ffffff 0%, transparent 60%),
    linear-gradient(160deg, #eef4fa 0%, #cddced 45%, #a9bfd8 100%);
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(244,248,252,0.15) 0%, rgba(244,248,252,0.75) 85%, var(--ice) 100%);
}

.hero__eyebrow {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--steel);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #c7d6e8 45%, #7f9bbd 55%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  filter: drop-shadow(0 6px 18px rgba(94, 123, 156, 0.35));
}

.hero__tagline {
  max-width: 42ch;
  font-size: 1.05rem;
  color: var(--steel);
  margin: 0 0 2.5rem;
}

.hero__tagline em {
  color: var(--ink);
  font-style: normal;
  border-bottom: 1px dashed var(--chrome-3);
}

.hero__cta-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--chrome-3);
  border-radius: 999px;
  background: var(--glass-fill);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.pill:hover {
  border-color: var(--steel);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------------
   Section scaffolding
--------------------------------------------------------------------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section + .section { border-top: 1px solid var(--line); }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.section__index {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--chrome-3);
}

.section__title {
  font-family: var(--f-display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  margin: 0;
}

.section__lede {
  color: var(--steel);
  max-width: 60ch;
  margin: -1.25rem 0 2.5rem;
}

/* ---------------------------------------------------------------------
   Glass panel — the reusable "chrome card" surface
--------------------------------------------------------------------- */
.glass-panel {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 18px 40px -24px rgba(20, 40, 70, 0.35);
  padding: 2rem;
}

/* ---------------------------------------------------------------------
   Image frame — graceful placeholder pattern used everywhere an image
   goes. If the <img> 404s, its onerror hides it and this label + the
   chrome gradient behind it remain visible, so nothing ever looks
   "broken" while you're still adding your own art.
--------------------------------------------------------------------- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--chrome-3);
  background:
    repeating-linear-gradient(135deg, var(--chrome-2) 0 2px, var(--chrome-1) 2px 14px);
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
  padding: 1rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--steel);
  pointer-events: none;
}

.frame__label strong {
  font-size: 0.72rem;
  color: var(--ink);
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------
   Synopsis
--------------------------------------------------------------------- */
.synopsis {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.synopsis .frame { aspect-ratio: 2 / 3; }

.synopsis__body p { margin: 0 0 1.1rem; }

.synopsis__meta {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--steel);
}

.synopsis__meta strong { color: var(--ink); }

@media (max-width: 640px) {
  .synopsis { grid-template-columns: 1fr; }
  .synopsis .frame { max-width: 220px; }
}

/* ---------------------------------------------------------------------
   Chapter directory
--------------------------------------------------------------------- */
.directory { list-style: none; margin: 0; padding: 0; }

.directory__row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.directory__row:hover { background: var(--line-soft); }

.directory__id {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--chrome-3);
}

.directory__title { font-weight: 500; }

.directory__title small {
  display: block;
  font-weight: 400;
  color: var(--steel);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.tag {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.tag--read { background: #e3f8ee; color: #1f7a4d; }
.tag--locked { background: var(--chrome-2); color: var(--steel); }

/* ---------------------------------------------------------------------
   Character dossier grid
--------------------------------------------------------------------- */
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.id-card { padding: 0; overflow: hidden; }

.id-card .frame { aspect-ratio: 3 / 4; border-radius: 10px 10px 0 0; border-width: 0 0 1px 0; }

.id-card__body { padding: 1.1rem 1.2rem 1.3rem; }

.id-card__designation {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--chrome-3);
}

.id-card__name {
  font-family: var(--f-display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  margin: 0.3rem 0;
}

.id-card__role { color: var(--steel); font-size: 0.85rem; margin: 0 0 0.6rem; }

.id-card__blurb { font-size: 0.85rem; margin: 0; }

/* ---------------------------------------------------------------------
   Gallery
--------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.gallery .frame { aspect-ratio: 1 / 1; }

/* ---------------------------------------------------------------------
   Author's log
--------------------------------------------------------------------- */
.log-entry {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.log-entry:last-child { border-bottom: none; }

.log-entry__date {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--chrome-3);
}

.log-entry__title { margin: 0 0 0.4rem; font-family: var(--f-display); font-size: 0.85rem; letter-spacing: 0.03em; }

.log-entry p { margin: 0; }

@media (max-width: 560px) {
  .log-entry { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ---------------------------------------------------------------------
   Footer — retro web furniture
--------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.footer-widgets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.widget {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--steel);
  border: 1px solid var(--chrome-3);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  background: var(--chrome-1);
}

.widget strong { display: block; color: var(--ink); font-size: 0.85rem; letter-spacing: 0.08em; }

.counter-digits {
  display: inline-flex;
  gap: 2px;
  margin-top: 0.35rem;
}

.counter-digits span {
  background: var(--ink);
  color: var(--glow);
  font-family: var(--f-mono);
  font-size: 0.9rem;
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
}

.site-footer small {
  display: block;
  color: var(--chrome-3);
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.site-footer nav {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  margin-bottom: 1rem;
}

.site-footer nav a { margin: 0 0.5rem; }
