/* ============================================================
   CLEANFREQS — base.css
   Shared across all pages.
   ============================================================ */

/* ── TOKENS ── */
:root {
  --bg:         #050505;
  --fg:         #f0ede6;
  --green:      #b8ff00;
  --blue:       #1a8fff;
  --blue-bright:#3fb4ff;
  --muted:      #555;
  --muted2:     #888;

  --font-mono:  'DM Mono', monospace;
  --font-code:  'Space Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-weight: 300;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── BACKGROUND ── */
.bg-image {
  position: fixed;
  inset: 0;
  background-image: url('../img/background.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.45) contrast(1.1) saturate(0.8);
  transform: scale(1.1);
  z-index: 0;
  opacity: 0;
  transition: opacity 2.2s ease;
  animation: bg-drift 30s ease-in-out infinite alternate;
  animation-play-state: paused;
}

/* index.html sits at root so path is relative from there */
body.page-home .bg-image {
  background-image: url('img/background.jpg');
}

.bg-image.entered {
  opacity: 1;
  animation-play-state: running;
}

@keyframes bg-drift {
  0%   { transform: scale(1.1) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1%, -1%); }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(5,5,5,0.35) 0%, rgba(5,5,5,0.85) 100%),
    linear-gradient(180deg, rgba(5,5,5,0.6) 0%, rgba(5,5,5,0.4) 50%, rgba(5,5,5,0.7) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ── GRAIN ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.08;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* ── SCAN LINES ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 3px,
    rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 5px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ── FRAME ── */
.frame-line {
  position: fixed;
  background: rgba(255,255,255,0.06);
  z-index: 5;
  pointer-events: none;
}
.fl-top    { top: 0;    left: 0; right: 0;  height: 1px; }
.fl-bottom { bottom: 0; left: 0; right: 0;  height: 1px; }
.fl-left   { left: 0;  top: 0;  bottom: 0;  width: 1px; }
.fl-right  { right: 0; top: 0;  bottom: 0;  width: 1px; }

.corner {
  position: fixed;
  width: 12px;
  height: 12px;
  z-index: 6;
  pointer-events: none;
}
.corner::before,
.corner::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.18);
}
.corner::before { width: 100%; height: 1px; top: 0; left: 0; }
.corner::after  { width: 1px; height: 100%; top: 0; left: 0; }
.c-tl { top: 0;    left: 0;  }
.c-tr { top: 0;    right: 0; transform: scaleX(-1); }
.c-bl { bottom: 0; left: 0;  transform: scaleY(-1); }
.c-br { bottom: 0; right: 0; transform: scale(-1); }

/* ── SEQUENCED ENTRANCE SYSTEM ──
   All .seq elements start invisible + offset.
   entrance.js adds .entered with per-element data-delay.
   CSS transitions handle the animation — no jank.
── */
.seq {
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity   0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.seq.entered {
  opacity: 1;
  transform: translateY(0);
}

/* ── SHARED NAV TYPOGRAPHY ── */
.tag-collective {
  position: fixed;
  top: 2rem;
  left: 2.2rem;
  z-index: 20;
  font-family: var(--font-code);
  font-size: 0.5rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(240,237,230,0.6);
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}

.links {
  position: fixed;
  top: 1.9rem;
  right: 2.2rem;
  z-index: 20;
  display: flex;
  gap: 1.6rem;
  align-items: center;
}

.links a {
  font-family: var(--font-code);
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,237,230,0.55);
  text-decoration: none;
  transition: color 0.2s;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}
.links a:hover,
.links a.active { color: var(--green); }

.meta-left {
  position: fixed;
  bottom: 2rem;
  left: 2.2rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-left span {
  font-size: 0.48rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240,237,230,0.4);
  line-height: 1;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}
.meta-left span.bright { color: rgba(240,237,230,0.65); }

/* ── MOBILE ── */
@media (max-width: 600px) {
  .tag-collective {
    top: 1.15rem;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 2rem);
    font-size: 0.43rem;
    letter-spacing: 0.24em;
    text-align: center;
  }

  .links {
    top: 3rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    gap: 0.85rem;
    justify-content: center;
    width: max-content;
    max-width: calc(100vw - 2rem);
  }

  .links a {
    font-size: 0.43rem;
    letter-spacing: 0.16em;
  }
}

@media (max-width: 380px) {
  .links { gap: 0.65rem; }
  .links a { font-size: 0.4rem; letter-spacing: 0.12em; }
  .tag-collective { font-size: 0.4rem; letter-spacing: 0.2em; }
}
