/* ============================================
   BASE STYLES — Reset, Typography, Globals
   Editorial Cream Theme
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color var(--duration-slow) var(--ease-out),
              color var(--duration-slow) var(--ease-out);
}


::selection {
  background: var(--accent);
  color: #ffffff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

a {
  color: inherit;
  text-decoration: none;
}


img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}


button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-padding {
  padding: var(--space-section) 0;
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--accent);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  font-style: italic;
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--space-lg);
  line-height: var(--lh-snug);
}

.reveal {
  opacity: 0;
  transform: translateY(60px) scale(0.98);
  transition: opacity var(--duration-slower) var(--ease-awwwards),
              transform var(--duration-slower) var(--ease-awwwards);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.noise-overlay {
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: 0.035;
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grain 0.8s steps(10) infinite;
}

.separator {
  width: 100%;
  height: 1px;
  background: var(--border-color);
}

/* ── Cinematic Flash Glitch ── */
.glitch-flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
}
.glitch-flash.active {
  animation: flashCut 0.4s var(--ease-smooth) forwards;
}

@keyframes flashCut {
  0% { opacity: 0; }
  10% { opacity: 0.95; }
  15% { opacity: 0.1; }
  22% { opacity: 0.8; }
  30% { opacity: 0; }
  45% { opacity: 0.5; }
  60% { opacity: 0; }
  100% { opacity: 0; }
}

/* Ambient portals — subtle in editorial theme */
.ambient-portals {
  opacity: 0.08 !important;
  visibility: visible;
  transition: opacity var(--duration-slow) var(--ease-out);
}
