/* accelerateanon.com — dark, cinematic, quiet confidence */

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

:root {
  --void: #050505;
  --surface: #0c0c0c;
  --ink: #eceae6;
  --muted: #8a8780;
  --dim: #5c5a55;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #d8d2c8;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  background: var(--void);
}

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* faint film grain only — no neon grid */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.04;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
}

.site-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  pointer-events: none;
}

.brand-mark {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  color: var(--dim);
  font-weight: 500;
  text-transform: uppercase;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 120px;
}

#progress-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}

.progress-track {
  width: 120px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

#progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
  box-shadow: none;
}

#story {
  position: relative;
  z-index: 2;
}

.chapter {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: end start;
  overflow: hidden;
  isolation: isolate;
}

.chapter-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.chapter-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  filter: saturate(0.95) contrast(1.06) brightness(0.68);
  will-change: transform;
}

/* hangar / portrait stills: keep faces & debris readable */
.theme-warehouse .chapter-img {
  object-position: center 35%;
  filter: saturate(0.9) contrast(1.08) brightness(0.78);
}

.theme-economy .chapter-img {
  object-position: center 45%;
  filter: saturate(0.88) contrast(1.1) brightness(0.72);
}

.chapter.is-active .chapter-img.kenburns {
  animation: kenburns 22s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from {
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-1.2%, -0.6%, 0);
  }
}

/* deep cinematic veil — no colored neon blobs */
.chapter-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(5, 5, 5, 0.15) 0%,
      rgba(5, 5, 5, 0.35) 42%,
      rgba(5, 5, 5, 0.92) 100%
    ),
    linear-gradient(
      90deg,
      rgba(5, 5, 5, 0.55) 0%,
      rgba(5, 5, 5, 0.1) 55%,
      rgba(5, 5, 5, 0.35) 100%
    );
}

.chapter-scanlines,
.chapter-grid {
  display: none;
}

.chapter-content {
  position: relative;
  z-index: 2;
  padding: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 10vh, 5.5rem);
  max-width: min(640px, 92vw);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 0.8, 0.22, 1);
}

.chapter.is-active .chapter-content {
  opacity: 1;
  transform: translateY(0);
}

.chapter-index {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--dim);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  font-weight: 500;
}

.chapter-title {
  font-weight: 600;
  font-size: clamp(2rem, 6.2vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--ink);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

.chapter--hero .chapter-title {
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  letter-spacing: -0.03em;
  font-weight: 600;
  color: #f4f1ea;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  filter: none;
}

/* kill glitch entirely */
.glitch::before,
.glitch::after {
  display: none !important;
  content: none !important;
}

.chapter-caption {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--muted);
  max-width: 32em;
  font-weight: 400;
  line-height: 1.6;
}

.chapter.is-active .chapter-caption {
  color: #bdb8b0;
}

.scroll-hint {
  margin-top: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--dim);
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(236, 234, 230, 0.45), transparent);
  animation: pulse-line 2.4s ease-in-out infinite;
}

@keyframes pulse-line {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.75);
  }
  50% {
    opacity: 0.9;
    transform: scaleY(1);
  }
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.6rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid rgba(236, 234, 230, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-decoration: none;
  border-radius: 2px;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease;
  pointer-events: auto;
}

.cta-button:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(236, 234, 230, 0.5);
  transform: none;
  box-shadow: none;
}

.cta-pulse {
  display: none;
}

/* video full-bleed */
.chapter-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.95) contrast(1.05) brightness(0.7);
  background: #000;
}

.theme-autonomy .chapter-video,
.theme-robotics .chapter-video {
  filter: saturate(0.92) contrast(1.08) brightness(0.75);
}

/* minimal footer — credits on credits.html */
.site-foot {
  position: relative;
  z-index: 2;
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  background: #050505;
}

.refs-link {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
}

.refs-link:hover {
  color: var(--muted);
}

/* ambient music control */
.music-toggle {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  z-index: 45;
  border: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.72);
  color: var(--dim);
  font-family: inherit;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  border-radius: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.music-toggle:hover,
.music-toggle.is-on {
  color: var(--ink);
  border-color: rgba(236, 234, 230, 0.35);
}

body:not(.is-ready) #story {
  opacity: 0;
}

body.is-ready #story {
  opacity: 1;
  transition: opacity 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .chapter-img.kenburns,
  .scroll-line {
    animation: none !important;
  }
  .chapter-content {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .site-chrome {
    padding: 0.8rem 0.95rem;
  }
  .progress-track {
    width: 88px;
  }
  .chapter-content {
    padding-bottom: 3.5rem;
  }
}
