/*
  OutOS background candidates v2 - internal comparison page.
  Owner verdict on v1: 04 removed; 01/02/03/05 kept but pushed much deeper.
  06 is a new hybrid of the two favourites (02 depth + 05 rails).
  Monochrome graphite/white only. Animation uses transform/opacity (and
  background-position on composited layers). Frozen under reduced motion.
*/
:root {
  --bg: #161616;
  --bg-deep: #101010;
  --line: rgba(245,245,240,0.16);
  --text: #F4F4F0;
  --muted: #B8B8B0;
  --dim: #7C7C76;
  --invert: #080808;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: clamp(13px, 12.25px + 0.098vw, 16px); }
body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Montserrat", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
.mono { font-family: "Cascadia Mono", "Roboto Mono", ui-monospace, monospace; }

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(16,16,16,0.92);
  border-bottom: 1px solid var(--line);
}
.bar img { height: 22px; width: auto; display: block; }
.bar span { color: var(--dim); font-size: 0.74rem; }
.bar.end { position: static; border-top: 1px solid var(--line); border-bottom: 0; }

/* ---------- sample frame ---------- */
.sample {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.plate {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 22px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  background: rgba(16,16,16,0.85);
  padding: 12px 16px;
  max-width: 380px;
}
.plate .idx { color: var(--dim); font-size: 0.78rem; }
.plate strong { font-size: 1.05rem; font-weight: 800; }
.plate em { font-style: normal; color: var(--muted); font-size: 0.82rem; }

.mock {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  width: min(480px, calc(100vw - 48px));
  border: 1px solid var(--line);
  background: rgba(16,16,16,0.9);
  padding: 24px;
}
.mock .micro {
  color: var(--dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
}
.mock h2 { font-size: 2rem; line-height: 1; font-weight: 900; }
.mock .cta {
  justify-self: start;
  background: var(--text);
  color: var(--invert);
  font-weight: 900;
  padding: 10px 16px;
  border-radius: 6px;
}
.mock .meta { color: var(--muted); font-size: 0.74rem; }

/* ============================================================
   ( 01 ) registration grid v2
   ============================================================ */
.bg-grid { background: var(--bg); }
.bg-grid .grid-base {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(245,245,240,0.16) 1px, transparent 1.4px);
  background-size: 18px 18px;
  opacity: 0.6;
}
/* slow-traveling brighter focus zone (same lattice, brighter, soft mask) */
.bg-grid .grid-focus {
  position: absolute;
  inset: -30vh -30vw;
  background-image: radial-gradient(circle, rgba(245,245,240,0.38) 1px, transparent 1.4px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 420px 300px at 50% 50%, #000 0 35%, transparent 70%);
  mask-image: radial-gradient(ellipse 420px 300px at 50% 50%, #000 0 35%, transparent 70%);
  animation: focus-roam 38s ease-in-out infinite alternate;
}
@keyframes focus-roam {
  0%   { transform: translate(-26vw, -18vh); }
  33%  { transform: translate(22vw, 10vh); }
  66%  { transform: translate(-12vw, 24vh); }
  100% { transform: translate(28vw, -22vh); }
}
/* twinkling intersection ticks at sparse pitch */
.bg-grid .ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bg-grid .t1 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.55) 1.1px, transparent 1.9px);
  background-size: 252px 234px;
  animation: tick-twinkle 5.5s ease-in-out infinite;
}
.bg-grid .t2 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.45) 1.1px, transparent 1.9px);
  background-size: 198px 306px;
  background-position: 120px 80px;
  animation: tick-twinkle 7.5s ease-in-out infinite reverse;
}
@keyframes tick-twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.8; }
}
.bg-grid .scan-h {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0 49.6%, rgba(245,245,240,0.10) 50%, transparent 50.4% 100%);
  transform: translateY(-60%);
  animation: scan-down 13s linear infinite;
}
.bg-grid .scan-v {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0 49.7%, rgba(245,245,240,0.07) 50%, transparent 50.3% 100%);
  transform: translateX(-60%);
  animation: scan-right 29s linear infinite;
}
@keyframes scan-down { 0% { transform: translateY(-60%); } 100% { transform: translateY(60%); } }
@keyframes scan-right { 0% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

/* ============================================================
   ( 02 ) depth field v2
   ============================================================ */
.bg-depth { background: var(--bg-deep); }
.zoom {
  position: absolute;
  inset: 0;
  animation: breathe 64s ease-in-out infinite alternate;
}
@keyframes breathe {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}
.layer {
  position: absolute;
  inset: -240px 0 0 0;
  pointer-events: none;
}
.layer.l1 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.10) 1px, transparent 1.5px);
  background-size: 230px 250px;
  animation: fall 260s linear infinite;
}
.layer.l2 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.16) 1px, transparent 1.5px);
  background-size: 150px 165px;
  background-position: 60px 40px;
  animation: fall 170s linear infinite;
}
.layer.l3 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.24) 1.2px, transparent 1.8px);
  background-size: 95px 105px;
  background-position: 120px 90px;
  animation: fall 100s linear infinite;
}
.layer.l4 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.34) 1.5px, transparent 2.2px);
  background-size: 320px 280px;
  background-position: 40px 200px;
  animation: fall 60s linear infinite;
}
.twinkle {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.twinkle.w1 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.7) 1.4px, transparent 2.4px);
  background-size: 460px 380px;
  background-position: 90px 60px;
  animation: star-twinkle 4.2s ease-in-out infinite;
}
.twinkle.w2 {
  background-image: radial-gradient(circle, rgba(245,245,240,0.6) 1.2px, transparent 2px);
  background-size: 540px 460px;
  background-position: 300px 240px;
  animation: star-twinkle 6.4s ease-in-out 1.8s infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.9; }
}
@keyframes fall {
  0% { transform: translateY(0); }
  100% { transform: translateY(220px); }
}
.bg-depth::after,
.bg-channel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(8,8,8,0.55));
  pointer-events: none;
}
/* rare shooting streaks */
.streak {
  position: absolute;
  top: 12%;
  left: -12%;
  width: 220px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,245,240,0.85), transparent);
  transform: rotate(16deg) translateX(0);
  opacity: 0;
  animation: shoot 13s linear infinite;
}
.streak.s2 {
  top: 58%;
  width: 160px;
  animation-delay: 6.5s;
  animation-duration: 17s;
  transform: rotate(11deg);
}
@keyframes shoot {
  0%, 91% { opacity: 0; transform: rotate(16deg) translateX(0); }
  92%     { opacity: 0.9; }
  98%     { opacity: 0; transform: rotate(16deg) translateX(130vw); }
  100%    { opacity: 0; transform: rotate(16deg) translateX(130vw); }
}

/* ============================================================
   ( 03 ) horizon grid v2
   ============================================================ */
.bg-horizon { background: var(--bg-deep); }
.bg-horizon .sky {
  position: absolute;
  inset: 0 0 52% 0;
  background-image: radial-gradient(circle, rgba(245,245,240,0.20) 1px, transparent 1.5px);
  background-size: 170px 135px;
}
.bg-horizon .sky-twinkle {
  position: absolute;
  inset: 0 0 52% 0;
  background-image: radial-gradient(circle, rgba(245,245,240,0.65) 1.3px, transparent 2.2px);
  background-size: 430px 320px;
  background-position: 140px 70px;
  animation: star-twinkle 5s ease-in-out infinite;
}
.bg-horizon .glow {
  position: absolute;
  left: 0;
  right: 0;
  top: 48%;
  height: 1px;
  background: rgba(245,245,240,0.45);
  box-shadow: 0 0 18px 2px rgba(245,245,240,0.18);
  animation: glow-breathe 7s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}
.bg-horizon .floor-wrap {
  position: absolute;
  left: -40%;
  right: -40%;
  top: 48%;
  bottom: -14%;
  perspective: 620px;
  overflow: hidden;
}
.bg-horizon .floor {
  position: absolute;
  inset: 0;
  transform: rotateX(63deg);
  transform-origin: 50% 0%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
}
.bg-horizon .f1 {
  background:
    repeating-linear-gradient(0deg, rgba(245,245,240,0.16) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(245,245,240,0.16) 0 1px, transparent 1px 64px);
  background-size: 64px 64px;
  animation: floor-drift 6s linear infinite;
}
.bg-horizon .f2 {
  background:
    repeating-linear-gradient(0deg, rgba(245,245,240,0.07) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(245,245,240,0.07) 0 1px, transparent 1px 16px);
  background-size: 16px 16px;
  animation: floor-drift-fine 6s linear infinite;
}
@keyframes floor-drift { 0% { background-position: 0 0; } 100% { background-position: 0 64px; } }
@keyframes floor-drift-fine { 0% { background-position: 0 0; } 100% { background-position: 0 16px; } }
/* pulse wave rolling from horizon toward viewer */
.bg-horizon .wave {
  position: absolute;
  inset: 0;
  transform: rotateX(63deg);
  transform-origin: 50% 0%;
  background: linear-gradient(180deg, transparent 0 6%, rgba(245,245,240,0.22) 7%, transparent 9% 100%);
  background-size: 100% 900px;
  background-repeat: no-repeat;
  animation: wave-roll 7s cubic-bezier(0.2, 0.6, 0.8, 1) infinite;
}
.bg-horizon .wave.w2 { animation-delay: 3.5s; }
@keyframes wave-roll {
  0% { background-position: 0 -120px; opacity: 0.9; }
  85% { opacity: 0.5; }
  100% { background-position: 0 900px; opacity: 0; }
}

/* ============================================================
   ( 05 ) signal rails v2
   ============================================================ */
.bg-rails { background: var(--bg-deep); }
.railset {
  position: absolute;
  inset: 0 -480px 0 0;
  pointer-events: none;
}
.railset.a {
  background: repeating-linear-gradient(90deg, rgba(245,245,240,0.10) 0 1px, transparent 1px 170px);
  animation: rail-l 160s linear infinite;
}
.railset.b {
  background: repeating-linear-gradient(90deg, rgba(245,245,240,0.18) 0 1px, transparent 1px 470px);
  animation: rail-r 110s linear infinite;
}
.railset.sparse {
  background: repeating-linear-gradient(90deg, rgba(245,245,240,0.14) 0 1px, transparent 1px 330px);
  animation: rail-l 200s linear infinite;
}
.crossrails {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(245,245,240,0.05) 0 1px, transparent 1px 240px);
}
@keyframes rail-l { 0% { transform: translateX(0); } 100% { transform: translateX(-340px); } }
@keyframes rail-r { 0% { transform: translateX(-470px); } 100% { transform: translateX(0); } }
/* light pulses running down individual rails */
.pulse {
  position: absolute;
  top: -90px;
  width: 1px;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(245,245,240,0.9));
  animation: pulse-run 6s linear infinite;
}
.pulse[data-rail="1"] { left: 11%;  animation-duration: 7.2s;  animation-delay: 0s; }
.pulse[data-rail="2"] { left: 23%;  animation-duration: 5.4s;  animation-delay: 2.1s; }
.pulse[data-rail="3"] { left: 41%;  animation-duration: 8.6s;  animation-delay: 0.9s; }
.pulse[data-rail="4"] { left: 59%;  animation-duration: 6.1s;  animation-delay: 3.4s; }
.pulse[data-rail="5"] { left: 76%;  animation-duration: 7.8s;  animation-delay: 1.5s; }
.pulse[data-rail="6"] { left: 91%;  animation-duration: 5.9s;  animation-delay: 4.2s; }
@keyframes pulse-run {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(calc(100vh + 180px)); opacity: 0; }
}
/* rare full-rail bursts */
.burst {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(245,245,240,0.55);
  opacity: 0;
  animation: rail-burst 11s linear infinite;
}
.burst.x1 { left: 33%; }
.burst.x2 { left: 67%; animation-delay: 5.5s; animation-duration: 14s; }
@keyframes rail-burst {
  0%, 90% { opacity: 0; }
  91% { opacity: 0.7; }
  94% { opacity: 0.15; }
  96% { opacity: 0.45; }
  100% { opacity: 0; }
}

/* ============================================================
   ( 06 ) deep channel - hybrid of 02 + 05
   ============================================================ */
.bg-channel { background: var(--bg-deep); }

/* ============================================================
   ( 07 ) arc field - the curves, deliberate this time
   ============================================================ */
.bg-arcs { background: var(--bg-deep); }
.bg-arcs .ringfield {
  position: absolute;
  inset: -30%;
  pointer-events: none;
}
.bg-arcs .r1 {
  background: repeating-radial-gradient(circle at 18% 22%, rgba(245,245,240,0.085) 0 1px, transparent 1px 120px);
  animation: ring-drift-a 70s ease-in-out infinite alternate;
}
.bg-arcs .r2 {
  background: repeating-radial-gradient(circle at 86% 84%, rgba(245,245,240,0.06) 0 1px, transparent 1px 180px);
  animation: ring-drift-b 95s ease-in-out infinite alternate;
}
@keyframes ring-drift-a {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, 2%) scale(1.06); }
}
@keyframes ring-drift-b {
  0% { transform: translate(0, 0) scale(1.05); }
  100% { transform: translate(-2.5%, -2%) scale(1); }
}
.bg-arcs .arcfrag {
  position: absolute;
  border: 1px solid rgba(245,245,240,0.22);
  border-radius: 50%;
  pointer-events: none;
  -webkit-mask-image: conic-gradient(#000 0 95deg, transparent 95deg 360deg);
  mask-image: conic-gradient(#000 0 95deg, transparent 95deg 360deg);
  animation: frag-turn 80s linear infinite;
}
.bg-arcs .f1 { width: 72vmax; height: 72vmax; left: -22vmax; top: -30vmax; }
.bg-arcs .f2 { width: 48vmax; height: 48vmax; right: -16vmax; bottom: -22vmax; animation-duration: 120s; animation-direction: reverse; }
.bg-arcs .f3 { width: 30vmax; height: 30vmax; left: 8vw; bottom: -12vmax; animation-duration: 60s; }
@keyframes frag-turn {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.bg-arcs .ripple {
  position: absolute;
  left: 38%;
  top: 42%;
  width: 70vmin;
  height: 70vmin;
  margin: -35vmin 0 0 -35vmin;
  border: 1px solid rgba(245,245,240,0.5);
  border-radius: 50%;
  opacity: 0;
  animation: ripple-out 11s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.bg-arcs .rp2 { left: 64%; top: 30%; animation-delay: 5.5s; animation-duration: 14s; }
@keyframes ripple-out {
  0% { transform: scale(0.08); opacity: 0; }
  6% { opacity: 0.45; }
  60% { opacity: 0.08; }
  100% { transform: scale(1.5); opacity: 0; }
}
.bg-arcs .dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(245,245,240,0.22) 1px, transparent 1.5px);
  background-size: 260px 220px;
  background-position: 80px 60px;
  animation: star-twinkle 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 920px) {
  .plate { position: static; margin: 80px 22px 18px; }
  .sample { align-content: start; }
  .mock { margin: 0 22px 60px; }
}
