/* ============ NIGHT SHIFT — base.css ============ */

:root {
  --bg: #0b0f16;
  --bg-2: #0e1420;
  --fg: #e8e2d4;
  --dim: #93a0b8;
  --line: rgba(214, 226, 244, 0.14);
  --line-soft: rgba(214, 226, 244, 0.07);
  --sig: #7ef0a8;
  --amber: #ffb454;
  --red: #ff6b5e;
  --ink: #161c26;
  --paper: #f3eee3;
  --paper-line: rgba(22, 28, 38, 0.16);
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --pad: clamp(1.25rem, 4vw, 3rem);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.4s var(--ease);
  overflow-x: hidden;
}
body.dawn { background: var(--paper); color: var(--ink); }
::selection { background: var(--amber); color: var(--bg); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- film grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color 1.4s var(--ease), border-color 1.4s var(--ease);
}
body.dawn .hud { background: color-mix(in srgb, var(--paper) 78%, transparent); }
.hud__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem var(--pad);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hud__brand { font-weight: 600; }
.hud__call { color: var(--dim); margin-left: 1.2em; }
.hud__right { display: flex; align-items: center; gap: 1.4rem; }
.hud__status { color: var(--dim); }
.hud__status i, .live {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sig);
  margin-right: 0.5em;
  animation: beat 2.4s ease-in-out infinite;
}
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hud__clock {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.hud__sc { height: 1px; background: var(--line); }
.hud__sc i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
  transition: width 0.2s linear;
}

/* ---------- timeline scaffold ---------- */
.log { max-width: 1180px; margin: 0 auto; padding: calc(4.5rem + 2vh) var(--pad) 0; }
.log__disclaimer {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: clamp(4rem, 12vh, 8rem);
  border-left: 2px solid var(--amber);
  padding-left: 1rem;
}

.entry {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  border-top: 1px solid var(--line-soft);
  padding: clamp(3.5rem, 9vh, 7rem) 0;
}
.entry:first-of-type { border-top: 0; }

.entry__rail {
  position: relative;
  padding-right: clamp(1.5rem, 3vw, 2.5rem);
}
.entry__rail::after {
  content: "";
  position: absolute;
  top: 0.4rem;
  right: -1px;
  width: 1px;
  height: 100%;
  background: var(--line);
}
.entry__rail time {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  display: block;
}

/* ---------- reveal system ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
  transition:
    opacity 1.1s var(--ease),
    transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.in .entry__body > *,
.in .probe,
.in .ledger__row,
.in .vault__row,
.in .crew__row {
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- stamps ---------- */
.stamp {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.45em 0.9em;
  border: 2px solid var(--sig);
  color: var(--sig);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  border-radius: 2px;
  opacity: 0.9;
}
.stamp--amber { border-color: var(--amber); color: var(--amber); }

/* ---------- scroll cue ---------- */
.scrollcue {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.8em;
}
.caret { animation: drift 1.8s var(--ease) infinite; color: var(--amber); }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- footer ---------- */
.handover {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.4rem var(--pad) 2rem;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  transition: transform 1s var(--ease);
}

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