/* ============================================
   DOLLHAVEN ETERNAL AUTUMN — The Illuminated Archive
   Design System CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&family=Inter:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

@font-face {
  font-family: 'PP Mondwest';
  src: url('../PPMondwest-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Bit';
  src: url('../PPNeueBit-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- CSS Custom Properties ---- */
:root {
  /* Foundation */
  --bg: #0a0a0a;
  --surface: #131313;
  --surface-low: #1c1b1b;
  --surface-container: #201f1f;
  --surface-high: #2a2a2a;
  --surface-highest: #353534;
  --surface-lowest: #0e0e0e;

  /* Earth Tones */
  --amber: #f0e6d3;
  --gold: #e8dcc8;
  --copper: #c97d4a;
  --moss: #e8775a;
  --moss-dark: #b84a30;
  --burgundy: #ffb4a8;
  --burgundy-deep: #db4231;
  --blood: #690000;
  --blood-dark: #200000;

  /* Text */
  --on-surface: #e5e2e1;
  --on-surface-variant: #c4c7c7;
  --on-surface-dim: #8e9192;
  --outline-variant: #444748;

  /* Typography */
  --font-display: 'PP Mondwest', 'Newsreader', serif;
  --font-display-decorative: 'PP Mondwest', 'Newsreader', serif;
  --font-body: 'Newsreader', serif;
  --font-label: 'PP Neue Bit', 'Inter', sans-serif;

  /* Transitions */
  --ease-parchment: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-slow: 500ms;
  --duration-medium: 400ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 191, 0, 0.3);
  color: var(--amber);
}

a {
  color: var(--burgundy);
  text-decoration: none;
  transition: color var(--duration-medium) var(--ease-parchment);
}

a:hover {
  color: var(--gold);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Grain Texture Overlay ---- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  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.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Navigation ---- */
.nav-bar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(19, 19, 19, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 226, 171, 0.05);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.nav-links {
  display: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-label);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(229, 226, 225, 0.5);
  transition: color var(--duration-medium) var(--ease-parchment);
  position: relative;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links a.active {
  color: var(--amber);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
}

.nav-mobile-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--amber);
  cursor: pointer;
  font-size: 1.5rem;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(24px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mobile-menu a:hover {
  color: var(--gold);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  .nav-mobile-toggle {
    display: none;
  }
}

/* ---- Section Utilities ---- */
.section {
  padding: 6rem 2rem;
}

.section--dark {
  background-color: var(--surface-lowest);
}

.section--mid {
  background-color: var(--surface-low);
}

.container {
  max-width: 72rem;
  margin: 0 auto;
}

.container--narrow {
  max-width: 48rem;
  margin: 0 auto;
}

.container--text {
  max-width: 42rem;
  margin: 0 auto;
}

/* ---- Typography ---- */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-transform: uppercase;
}

.subhead {
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-style: normal;
  color: var(--on-surface-variant);
  line-height: 1.6;
}

.label {
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
}

.label--gold { color: var(--amber); }
.label--moss { color: var(--moss); }
.label--copper { color: var(--burgundy); }

.body-text {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(229, 226, 225, 0.85);
  font-weight: 300;
}

.color-amber { color: var(--amber); }
.color-gold { color: var(--gold); }
.color-burgundy { color: var(--burgundy); }
.color-moss { color: var(--moss); }
.color-dim { color: var(--on-surface-dim); }

/* ---- Decorative Elements ---- */
.divider-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.divider-dots span {
  width: 5px;
  height: 5px;
  background: rgba(255, 191, 0, 0.3);
}

.divider-dots span:nth-child(2) {
  transform: rotate(45deg);
}

.divider-line {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 226, 171, 0.15), transparent);
  margin: 3rem 0;
}

.marginalia {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: 0.08;
}

.marginalia .material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 100;
}

/* Celtic Knotwork Border (CSS-only) */
.knotwork-border {
  border-image: repeating-linear-gradient(
    90deg,
    var(--gold) 0px,
    var(--gold) 2px,
    transparent 2px,
    transparent 6px,
    var(--copper) 6px,
    var(--copper) 8px,
    transparent 8px,
    transparent 12px
  ) 1;
  border-width: 1px;
  border-style: solid;
  opacity: 0.3;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 1rem 2.5rem;
  cursor: pointer;
  transition: all var(--duration-medium) var(--ease-parchment);
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--blood-dark);
  color: var(--burgundy);
}

.btn--primary:hover {
  background: var(--blood);
  color: #ffdad4;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(68, 71, 72, 0.3);
  color: var(--amber);
}

.btn--ghost:hover {
  border-color: var(--amber);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.6rem;
}

/* ---- Artist Cards ---- */
.artist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 640px) {
  .artist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .artist-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.artist-card {
  position: relative;
  aspect-ratio: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-parchment);
}

.artist-card:nth-child(odd) {
  background: var(--surface-low);
}

.artist-card:nth-child(even) {
  background: var(--surface);
}

.artist-card:hover {
  background: var(--surface-high);
}

.artist-card__bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-parchment);
  pointer-events: none;
}

.artist-card:hover .artist-card__bg {
  opacity: 0.15;
}

.artist-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.2);
}

.artist-card__index {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-family: var(--font-label);
  font-size: 0.625rem;
  color: rgba(255, 191, 0, 0.3);
  letter-spacing: 0.05em;
}

.artist-card__avatar {
  width: 6.5rem;
  height: 6.5rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

.artist-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 700ms var(--ease-parchment);
}

.artist-card:hover .artist-card__avatar img {
  filter: grayscale(0);
}

.artist-card__name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--amber);
  letter-spacing: -0.01em;
  position: relative;
  z-index: 2;
  text-transform: uppercase;
}

.artist-card__role {
  font-family: var(--font-label);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--moss);
  margin-top: 0.5rem;
  position: relative;
  z-index: 2;
}

/* ---- Artist Card Preview (home page) ---- */
.artist-card--preview .artist-card__avatar {
  width: 4.5rem;
  height: 4.5rem;
}
.artist-card--preview .artist-card__name {
  font-size: 1.2rem;
}
.artist-card--preview .artist-card__role {
  font-size: 0.65rem;
}

/* ---- Artist Detail (expanded) ---- */
.artist-detail {
  display: none;
  background: var(--surface-low);
  border-top: 1px solid rgba(255, 191, 0, 0.08);
  padding: 2rem;
  animation: fadeIn 400ms var(--ease-parchment);
}

.artist-detail.open {
  display: block;
}

.artist-detail__header-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  margin-bottom: 1.5rem;
  filter: contrast(1.1) brightness(0.9);
}

.artist-detail__bio {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--on-surface-variant);
  margin-bottom: 1.5rem;
}

.artist-detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.artist-detail__links a {
  font-family: var(--font-label);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-dim);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--outline-variant);
  transition: all var(--duration-medium) var(--ease-parchment);
}

.artist-detail__links a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.artist-detail__embed {
  margin-top: 1.5rem;
}

.artist-detail__embed iframe {
  max-width: 100%;
  border: none;
}

/* ---- Release Cards ---- */
.release-grid {
  display: grid;
  gap: 4rem;
}

.release-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .release-card {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .release-card:nth-child(even) {
    direction: rtl;
  }

  .release-card:nth-child(even) > * {
    direction: ltr;
  }
}

.release-card__art {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  background: var(--surface-low);
  border: 1px solid rgba(68, 71, 72, 0.1);
}

.release-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.5);
  transition: all 700ms var(--ease-parchment);
  transform: scale(1.05);
}

.release-card:hover .release-card__art img {
  filter: grayscale(0);
  transform: scale(1);
}

.release-card__art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface) 0%, transparent 50%);
  opacity: 0.6;
}

.release-card__info {
  padding-top: 1rem;
}

.release-card__number {
  font-family: var(--font-label);
  font-size: 0.6rem;
  color: var(--on-surface-dim);
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

.release-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--amber);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.release-card__desc {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--on-surface-variant);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.release-card__actions {
  display: flex;
  gap: 1rem;
}

/* ---- Codex Sections ---- */
.codex-entry {
  margin-bottom: 6rem;
}

.codex-entry__label {
  font-family: var(--font-label);
  font-size: 0.6rem;
  color: rgba(255, 191, 0, 0.4);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.codex-entry__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.codex-entry__title--amber { color: var(--amber); }
.codex-entry__title--burgundy { color: var(--burgundy); }
.codex-entry__title--moss { color: var(--moss); }

.codex-entry__body {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.9;
  color: rgba(229, 226, 225, 0.85);
  font-weight: 300;
}

.codex-entry__body p {
  margin-bottom: 1.5rem;
}

.codex-entry__body strong {
  color: var(--on-surface);
  font-weight: 500;
}

.codex-pullquote {
  border-left: 1px solid rgba(255, 191, 0, 0.2);
  padding-left: 1.5rem;
  font-style: normal;
  color: rgba(229, 226, 225, 0.6);
  margin: 2rem 0;
}

.codex-negation {
  background: var(--blood-dark);
  padding: 3rem;
  border: 1px solid rgba(255, 180, 168, 0.1);
}

.codex-negation li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 300;
  list-style: none;
}

.codex-negation li .x-mark {
  color: var(--burgundy);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ---- Philosophy Grid ---- */
.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .philosophy-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

.philosophy-grid__item h3 {
  font-family: var(--font-label);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--burgundy);
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.philosophy-grid__item p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--on-surface-variant);
  line-height: 1.7;
  font-weight: 300;
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 64rem;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero__eyebrow-line {
  height: 1px;
  width: 3rem;
  background: rgba(255, 226, 171, 0.3);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.hero__title em {
  font-style: normal;
  color: var(--burgundy);
  font-family: var(--font-display);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-style: normal;
  color: var(--on-surface-variant);
  line-height: 1.6;
  max-width: 40rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  opacity: 0.12;
  filter: blur(80px);
  background: radial-gradient(ellipse at center, rgba(32, 0, 0, 0.8), transparent 60%);
  pointer-events: none;
}

/* ---- Events Section ---- */
.event-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(68, 71, 72, 0.1);
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .event-item {
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
  }
}

.event-item__date {
  flex-shrink: 0;
  width: 8rem;
}

.event-item__date-day {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--amber);
}

.event-item__date-year {
  font-family: var(--font-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--on-surface-variant);
}

.event-item__info {
  flex-grow: 1;
}

.event-item__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  transition: color var(--duration-medium) var(--ease-parchment);
}

.event-item:hover .event-item__title {
  color: var(--burgundy);
}

.event-item__desc {
  color: var(--on-surface-variant);
  font-size: 1rem;
  max-width: 36rem;
}

/* ---- Contact ---- */
.contact-role {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(68, 71, 72, 0.1);
}

.contact-role__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
  margin-bottom: 0.5rem;
}

.contact-role__email {
  font-family: var(--font-label);
  font-size: 1.15rem;
  color: var(--on-surface-variant);
}

.contact-role__email a {
  color: var(--burgundy);
}

/* ---- Footer ---- */
.footer {
  width: 100%;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  background: var(--bg);
  border-top: 1px solid rgba(255, 226, 171, 0.08);
}

@media (min-width: 768px) {
  .footer {
    flex-direction: row;
    justify-content: space-between;
    padding: 4rem 3rem;
  }
}

.footer__brand {
  text-align: center;
}

@media (min-width: 768px) {
  .footer__brand {
    text-align: left;
  }
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__copy {
  font-family: var(--font-label);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(229, 226, 225, 0.3);
  margin-top: 0.5rem;
}

.footer__links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: rgba(229, 226, 225, 0.35);
  transition: color var(--duration-slow) var(--ease-parchment);
}

.footer__links a:hover {
  color: var(--burgundy);
}

.footer__meta {
  font-family: var(--font-label);
  font-size: 0.6rem;
  color: rgba(229, 226, 225, 0.2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.08; }
  50% { opacity: 0.15; }
}

.fade-in {
  animation: fadeIn 600ms var(--ease-parchment) forwards;
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mt-8 { margin-top: 4rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 3rem; }
.pb-0 { padding-bottom: 0; }
.pt-8 { padding-top: 4rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ============================================
   VISUAL EFFECTS
   ============================================ */

/* ---- Glitch Text ---- */
[data-glitch] {
  position: relative;
}

[data-glitch]::before,
[data-glitch]::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

[data-glitch]::before {
  color: var(--burgundy-deep);
}

[data-glitch]::after {
  color: #4a7a8a;
}

[data-glitch].glitch-active::before {
  opacity: 0.8;
  animation: glitch-1 0.3s steps(2) both;
}

[data-glitch].glitch-active::after {
  opacity: 0.6;
  animation: glitch-2 0.3s steps(3) both;
}

@keyframes glitch-1 {
  0%   { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 1px); }
  25%  { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
  50%  { clip-path: inset(40% 0 30% 0); transform: translate(-1px, 2px); }
  75%  { clip-path: inset(10% 0 70% 0); transform: translate(3px, -2px); }
  100% { clip-path: inset(50% 0 20% 0); transform: translate(-2px, 1px); }
}

@keyframes glitch-2 {
  0%   { clip-path: inset(70% 0 5% 0); transform: translate(3px, -1px); }
  33%  { clip-path: inset(15% 0 55% 0); transform: translate(-2px, 2px); }
  66%  { clip-path: inset(45% 0 25% 0); transform: translate(1px, -2px); }
  100% { clip-path: inset(5% 0 75% 0); transform: translate(-3px, 1px); }
}

/* ---- Scroll Reveals ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-parchment), transform 0.7s var(--ease-parchment);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 500ms; }

/* ---- Particle Canvas ---- */
.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
}

/* ---- Mycelium Canvas ---- */
#mycelium-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Knotwork SVGs ---- */
.knotwork-svg {
  display: block;
  margin: 3rem auto;
  overflow: visible;
}

.knot-draw {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 640px) {
  [data-glitch].glitch-active::before,
  [data-glitch].glitch-active::after {
    transform: translate(-1px, 1px);
  }
}
