/* ===========================
   RESET & BASE
   =========================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Inspired by Storke Tower */
  --color-cream: #F8E3AF;
  --color-gold: #DAB452;
  --color-dark-gold: #9A7311;
  --color-black: #000000;
  --color-brown: #7A5A3A;
  --color-taupe: #5E5141;
  --color-grey-brown: #8C7152;
  --color-white: #FFFFFF;

  /* Accent colors */
  --accent-primary: var(--color-gold);
  --accent-secondary: var(--color-brown);
  --accent-tertiary: var(--color-cream);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--color-black);
  color: var(--color-white);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  line-height: 1.3;
  overflow-x: hidden;
}

/* noise texture removed for scroll performance */

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-tertiary);
}

img {
  max-width: 100%;
  display: block;
}

/* ===========================
   HEADER
   =========================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background-color: var(--color-cream);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 1001;
}

.section-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  padding: 4px;
  margin-left: auto;
  color: #1e1e1e;
  z-index: 1001;
}

.section-menu-toggle svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-menu-toggle.active {
  color: var(--accent-primary);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #1e1e1e;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.logo {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e1e1e;
  margin-left: 20px;
  letter-spacing: 0.5px;
}

.logo:hover {
  color: #1e1e1e;
}

.header-nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.header-nav a {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e1e1e;
}

.header-nav a:hover {
  color: var(--accent-primary);
}

/* ===========================
   SIDEBAR
   =========================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  background: #ffffff;
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
  overflow-y: auto;
  padding: 80px 32px 32px;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar--sections {
  left: auto;
  right: 0;
  transform: translateX(100%);
}

.sidebar--sections.active {
  transform: translateX(0);
}

.sidebar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #1e1e1e;
  cursor: pointer;
  line-height: 1;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b39809;
  border-bottom: 2px solid #ffefb6;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.sidebar-section a {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1rem;
  color: #1e1e1e;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: padding-left 0.2s ease, color 0.2s ease;
}

.sidebar-section a:hover {
  padding-left: 8px;
  color: var(--accent-primary);
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #1a1a2e 100%);
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  padding: 0 24px;
}

.hero-category {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 16px;
}

.hero-title {
  font-family: Georgia, "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.hero-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 28px 14px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, transparent 100%);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
  user-select: text;
  -webkit-user-select: text;
}

/* ===========================
   ARTICLE
   =========================== */
.article {
  padding: 60px 24px 0;
}

.article-container {
  max-width: 720px;
  margin: 0 auto;
}

/* Byline */
.byline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 20px;
  margin-bottom: 40px;
}

.byline-author {
  display: block;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.byline-date {
  display: block;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.byline-share {
  display: flex;
  gap: 8px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

/* Body Text */
.article-body p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
}

/* Pull Quotes */
.pull-quote {
  margin: 56px 0;
  padding: 0;
}

.pull-quote p {
  font-family: Georgia, "Playfair Display", serif;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.6;
  color: #ffffff;
  margin-bottom: 12px !important;
}

.pull-quote cite {
  display: block;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

/* Section Headings */
.section-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

/* Charts */
.chart-section {
  margin: 48px 0 56px;
}

.chart-description {
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
  margin-bottom: 24px !important;
  line-height: 1.5 !important;
}

.chart-wrapper {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 24px;
  margin-bottom: 8px;
}

/* Article Figure */
.article-figure {
  position: relative;
  overflow: hidden;
  margin: 48px 0;
}

.figure-placeholder {
  width: 100%;
  height: 400px;
  background: linear-gradient(145deg, #2a2a3e, #1a1a2e);
  display: flex;
  align-items: center;
  justify-content: center;
}

.figure-placeholder span {
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.article-figure figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin: 0;
}

/* ===========================
   SCROLL REVEAL (scroll-driven)
   =========================== */
.reveal-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ===========================
   INTRO — Storke Tower Fly-In
   =========================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  perspective: 700px;
  perspective-origin: 50% calc(5vh + 92px);

  /* Sky only — clouds are in separate divs for parallax */
  background:
    /* Subtle vignette */
    radial-gradient(ellipse at top center,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.04) 25%,
      transparent 60%
    ),
    /* Main sky gradient */
    linear-gradient(
      to bottom,
      #4a7cb8 0%,
      #5a8cc2 15%,
      #6b9dcc 30%,
      #7cadd6 45%,
      #92bde0 58%,
      #a8cde8 68%,
      #c4d4e2 76%,
      #d8c8a8 84%,
      #b8a082 90%,
      #8a755b 100%
    );

  font-family: system-ui, sans-serif;
}

/* Shared cloud layer base styles */
.intro-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
  z-index: 1;
}

/* High-altitude cirrus — long broad streaks with wispy tails */
.intro-clouds--high {
  background:
    /* Cloud 1: large left streak cluster */
    radial-gradient(ellipse 480px 60px at 18% 7%,
      rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.16) 40%,
      rgba(255, 255, 255, 0.03) 68%, transparent 85%
    ),
    radial-gradient(ellipse 300px 35px at 15% 10%,
      rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.10) 50%,
      transparent 78%
    ),
    radial-gradient(ellipse 200px 25px at 24% 13%,
      rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 55%,
      transparent 80%
    ),
    /* Cloud 2: large right streak cluster */
    radial-gradient(ellipse 520px 55px at 76% 9%,
      rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.14) 42%,
      rgba(255, 255, 255, 0.03) 68%, transparent 85%
    ),
    radial-gradient(ellipse 320px 32px at 80% 14%,
      rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 52%,
      transparent 80%
    ),
    /* Cloud 3: upper-right puff */
    radial-gradient(ellipse 220px 80px at 88% 19%,
      rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.10) 42%,
      transparent 72%
    );
}

/* Mid-level cumulus — big puffy masses built from overlapping ellipses */
.intro-clouds--mid {
  background:
    /* New: small left puff to sit closer to the tower (additional subtle mass) */
    radial-gradient(ellipse 110px 60px at 6% 30%,
      rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.14) 38%, transparent 70%
    ),
    /* Cloud A: large left cumulus mass */
    radial-gradient(ellipse 280px 120px at 12% 28%,
      rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.18) 30%,
      rgba(255, 255, 255, 0.05) 60%, transparent 80%
    ),
    radial-gradient(ellipse 200px 90px at 18% 32%,
      rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 40%,
      transparent 70%
    ),
    radial-gradient(ellipse 160px 70px at 8% 34%,
      rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 48%,
      transparent 75%
    ),
    /* Cloud B: large right cumulus mass */
    radial-gradient(ellipse 300px 130px at 82% 30%,
      rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.16) 32%,
      rgba(255, 255, 255, 0.04) 62%, transparent 82%
    ),
    radial-gradient(ellipse 220px 95px at 88% 35%,
      rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.10) 42%,
      transparent 72%
    ),
    /* Cloud C: center-right mid cloud */
    radial-gradient(ellipse 240px 110px at 58% 33%,
      rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.13) 35%,
      rgba(255, 255, 255, 0.03) 62%, transparent 82%
    ),
    radial-gradient(ellipse 160px 80px at 64% 37%,
      rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 45%,
      transparent 75%
    ),
    /* Broad atmospheric haze band */
    radial-gradient(ellipse 700px 55px at 50% 46%,
      rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 48%,
      transparent 80%
    ),
    radial-gradient(ellipse 400px 45px at 20% 50%,
      rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 55%,
      transparent 85%
    ),
    radial-gradient(ellipse 450px 50px at 78% 49%,
      rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 52%,
      transparent 82%
    );
}

.intro-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) translateZ(0px) scale(1);
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
}

.intro-title-main {
  display: block;
  font-size: clamp(1.6rem, 7.5vw, 6.25rem);
  font-weight: 900;
  font-family: "Merriweather", "Roboto Slab", serif;
  letter-spacing: 0.04em;
  line-height: 1.05;

  /* Rusty gold fill */
  color: #c8872a;

  /* Layered text-shadow for the "popping out" 3D outline effect */
  text-shadow:
    /* crisp dark outline */
    -1px -1px 0   #2a1600,
     1px -1px 0   #2a1600,
    -1px  1px 0   #2a1600,
     1px  1px 0   #2a1600,
    /* mid rusty-amber extrusion — gives the 3D depth */
     2px  2px 0   #7a3d08,
     3px  3px 0   #6b3507,
     4px  4px 0   #5c2d06,
     5px  5px 0   #4d2505,
    /* warm drop shadow */
     6px  8px 14px rgba(20, 8, 0, 0.75),
     2px  4px 22px rgba(200, 120, 20, 0.25);
}

.intro-title-sub {
  display: block;
  font-size: clamp(0.65rem, 2.2vw, 1.4rem);
  font-weight: 400;
  font-style: italic;
  font-family: "Merriweather", "Roboto Slab", serif;
  letter-spacing: 0.12em;
  line-height: 1.2;

  /* Slightly cooler, more muted gold for contrast with the main title */
  color: #e8b86a;

  text-shadow:
    -1px -1px 0   rgba(30, 12, 0, 0.8),
     1px -1px 0   rgba(30, 12, 0, 0.8),
    -1px  1px 0   rgba(30, 12, 0, 0.8),
     1px  1px 0   rgba(30, 12, 0, 0.8),
     2px  2px 5px rgba(10, 4, 0, 0.6),
     0    3px 18px rgba(200, 130, 30, 0.2);
}

.intro-camera {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.intro-tower-clip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.intro-tower {
  position: absolute;
  top: 0;
  left: 50%;
  width: 90px;
  height: 680px;
  transform-style: preserve-3d;
  /* perspective-origin on overlay targets the carillonist position. */
  transform: translate(-50%, 10px);
  transform-origin: top center;  /* JS scale anchors here so ground stays in clip */
  will-change: transform;
}

/* --- Tower faces --- */
.intro-face {
  position: absolute;
  width: 90px;
  height: 680px;
}

.intro-front {
  position: relative; /* allow ::before positioning */
  transform: translateZ(45px);
  background:
    /* Weathering: vertical water staining from rain runoff */
    linear-gradient(to bottom,
      transparent 0px, transparent 180px,
      rgba(150, 135, 110, 0.04) 240px,
      rgba(145, 130, 105, 0.06) 540px,
      rgba(140, 125, 100, 0.04) 680px,
      transparent 680px
    ),
    /* Weathering: subtle darker patches from age */
    radial-gradient(ellipse 40px 100px at 28px 360px, rgba(0,0,0,0.025), transparent),
    radial-gradient(ellipse 35px 80px at 58px 620px, rgba(0,0,0,0.02), transparent),
    radial-gradient(ellipse 28px 65px at 18px 640px, rgba(0,0,0,0.018), transparent),
    /* Vertical ribs — thin concrete fins between horizontal bands */
    repeating-linear-gradient(
      to right,
      transparent 0, transparent 4.5px,
      rgba(0,0,0,0.03) 4.5px,
      rgba(60, 50, 35, 0.07) 5.2px,
      rgba(0,0,0,0.03) 5.9px,
      transparent 5.9px, transparent 10px
    ),
    /* Vertical rib highlight (light catching the raised edge) */
    repeating-linear-gradient(
      to right,
      transparent 0, transparent 4px,
      rgba(255,255,240,0.04) 4px,
      rgba(255,255,240,0.02) 4.5px,
      transparent 4.5px, transparent 10px
    ),
    /* Edge ambient occlusion for depth */
    linear-gradient(
      to right,
      rgba(0,0,0,0.07) 0%,
      rgba(0,0,0,0.02) 10%,
      transparent 22%,
      transparent 78%,
      rgba(0,0,0,0.02) 90%,
      rgba(0,0,0,0.05) 100%
    ),
    /* Vertical darkening toward base (atmospheric) */
    linear-gradient(
      to bottom,
      rgba(0,0,0,0) 0%,
      rgba(0,0,0,0.01) 50%,
      rgba(0,0,0,0.04) 100%
    ),
    /* Base warm concrete — extended stops for smoother tone shift */
    linear-gradient(to bottom,
      #ddd1b9 0%, #dccfb5 12%, #d9ccb0 24%,
      #d6c9ab 36%, #d4c6a6 48%, #d1c3a2 60%,
      #cfc09e 72%, #ccbd9a 84%, #c9ba96 100%
    );
  border: 1px solid rgba(80, 65, 45, 0.18);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.03),
    inset 3px 0 8px rgba(255, 250, 230, 0.07),
    inset -3px 0 8px rgba(0, 0, 0, 0.05);
}

/* 7 equidistant horizontal joints: starting exactly below belfry */
.intro-front::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;

  /* tower: 0–680, belfry: 0–155
     band from 155px to 615px => height 460px
     7 joints => spacing ≈ 76.67px
     joints at: 155, 231.67, 308.33, 385, 461.67, 538.33, 615 */
  top: 155px;
  height: 462px;  /* 460 + 2px so the 7th line at 460px isn't edge-clipped */

  pointer-events: none;

  /* 7 equidistant joints, thinner line for subtlety */
  background: repeating-linear-gradient(
    to bottom,
    rgba(80, 60, 40, 0.8) 0px,
    rgba(80, 60, 40, 0.8) 1px,  /* was 2px */
    transparent 1px,            /* was 2px */
    transparent 76.67px
  );

  /* slightly softer halo so lines feel finer */
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.02),
    0 0 0.5px rgba(0, 0, 0, 0.4);

  opacity: 1;
}

/* --- Belfry section (flush with shaft) --- */
.intro-belfry {
  position: relative; /* ensure pseudo-elements are positioned relative to the belfry */
  top: 0;
  left: 0;
  right: 0;
  height: 155px;
  background:
    /* Edge ambient occlusion */
    linear-gradient(
      to right,
      rgba(0,0,0,0.06) 0%,
      transparent 15%,
      transparent 85%,
      rgba(0,0,0,0.04) 100%
    ),
    /* Matching concrete */
    linear-gradient(to bottom,
      #ddd1b9 0%, #dccfb6 50%, #d9ccb1 100%
    );
  border: 1px solid rgba(80, 65, 45, 0.18);
  border-top: 2px solid rgba(100, 85, 62, 0.35);
  border-bottom: none;
  z-index: 1;
  box-shadow:
    0 -1px 3px rgba(0, 0, 0, 0.08),
    inset 0 0 20px rgba(0, 0, 0, 0.03),
    inset 3px 0 6px rgba(255, 250, 230, 0.06),
    inset -3px 0 6px rgba(0, 0, 0, 0.04);
  overflow: hidden; /* already present — keep to clip marks to the beige area */
}

.intro-belfry::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  pointer-events: none;
  z-index: 0;

  /* Draw the short horizontal ticks (window-side tiles) on top,
     then paint the full-height vertical micro-strokes underneath.
     This ordering prevents vertical strokes from visually crossing the horizontals. */
  background-image:
    /* Six narrow window tiles that draw short horizontal ticks confined to the window band (top-most) */
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 18px
    ),

    /* NEW: fine horizontal micro-grid across the beige belfry
       — 1px hairlines every 10px (matches vertical stroke spacing) */
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.06) 0px,
      rgba(80,60,40,0.06) 1px,
      transparent 1px,
      transparent 10px
    ),

    /* NEW: thin horizontal line aligned to the bottom of the windows (window bottom at 22px + 120px = 142px).
       This sits underneath the window ticks (so it won't visually clash) and spans the full width of the beige belfry. */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px
    ),

    /* Vertical micro-strokes as individually positioned 1px columns.
       All columns use a "split" band (transparent 22px → 142px) so they do not
       intersect the short horizontal ticks drawn by the window tiles above. */

    /* x = 6px  (closest to the left) - split across window band */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 16px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 26px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 36px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 46px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 56px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 66px (third from right) - split across window band */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 76px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    ),

    /* x = 86px */
    linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 22px,
      transparent 22px,
      transparent 142px,
      rgba(80,60,40,0.62) 142px,
      rgba(80,60,40,0.62) 100%
    );

  background-size:
    18px 120px, 18px 120px, 18px 120px, 18px 120px, 18px 120px, 18px 120px,
    100% 100%,    /* fine horizontal micro-grid covering the beige belfry */
    100% 1px,     /* single bottom-of-window hairline */
    1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%;

  /* positions: window tiles positioned at the window top (22px),
     micro-grid anchors at 0, bottom line at the window bottom (142px),
     vertical stroke columns positioned at explicit X offsets */
  background-position:
    0px 22px, 27px 22px, 30px 22px, 52px 22px, 55px 22px, 77px 22px,
    0px 0px,     /* micro-grid covers the belfry element */
    0px 142px,   /* new horizontal line */
    6px 0, 16px 0, 26px 0, 36px 0, 46px 0, 56px 0, 66px 0, 76px 0, 86px 0;

  /* none of these layers should repeat beyond the element */
  background-repeat:
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat,
    no-repeat,
    no-repeat,
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

.intro-belfry::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  pointer-events: none;
  z-index: 0;

  /* Only keep the tiny right-edge fallback column here.
     The full-height vertical grid is painted once in ::before so each
     vertical stroke remains continuous from top to bottom. */
  background-image:
    /* tiny right-edge fallback column (in case of clipping) */
    repeating-linear-gradient(
      to bottom,
      rgba(80,60,40,0.62) 0px,
      rgba(80,60,40,0.62) 1px,
      transparent 1px,
      transparent 16px
    );

  background-size:
    12px 100%;

  /* place the fallback column flush to the right edge */
  background-position:
    calc(100% - 12px) 0;

  background-repeat: repeat-y;
}

/* --- Belfry base ledge (shaft-to-belfry transition) --- */
.intro-belfry-ledge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    to bottom,
    rgba(190, 175, 150, 0.5) 0%,
    rgba(165, 150, 125, 0.6) 40%,
    rgba(145, 130, 105, 0.4) 100%
  );
  z-index: 2;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 1px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* --- Base arch (entrance opening) --- */
.intro-base {
  position: absolute;
  top: 640px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
}

.intro-base-arch {
  width: 50px;
  height: 40px;
  background: linear-gradient(to bottom,
    #1a1a18 0%,
    #0e0e0c 40%,
    #080807 100%
  );
  border-radius: 25px 25px 0 0;
  box-shadow:
    inset 0 4px 10px rgba(0, 0, 0, 0.9),
    inset 3px 0 5px rgba(0, 0, 0, 0.5),
    inset -3px 0 5px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(70, 58, 40, 0.25);
}

/* --- Arched windows --- */
.intro-windows {
  position: absolute;
  top: 22px;
  left: 11px; /* shifted slightly left so windows/carillonist sit more centrally */
  width: 66px;
  height: 120px;
  display: flex;
  justify-content: space-between;
  z-index: 1;
}

.intro-window {
  width: 16px;
  height: 120px;
  background: linear-gradient(to bottom,
    #1a1a18 0%,
    #121210 15%,
    #0a0a08 40%,
    #060605 70%,
    #040403 100%
  );
  border-radius: 8px 8px 2px 2px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 4px 14px rgba(0, 0, 0, 0.95),
    inset 3px 0 6px rgba(0, 0, 0, 0.6),
    inset -3px 0 6px rgba(0, 0, 0, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4),
    0 0 0 1.5px rgba(70, 58, 40, 0.3),
    0 0 0 3px rgba(200, 185, 160, 0.12);
}

/* Louver bars inside windows */
.intro-louvers {
  position: absolute;
  inset: 10px 1px 4px 1px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 4px,
    rgba(110, 95, 72, 0.12) 4px,
    rgba(85, 72, 52, 0.28) 5.5px,
    rgba(110, 95, 72, 0.10) 6.5px,
    transparent 7px
  );
  pointer-events: none;
}

.intro-window.intro-middle {
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 1),
    0 0 18px rgba(255, 255, 255, 0.35),
    0 0 0 1.5px rgba(70, 58, 40, 0.3),
    0 0 0 3px rgba(200, 185, 160, 0.12);
}

/* --- Glow effect --- */
.intro-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 38%,
    rgba(255, 215, 140, 0.60) 0%,
    rgba(255, 185, 110, 0.44) 28%,
    rgba(130, 95, 60, 0.38) 42%,
    rgba(40, 30, 20, 0.80) 56%,
    rgba(0, 0, 0, 1) 66%
  );
  /* filter: blur removed — runs on GPU in 3D context and causes major lag */
  opacity: 0;
  /* transition removed — JS drives opacity every rAF frame */
  pointer-events: none;
  will-change: opacity;
  z-index: 1;
}

/* --- Carillonist silhouette --- */
.intro-carillonist {
  position: absolute;
  bottom: -25px;
  left: 50%;
  width: 50px;
  height: 90px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.intro-carillonist svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: bottom center;
  animation: intro-pop 1s ease-in-out infinite alternate;
}

.intro-carillonist-img {
  width: 100%;             /* controlled by container; keeps natural raster size */
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimizeQuality;
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes intro-pop {
  0%   { transform: scale(0.88); }
  100% { transform: scale(0.95); }
}

/* --- Blackout & controls --- */
.intro-blackout {
  position: absolute;
  inset: 0;
  background: black;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  will-change: opacity;
}

.intro-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  z-index: 50;
  opacity: 1;
  transition: opacity 0.6s ease;
  animation: intro-bob 2s ease-in-out infinite;
}

@keyframes intro-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}

/* --- Platform / Plaza base --- */
.intro-plaza {
  position: absolute;
  top: 676px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-plaza-upper {
  width: 160px;
  height: 10px;
  background: linear-gradient(to bottom,
    #c9bd9f 0%, #bfb393 50%, #b5a889 100%
  );
  border: 1px solid rgba(80, 65, 45, 0.18);
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.intro-plaza-lower {
  width: 260px;
  height: 12px;
  margin-top: -1px;
  background: linear-gradient(to bottom,
    #c0b48a 0%, #b5a880 50%, #a99c76 100%
  );
  border: 1px solid rgba(80, 65, 45, 0.2);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* --- Landscaping trees --- */
.intro-tree {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: center bottom;
}

.intro-tree-canopy {
  width: 26px;
  height: 34px;
  background: radial-gradient(ellipse at 50% 55%,
    #4a6a38 0%, #3a5a28 35%, #2a4a1a 65%, #1a3a0e 100%
  );
  border-radius: 50% 50% 42% 42%;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.3),
    inset 0 -4px 8px rgba(0, 0, 0, 0.15),
    inset 3px 3px 6px rgba(90, 120, 60, 0.2);
}

.intro-tree-trunk {
  width: 4px;
  height: 12px;
  background: linear-gradient(to bottom,
    #6a5a3a 0%, #5a4a2a 100%
  );
  border-radius: 0 0 1px 1px;
  margin-top: -3px;
}

.intro-tree-l1 {
  top: 654px;
  left: 50%;
  transform: translateX(calc(-50% - 80px));
}

.intro-tree-r1 {
  top: 656px;
  left: 50%;
  transform: translateX(calc(-50% + 82px));
}

.intro-tree-l2 {
  top: 654px;
  left: 50%;
  transform: translateX(calc(-50% - 135px)) scale(0.75);
}

.intro-tree-r2 {
  top: 654px;
  left: 50%;
  transform: translateX(calc(-50% + 138px)) scale(0.8);
}

/* --- Ground plane --- */
.intro-ground {
  position: absolute;
  top: 697px;
  left: 50%;
  width: 120vw;
  transform: translateX(-50%);
  height: 200px;

  background: linear-gradient(to bottom,
      #5c6a38 0px,
      #4a5a2d 12px,
      #3a4d28 24px,
      #2a4a1a 36px,
      #1e3212 60px,
      #1e3212 200px
    );
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

/* --- Intro responsive --- */
/* clamp() handles most sizing; media queries cover layout/overflow edge cases */
@media (max-width: 768px) {
  .intro-title {
    white-space: normal;
    text-align: center;
    width: 88%;
    line-height: 1.15;
  }

  .intro-scroll-hint {
    bottom: max(env(safe-area-inset-bottom, 0px), 20px);
    padding-bottom: 12px;
    font-size: 0.75rem;
  }
}

/* Landscape mobile: viewport too short for full tower — tighten clip height */
@media (orientation: landscape) and (max-height: 520px) {
  .intro-tower-clip {
    height: 100svh;
  }

  .intro-title {
    white-space: normal;
    text-align: center;
    width: 80%;
    font-size: clamp(1.2rem, 5.5vw, 3rem);
    line-height: 1.1;
  }

  .intro-scroll-hint {
    bottom: max(env(safe-area-inset-bottom, 0px), 12px);
    font-size: 0.7rem;
  }
}

