/* ==============================================
   Pamyatnik — Modern Responsive Stylesheet
   Palette: Option 3 — Lighter / Airier Teal
   ============================================== */

:root {
  --bg-primary: #F2F6F7;
  --bg-secondary: #FFFFFF;
  --bg-sidebar: #E8F0F2;
  --accent-primary: #2B8A96;
  --accent-secondary: #45B5C0;
  --text-primary: #2A3B40;
  --text-heading: #1A5560;
  --nav-bg: #1E4A54;
  --nav-bg-dark: #163940;
  --highlight: #5CD6C8;
  --border: #D0DADD;
  --link: #2B8A96;
  --nav-text: #F2F6F7;
  --status-ready: #2E9E6B;
  --status-new: #D94040;
  --shadow-sm: 0 1px 3px rgba(30,74,84,0.08);
  --shadow-md: 0 4px 12px rgba(30,74,84,0.1);
  --shadow-lg: 0 8px 24px rgba(30,74,84,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-heading: Verdana, Geneva, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  --transition: 0.2s ease;
}

/* === Night mode — «Ночной Музей» === */
body.night {
  --bg-primary: #0E2228;
  --bg-secondary: #14313A;
  --bg-sidebar: #122A32;
  --accent-primary: #45B5C0;
  --accent-secondary: #5CD6C8;
  --text-primary: #C9D8DC;
  --text-heading: #9FD8DE;
  --nav-bg: #0B1D22;
  --nav-bg-dark: #081418;
  --highlight: #5CD6C8;
  --border: #24444D;
  --link: #5CD6C8;
  --nav-text: #DCE9EC;
  --status-ready: #4FC08D;
  --status-new: #E97B7B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* Photos dimmed slightly, like a museum after closing */
body.night img,
body.night video { filter: brightness(0.9); }

/* Privet.png is dark handwriting on transparency — at night, outline the
   glyphs with a white silhouette (shifted copies of the opaque pixels),
   preserving the artwork and its transparency */
body.night .privet-img {
  filter:
    drop-shadow(1px 0 0 rgba(255,255,255,0.85))
    drop-shadow(-1px 0 0 rgba(255,255,255,0.85))
    drop-shadow(0 1px 0 rgba(255,255,255,0.85))
    drop-shadow(0 -1px 0 rgba(255,255,255,0.85));
}

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

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

/* Honor the OS "reduce animations" accessibility setting */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-logo-char, .site-logo-wipe, .hero-phase,
  .p1-line, .p1-plaque-img, .p3-photo, .p3-hand {
    animation: none !important;
    transition: none !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  /* .subglobalNav::before extends 100vw past both edges for its full-width
     band; clip it so the page never scrolls horizontally */
  overflow-x: clip;
  /* Soften the day ⇄ night flip */
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-secondary); }

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.3;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4, h5, h6 { font-size: 1rem; }

p { margin: 0 0 1em; }

blockquote {
  margin: 0;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid var(--accent-secondary);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

/* === Skip Links (accessibility) === */
.skipLinks {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--nav-bg);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-size: 0.875rem;
}
.skipLinks:focus-within { top: 0; }
.skipLinks a { color: var(--highlight); margin: 0 8px; }

/* === Masthead (Header) === */
#masthead {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  box-shadow: var(--shadow-md);
}

.masthead-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Top bar: logo + utility */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  gap: 1rem;
}

#logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  /* Absorb all flexible header space so the buttons on the right stay put
     while the animated logo text grows and shrinks */
  flex: 1 1 auto;
  min-width: 0;
}

#logo a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--highlight);
  text-decoration: none;
}

.monument-icon-wrap {
  position: relative;
  width: 37px;
  height: 52px;
  flex-shrink: 0;
}

#logo img.monument-icon,
#logo img.monument-icon-hover {
  width: 37px;
  height: 52px;
  border-radius: var(--radius-sm);
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s;
}

#logo img.monument-icon-hover {
  opacity: 0;
}

#logo a:hover img.monument-icon {
  opacity: 0;
}

#logo a:hover img.monument-icon-hover {
  opacity: 1;
}

#logo .site-logo-img {
  height: 40px;
  width: auto;
}

/* Animated site logo text (replaces Pamyatnik1.gif) */
.site-logo-text {
  display: inline-block;
  height: 44px;
  line-height: 44px;
  margin-left: 4px;
  /* Marck Script (webfont) covers Cyrillic on Android/iOS, where the
     generic cursive fallback is Latin-only and breaks the Russian logo */
  font-family: 'Monotype Corsiva', 'Apple Chancery', 'ITC Zapf Chancery', 'Marck Script', cursive;
  font-size: 32px;
  font-weight: bold;
  font-style: italic;
  color: #fff;
  white-space: nowrap;
  vertical-align: middle;
  overflow: visible;
  padding-right: 4px;
  min-width: 210px;
}
.site-logo-text.en { font-size: 32px; }

/* Monument-rise animation: each letter scales up from bottom */
.site-logo-char {
  display: inline-block;
  transform: scaleY(0);
  transform-origin: bottom;
  opacity: 0;
}
.site-logo-char.rise {
  animation: monumentRise 0.25s ease-out forwards;
}
@keyframes monumentRise {
  0%   { transform: scaleY(0); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}

/* Wipe-right animation: text clips from left to right */
.site-logo-wipe {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
}
.site-logo-wipe.wipe {
  animation: wipeRight 3s ease-out forwards;
}
@keyframes wipeRight {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}

/* Utility links (top-right) */
#utility {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
}

#utility a {
  color: rgba(242,246,247,0.75);
  transition: color var(--transition);
  white-space: nowrap;
}

#utility a:hover { color: #fff; }

/* Language toggle */
.lang-toggle {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition);
  min-width: 4.5rem;
  text-align: center;
}

.lang-toggle:hover { background: var(--accent-secondary); }

/* === Night toggle (moon/sun) — sits next to the language pill === */
.night-toggle {
  background: none;
  border: 1px solid rgba(242,246,247,0.35);
  border-radius: 999px;
  color: #F2F6F7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}
.night-toggle:hover {
  border-color: var(--highlight);
  background: rgba(92,214,200,0.12);
}
.night-toggle svg { display: block; }

/* The mobile variant only exists at mobile widths */
.night-toggle-mobile { display: none; }
@media (max-width: 768px) {
  .night-toggle-mobile { display: inline-flex; }
}

/* === Night-mode toast («Музей после отбоя…») === */
#nightToast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #0B1D22;
  color: #DCE9EC;
  border: 1px solid rgba(92,214,200,0.35);
  border-radius: 10px;
  padding: 0.8rem 1.4rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: 3000;
  max-width: 92vw;
  text-align: center;
}
#nightToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#nightToast .night-toast-moon { margin-right: 0.5rem; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  /* Center the bars inside the (larger) tap target so the button's
     invisible slack doesn't read as a huge right margin */
  align-items: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* === Global Navigation === */
#globalNav {
  background: var(--nav-bg-dark);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.globalNav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#globalLink {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

a.glink, a.glink:visited {
  font-size: 0.875rem;
  color: rgba(242,246,247,0.85);
  font-weight: 600;
  padding: 0.625rem 0.875rem;
  border-right: 1px solid rgba(255,255,255,0.1);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

a.glink:last-child { border-right: none; }

a.glink:hover {
  background: rgba(92,214,200,0.15);
  color: #fff;
  text-decoration: none;
}

/* Search in nav */
#search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#search input[type="text"] {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: var(--font-body);
  width: 140px;
  transition: border-color var(--transition), width var(--transition);
}

#search input[type="text"]::placeholder { color: rgba(255,255,255,0.4); }
#search input[type="text"]:focus {
  outline: none;
  border-color: var(--highlight);
  width: 180px;
}

#searchbtn {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition);
  min-width: 4.5rem;
  text-align: center;
}

#searchbtn:hover { background: var(--accent-secondary); }

/* Sub-navigation dropdowns */
.subglobalNav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--accent-primary);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-md);
  /* Center content to match globalNav-inner */
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  gap: 0.25rem 0.25rem;
  /* Extend background full-width beyond centered content */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.subglobalNav::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100vw;
  right: -100vw;
  background: var(--accent-primary);
  z-index: -1;
}

.subglobalNav.visible {
  visibility: visible;
  opacity: 1;
}

/* Night: the dropdown band goes dark like the rest of the museum */
body.night .subglobalNav,
body.night .subglobalNav::before {
  background: #14313A;
}
body.night .subglobalNav {
  border-bottom: 1px solid rgba(92,214,200,0.25);
}

.subglobalNav a:link, .subglobalNav a:visited {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.9);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.subglobalNav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* === Page Layout === */
#pagecell1 {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  min-height: calc(100vh - 200px);
}

/* Nav & sidebar decorative icons */
a[data-i18n="nav.adventures"]::after {
  content: '\2122';
  color: #61CBF4;
  font-size: 0.78em;
  vertical-align: super;
}
a[data-i18n="sidebar.wife"]::after {
  content: ' \2665';
  color: #E8657C;
  font-size: 1.15em;
}
a[data-i18n="sidebar.newspapers"]::after {
  content: ' \1F3A8';
}
a[data-i18n="sidebar.august16"]::after {
  content: ' \1F319';
}

/* Breadcrumb */
#breadCrumb {
  padding: 0.75rem 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#breadCrumb a {
  color: var(--accent-primary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  font-size: 0.80em;
  line-height: 1;
  position: relative;
  top: 1px;
}

#breadCrumb a:hover {
  background: rgba(43,138,150,0.1);
  text-decoration: none;
}

/* Main content grid: sidebar + content */
.page-grid {
  display: grid;
  /* minmax(0,1fr): let the content column shrink below its min-content
     width (fixed-size hero, wide tables) instead of overflowing the page */
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* === Sidebar Navigation === */
#pageNav {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: 120px;
}

#sectionLinks {
  padding: 0;
}

/* Shared sidebar section headings */
#pageNav h3 {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--accent-primary);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  margin: 0;
}

/* Shared sidebar link style */
#pageNav a:link, #pageNav a:visited {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-heading);
  border-bottom: 1px solid var(--border);
  background: none;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
}

#pageNav a:hover {
  background: rgba(43,138,150,0.06);
  color: var(--accent-primary);
  padding-left: 1.25rem;
  text-decoration: none;
}

.relatedLinks {
  padding: 0;
  border-bottom: none;
}

.relatedLinks:last-of-type { border-bottom: none; }

/* Sidebar ad/promo */
#advert {
  padding: 0.75rem;
  text-align: center;
}

#advert img {
  display: block;
  margin: 0 auto 0.5rem;
  border-radius: var(--radius-sm);
  max-width: 100%;
}

#advert a:link, #advert a:visited {
  border-bottom: none;
  text-align: center;
  font-weight: 600;
}

/* === Content Area === */
#content {
  padding: 0;
  margin: 0;
  border: none;
  min-width: 0;
}

/* Feature (hero) section */
.feature {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  height: auto;
  font-size: 0.9375rem;
}

.feature h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.feature h3 {
  font-size: 1.25rem;
  padding: 1rem 0 0.5rem;
}

.feature img {
  float: none;
  padding: 0;
}

.feature video {
  border-radius: var(--radius-md);
  max-width: 100%;
  height: auto;
}

/* ── InLaws Title Wipe Animation ───────────────── */

.inlaws-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;       /* matches .feature h2 size */
  color: var(--text-heading);
  text-align: center;
  margin: 0.5rem 0;
  padding: 0.25rem 0;
  clip-path: inset(0 100% 0 0);
}

.inlaws-title.wipe-active {
  animation: inlawsWipeRight 3s ease-out forwards;
}

@keyframes inlawsWipeRight {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* ── Credits Roll (SamSebe page) — gabbro headstone ───────────────── */
.stone-wrap {
  width: 340px;
  max-width: 100%;
  margin: 1.25rem auto;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,0.55));
}

.credits-stone {
  position: relative;
  width: 340px;
  max-width: 100%;
  height: 430px;
  overflow: hidden;
  /* classic semicircular headstone */
  border-radius: 150px 150px 10px 10px;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,0.3),
    inset 0 -3px 6px rgba(0,0,0,0.35);
  /* coarse black gabbro with a teal cast (grain + dust + polish + base) */
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="260" height="260"><filter id="c"><feTurbulence type="fractalNoise" baseFrequency="0.45" numOctaves="3" seed="11"/><feColorMatrix type="saturate" values="0"/></filter><rect width="260" height="260" filter="url(%23c)" opacity="0.42"/></svg>'),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140"><filter id="f"><feTurbulence type="fractalNoise" baseFrequency="1.1" numOctaves="2" seed="4"/><feColorMatrix type="saturate" values="0"/></filter><rect width="140" height="140" filter="url(%23f)" opacity="0.22"/></svg>'),
    radial-gradient(ellipse 90% 60% at 30% 15%, rgba(92,214,200,0.10), transparent 65%),
    linear-gradient(165deg, #2C3B42 0%, #16262C 50%, #24343B 100%);
}

/* bottom: rows dissolve fully into the stone — text grows out of the ground */
.credits-stone::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 86px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(rgba(26,34,38,0), rgba(26,34,38,0.55) 45%, rgba(26,34,38,1) 100%);
}

/* carved epitaph inside the arch */
.stone-head {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2.2rem 0 0;
}
.stone-head .llc {
  display: block;
  font-family: "Merriweather", Georgia, serif;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}
.stone-head .dates {
  display: block;
  font-family: "Merriweather", Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 0.25rem;
  letter-spacing: 0.12em;
}
/* © sits on the same baseline as the digits */
.stone-head .dates .c {
  display: inline-block;
  position: relative;
  top: 0.09em;
}
/* wider, weightier infinity; its shadows are pre-shrunk because the
   transform scales them together with the glyph */
.stone-head .dates .inf {
  display: inline-block;
  transform: scale(1.45, 1.2) translateY(-0.02em);
  transform-origin: center;
  text-shadow:
    0 -1.4px 1.4px rgba(0,0,0,0.95),
    0 0.8px 0.8px rgba(255,255,255,0.28),
    0 0 5px rgba(0,0,0,0.6);
}
.stone-head::after {
  content: '';
  display: block;
  margin: 0.85rem auto 0;
  width: 62%;
  height: 2px;
  background: linear-gradient(rgba(0,0,0,0.8), rgba(214,224,227,0.5));
}

/* sandblasted lettering sunk into the dark stone */
.credits-stone .credits-role {
  color: rgba(210,224,228,0.8);
  text-shadow: 0 -1px 1px rgba(0,0,0,0.85);
}
.credits-stone .credits-name,
.credits-stone .stone-head .llc,
.credits-stone .stone-head .dates {
  color: #CFDBDE;
  text-shadow:
    0 -2px 2px rgba(0,0,0,0.95),
    0 1px 1px rgba(255,255,255,0.28),
    0 0 8px rgba(0,0,0,0.6);
}

/* the rolling window starts right at the carved divider, so the rows
   disappear straight into the header line */
.credits-viewport {
  position: absolute;
  inset: 107px 0 0 0;
  overflow: hidden;
}

.credits-track {
  position: absolute;
  left: 0;
  right: 0;
  will-change: transform;
}

.credits-row {
  text-align: center;
  padding: 0.55rem 0;
}

.credits-role {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 1.5rem;
}

.credits-name {
  display: block;
  font-family: "Merriweather", Georgia, serif;
  font-weight: 900;
  font-size: 1.7rem;
  margin-top: 0.1rem;
}

/* ── Hero Animation (Main page) ────────────────── */

.hero-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  min-height: 48px;
}

.hero-title {
  font-size: 1.5rem;
  color: var(--text-heading);
  opacity: 0;
  transition: opacity 0.8s ease;
  white-space: nowrap;
  margin: 0;
}

.hero-title.visible {
  opacity: 1;
}

.hero-anim {
  position: relative;
  width: 576px;
  height: 432px;
  max-width: 100%;
  margin: 0 auto 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  /* "Museum wall" — light marble in the site palette (hero demo option A) */
  background:
    radial-gradient(ellipse 120% 60% at 20% 10%, rgba(176,190,197,0.25), transparent 60%),
    radial-gradient(ellipse 90% 50% at 75% 80%, rgba(144,164,174,0.18), transparent 55%),
    radial-gradient(ellipse 60% 35% at 60% 30%, rgba(207,216,220,0.35), transparent 60%),
    linear-gradient(160deg, #FAFCFC 0%, #EDF2F4 45%, #F6F9FA 70%, #E8EEF0 100%);
  border: 1px solid var(--border);
}

/* Thin display-case frame inside the marble wall */
.hero-anim::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(30,74,84,0.15);
  border-radius: 6px;
  pointer-events: none;
  z-index: 5;
}

/* Night: the marble wall goes dark, lit by a teal spotlight from above */
body.night .hero-anim {
  background:
    radial-gradient(ellipse 65% 80% at 50% 8%, rgba(92,214,200,0.14), transparent 70%),
    linear-gradient(170deg, #142F36 0%, #0E2228 100%);
  border-color: var(--border);
}
body.night .hero-anim::after { border-color: rgba(92,214,200,0.18); }

.hero-phase {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

/* Phase 1 — Welcome + Marble Plaque (Merriweather) */
.p1-line {
  font-family: "Merriweather", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 2.5rem;     /* scaled for 432px height */
  line-height: 1.25;
  text-align: center;
  /* "Engraved in marble": highlight below, shadow above (hero-text demo A) */
  color: var(--text-heading);
  text-shadow: 0 1px 1px rgba(255,255,255,0.9), 0 -1px 1px rgba(20,60,70,0.3);
  opacity: 0;
}

/* Night: light letters under a soft teal spotlight */
body.night .p1-line {
  color: #A8DDE2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65), 0 0 18px rgba(92,214,200,0.3);
}

.p1-line.p1-sm {
  font-size: 2.2rem;     /* scaled for 432px height */
}

.p1-plaque-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 1.5rem 1.25rem;
  margin-top: 0.5rem;
  overflow: visible;
}

.p1-plaque-wrap .p1-plaque-text {
  font-size: 1.7rem;     /* scaled for 432px height */
}

.p1-plaque-img {
  position: absolute;
  width: 280px;              /* scaled for 432px height */
  max-width: 90%;
  height: auto;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.p1-plaque-text {
  position: relative;
  z-index: 1;
  transition: color 0.8s ease, text-shadow 0.8s ease;
}

.p1-plaque-text.embossed {
  color: rgba(70, 64, 55, 0.6);
  text-shadow:
    -1.5px -1.5px 0.5px rgba(255,255,255,0.9),
     1.5px  1.5px 1.5px rgba(0,0,0,0.3),
     0 0 3px rgba(0,0,0,0.05);
}

/* Phase 2 — Quote (Merriweather Italic, -19.4° rotation, teal glow) */
.p2-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.p2-quote {
  position: relative;
  z-index: 1;
  transform: rotate(-19.4deg);
  padding: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-self: flex-end;
  margin-top: auto;
  margin-bottom: 1.5rem;
  margin-right: 1.6rem;         /* scaled from 2rem */
  width: 100%;                 /* full width to fit Russian text in 3 lines */
}

.p2-line {
  display: block;
  font-family: "Merriweather", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 1.6rem;       /* scaled from 2rem */
  font-weight: 400;
  font-style: italic;
  line-height: 1.45;
  color: #fff;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,0.7), 1px -1px 0 rgba(0,0,0,0.7),
    -1px 1px 0 rgba(0,0,0,0.7), 1px 1px 0 rgba(0,0,0,0.7),
    0 0 8px rgba(0,0,0,0.8),
    0 0 20px rgba(19,86,116,0.5);
}

.p2-word {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.p2-word.visible {
  opacity: 1;
}

/* Phase 3 — Metronome Photo Slideshow */
.p3-photos {
  position: absolute;
  inset: 0;
}

.p3-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.p3-hand {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(160px, 28%);
  height: 90%;
  transform: translateX(-50%) rotate(0deg);
  transform-origin: center bottom;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}

.p3-hand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
}

.p3-hand svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.4));
}

/* Phase 4: "Wipe the screen" text */
#heroPhase4 {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
}
.p4-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
  text-align: center;
}
.p4-text em {
  font-style: italic;
  font-weight: 700;
}
.p4-arrow {
  font-size: 2rem;
  color: var(--accent-primary);
  opacity: 0;
  animation: none;
}
@keyframes p4ArrowPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.p4-hand {
  margin-top: 0.5rem;
  color: var(--accent-primary);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
  animation: p4Swipe 2s ease-in-out infinite;
}
@keyframes p4Swipe {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(30px); }
  50%  { transform: translateX(0); }
  75%  { transform: translateX(-30px); }
  100% { transform: translateX(0); }
}

/* Story cards */
.story {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
}

.story h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.story p { padding: 0; margin-bottom: 0.75rem; }

.story .secret-title {
  color: #7B8794;
  margin-top: 1.5rem;
}
.story .secret-text {
  color: #8B949E;
}

.odometer-digit {
  display: inline-block;
  width: 1.2em;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  font-size: 1.1em;
  background: #f0f0f0;
  color: #2A3B40; /* fixed: a mechanical counter keeps its look at night */
  border: 1px solid #bbb;
  border-radius: 3px;
  box-shadow: 2px 2px 3px rgba(0,0,0,0.2);
  margin: 0 1px;
  padding: 2px 0;
  line-height: 1.3;
}

.story a.capsule {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--accent-primary);
  display: block;
  padding: 0.375rem 0;
  transition: color var(--transition);
}

.story a.capsule:hover { color: var(--accent-secondary); text-decoration: none; }

/* Story grid (two-column stories) */
.story table { width: 100%; }
.story td { vertical-align: top; padding: 0.5rem; }
td.storyLeft { padding-right: 1rem; }

/* Status labels */
.style6 { color: var(--status-ready); font-weight: 600; }
.style8 { color: var(--status-new); font-weight: 600; }
.style1 { color: var(--text-heading); }

/* === Album / Gallery === */
.album {
  padding: 0;
  font-size: 0.875rem;
  height: auto;
}

.imagetable img {
  padding: 0;
  border-radius: var(--radius-sm);
}

/* === Footer === */
#siteInfo {
  clear: both;
  border-top: none;
  background: var(--nav-bg);
  color: rgba(242,246,247,0.7);
  padding: 1.25rem 1.5rem;
  font-size: 0.8125rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: 1.5rem;
  text-align: center;
}

#siteInfo a { color: rgba(242,246,247,0.85); }
#siteInfo a:hover { color: var(--highlight); }
.grey { color: rgba(242,246,247,0.5); }

/* === Audio Player Button === */
.audio-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  border: none;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition), transform var(--transition), color var(--transition);
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 900;
  box-shadow: var(--shadow-md);
}

.audio-play-btn:hover {
  background: var(--border);
  transform: scale(1.05);
}

.audio-play-btn.playing {
  background: var(--accent-primary);
  color: #fff;
}

.audio-play-btn.playing:hover {
  background: var(--accent-secondary);
}

/* === Page Name (right column label) === */
#pageName {
  position: static;
  width: auto;
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 1rem;
}

#pageName h2 {
  font-size: 1.5rem;
  margin: 0;
  padding: 0;
}

/* === Forms === */
form { padding: 0; }

label {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.875rem;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(43,138,150,0.15);
}

/* === Lists === */
ul { list-style-type: disc; padding-left: 1.5rem; }
ul ul { list-style-type: circle; }

/* === Decorative corners (hidden — replaced by border-radius) === */
#tl, #tr { display: none; }

/* === Legacy image spacers === */
img[alt="spacer"], img[name*="spacer"], img[name*="Spacer"] {
  display: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: ≤1024px */
@media (max-width: 1024px) {
  .page-grid {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
  }

  /* Unshrinkable content (wide tables, fixed galleries) scrolls inside
     its own card instead of pushing past the viewport */
  .feature, .story { overflow-x: auto; }

  .header-top { flex-wrap: wrap; }

  #search input[type="text"] { width: 120px; }
  #search input[type="text"]:focus { width: 140px; }

  a.glink, a.glink:visited {
    font-size: 0.8125rem;
    padding: 0.5rem 0.625rem;
  }
}

/* Mobile: ≤768px */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .hamburger { display: flex; }

  .header-top {
    flex-wrap: nowrap;
  }

  #utility {
    display: none;
  }

  #utility.mobile-visible {
    display: flex;
    order: 99;
    width: 100%;
    justify-content: center;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  /* Mobile nav */
  #globalNav {
    display: none;
  }

  #globalNav.mobile-open {
    display: block;
  }

  .globalNav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  #globalLink {
    flex-direction: column;
    width: 100%;
  }

  a.glink, a.glink:visited {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
  }

  #search {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  #search input[type="text"] { flex: 1; width: auto; }

  .subglobalNav {
    position: static;
    visibility: visible;
    opacity: 1;
    flex-direction: column;
    padding: 0.5rem 1rem 0.5rem 2rem;
    background: rgba(43,138,150,0.15);
    box-shadow: none;
  }

  /* Page layout: stack sidebar under content */
  .page-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #pageNav {
    order: 2;
    position: static;
  }

  #content { order: 1; }

  .feature { padding: 1rem; }
  .story { padding: 1rem; }

  .feature h3 { font-size: 1.125rem; }

  /* Allow long h2 titles to wrap on mobile instead of blowing out viewport */
  .feature td[nowrap] { white-space: normal !important; }
  .feature h2 { font-size: 1.2rem; }
  .privet-img { width: 100px !important; height: auto !important; }

  /* Story tables: keep 2-column but allow natural shrinking */
  .story table { width: 100%; table-layout: fixed; }
  .story table td { word-wrap: break-word; overflow-wrap: break-word; font-size: 0.8125rem; }
  td.storyLeft { padding-right: 0.25rem; }

  #breadCrumb { font-size: 0.8125rem; }
}

/* Small mobile: ≤375px */
@media (max-width: 375px) {
  html { font-size: 14px; }

  #pagecell1 { padding: 0.5rem; }

  .feature, .story {
    border-radius: var(--radius-md);
    padding: 0.75rem;
  }

  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }

  .feature video { border-radius: var(--radius-sm); }

  .hero-anim { border-radius: var(--radius-sm); }
  .hero-title { font-size: 1.15rem; }
  .p1-line { font-size: 1.6rem; }
  .p1-line.p1-sm { font-size: 1.4rem; }
  .p2-line { font-size: 1rem; }
  .p2-quote { padding: 0 0.5rem; margin-right: 0.25rem; margin-bottom: 1rem; }
}

/* Ensure tap targets are ≥44px on touch */
@media (pointer: coarse) {
  a.glink, a.glink:visited { min-height: 44px; display: flex; align-items: center; }
  #sectionLinks a:link, #sectionLinks a:visited { min-height: 44px; display: flex; align-items: center; }
  .relatedLinks a { min-height: 44px; display: flex; align-items: center; }
  #breadCrumb a { min-height: 44px; display: flex; align-items: center; }
  #utility a { min-height: 44px; display: flex; align-items: center; }
  .lang-toggle { min-height: 44px; }
  .hamburger { min-width: 44px; min-height: 44px; justify-content: center; }
}

/* ============================================
   MOBILE SMARTPHONE EXPERIENCE (≤768px)
   Bottom bar, swipe nav, accordion menu, sidebar panel
   ============================================ */

@media (max-width: 768px) {
  /* --- Prevent viewport blowout from hardcoded pixel widths --- */
  html, body { overflow-x: hidden; max-width: 100vw; }
  #content { overflow-x: hidden; }
  .feature, .story { overflow-x: auto; max-width: 100%; }
  .feature img, .feature video, .story img { max-width: 100% !important; height: auto !important; }
  /* Hero animation images need object-fit, not height:auto */
  .feature .p2-bg { width: 100% !important; height: 100% !important; object-fit: cover !important; }
  .feature .p3-photo { width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center center !important; }
  .feature .p3-hand img { width: 100% !important; height: 100% !important; object-fit: contain !important; object-position: center bottom !important; }
  .feature table, .story table { max-width: 100%; }
  /* Override inline widths only — do NOT touch heights */
  .feature div[style*="width:"] { max-width: 100% !important; }
  .hero-anim { width: 100% !important; max-width: 576px; height: auto !important; aspect-ratio: 576 / 432; }
  /* Gallery buttons: prevent width squishing */
  .button { flex-shrink: 0; }

  /* --- Mobile gallery: hide thumbnails, show toggle --- */
  .kvnThumb, .lovThumb, .wiwThumb, .trivThumb, .funThumb,
  .trvThumb, .sixThumb, .sevThumb, .eigThumb, .ninThumb, .etcThumb,
  .lupaThumb, .intThumb, .newsThumb, .resThumb,
  .kvn-thumbs-wrap, .kvn-thumb-row,
  #lovThumbs, #wiwThumbs, #trivThumbs, #trvThumbs,
  #sixThumbs, #sevThumbs, #eigThumbs, #ninThumbs, #etcThumbs,
  #intThumbs, #newsThumbs {
    display: none !important;
  }
  /* Hide JS-generated thumb containers and inline thumb divs */
  .feature div[id$="Thumbs"] { display: none !important; }
  /* Fun page thumb rows inside control panel */
  #funGallery div[style*="flex-direction:column"] { display: none !important; }

  /* Auto-advance toggle button — round, matching Login toggle style */
  .mobile-auto-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-image: linear-gradient(to bottom, #f4f1ee, #fff);
    box-shadow: 0px 8px 10px 0px rgba(0,0,0,.3), inset 0px 4px 1px 1px white, inset 0px -3px 1px 1px rgba(204,198,197,.5);
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    color: #21536A;
    text-shadow: 0px -1px 1px #73848C, 1px 1px 1px white;
    transition: all .1s linear;
    border: none;
    font-family: inherit;
    flex-shrink: 0;
  }
  .mobile-auto-toggle:hover, .mobile-auto-toggle:active {
    background-image: linear-gradient(to bottom, #fff, #f4f1ee);
    color: #2CB5AF;
    text-shadow: 0px 0px 6px #2CB5AF;
  }
  .mobile-auto-toggle:active {
    box-shadow: 0 3px 5px 0 rgba(0,0,0,.4), inset 0px -3px 1px 1px rgba(204,198,197,.5);
  }
  .mobile-auto-toggle.playing::after {
    content: '\275A\275A';
  }
  .mobile-auto-toggle:not(.playing)::after {
    content: '\276F\276F';
  }

  /* Video chapter numbered buttons (mobile) */
  .mobile-chapter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(43,138,150,0.15);
    border: 2px solid #D0DADD;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    font-family: var(--font-body);
  }
  .mobile-chapter-btn.active {
    border-color: #2B8A96;
    background: rgba(43,138,150,0.3);
    color: #fff;
  }

  /* --- Hide desktop subglobal menus (replaced by accordion) --- */
  .subglobalNav {
    display: none !important;
    visibility: hidden !important;
  }

  /* --- Compact top bar --- */
  #masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
  }

  /* Desktop keeps 1rem side padding here; on mobile it stacks with the
     header-top padding and wastes width */
  .masthead-inner { padding: 0 0.25rem; }

  .header-top {
    padding: 0.5rem 0.375rem 0.5rem 0.5rem;
    min-height: 48px;
    gap: 0.4rem;
  }

  #logo .site-logo-img { height: 28px; }
  .monument-icon-wrap { width: 28px; height: 40px; }
  #logo img.monument-icon,
  #logo img.monument-icon-hover { width: 28px; height: 40px; }

  /* Tighter icon-to-text spacing in the narrow header */
  #logo, #logo a { gap: 0.4rem; }

  /* Clip the logo text instead of letting it run under the header buttons */
  #logo a { min-width: 0; overflow: hidden; }

  /* Disable logo animation on mobile — prevents lang toggle jump */
  .site-logo-text { min-width: 0; width: auto; font-size: 19px; height: 28px; line-height: 28px; overflow: hidden; text-overflow: ellipsis; }
  .site-logo-text.en { font-size: 17px; }

  /* Slightly smaller night toggle in the tight mobile header */
  .night-toggle-mobile { width: 24px; height: 24px; }
  .night-toggle-mobile svg { width: 15px; height: 15px; }
  .site-logo-char { transform: none !important; opacity: 1 !important; animation: none !important; }

  /* Push page content below fixed header */
  body {
    padding-top: 48px;
    padding-bottom: 56px; /* space for bottom bar */
  }

  /* Hide breadcrumb on mobile */
  #breadCrumb { display: none; }

  /* Hide desktop sidebar on mobile */
  #pageNav { display: none; }

  /* Content full width, no grid gap */
  .page-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  #pagecell1 {
    padding: 0.5rem;
  }

  /* Hide desktop footer (info is in bottom bar) */
  #siteInfo { margin-bottom: 0; border-radius: var(--radius-md); }

  /* --- Accordion menu (replaces flat nav) --- */
  #globalNav.mobile-open {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 56px;
    overflow-y: auto;
    z-index: 1050;
    background: var(--nav-bg-dark);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-accordion-section {
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .mobile-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    color: var(--nav-text);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    transition: background var(--transition);
  }

  .mobile-accordion-header:hover,
  .mobile-accordion-header:active {
    background: rgba(92,214,200,0.1);
  }

  .mobile-accordion-header::after {
    content: '\25BC';
    font-size: 0.625rem;
    opacity: 0.6;
    transition: transform var(--transition);
  }

  .mobile-accordion-section.open .mobile-accordion-header::after {
    transform: rotate(180deg);
  }

  .mobile-accordion-body {
    display: none;
    padding: 0 1rem 0.5rem 1.5rem;
    background: rgba(0,0,0,0.15);
  }

  .mobile-accordion-section.open .mobile-accordion-body {
    display: block;
  }

  .mobile-accordion-body a {
    display: block;
    padding: 0.625rem 0.75rem;
    color: rgba(242,246,247,0.85);
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color var(--transition), padding-left var(--transition);
  }

  .mobile-accordion-body a:last-child { border-bottom: none; }

  .mobile-accordion-body a:hover,
  .mobile-accordion-body a:active {
    color: var(--highlight);
    padding-left: 1rem;
    text-decoration: none;
  }

  /* --- Bottom bar --- */
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1100;
    box-shadow: 0 -2px 8px rgba(30,74,84,0.15);
    padding: 0 0.5rem;
  }

  .mobile-bottom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: rgba(242,246,247,0.7);
    font-size: 1.25rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    min-width: 56px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    font-family: var(--font-body);
  }

  .mobile-bottom-btn span {
    font-size: 0.625rem;
    letter-spacing: 0.02em;
  }

  .mobile-bottom-btn:hover,
  .mobile-bottom-btn:active,
  .mobile-bottom-btn.active {
    color: var(--highlight);
    background: rgba(92,214,200,0.1);
  }

  /* --- Sidebar slide-up panel --- */
  .mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .mobile-sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .mobile-sidebar-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 70vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1250;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem 2rem;
    box-shadow: 0 -4px 20px rgba(30,74,84,0.2);
  }

  .mobile-sidebar-panel.visible {
    transform: translateY(0);
  }

  .mobile-sidebar-panel .panel-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 1rem;
  }

  .mobile-sidebar-panel h3 {
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    color: var(--accent-primary);
    margin: 0.75rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .mobile-sidebar-panel a {
    display: block;
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
    color: var(--text-heading);
    border-bottom: 1px solid var(--border);
    transition: color var(--transition);
  }

  .mobile-sidebar-panel a:hover,
  .mobile-sidebar-panel a:active {
    color: var(--accent-primary);
    text-decoration: none;
  }

  /* --- Swipe hint (visual only) --- */
  .swipe-indicator {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: var(--accent-primary);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 900;
    pointer-events: none;
  }

  .swipe-indicator.left { left: 2px; }
  .swipe-indicator.right { right: 2px; }
  .swipe-indicator.active { opacity: 0.5; }

  /* --- Mobile language toggle (in header-top) --- */
  .mobile-lang-toggle {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    letter-spacing: 0.05em;
    transition: background var(--transition);
    min-height: 28px;
    min-width: 36px;
    flex-shrink: 0;
  }

  .mobile-lang-toggle:hover,
  .mobile-lang-toggle:active {
    background: var(--accent-secondary);
  }

  /* --- Mobile nav arrows in bottom bar --- */
  .mobile-nav-btn {
    min-width: 44px;
    padding: 0.375rem 0.5rem;
  }

  /* --- Swipe onboarding hint --- */
  .swipe-onboarding {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
  }
  .swipe-onboarding.animate {
    opacity: 1;
    animation: swipeHint 2s ease-in-out;
  }
  .swipe-onboarding.fade-out {
    opacity: 0;
  }
  .swipe-hand {
    color: var(--accent-primary);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  }
  @keyframes swipeHint {
    0%   { transform: translateX(-50%); }
    25%  { transform: translateX(calc(-50% + 40px)); }
    50%  { transform: translateX(-50%); }
    75%  { transform: translateX(calc(-50% - 40px)); }
    100% { transform: translateX(-50%); }
  }

  /* Hide desktop audio button (replaced by bottom bar icon) */
  .audio-play-btn { display: none; }

  /* --- Mobile page indicator (trapezoid pull-down) --- */
  .mobile-page-indicator {
    position: fixed;
    top: 48px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 1099;
    background: var(--nav-bg);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 1.5rem 0;
    text-align: center;
    clip-path: polygon(0% 0%, 100% 0%, 92% 100%, 8% 100%);
    transition: transform 0.3s ease-out;
    pointer-events: none;
    white-space: nowrap;
  }
  .mobile-page-indicator.visible {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    cursor: pointer;
  }
  .mobile-page-indicator.retracting {
    transform: translateX(-50%) translateY(-100%);
    transition: transform 0.3s ease-in;
  }
}

/* ==============================================
   BRASS & GOLD HEADINGS (Awards page)
   Metallic lettering with a slow display-lamp gleam
   ============================================== */
h2.brass-heading {
  background: linear-gradient(100deg,
    #9A7B45 0%, #C4A35F 18%, #F0DFA8 30%, #C4A35F 42%,
    #8A6C3B 58%, #B8944E 78%, #9A7B45 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,0.7)) drop-shadow(0 -1px 1px rgba(90,68,32,0.35));
  animation: goldGleam 15s linear infinite;
}

h3.gold-heading {
  background: linear-gradient(100deg,
    #A8873F 0%, #E8C96B 18%, #FFF3C4 30%, #E8C96B 42%,
    #A8873F 58%, #D9B95E 78%, #A8873F 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,0.65)) drop-shadow(0 -1px 1px rgba(96,70,22,0.4));
  animation: goldGleam 15s linear infinite;
}

/* Stagger the gleam so the "lamp" pans across the exhibits one by one */
.brass-heading.gleam-2, .gold-heading.gleam-2 { animation-delay: -5s; }
.brass-heading.gleam-3, .gold-heading.gleam-3 { animation-delay: -10s; }

/* Links inside gold headings: no underline — a distinctly deeper bronze
   shade is the click affordance, brightening on hover */
h3.gold-heading a {
  color: #97742F;
  text-decoration: none;
  transition: color var(--transition);
}
h3.gold-heading a:hover { color: #C89B4B; }
body.night h3.gold-heading a { color: #F2DA9A; }
body.night h3.gold-heading a:hover { color: #FFE9B0; }

@keyframes goldGleam {
  0% { background-position: 0% 0; }
  100% { background-position: 220% 0; }
}

/* Night: metal lightens and picks up the spotlight */
body.night h2.brass-heading {
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)) drop-shadow(0 0 14px rgba(232,204,138,0.25));
}
body.night h3.gold-heading {
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)) drop-shadow(0 0 16px rgba(255,223,128,0.3));
}
body.night h3.gold-heading a { text-decoration-color: rgba(232,204,138,0.6); }

/* Reduced motion: static metal, highlight parked mid-word */
@media (prefers-reduced-motion: reduce) {
  h2.brass-heading, h3.gold-heading {
    animation: none !important;
    background-position: 30% 0;
  }
}

/* === Print styles === */
@media print {
  #masthead, #globalNav, .audio-play-btn, #search, .hamburger { display: none; }
  .mobile-bottom-bar { display: none; }
  body { background: #fff; color: #000; padding: 0; }
  #pagecell1 { max-width: 100%; }
  .page-grid { grid-template-columns: 1fr; }
}
