:root {
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html {
  background-color: #141615;
  color: #f2f4ef;
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "cv01" on;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: #141615;
  color: #f2f4ef;
}

/* Muscular Scotch-serif display treatment matching the reference posters */
.font-editorial {
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 72;
  font-weight: 500;
  letter-spacing: -0.032em;
}

.font-mono-tech {
  font-family: var(--font-mono);
}

/* Stark black-boxed architectural tag from the left-edge strata reference */
.stratum-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem;
  background-color: #0b0d0c;
  border: 1px solid rgba(242, 244, 239, 0.16);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e4e8e3;
}

/* Subtle analog film grain */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.028;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scroll reveal choreography */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header scrolled state */
#site-header.is-scrolled {
  background-color: rgba(20, 22, 21, 0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* Audio equalizer bars */
@keyframes eqPulse {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}
.audio-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
#audio-toggle.is-active {
  border-color: rgba(254, 97, 27, 0.65);
  background-color: rgba(254, 97, 27, 0.14);
  color: #f2f4ef;
}
#audio-toggle.is-active .audio-eq {
  display: flex;
}
.audio-eq span {
  width: 2px;
  background: #fe611b;
  transform-origin: bottom;
  animation: eqPulse 1s ease-in-out infinite;
}
.audio-eq span:nth-child(1) { height: 8px; animation-duration: 0.85s; }
.audio-eq span:nth-child(2) { height: 12px; animation-duration: 1.2s; }
.audio-eq span:nth-child(3) { height: 6px; animation-duration: 1.05s; }

/* Mobile drawer, article drawer & contact modal state transitions */
#mobile-nav {
  display: none;
}
#mobile-nav.is-open {
  display: block;
}

#article-drawer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#article-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}
#article-drawer .drawer-sheet {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#article-drawer.is-open .drawer-sheet {
  transform: translateX(0);
}

#contact-modal,
#letter-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#contact-modal.is-open,
#letter-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
#contact-modal .modal-box,
#letter-modal .modal-box {
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
#contact-modal.is-open .modal-box,
#letter-modal.is-open .modal-box {
  transform: translateY(0) scale(1);
}

/* Accordion smooth height */
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.is-open > .accordion-panel {
  grid-template-rows: 1fr;
}
.accordion-inner {
  overflow: hidden;
}

/* Active button highlights */
.hero-stratum-btn.is-active {
  background-color: #fe611b;
  border-color: #fe611b;
  color: #141615;
  font-weight: 600;
  transform: translateX(6px);
  box-shadow: 0 0 24px rgba(254, 97, 27, 0.42);
}
.hero-stratum-btn.is-active .stratum-idx {
  color: rgba(20, 22, 21, 0.78);
}
.hero-stratum-btn.is-active .stratum-sub {
  color: rgba(20, 22, 21, 0.9);
  opacity: 1;
}

.year-node.is-passed .year-box {
  background-color: #1e3129;
  border-color: #426658;
  color: #f2f4ef;
}
.year-node.is-active .year-box {
  background-color: #fe611b;
  border-color: #fe611b;
  color: #141615;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(254, 97, 27, 0.35);
}
.year-node.is-active .year-label {
  color: #f2f4ef;
}

/* Custom sleek dark scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #141615;
}
::-webkit-scrollbar-thumb {
  background: #2b332f;
}
::-webkit-scrollbar-thumb:hover {
  background: #fe611b;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
