/* ==========================================================================
   DR. SZEGŐ ÁGNES (ORBÁNNÉ DR. SZEGŐ ÁGNES)
   TÖRTÉNÉSZ · CSALÁDFAKUTATÓ · GENEALÓGUS
   Archival Luxury & Living Memory Design System (Light & Dark Mode)
   ========================================================================== */

:root {
  /* Light Theme Tokens — Warm Archival Parchment, Alabaster & Antique Gold */
  --bg-canvas-light: #faf6ef;
  --bg-surface-light: #f3ece0;
  --bg-elevated-light: #ffffff;
  --bg-subtle-light: #ece2d0;
  --bg-glass-light: rgba(250, 246, 239, 0.86);
  --bg-card-hover-light: #fffdf9;

  --text-primary-light: #181410;
  --text-secondary-light: #473f35;
  --text-muted-light: #736758;

  --accent-gold-light: #966919;
  --accent-gold-strong-light: #76500d;
  --accent-gold-soft-light: rgba(150, 105, 25, 0.11);
  --accent-gold-glow-light: rgba(150, 105, 25, 0.22);
  --accent-burgundy-light: #6e242c;
  --accent-emerald-light: #1b6545;
  --accent-error-light: #b9251e;
  --accent-error-bg-light: #fdf0ef;

  --border-subtle-light: rgba(24, 20, 16, 0.1);
  --border-strong-light: rgba(24, 20, 16, 0.18);
  --border-gold-light: rgba(150, 105, 25, 0.36);

  --shadow-card-light: 0 12px 34px -8px rgba(24, 19, 12, 0.08), 0 2px 6px rgba(24, 19, 12, 0.04);
  --shadow-elevated-light: 0 24px 56px -12px rgba(24, 19, 12, 0.18);

  /* Dark Theme Tokens — Obsidian Memorial & Candlelight Gold */
  --bg-canvas-dark: #0b0d13;
  --bg-surface-dark: #111520;
  --bg-elevated-dark: #161b28;
  --bg-subtle-dark: #1d2436;
  --bg-glass-dark: rgba(11, 13, 19, 0.86);
  --bg-card-hover-dark: #1c2334;

  --text-primary-dark: #f5efe4;
  --text-secondary-dark: #c9bfa9;
  --text-muted-dark: #8e8471;

  --accent-gold-dark: #e2b155;
  --accent-gold-strong-dark: #f6ce7d;
  --accent-gold-soft-dark: rgba(226, 177, 85, 0.14);
  --accent-gold-glow-dark: rgba(226, 177, 85, 0.28);
  --accent-burgundy-dark: #dc727e;
  --accent-emerald-dark: #4cc38a;
  --accent-error-dark: #ff7369;
  --accent-error-bg-dark: rgba(185, 37, 30, 0.18);

  --border-subtle-dark: rgba(245, 239, 228, 0.1);
  --border-strong-dark: rgba(245, 239, 228, 0.2);
  --border-gold-dark: rgba(226, 177, 85, 0.38);

  --shadow-card-dark: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-elevated-dark: 0 28px 68px -12px rgba(0, 0, 0, 0.85);

  /* Base Fallback (Light) */
  --bg-canvas: var(--bg-canvas-light);
  --bg-surface: var(--bg-surface-light);
  --bg-elevated: var(--bg-elevated-light);
  --bg-subtle: var(--bg-subtle-light);
  --bg-glass: var(--bg-glass-light);
  --bg-card-hover: var(--bg-card-hover-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-muted: var(--text-muted-light);
  --accent-gold: var(--accent-gold-light);
  --accent-gold-strong: var(--accent-gold-strong-light);
  --accent-gold-soft: var(--accent-gold-soft-light);
  --accent-gold-glow: var(--accent-gold-glow-light);
  --accent-burgundy: var(--accent-burgundy-light);
  --accent-emerald: var(--accent-emerald-light);
  --accent-error: var(--accent-error-light);
  --accent-error-bg: var(--accent-error-bg-light);
  --border-subtle: var(--border-subtle-light);
  --border-strong: var(--border-strong-light);
  --border-gold: var(--border-gold-light);
  --shadow-card: var(--shadow-card-light);
  --shadow-elevated: var(--shadow-elevated-light);
  --scrollbar-thumb: #b49a6b;
  --scrollbar-track: #efe8dc;

  /* Alapértelmezett világos téma (sötét módra kapcsolható a fejlécben) */
  color-scheme: light;

  /* Map <meta name="color-scheme"> override back to CSS cascade */
  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
    --bg-canvas: var(--bg-canvas-dark);
    --bg-surface: var(--bg-surface-dark);
    --bg-elevated: var(--bg-elevated-dark);
    --bg-subtle: var(--bg-subtle-dark);
    --bg-glass: var(--bg-glass-dark);
    --bg-card-hover: var(--bg-card-hover-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-muted: var(--text-muted-dark);
    --accent-gold: var(--accent-gold-dark);
    --accent-gold-strong: var(--accent-gold-strong-dark);
    --accent-gold-soft: var(--accent-gold-soft-dark);
    --accent-gold-glow: var(--accent-gold-glow-dark);
    --accent-burgundy: var(--accent-burgundy-dark);
    --accent-emerald: var(--accent-emerald-dark);
    --accent-error: var(--accent-error-dark);
    --accent-error-bg: var(--accent-error-bg-dark);
    --border-subtle: var(--border-subtle-dark);
    --border-strong: var(--border-strong-dark);
    --border-gold: var(--border-gold-dark);
    --shadow-card: var(--shadow-card-dark);
    --shadow-elevated: var(--shadow-elevated-dark);
    --scrollbar-thumb: #6b5835;
    --scrollbar-track: #12151e;
  }

  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
    --bg-canvas: var(--bg-canvas-light);
    --bg-surface: var(--bg-surface-light);
    --bg-elevated: var(--bg-elevated-light);
    --bg-subtle: var(--bg-subtle-light);
    --bg-glass: var(--bg-glass-light);
    --bg-card-hover: var(--bg-card-hover-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --text-muted: var(--text-muted-light);
    --accent-gold: var(--accent-gold-light);
    --accent-gold-strong: var(--accent-gold-strong-light);
    --accent-gold-soft: var(--accent-gold-soft-light);
    --accent-gold-glow: var(--accent-gold-glow-light);
    --accent-burgundy: var(--accent-burgundy-light);
    --accent-emerald: var(--accent-emerald-light);
    --accent-error: var(--accent-error-light);
    --accent-error-bg: var(--accent-error-bg-light);
    --border-subtle: var(--border-subtle-light);
    --border-strong: var(--border-strong-light);
    --border-gold: var(--border-gold-light);
    --shadow-card: var(--shadow-card-light);
    --shadow-elevated: var(--shadow-elevated-light);
    --scrollbar-thumb: #b49a6b;
    --scrollbar-track: #efe8dc;
  }

  @supports (color: light-dark(white, black)) {
    --bg-canvas: light-dark(var(--bg-canvas-light), var(--bg-canvas-dark));
    --bg-surface: light-dark(var(--bg-surface-light), var(--bg-surface-dark));
    --bg-elevated: light-dark(var(--bg-elevated-light), var(--bg-elevated-dark));
    --bg-subtle: light-dark(var(--bg-subtle-light), var(--bg-subtle-dark));
    --bg-glass: light-dark(var(--bg-glass-light), var(--bg-glass-dark));
    --bg-card-hover: light-dark(var(--bg-card-hover-light), var(--bg-card-hover-dark));
    --text-primary: light-dark(var(--text-primary-light), var(--text-primary-dark));
    --text-secondary: light-dark(var(--text-secondary-light), var(--text-secondary-dark));
    --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --accent-gold: light-dark(var(--accent-gold-light), var(--accent-gold-dark));
    --accent-gold-strong: light-dark(var(--accent-gold-strong-light), var(--accent-gold-strong-dark));
    --accent-gold-soft: light-dark(var(--accent-gold-soft-light), var(--accent-gold-soft-dark));
    --accent-gold-glow: light-dark(var(--accent-gold-glow-light), var(--accent-gold-glow-dark));
    --accent-burgundy: light-dark(var(--accent-burgundy-light), var(--accent-burgundy-dark));
    --accent-emerald: light-dark(var(--accent-emerald-light), var(--accent-emerald-dark));
    --accent-error: light-dark(var(--accent-error-light), var(--accent-error-dark));
    --accent-error-bg: light-dark(var(--accent-error-bg-light), var(--accent-error-bg-dark));
    --border-subtle: light-dark(var(--border-subtle-light), var(--border-subtle-dark));
    --border-strong: light-dark(var(--border-strong-light), var(--border-strong-dark));
    --border-gold: light-dark(var(--border-gold-light), var(--border-gold-dark));
    --shadow-card: light-dark(var(--shadow-card-light), var(--shadow-card-dark));
    --shadow-elevated: light-dark(var(--shadow-elevated-light), var(--shadow-elevated-dark));
    --scrollbar-thumb: light-dark(#b49a6b, #6b5835);
    --scrollbar-track: light-dark(#efe8dc, #12151e);
  }

  /* Typography & Layout Tokens */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-h: 76px;
  --container-max: 1320px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  accent-color: var(--accent-gold);
  /* Pair scrollbar-color with scrollbar-width so macOS renders custom scrollbars; never animate scrollbar-color */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Legacy fallback for WebKit browsers without standard scrollbar-color */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

/* View Transition Diagonal Curtain Wipe for Theme Switch */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: theme-curtain-reveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes theme-curtain-reveal {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* ==========================================================================
   BASE RESET & LAYOUT
   ========================================================================== */

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

[hidden],
.is-hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: clip;
  max-width: 100%;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -5%, var(--accent-gold-soft), transparent 70%),
    radial-gradient(circle at 85% 25%, var(--accent-gold-soft), transparent 45%);
}

/* Prevent any grid or flex child from overflowing mobile viewport */
.hero-grid > *,
.services-grid > *,
.methodology-layout > *,
.stories-grid > *,
.museums-grid > *,
.books-featured-grid > *,
.video-grid > *,
.lectures-press-grid > *,
.bio-grid > *,
.contact-grid > *,
.form-row-2 > *,
.field,
#contact-form-home,
.contact-focus-stage,
.contact-form-card {
  min-width: 0;
  max-width: 100%;
}

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

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

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

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

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

/* Reading / Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 1200;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-burgundy), var(--accent-gold-strong));
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* ==========================================================================
   STICKY HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-card);
  border-bottom-color: var(--border-gold);
}

.header-inner {
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-emblem {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-subtle));
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  box-shadow: 0 4px 14px var(--accent-gold-soft);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex-shrink: 0;
}

.brand-eyebrow {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--accent-gold);
  font-weight: 700;
  white-space: nowrap;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.nav-link {
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text-primary);
  background-color: var(--accent-gold-soft);
}

.nav-link-cta {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-strong));
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.46rem 0.95rem;
  margin-left: 0.25rem;
  box-shadow: 0 4px 14px var(--accent-gold-glow);
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .nav-link-cta {
  color: #12100b !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
}

.control-btn:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
}

.lang-flag-btn {
  padding: 0.22rem;
  gap: 0.2rem;
}

.lang-flag-option {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.68;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.lang-flag-option:hover {
  opacity: 0.95;
}

.lang-flag-option.is-active {
  background: var(--accent-gold-soft);
  color: var(--text-primary);
  opacity: 1;
  box-shadow: inset 0 0 0 1px var(--border-gold);
}

.flag-svg {
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 2.5px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

.mobile-menu-btn {
  display: none;
}

/* Theme toggle icon branching via CSS cascade */
.theme-toggle-btn .icon-moon {
  display: inline-block;
}
.theme-toggle-btn .icon-sun {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle-btn .icon-moon {
  display: none;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle-btn .icon-sun {
  display: inline-block;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-toggle-btn .icon-moon {
  display: inline-block;
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-toggle-btn .icon-sun {
  display: none;
}

/* ==========================================================================
   HERO SECTION — EDITORIAL & ARCHIVAL LUXURY
   ========================================================================== */

.hero-section {
  position: relative;
  padding: 4.5rem 0 5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-bg-ornament {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, black 20%, transparent 80%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
}

.pill-badge--secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 4.6vw, 4.15rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
}

.hero-title-highlight {
  color: var(--accent-gold);
  font-style: italic;
  font-weight: 600;
}

.hero-former-name {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 1.4rem;
}

.hero-lead {
  font-size: 1.1rem;
  line-height: 1.72;
  color: var(--text-secondary);
  margin: 0 0 2rem;
  max-width: 64ch;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-strong));
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 10px 28px -6px var(--accent-gold-glow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .btn-primary {
  color: #13100a;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 34px -6px var(--accent-gold-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

/* Hero Right Portrait & Archival Pedigree Showcase */
.hero-visual {
  position: relative;
}

.portrait-showcase {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  padding: 1rem;
  box-shadow: var(--shadow-elevated);
}

.portrait-frame {
  position: relative;
  border-radius: calc(var(--radius-lg) - 8px);
  overflow: hidden;
  aspect-ratio: 4 / 4.3;
  background: var(--bg-subtle);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.6s ease;
}

.portrait-showcase:hover .portrait-frame img {
  transform: scale(1.03);
}

.portrait-caption-bar {
  margin-top: 0.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.portrait-caption-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.portrait-caption-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portrait-switcher {
  display: flex;
  gap: 0.35rem;
}

.portrait-thumb-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  padding: 0;
  cursor: pointer;
  background: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.portrait-thumb-btn.is-active,
.portrait-thumb-btn:hover {
  border-color: var(--accent-gold);
  transform: scale(1.06);
}

.portrait-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-credential {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 260px;
  z-index: 3;
}

.floating-credential--top {
  top: -18px;
  left: -16px;
}

.floating-credential--bottom {
  bottom: 108px;
  right: -16px;
}

.cred-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.cred-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
}

.cred-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SECTIONS & EDITORIAL HEADINGS
   ========================================================================== */

.section {
  padding: 5.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.section--alt {
  background-color: var(--bg-surface);
}

.section-header {
  max-width: 780px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.14;
  margin: 0 0 1rem;
}

.section-desc {
  font-size: 1.04rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
}

/* ==========================================================================
   SCROLL-DRIVEN ENTRY ANIMATIONS (modern-web-guidance compliant)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up {
      from {
        opacity: 0.15;
        transform: translateY(28px) scale(0.98);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .reveal-card {
      animation: reveal-up auto linear backwards;
      animation-timeline: view(block);
      animation-range: entry 0% cover 24%;
    }
  }
}

/* Fallback for browsers without CSS view() timeline */
.reveal-card.js-reveal-init {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal-card.js-reveal-init.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   GENEALOGY SERVICES & PACKAGES (SALES PROFILE)
   ========================================================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.service-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-elevated);
}

.service-card--featured {
  border: 2px solid var(--accent-gold);
  background:
    linear-gradient(180deg, var(--accent-gold-soft) 0%, transparent 38%),
    var(--bg-elevated);
}

.service-featured-ribbon {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-strong));
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .service-featured-ribbon {
  color: #141008;
}

.service-roman {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.service-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.85rem;
}

.service-summary {
  font-size: 0.96rem;
  color: var(--text-secondary);
  margin: 0 0 1.35rem;
}

.service-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.service-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.service-features li::before {
  content: "✦";
  color: var(--accent-gold);
  font-size: 0.85rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.service-footer {
  padding-top: 1.35rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.service-Deliverable {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.service-Deliverable strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.84rem;
}

/* ==========================================================================
   INTERACTIVE ARCHIVAL GENERATION TIME-MACHINE & METHODOLOGY
   ========================================================================== */

.methodology-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 2.5rem;
  align-items: start;
}

.era-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.era-tab-btn {
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.era-tab-btn:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.era-tab-btn.is-active {
  border-color: var(--accent-gold);
  background: linear-gradient(90deg, var(--accent-gold-soft), var(--bg-elevated));
  box-shadow: var(--shadow-card);
}

.era-years {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: block;
}

.era-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.era-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.era-detail-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-elevated);
}

.era-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.era-detail-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0;
}

.era-archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.25rem 0;
}

.archive-tag {
  padding: 0.32rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.era-preview-img {
  margin-top: 1.25rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  max-height: 230px;
}

.era-preview-img img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

/* ==========================================================================
   CASE STUDIES / FAMILY STORIES ("STORYK A KUTATÓMŰHELYBŐL")
   ========================================================================== */

.stories-filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 2.5rem;
}

.filter-chip {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #ffffff;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .filter-chip.is-active {
  color: #13100a;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.story-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.story-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-elevated);
}

.story-img-wrap {
  position: relative;
  height: 230px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.story-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.5s ease;
}

.story-card:hover .story-img-wrap img {
  transform: scale(1.05);
}

.story-region-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 17, 24, 0.82);
  color: #f6ce7d;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(246, 206, 125, 0.35);
}

.story-body {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.story-timespan {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.story-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.22;
  margin: 0 0 0.75rem;
}

.story-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1.35rem;
  flex: 1;
}

.story-read-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.story-read-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   DIGITAL MEMORIAL MUSEUMS & LIVE DATABASES
   ========================================================================== */

.museums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.museum-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.museum-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

.museum-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-emerald);
  margin-bottom: 0.75rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 4px rgba(27, 101, 69, 0.2);
}

.museum-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.museum-authors {
  font-size: 0.82rem;
  color: var(--accent-gold);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.museum-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin: 1.2rem 0;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.museum-metric-val {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  line-height: 1.1;
}

.museum-metric-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   BOOKS, MONOGRAPHS & SCIENTIFIC PUBLICATIONS
   ========================================================================== */

.books-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.book-showcase-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.book-cover-stage {
  height: 290px;
  background: linear-gradient(145deg, var(--bg-subtle), var(--bg-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.book-cover-stage img {
  max-height: 100%;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.book-info {
  padding: 1.65rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-year-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.22;
  margin: 0 0 0.65rem;
}

.book-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1.2rem;
  flex: 1;
}

.bibliography-list {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.bib-item {
  display: grid;
  grid-template-columns: 95px 1fr auto;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.bib-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bib-year {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.bib-citation strong {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  display: block;
  margin-bottom: 0.2rem;
}

.bib-citation span {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   LECTURES, VIDEOS & MEDIA APPEARANCES
   ========================================================================== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.video-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0d1017;
  overflow: hidden;
  cursor: pointer;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.video-card:hover .video-thumb img {
  transform: scale(1.05);
  opacity: 1;
}

.video-play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(200, 150, 62, 0.94);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.video-card:hover .video-play-btn {
  transform: scale(1.1);
}

.video-body {
  padding: 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lectures-press-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
}

.panel-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.timeline-list li {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-gold);
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-gold);
}

.press-link-card {
  display: block;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  margin-bottom: 0.85rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.press-link-card:hover {
  border-color: var(--accent-gold);
  transform: translateX(4px);
}

/* ==========================================================================
   BIOGRAPHY & INSTITUTIONAL ROLES
   ========================================================================== */

.bio-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 2.75rem;
  align-items: start;
}

.bio-photo-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
}

.bio-photo-card img {
  border-radius: calc(var(--radius-lg) - 8px);
  width: 100%;
  object-fit: cover;
}

.bio-quote {
  margin: 1.25rem 0 0;
  padding: 1.15rem;
  border-left: 3px solid var(--accent-gold);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-style: italic;
  color: var(--text-primary);
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.role-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.role-org {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  margin-bottom: 0.25rem;
}

.role-title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

/* ==========================================================================
   CONTACT & GENEALOGY INQUIRY FORM (validate-input-after-interaction compliant)
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 2.75rem;
  align-items: start;
}

.contact-info-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
}

.contact-form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-elevated);
}

.contact-focus-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.contact-focus-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
}

.contact-focus-close {
  position: static !important;
  float: none !important;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.contact-focus-close:hover {
  border-color: var(--accent-gold);
  transform: scale(1.03);
}

.contact-focus-backdrop {
  z-index: 2100;
  background: rgba(10, 12, 18, 0.76);
  backdrop-filter: blur(12px);
}

.contact-focus-stage {
  width: min(720px, 100%);
  max-height: 92vh;
  display: flex;
  justify-content: center;
}

@keyframes contact-focus-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.contact-focus-stage .contact-form-card {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-gold);
  opacity: 1 !important;
  animation: contact-focus-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

.contact-focus-stage .contact-focus-topbar {
  display: flex;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.field {
  margin-bottom: 1.35rem;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

/* MANDATORY per validate-input-after-interaction: Place format hints above the input so autocomplete popovers and mobile keyboards don't cover them */
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field select {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-soft);
}

.error-msg {
  display: none;
  color: var(--accent-error);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

/* DO: Only show error styles after user interaction (:user-invalid + fallback class) */
.field input:user-invalid,
.field textarea:user-invalid,
.field input.user-invalid,
.field textarea.user-invalid {
  border-color: var(--accent-error);
  background-color: var(--accent-error-bg);
}

.field input:user-invalid + .error-msg,
.field textarea:user-invalid + .error-msg,
.field input.user-invalid + .error-msg,
.field textarea.user-invalid + .error-msg {
  display: block;
}

/* DO: Provide a clear success indication on :user-valid */
.field input:user-valid,
.field textarea:user-valid,
.field input.user-valid,
.field textarea.user-valid {
  border-color: var(--accent-emerald);
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
}

.form-status-box.is-success {
  display: block;
  background: rgba(27, 101, 69, 0.14);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
}

.form-status-box.is-error {
  display: block;
  background: var(--accent-error-bg);
  border: 1px solid var(--accent-error);
  color: var(--accent-error);
}

/* ==========================================================================
   MODALS (STORY READER & VIDEO THEATER)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 10, 15, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: var(--shadow-elevated);
  position: relative;
}

.modal-close-btn {
  position: sticky;
  top: 0;
  float: right;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

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

.site-footer {
  padding: 3.5rem 0 2.5rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */

@media (max-width: 1340px) {
  .nav-link {
    padding: 0.36rem 0.52rem;
    font-size: 0.79rem;
  }
  .nav-link-cta {
    padding: 0.42rem 0.8rem;
  }
}

@media (max-width: 1180px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 1080px) {
  .hero-grid,
  .methodology-layout,
  .lectures-press-grid,
  .bio-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .stories-grid,
  .museums-grid,
  .books-featured-grid,
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .floating-credential--top {
    left: 10px;
    top: 10px;
  }
  .floating-credential--bottom {
    right: 10px;
    bottom: 90px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 62px;
  }

  .container {
    padding: 0 1rem;
  }

  /* Compact mobile header so brand + controls never overflow */
  .header-inner {
    padding: 0 0.85rem;
    gap: 0.45rem;
  }
  .brand-link {
    min-width: 0;
    flex-shrink: 1;
    gap: 0.5rem;
  }
  .brand-emblem {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .brand-emblem svg {
    width: 18px;
    height: 18px;
  }
  .brand-text {
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-eyebrow {
    font-size: 0.52rem;
    letter-spacing: 0.05em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-title {
    font-size: 1.08rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .control-btn {
    padding: 0.38rem 0.58rem;
    font-size: 0.74rem;
  }
  .lang-flag-btn {
    padding: 0.18rem;
    gap: 0.15rem;
  }
  .lang-flag-option {
    padding: 0.24rem 0.38rem;
  }
  .lang-code-text {
    display: none;
  }
  .theme-label-text {
    display: none;
  }

  /* Above-the-fold mobile Hero: Badge -> Title -> Photo -> CTA Buttons -> Lead -> 2x2 Stats */
  .hero-section {
    padding: 0.95rem 0 2.25rem;
  }
  .hero-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .hero-content {
    display: contents;
  }
  .hero-badges {
    order: 1;
    margin-bottom: 0;
    gap: 0.35rem;
  }
  .hero-badges .pill-badge {
    font-size: 0.64rem;
    padding: 0.26rem 0.65rem;
    letter-spacing: 0.04em;
    white-space: normal;
    line-height: 1.25;
  }
  .hero-badges .pill-badge--secondary {
    display: none;
  }
  .hero-title {
    order: 2;
    font-size: clamp(1.62rem, 6.4vw, 2.05rem);
    line-height: 1.12;
    margin: 0;
  }
  .hero-visual {
    order: 3;
    width: 100%;
    margin: 0.1rem 0;
  }
  .floating-credential {
    display: none;
  }
  .portrait-showcase {
    padding: 0.55rem;
    border-radius: 16px;
  }
  .portrait-frame {
    aspect-ratio: 16 / 10.5;
    max-height: 215px;
    border-radius: 11px;
  }
  .portrait-frame img {
    object-position: center 12%;
  }
  .portrait-caption-bar {
    margin-top: 0.45rem;
    padding: 0.45rem 0.65rem;
    gap: 0.5rem;
  }
  .portrait-caption-name {
    font-size: 0.96rem;
    line-height: 1.15;
  }
  .portrait-caption-role {
    font-size: 0.7rem;
    line-height: 1.2;
  }
  .portrait-thumb-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
  }
  .hero-cta-row {
    order: 4;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.1rem 0 0.25rem;
    width: 100%;
  }
  .hero-former-name {
    order: 5;
    font-size: 0.95rem;
    line-height: 1.35;
    margin: 0;
  }
  .hero-lead {
    order: 6;
    font-size: 0.92rem;
    line-height: 1.56;
    margin: 0;
  }
  .hero-stats-grid {
    order: 7;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 0.85rem;
    padding-top: 0.95rem;
    margin-top: 0.2rem;
    width: 100%;
  }
  .stat-value {
    font-size: 1.55rem;
  }
  .stat-label {
    font-size: 0.72rem;
  }

  /* Refined, non-bulky mobile buttons that never clip or overflow */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 0.72rem 0.95rem;
    font-size: 0.85rem;
    line-height: 1.28;
    border-radius: 12px;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }

  .pill-badge {
    white-space: normal;
    line-height: 1.3;
    max-width: 100%;
  }

  .section {
    padding: 2.75rem 0;
  }
  .section-header {
    margin-bottom: 1.85rem;
  }
  .section-title {
    font-size: clamp(1.55rem, 5.8vw, 2rem);
  }
  .section-desc {
    font-size: 0.94rem;
  }

  .services-grid,
  .stories-grid,
  .museums-grid,
  .books-featured-grid,
  .video-grid,
  .roles-grid,
  .form-row-2,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .stories-filter-bar {
    gap: 0.45rem;
  }
  .filter-chip {
    padding: 0.48rem 0.8rem;
    font-size: 0.78rem;
    border-radius: 10px;
  }
  .bib-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .contact-form-card,
  .contact-info-card,
  .service-card,
  .era-detail-card,
  .museum-card {
    padding: 1.25rem;
    border-radius: 16px;
  }

  /* Mobile Focus Mode Modal adjustments */
  .modal-backdrop {
    padding: 0.6rem;
  }
  .contact-focus-stage .contact-form-card {
    padding: 1.1rem 0.95rem;
    border-radius: 16px;
    max-height: 92vh;
  }
  .contact-focus-topbar {
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
  }
  .contact-focus-badge {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    line-height: 1.25;
  }
  .contact-focus-close {
    padding: 0.34rem 0.65rem;
    font-size: 0.74rem;
  }
  .field {
    margin-bottom: 0.95rem;
  }
  .field input,
  .field select,
  .field textarea {
    padding: 0.68rem 0.85rem;
    font-size: 0.9rem;
  }
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(8, 10, 15, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(340px, 88vw);
  height: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-gold);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
