/* ============================================================
   RAISED BY ROBOTS — shared site styles
   Used by: contact.html, manifesto.html, team.html, film.html, index.html
   Page-specific styles remain inline in each .html file.
   ============================================================ */

/* ───── Tokens ───── */
:root {
  --black:   #000;
  --white:   #fff;
  --accent:  #FFE814;
  --red:     #FF2020;
  --electric:#3da5ff;
  --grey:    #0e0e2a;
  --mid:     #22203e;
  --tg:      #555;

  --ui:   'DM Sans', sans-serif;
  --head: 'Anton', sans-serif;
  --mono: 'Space Mono', monospace;
}

/* ───── Reset ───── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html {
  scroll-behavior: smooth;
  background: var(--black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--ui);
  overflow-x: hidden;
}

::selection            { background: var(--accent); color: var(--black); }
::-webkit-scrollbar    { width: 3px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ───── Film grain overlay ───── */
#grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-size: 128px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ───── Ambient glows (positioned by modifier classes per page) ───── */
.glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

/* ───── Decorative vertical line (manifesto, contact) ───── */
.deco-line {
  position: fixed;
  top: 0;
  bottom: 0;
  left: clamp(60px, 8vw, 120px);
  width: 1px;
  background: var(--accent);
  opacity: .06;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   NAVIGATION — hamburger + slide-in menu + overlay
   ============================================================ */

/* ───── Brand wordmark — hidden site-wide (kept in DOM for a11y/back-compat) ───── */
.rbr-mark {
  display: none !important;
  position: fixed;
  top: 18px;
  left: clamp(64px, calc(4vw + 50px), 90px);
  z-index: 10001;
  padding: 6px 10px 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 3px;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color .3s, color .3s, background .3s;
}
.rbr-mark:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 0, 0, .55);
}
@media (max-width: 480px) {
  .rbr-mark {
    font-size: 8px;
    letter-spacing: 2px;
    padding: 5px 8px 4px;
  }
}
/* In 2084 mode the toggle pill carries the brand; hide the RBR wordmark to avoid duplication. */
[data-mode="2084"] .rbr-mark { display: none; }

.hamburger {
  position: fixed;
  top: 14px;
  left: clamp(10px, 4vw, 30px);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 14px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  /* Reset native <button> chrome — same class is used on <button> and <div> */
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.hamburger:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: clamp(260px, 40vw, 360px);
  height: 100vh;
  z-index: 10000;
  padding: 80px clamp(24px, 4vw, 48px) 40px;
  background: rgba(8, 8, 8, .97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, .04);
  transform: translateX(-100%);
  transition: transform .4s cubic-bezier(.16, 1, .3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.nav-menu.open { transform: translateX(0); }

.nav-menu-links { display: flex; flex-direction: column; gap: 0; }

.nav-menu-link {
  font-family: var(--head);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 2px;
  color: var(--white);
  text-decoration: none;
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  transition: color .3s, padding-left .3s;
}
.nav-menu-link:first-child { border-top: 1px solid rgba(255, 255, 255, .03); }
.nav-menu-link:hover       { color: var(--accent); padding-left: 8px; }

.nav-menu-sub {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--tg);
  margin-top: 4px;
}

.nav-menu-footer {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--tg);
  opacity: .4;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }

/* ============================================================
   FADE REVEAL UTILITIES
   Pages can use either .fade (scroll-driven, toggled in JS)
   or .fi (play-once on load via animation + fadeUp keyframe).
   ============================================================ */

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* play-once on load */
.fi        { opacity: 0; transform: translateY(20px); animation: fadeUp .8s ease forwards; }
.fi-d1     { animation-delay: .10s; }
.fi-d2     { animation-delay: .20s; }
.fi-d3     { animation-delay: .35s; }
.fi-d4     { animation-delay: .50s; }
.fi-d5     { animation-delay: .65s; }
.fi-d6     { animation-delay: .80s; }

/* contact.html legacy aliases (.fade-in / .fade-in-d*) */
.fade-in       { opacity: 0; transform: translateY(20px); animation: fadeUp .8s ease forwards; }
.fade-in-d1    { animation-delay: .10s; }
.fade-in-d2    { animation-delay: .25s; }
.fade-in-d3    { animation-delay: .40s; }
.fade-in-d4    { animation-delay: .60s; }

/* scroll-driven (manifesto): JS toggles .vis / .out */
.fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(.16, 1, .3, 1),
              transform 1s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}
.fade.vis { opacity: 1; transform: translateY(0); }
.fade.out { opacity: 0; transform: translateY(-20px); }

.fade-d1 { transition-delay: .10s; }
.fade-d2 { transition-delay: .22s; }
.fade-d3 { transition-delay: .34s; }
.fade-d4 { transition-delay: .46s; }
.fade-d5 { transition-delay: .58s; }
.fade-d6 { transition-delay: .70s; }

/* ───── Basic footer ───── */
.page-footer {
  padding: 40px clamp(24px, 6vw, 80px);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 4px;
  color: var(--tg);
  opacity: .25;
  text-align: center;
}

/* ───── Accessibility: reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  #grain { display: none !important; }
  .fade, .fi, .fade-in { opacity: 1; transform: none; }
  .fade.out { opacity: 1; transform: none; }
}

/* ───── Small-screen tweaks ───── */
@media (max-width: 768px) {
  .deco-line { display: none; }
}
