/* ===== DESIGN SYSTEM ===== */
:root {
  --bg: #f6f5f3;
  --bg-warm: #edeae5;
  --text: #1a1d23;
  --text-secondary: #555a64;
  --header-bg: #0e1015;
  --header-text: #f4f6f8;
  --muted: #5f636a;
  --link: #1a1d23;
  --panel: #ffffff;
  --accent: #8a6518;
  --accent-light: #f5e6c8;
  --accent-dark: #6f5113;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

}

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

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

.site-container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.scroll-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--header-text);
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 4px;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.nav-toggle {
  margin-left: auto;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
}

.main-nav { margin-left: auto; }

.main-nav-list, .submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item { position: static; }

.nav-link {
  color: rgba(246, 248, 252, 0.88);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover, .nav-item.active > .nav-link {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255, 255, 255, 0.6);
  margin-top: 1px;
}

.submenu-toggle { display: none; }

.submenu {
  position: absolute;
  top: 100%;
  left: auto;
  min-width: 280px;
  background: #0e1015;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 8px;
  visibility: hidden;
  transform: translateY(6px);
  transition: transform 0.2s, visibility 0.2s;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.submenu a {
  display: block;
  color: #e8eaee;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 1rem;
  transition: background 0.15s;
}

.submenu a:hover { background: rgba(255, 255, 255, 0.1); }

.has-children:hover > .submenu,
.has-children:focus-within > .submenu,
.has-children.open > .submenu {
  visibility: visible;
  transform: translateY(0);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(138, 101, 24, 0.35);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

/* ===== HOME HERO ===== */
.home-hero {
  position: relative;
  min-height: min(85vh, 720px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.3) saturate(0.8);
}

.home-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,16,21,0.85) 0%, rgba(14,16,21,0.4) 100%);
}

.home-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 60px;
  padding: 120px 0 80px;
}

.home-hero-label {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}

.home-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0 0 24px;
}

.home-hero-sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 36px;
  max-width: 480px;
}

.home-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.home-hero-portrait {
  flex-shrink: 0;
}

.home-hero-portrait img {
  width: 320px;
  height: 400px;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 200px 200px 24px 24px;
  border: 3px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ===== STATS BAR ===== */
.home-stats {
  position: relative;
  z-index: 2;
  margin-top: -52px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.stat-unit {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 12px;
}

.stat-detail {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.home-stats-updated {
  margin: 14px 2px 0;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ===== HOME INTRO ===== */
.home-intro {
  padding: 100px 0 80px;
}

.home-intro-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 60px;
  align-items: center;
}

.home-intro-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 24px;
}

.home-intro-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.home-intro-text strong {
  color: var(--text);
  font-weight: 600;
}

.home-pullquote {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.05rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
}

.home-intro-image img {
  width: 100%;
  height: 560px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ===== EXPLORE CARDS ===== */
.home-explore {
  padding: 40px 0 100px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 40px;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.explore-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}

.explore-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

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

.explore-card:hover .explore-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.explore-card-img {
  height: 200px;
  overflow: hidden;
}

.explore-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.4s;
}

.explore-card-body {
  padding: 24px;
  position: relative;
}

.explore-card-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.explore-card-body p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.explore-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--muted);
  transition: transform 0.25s, color 0.25s;
}

/* Last two cards span wider */
.explore-grid .explore-card:nth-child(4) { grid-column: 1 / 2; }
.explore-grid .explore-card:nth-child(5) { grid-column: 2 / 4; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--header-bg);
  color: #eceff2;
}

.footer-inner {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-img {
  width: 36px;
  height: 36px;
}

.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-contact-title { margin-bottom: 4px; font-size: 1.08rem; }

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  color: rgba(236, 239, 242, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}

.footer-nav a:hover { color: #fff; }

.footer-contact {
  text-align: right;
}

.footer-contact a {
  color: rgba(236, 239, 242, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}

.footer-contact a:hover { color: #fff; }

.footer-social {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 1.1rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.footer-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(138, 101, 24, 0.1);
}

/* ===== SUB-PAGE LAYOUT (kept for compatibility) ===== */
.site-main {
  min-height: calc(100vh - 230px);
}

body:not(.is-home) .site-main {
  padding-bottom: 20px;
}

.content-wrap {
  width: min(1240px, calc(100% - 40px));
  margin: 30px auto 0;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.page-rail {
  position: sticky;
  top: 90px;
}

.rail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.rail-title {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
}

.rail-sub {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.rail-jump {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--accent-light);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.rail-jump:hover { background: #edd9b1; }

.rail-nav {
  margin-top: 14px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.rail-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-size: 0.94rem;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background 0.15s, border-color 0.15s;
}

.rail-link:hover { background: var(--bg-warm); }

.rail-link.level-3 {
  margin-left: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.rail-link.is-active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
  font-weight: 500;
}

/* ===== CONTENT AREA ===== */
.content-root {
  font-size: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 36px);
  box-shadow: var(--shadow-md);
}

.content-root > * + * { margin-top: 16px; }

.content-root p, .content-root li { font-size: 1em; line-height: 1.7; }

.content-root h1, .content-root h2, .content-root h3, .content-root h4 {
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  scroll-margin-top: 90px;
}

.content-root h1, .page-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  margin: 0 0 24px;
  font-weight: 800;
}

.content-root h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-top: 32px;
  margin-bottom: 14px;
}

.content-root h3 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.content-root img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  cursor: zoom-in;
}

.hero-slider img, .page-hero img { cursor: default; }

.content-root .has-background {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.alignwide, .alignfull { width: 100%; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.page-hero { margin: 0 0 20px; }

.page-hero img {
  width: 100%;
  height: clamp(220px, 35vw, 400px);
  object-fit: cover;
}

/* Legacy hero slider (kept for any sub-pages) */
.hero-slider {
  position: relative;
  width: 100%;
  height: clamp(260px, 45vw, 520px);
  overflow: hidden;
  margin-bottom: 24px;
  background: #141922;
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  text-decoration: none;
  color: #fff;
}

.hero-slider .slide.is-active { opacity: 1; z-index: 1; }

.hero-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider .slide-caption {
  position: absolute;
  left: 24px;
  bottom: 24px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 1.4rem;
  font-weight: 700;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.slider-control:hover { background: rgba(0, 0, 0, 0.6); }
.slider-control.prev { left: 14px; }
.slider-control.next { right: 14px; }

.slider-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 4;
}

.slider-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.4);
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.slider-dots button.is-active { background: #fff; }

/* ===== QUICK PANEL ===== */
.quick-panel[hidden], .image-lightbox[hidden] { display: none; }

.quick-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(9, 10, 12, 0.6);
  backdrop-filter: blur(8px);
}

.quick-panel-inner {
  width: min(640px, calc(100% - 30px));
  margin: 80px auto 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.quick-search-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--panel);
}

.quick-search-input:focus { outline: 0; border-bottom-color: var(--accent); }

.quick-results {
  max-height: min(60vh, 520px);
  overflow: auto;
}

.quick-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.12s;
}

.quick-result:hover, .quick-result.is-active {
  background: var(--accent-light);
}

.quick-result-title {
  display: block;
  font-weight: 600;
}

.quick-result-meta {
  display: block;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.quick-empty {
  padding: 20px;
  color: var(--text-secondary);
}

/* ===== LIGHTBOX ===== */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(8, 9, 12, 0.85);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-lightbox.is-open {
  opacity: 1;
}

.lightbox-frame {
  max-width: min(1100px, 92vw);
  max-height: 90vh;
  position: relative;
}

.lightbox-frame img {
  width: auto;
  max-width: 100%;
  max-height: calc(90vh - 30px);
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.lightbox-close:hover { transform: scale(1.1); }
.lightbox-close:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

/* ===== SUBPAGE CARDS (hub pages) ===== */
.subpage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.subpage-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
}

.subpage-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.subpage-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.subpage-card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subpage-card-text {
  min-width: 0;
}

.subpage-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.subpage-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
  line-height: 1.4;
}

.subpage-card .subpage-card-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.2rem;
  transition: transform 0.2s, color 0.2s;
}

.subpage-card:hover .subpage-card-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ===== PAGE HEADER (sub-pages) ===== */
.page-header-bar {
  background: var(--header-bg);
  padding: 48px 0 40px;
  margin-bottom: 0;
}

.page-header-bar .page-title {
  color: #fff;
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-header-bar .page-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  margin: 8px 0 0;
}

/* ===== CONTENT LINKS ===== */
.content-root a:not(.btn):not(.subpage-card) {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(138, 101, 24, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.content-root a:not(.btn):not(.subpage-card):hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ===== BETTER TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}

thead th {
  background: var(--header-bg);
  color: var(--header-text);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

th, td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
}

tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

tbody tr:hover {
  background: var(--accent-light);
}

/* ===== IFRAME CONTAINER ===== */
.content-root iframe {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ===== FIGURE CAPTIONS ===== */
.content-root figcaption {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* ===== CONTENT LISTS ===== */
.content-root ul, .content-root ol {
  padding-left: 24px;
}

.content-root li {
  margin-bottom: 6px;
}

.content-root li::marker {
  color: var(--accent);
}

/* ===== RECIPE CARDS ===== */
.recipe-card {
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  margin-bottom: 24px;
  overflow: hidden;
}

.recipe-card-header {
  margin-bottom: 28px;
}

.recipe-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 8px;
}

.recipe-card-tagline {
  font-size: 0.95rem;
  font-style: italic;
  opacity: 0.8;
  margin: 0;
}

.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 36px);
}

.recipe-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid currentColor;
  opacity: 0.9;
}

.recipe-card ul,
.recipe-card ol {
  padding-left: 20px;
  margin: 0;
}

.recipe-card li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.recipe-info {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.92rem;
  line-height: 1.6;
}

.recipe-info p {
  margin: 0 0 8px;
}

.recipe-info p:last-child {
  margin-bottom: 0;
}

.recipe-nutrition {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.85;
}

.recipe-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 16px;
}

.recipe-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

/* Recipe color themes */
.recipe-card--warm {
  background: var(--bg-warm);
  color: var(--text);
}

.recipe-card--warm .recipe-section-title {
  border-color: var(--accent);
}

.recipe-card--warm .recipe-info {
  background: rgba(138, 101, 24, 0.08);
}

.recipe-card--plum {
  background: #693651;
  color: #f6f4de;
}

.recipe-card--plum a { color: #f6d98c; }

.recipe-card--plum .recipe-info {
  background: rgba(255, 255, 255, 0.1);
}

.recipe-card--olive {
  background: #5f6541;
  color: #fff9df;
}

.recipe-card--olive a { color: #d4e088; }

.recipe-card--olive .recipe-info {
  background: rgba(255, 255, 255, 0.1);
}

.recipe-card--gold {
  background: #e4b668;
  color: #392611;
}

.recipe-card--gold a { color: #6f3b0a; }

.recipe-card--gold .recipe-info {
  background: rgba(0, 0, 0, 0.08);
}

.recipe-card--crimson {
  background: #a11609;
  color: #fff9df;
}

.recipe-card--crimson a { color: #ffd68a; }

.recipe-card--crimson .recipe-info {
  background: rgba(255, 255, 255, 0.1);
}

.recipe-card li::marker {
  color: currentColor;
  opacity: 0.5;
}

/* Recipe images grid for side-by-side */
.recipe-images {
  display: grid;
  gap: 12px;
}

@media (max-width: 768px) {
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== PROTOCOL LAYOUT ===== */
.protocol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.protocol-col {}

.section-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin: 0 0 16px;
}

.section-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 4px 0 12px;
}

.time-block {
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 3px solid var(--border);
}

.time-block:hover {
  border-left-color: var(--accent);
}

.time-label {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 8px;
}

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

/* ===== EVENT CARDS ===== */
.event-entry {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  border-top: 2px solid var(--accent);
}

.event-entry:first-of-type {
  border-top: none;
  padding-top: 0;
}

.event-entry--reverse {
  grid-template-columns: 1fr 140px;
}

.event-image img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.event-date {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.event-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.event-time {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.event-goal {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 8px 0 0;
}

/* ===== TIMELINE MILESTONES ===== */
.timeline-milestone {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 32px 0;
  border-top: 2px solid var(--accent);
}

.timeline-milestone:first-of-type {
  border-top: none;
  padding-top: 0;
}

.milestone-date {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.milestone-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.milestone-location {
  font-style: italic;
  color: var(--text-secondary);
  margin: 0;
}

.milestone-media img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.milestone-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.milestone-gallery img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: transform 0.2s;
}

.milestone-gallery img:hover {
  transform: scale(1.04);
}

@media (max-width: 768px) {
  .protocol-grid {
    grid-template-columns: 1fr;
  }
  .event-entry,
  .event-entry--reverse {
    grid-template-columns: 80px 1fr;
    gap: 16px;
  }
  .timeline-milestone {
    grid-template-columns: 1fr;
  }
  .milestone-gallery {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* ===== UTILITIES ===== */
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }

.js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .home-hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .home-hero-sub { margin-left: auto; margin-right: auto; }
  .home-hero-actions { justify-content: center; }
  .home-hero-portrait { order: -1; }
  .home-hero-portrait img { width: 240px; height: 300px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .home-intro-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .home-intro-image { order: -1; }
  .home-intro-image img { height: 360px; }

  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .explore-grid .explore-card:nth-child(4),
  .explore-grid .explore-card:nth-child(5) { grid-column: auto; }
  .explore-grid .explore-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .site-container { width: calc(100% - 32px); }

  .header-inner { min-height: 60px; }
  .brand-text { font-size: 1.1rem; }

  .nav-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.26s ease;
  }

  .site-header.open .main-nav {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .main-nav-list {
    display: block;
    padding: 10px;
  }

  .nav-item { position: relative; }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    font-size: 1rem;
    padding: 12px;
  }

  .submenu-toggle {
    display: inline-flex;
    position: absolute;
    right: 10px;
    top: 11px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }

  .has-children .nav-link { padding-right: 44px; }

  .submenu {
    position: static;
    min-width: 0;
    padding: 0 0 0 12px;
    border: 0;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .has-children.open > .submenu { display: block; }

  .submenu a { padding: 8px 12px; font-size: 0.95rem; }

  /* Home hero mobile */
  .home-hero { min-height: 85vh; }
  .home-hero-content { padding: 100px 0 60px; }
  .home-hero-title { font-size: 3rem; }
  .home-hero-portrait img { width: 180px; height: 220px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 20px 16px; }
  .stat-value { font-size: 2rem; }

  .home-intro { padding: 60px 0; }
  .home-intro-image img { height: 300px; }

  .home-explore { padding: 20px 0 60px; }
  .explore-grid { grid-template-columns: 1fr; }
  .explore-grid .explore-card:last-child { grid-column: auto; }
  .explore-card-img { height: 160px; }

  /* Subpage cards mobile */
  .subpage-cards {
    grid-template-columns: 1fr;
  }

  .subpage-card {
    padding: 16px;
    gap: 12px;
  }

  .subpage-card-icon {
    width: 40px;
    height: 40px;
  }

  .subpage-card-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Sub-page mobile */
  .content-wrap {
    width: calc(100% - 32px);
    margin-top: 18px;
  }

  .page-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .page-rail {
    position: static;
    top: auto;
  }

  .rail-card {
    border-radius: var(--radius-md);
    padding: 12px;
  }

  .rail-sub { display: none; }

  .rail-jump {
    width: auto;
    margin-bottom: 8px;
  }

  .rail-nav {
    margin-top: 0;
    max-height: none;
    overflow: auto hidden;
    white-space: nowrap;
    display: block;
    padding-bottom: 4px;
  }

  .rail-link {
    display: inline-block;
    margin-right: 6px;
  }

  .content-root {
    font-size: 1rem;
    border-radius: var(--radius-md);
    padding: 16px;
  }

  /* Image cropping: prefer showing top/center of images on mobile */
  .home-hero-portrait img,
  .home-intro-image img,
  .explore-card-img img,
  .page-hero img {
    object-position: center top;
  }

  /* Iframe responsive */
  .content-root iframe {
    width: 100%;
    max-height: 400px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    padding: 32px 0;
    gap: 20px;
  }

  .footer-contact { text-align: center; }
  .footer-social { justify-content: center; }
  .footer-nav { flex-wrap: wrap; justify-content: center; gap: 16px; }

  .quick-panel-inner {
    width: calc(100% - 16px);
    margin-top: 66px;
  }
}

@media (max-width: 480px) {
  .home-hero-title { font-size: 2.4rem; }
  .home-hero-portrait img { width: 150px; height: 180px; }
  .btn { padding: 12px 22px; font-size: 0.9rem; }
  .stat-value { font-size: 1.7rem; }
  .stat-card { padding: 16px 12px; }

  .event-entry,
  .event-entry--reverse {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .event-image img {
    max-height: 200px;
    object-fit: cover;
    object-position: center top;
  }

  .content-root iframe {
    max-height: 300px;
  }

  .page-title {
    font-size: 1.8rem;
  }
}

/* ===== STAGGER ANIMATION ===== */
.stats-grid .js-reveal:nth-child(2) { transition-delay: 0.08s; }
.stats-grid .js-reveal:nth-child(3) { transition-delay: 0.16s; }
.stats-grid .js-reveal:nth-child(4) { transition-delay: 0.24s; }

.explore-grid .js-reveal:nth-child(2) { transition-delay: 0.07s; }
.explore-grid .js-reveal:nth-child(3) { transition-delay: 0.14s; }
.explore-grid .js-reveal:nth-child(4) { transition-delay: 0.21s; }
.explore-grid .js-reveal:nth-child(5) { transition-delay: 0.28s; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal {
    opacity: 1;
    transform: none;
  }
  .scroll-progress > span { transition: none; }
  .hero-slider .slide { transition: none; }
}
