/* ============================================================
   ĒSELA PERAHĀRA — style.css
   ============================================================ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,500&family=Spectral:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── Design tokens ── */
:root {
  --feature:      #94271F;
  --feature-deep: #7A1E18;
  --accent:       #E0A828;
  --ochre:        #C8881F;
  --cream:        #F2E8D0;
  --ivory:        #FBF6EA;
  --indigo:       #2E4A7A;
  --ink:          #3A2A1E;
  --grain:        0.06;
}

/* ── Animation ── */
@keyframes kepRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ── Selection ── */
::selection {
  background: var(--accent);
  color: var(--ink);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Spectral', Georgia, serif;
  min-height: 100vh;
}

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

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

/* Paper grain overlay — SVG fractalNoise, very subtle */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Screen-reader utility */
.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;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ivory);
  border-bottom: 1px solid rgba(58, 42, 30, .08);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 13px clamp(18px, 5vw, 44px);
  display: flex;
  align-items: center;
  gap: 32px;
  position: relative;
}

/* Brand */
.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex-shrink: 0;
}

.site-brand__name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(18px, 4.2vw, 25px);
  color: var(--feature);
  letter-spacing: -0.01em;
}

.site-brand__tagline {
  font-family: 'Spectral', Georgia, serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #8a6a4a;
  margin-top: 2px;
}

/* Desktop nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.site-nav__link {
  font-family: 'Spectral', Georgia, serif;
  font-size: 16px;
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
  transition: color .18s;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--feature);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--feature);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav__cta {
  font-family: 'Spectral', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ivory);
  background: var(--feature);
  padding: 8px 20px;
  border-radius: 3px;
  white-space: nowrap;
  transition: background .18s;
}

.site-nav__cta:hover {
  background: var(--feature-deep);
}

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 2.png scroll strip below header bar */
.header-scroll {
  height: 34px;
  background: url('images/2.png') repeat-x center / auto 100%;
  box-shadow: 0 4px 12px rgba(58, 42, 30, .14);
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: var(--feature);
  color: var(--ivory);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle radial gold highlight */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(224, 168, 40, .13) 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(56px, 11vw, 108px) clamp(22px, 6vw, 44px);
  animation: kepRise .7s ease-out both;
}

.hero__eyebrow {
  font-family: 'Spectral', Georgia, serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 22px;
}

.hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(40px, 9.2vw, 82px);
  color: var(--accent);
  line-height: 1.02;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .22);
  margin-bottom: 28px;
}

.hero__lede {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(17px, 3vw, 21px);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 40px;
  color: var(--ivory);
}

.hero__cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: 'Spectral', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 3px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
}

.btn--accent {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}

.btn--accent:hover {
  background: var(--ochre);
  border-color: var(--ochre);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--outline:hover {
  background: rgba(224, 168, 40, .12);
}


/* ============================================================
   FEATURE PANEL  (4.png procession image)
   ============================================================ */

.feature-panel {
  background: var(--feature-deep);
}

/* 2.png scroll strips — top and bottom */
.feature-panel__scroll {
  height: 30px;
  background: url('images/2.png') repeat-x center / auto 100%;
}

.feature-panel__figure {
  margin: 0;
}

.feature-panel__img {
  width: 100%;
  height: auto;
  display: block;
}

.feature-panel__figcaption {
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: var(--cream);
  text-align: center;
  padding: 20px clamp(22px, 6vw, 44px);
  opacity: .88;
}


/* ============================================================
   READING SECTION
   ============================================================ */

.reading {
  background: var(--cream);
  padding: clamp(56px, 11vw, 100px) clamp(22px, 6vw, 40px);
}

.reading__inner {
  max-width: 1080px;
  margin: 0 auto;
}

.reading__text {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}

/* 3.png lotus roundel — circular, centered */
.lotus {
  display: block;
  width: clamp(66px, 15vw, 92px);
  height: clamp(66px, 15vw, 92px);
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 32px;
  box-shadow:
    0 4px 24px rgba(58, 42, 30, .18),
    0 0 0 3px rgba(200, 136, 31, .22);
}

/* Section heading set */
.section-eyebrow {
  font-family: 'Spectral', Georgia, serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 14px;
}

.section-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(30px, 6.4vw, 50px);
  color: var(--feature);
  line-height: 1.08;
  margin-bottom: 22px;
}

.section-body {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(17px, 2.6vw, 19px);
  line-height: 1.78;
  color: var(--ink);
}

.section-body + .section-body { margin-top: 1.2em; }


/* ============================================================
   CARD GRID
   ============================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: clamp(18px, 3vw, 26px);
}

.card {
  background: var(--ivory);
  border: 1px solid rgba(200, 136, 31, .45);
  border-radius: 6px;
  padding: clamp(26px, 4vw, 34px);
  box-shadow: 0 8px 26px rgba(58, 42, 30, .08);
}

.card__numeral {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 34px;
  color: var(--feature);
  margin-bottom: 10px;
  line-height: 1;
}

.card__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(21px, 3.4vw, 25px);
  color: var(--feature);
  line-height: 1.2;
  margin-bottom: 14px;
}

.card__body {
  font-family: 'Spectral', Georgia, serif;
  font-size: 16px;
  line-height: 1.68;
  color: var(--ink);
  margin-bottom: 20px;
}

.card__link {
  font-family: 'Spectral', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--indigo);
  transition: color .15s;
}

.card__link:hover {
  color: var(--feature);
}


/* ============================================================
   ARCH DIVIDER  (1.png row of figures under arches)
   ============================================================ */

.arch-divider {
  width: 100%;
  height: clamp(118px, 26vw, 196px);
  background: url('images/1.png') repeat-x center / auto 100%;
  box-shadow:
    inset 0 8px 20px rgba(58, 42, 30, .12),
    inset 0 -8px 20px rgba(58, 42, 30, .10);
}


/* ============================================================
   QUOTE FEATURE
   ============================================================ */

.quote-feature {
  background: var(--feature);
  color: var(--ivory);
  text-align: center;
  padding: clamp(56px, 10vw, 96px) clamp(22px, 8vw, 80px);
  position: relative;
  overflow: hidden;
}

/* Radial gold glow */
.quote-feature::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(224, 168, 40, .15) 0%, transparent 70%);
  pointer-events: none;
}

/* 54×2 gold rule */
.quote-feature__rule {
  width: 54px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 36px;
  position: relative;
}

.quote-feature__text {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(24px, 5vw, 40px);
  color: var(--accent);
  line-height: 1.28;
  max-width: 780px;
  margin: 0 auto 32px;
  position: relative;
}

.quote-feature__attribution {
  font-family: 'Spectral', Georgia, serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cream);
  font-style: normal;
  position: relative;
}


/* ============================================================
   INFO-CARD GRID  (Plan Your Visit)
   ============================================================ */

.info-section {
  background: var(--ivory);
  padding: clamp(56px, 11vw, 100px) clamp(22px, 6vw, 40px);
}

.info-section__inner {
  max-width: 1080px;
  margin: 0 auto;
}

.info-section__head {
  text-align: center;
  margin-bottom: 48px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(18px, 3vw, 26px);
}

.info-card {
  background: var(--ivory);
  border: 1px solid var(--ochre);
  border-radius: 6px;
  padding: 24px;
}

.info-card__label {
  font-family: 'Spectral', Georgia, serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 8px;
}

.info-card__value {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 6px;
}

.info-card__note {
  font-family: 'Spectral', Georgia, serif;
  font-size: 14px;
  color: #5A4636;
  line-height: 1.55;
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--feature-deep);
  color: var(--ivory);
}

/* 2.png strip on top */
.footer-scroll {
  height: 32px;
  background: url('images/2.png') repeat-x center / auto 100%;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 80px) clamp(22px, 6vw, 44px) clamp(36px, 6vw, 56px);
  text-align: center;
}

.footer__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(22px, 5vw, 34px);
  color: var(--accent);
  margin-bottom: 12px;
}

.footer__tagline {
  font-family: 'Spectral', Georgia, serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 36px;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin-bottom: 36px;
}

.footer__nav-link {
  font-family: 'Spectral', Georgia, serif;
  font-size: 15px;
  color: var(--ivory);
  transition: color .15s;
}

.footer__nav-link:hover {
  color: var(--accent);
}

.footer__divider {
  width: 80px;
  height: 1px;
  background: rgba(240, 232, 208, .22);
  margin: 0 auto 28px;
}

.footer__fine {
  font-family: 'Spectral', Georgia, serif;
  font-size: 14px;
  color: var(--cream);
  opacity: .78;
  line-height: 1.6;
}


/* ============================================================
   RESPONSIVE  — mobile-first, breakpoint at 800px
   ============================================================ */

@media (max-width: 800px) {

  /* Show hamburger, hide nav by default */
  .hamburger {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px clamp(18px, 5vw, 44px) 28px;
    gap: 0;
    border-bottom: 3px solid rgba(148, 39, 31, .15);
    box-shadow: 0 8px 24px rgba(58, 42, 30, .12);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav__link {
    padding: 10px 0;
    width: 100%;
    font-size: 17px;
    border-bottom: 1px solid rgba(58, 42, 30, .07);
  }

  .site-nav__cta {
    margin-top: 14px;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
  }

  /* Tighter hero on small screens */
  .hero__cta-group {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}


/* ============================================================
   PROCESSION PAGE — Timeline & Acts
   ============================================================ */

.procession-timeline {
  position: relative;
  max-width: 760px;
  margin: 48px auto 0;
}

/* Full-height muted track behind the advancing fill */
.procession-line-track {
  position: absolute;
  left: 16px;        /* centers 4px line within the 36px node column */
  top: 18px;
  bottom: 18px;
  width: 4px;
  background: rgba(200, 136, 31, .14);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}

/* Gold fill — height driven by JS scroll progress */
.procession-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(to bottom, var(--accent), var(--ochre));
  border-radius: 2px;
  transition: height .55s ease;
  will-change: height;
}

/* Each act: node column + body column */
.act {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 28px;
  padding-bottom: 52px;
}

.act:last-child { padding-bottom: 0; }

/* Round numbered node — sits on the line */
.act__node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid var(--ochre);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--feature);
  align-self: start;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.act__body { padding-top: 6px; }

/* Sinhala / English-name header */
.act__term {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: clamp(20px, 3.6vw, 27px);
  color: var(--feature);
  line-height: 1.1;
  margin-bottom: 3px;
}

.act__role {
  font-family: 'Spectral', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.act__eyeline {
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: #7a5a42;
  margin-bottom: 18px;
}

/* Two-column micro-label blocks */
.act__micro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
}

.act__micro-label {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.act__micro-label--see   { color: var(--indigo); }
.act__micro-label--means { color: var(--feature); }

.act__micro-text {
  font-family: 'Spectral', Georgia, serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}

/* Photo placeholder slot */
.photo-slot {
  margin: 16px 0;
  background: rgba(200, 136, 31, .05);
  border: 1px dashed rgba(200, 136, 31, .38);
  border-radius: 6px;
  aspect-ratio: 16 / 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.photo-slot__label {
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: #8a6a4a;
}

/* Side-by-side pair for act 3 (Flag bearers + Peramuna Rala) */
.act__img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.act__img-pair figure { margin: 0; }

.act__img-pair .act__feature-img { margin: 0 0 6px; }

@media (max-width: 580px) {
  .act__img-pair { grid-template-columns: 1fr; }
}

/* ── Sacred centre — Act 8 ── */
.act--sacred { padding-bottom: 72px; }

.act--sacred .act__node {
  background: var(--accent);
  border-color: var(--ochre);
  color: var(--ink);
  box-shadow: 0 0 0 5px rgba(224, 168, 40, .2);
}

.act--sacred .act__term {
  font-size: clamp(22px, 4vw, 32px);
  color: var(--ochre);
}

/* Gold-glow wrapper for the sacred centre body */
.sacred-wrap {
  background: linear-gradient(135deg, rgba(224, 168, 40, .07) 0%, rgba(200, 136, 31, .04) 100%);
  border: 1px solid rgba(200, 136, 31, .22);
  border-radius: 8px;
  padding: clamp(20px, 3.5vw, 32px);
}

/* 4.png feature image inside the sacred centre */
.act__feature-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 2px solid rgba(200, 136, 31, .3);
  box-shadow: 0 10px 36px rgba(58, 42, 30, .16);
  margin: 20px 0 10px;
}

.act__figcaption {
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: #7a5a42;
  text-align: center;
  margin-bottom: 22px;
}

.act__pavada-note {
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ochre);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(200, 136, 31, .2);
}

/* Compact hero variant for closing CTA */
.hero--cta .hero__inner {
  padding: clamp(40px, 7vw, 64px) clamp(22px, 6vw, 44px);
  animation: none;
}


/* ============================================================
   GAME — ordering pieces (class .piece, not .card)
   ============================================================ */

.game-area {
  max-width: 680px;
  margin: 0 auto;
}

.piece-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

/* .piece is a <button> — full-width, themed */
.piece {
  width: 100%;
  background: var(--ivory);
  border: 2px solid rgba(200, 136, 31, .45);
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  user-select: none;
  touch-action: manipulation;
  text-align: left;
  font-size: inherit;
}

.piece:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.piece__num {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 15px;
  color: rgba(58, 42, 30, .35);
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.piece__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.piece__term {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: var(--feature);
}

.piece__role {
  font-family: 'Spectral', Georgia, serif;
  font-size: 13px;
  color: var(--ink);
  opacity: .7;
}

/* Piece states */
.piece--selected {
  border-color: var(--feature);
  box-shadow: 0 0 0 3px rgba(148, 39, 31, .12);
  background: rgba(148, 39, 31, .04);
}

.piece--selected .piece__num { color: var(--feature); }

.piece--correct {
  border-color: var(--ochre);
  background: rgba(200, 136, 31, .09);
}

.piece--wrong { border-color: rgba(148, 39, 31, .4); }

.piece--revealed {
  border-color: var(--ochre);
  background: rgba(200, 136, 31, .06);
  cursor: default;
}

.piece--revealed .piece__num { color: var(--ochre); }

.game-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.game-result {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: 16px;
  color: var(--ink);
  min-height: 26px;
  font-weight: 500;
}

.game-result--win   { color: #3d6012; }
.game-result--close { color: var(--ochre); }


/* ── Procession-page responsive addenda ── */
@media (max-width: 800px) {
  .act__micro {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .procession-timeline {
    margin-top: 32px;
  }

  /* Game controls stack cleanly on mobile */
  .game-controls .btn {
    max-width: none;
    flex: 1 1 auto;
  }
}

/* Reduced motion: show the full line immediately, no transition */
@media (prefers-reduced-motion: reduce) {
  .procession-line-fill {
    height: 100% !important;
    transition: none;
  }
}


/* ── Picture ordering game ── */
.pic-game { margin-top: 32px; }

/* Horizontally scrollable track */
.pic-row-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 136, 31, .4) transparent;
}

.pic-row-wrap::-webkit-scrollbar { height: 4px; }
.pic-row-wrap::-webkit-scrollbar-thumb { background: rgba(200, 136, 31, .4); border-radius: 2px; }

/* The flex row of tiles */
.pic-row {
  list-style: none;
  margin: 0;
  padding: 4px 2px;
  display: flex;
  gap: 10px;
}

/* Each slot — fixed width, transition for shift animation */
.pic-slot {
  flex: 0 0 140px;
  position: relative;
  transition: transform 0.18s ease;
}

.pic-slot--source { opacity: 0; pointer-events: none; }

@media (max-width: 700px) { .pic-slot { flex-basis: 110px; } }
@media (max-width: 440px) { .pic-slot { flex-basis: 95px;  } }

/* Tile button */
.pic-tile {
  width: 100%;
  padding: 0;
  border: 2px solid rgba(200, 136, 31, .35);
  border-radius: 8px;
  background: var(--ivory);
  cursor: grab;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}

.pic-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pic-tile:active { cursor: grabbing; }

.pic-tile__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.pic-tile__badge {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--feature);
  color: #fff;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  pointer-events: none;
}

.pic-tile__name {
  display: block;
  padding: 5px 6px 7px;
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(10px, 1.6vw, 12px);
  color: var(--ink);
  font-style: italic;
  line-height: 1.25;
  pointer-events: none;
}

/* Floating ghost tile during drag */
.pic-tile--ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  margin: 0;
  cursor: grabbing;
  box-shadow: 0 8px 32px rgba(58, 42, 30, .28), 0 2px 8px rgba(58, 42, 30, .15);
  opacity: .95;
  transform: scale(1.04);
}

/* States */
.pic-tile--selected {
  border-color: var(--feature);
  box-shadow: 0 0 0 3px rgba(148, 39, 31, .18);
}

.pic-tile--selected .pic-tile__badge { background: var(--feature-deep); }

.pic-tile--correct {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 168, 40, .3), 0 2px 12px rgba(200, 136, 31, .18);
}

.pic-tile--correct .pic-tile__badge { background: var(--ochre); }

.pic-tile--wrong {
  border-color: var(--feature-deep);
  box-shadow: 0 0 0 2px rgba(122, 30, 24, .2);
}

.pic-tile--revealed {
  border-color: var(--ochre);
  opacity: .9;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .pic-slot  { transition: none; }
  .pic-tile--ghost { transform: none; }
}


/* ── see-it.html: etiquette list on a feature (hero) surface ── */
.etiquette-list {
  list-style: none;
  margin: clamp(24px, 4vw, 36px) auto 0;
  padding: 0;
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.etiquette-list li {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(15px, 1.9vw, 17px);
  color: var(--cream);
  line-height: 1.6;
  padding-left: 28px;
  position: relative;
}

.etiquette-list li::before {
  content: '\2014'; /* em dash */
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
}

/* ── see-it.html: practical tips list ── */
.tip-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
}

.tip-list li {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(15px, 1.9vw, 17px);
  color: var(--ink);
  line-height: 1.6;
  padding-left: 24px;
  position: relative;
}

.tip-list li::before {
  content: '\00B7'; /* middle dot */
  position: absolute;
  left: 6px;
  color: var(--ochre);
  font-size: 22px;
  line-height: 1.1;
}

/* ── questions.html: FAQ accordion ── */

.faq-heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.faq-section {
  margin-top: 40px;
}

.faq-section:first-child {
  margin-top: 0;
}

.faq-group {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.faq-item {
  border-bottom: 1px solid rgba(200, 136, 31, .2);
}

.faq-item:first-child {
  border-top: 1px solid rgba(200, 136, 31, .2);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  transition: color .15s;
}

.faq-question:hover,
.faq-question[aria-expanded="true"] {
  color: var(--feature);
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.faq-chevron {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  transition: transform .22s ease;
}

.faq-chevron::before {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ochre);
  border-bottom: 2px solid var(--ochre);
  transform: rotate(45deg) translate(-2px, -2px);
}

.faq-question[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}

.faq-answer__inner {
  padding: 0 0 22px;
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(15px, 1.9vw, 17px);
  color: var(--ink);
  line-height: 1.7;
}

.faq-answer__inner p + p {
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .faq-answer  { transition: none; }
  .faq-chevron { transition: none; }
}

/* ── story.html: historical witness list (dark surface) ── */
.century-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: left;
}

.century-list__date {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(11px, 1.3vw, 13px);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.century-list__fact {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(15px, 1.9vw, 17px);
  color: var(--cream);
  line-height: 1.65;
}
