/* ==========================================================================
   Kalabhairavam Portal v3 - Premium Design System
   Mix of v1 (content depth, theme modes, accessibility) + v2 (premium look)
   ========================================================================== */

/* --- 1. Theme tokens --- */
:root {
  --bg-page: #f8faf9;
  --bg-surface: #ffffff;
  --bg-soft: #f1f4f2;
  --text-strong: #0f1715;
  --text: #2c3a36;
  --text-soft: #4b5551;
  --text-muted: #828d89;

  --brand: #1b4938;        /* rich green */
  --brand-strong: #0f2b22;
  --brand-soft: #26634d;
  --gold: #d4a352;         /* premium gold */
  --gold-strong: #b88a3f;
  --gold-soft: #f3d494;

  --line: rgba(27, 73, 56, 0.12);
  --line-strong: rgba(27, 73, 56, 0.22);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-line: rgba(255, 255, 255, 0.4);

  --shadow-sm: 0 4px 8px -2px rgba(15, 23, 21, 0.06);
  --shadow-md: 0 12px 24px -8px rgba(15, 23, 21, 0.10);
  --shadow-lg: 0 24px 40px -12px rgba(27, 73, 56, 0.18);
  --shadow-glow: 0 0 0 6px rgba(212, 163, 82, 0.16), 0 18px 40px -12px rgba(212, 163, 82, 0.36);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --nav-h: 80px;
  --nav-h-shrunk: 66px;
  --shell: min(1180px, calc(100% - 32px));

  --t-fast: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-norm: 700ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 900ms cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

html[data-theme-active="dark"] {
  --bg-page: #0a0f0d;
  --bg-surface: #121a17;
  --bg-soft: #192420;
  --text-strong: #f0fdf8;
  --text: #d6e1dc;
  --text-soft: #a7b8b2;
  --text-muted: #6f7f79;

  --brand: #348265;
  --brand-strong: #41a37e;
  --brand-soft: #2d6b57;
  --gold: #e0b977;
  --gold-strong: #d4a352;
  --gold-soft: #f3d494;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --glass: rgba(18, 26, 23, 0.72);
  --glass-line: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 4px 8px -2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 24px -8px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 40px -12px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 6px rgba(224, 185, 119, 0.14), 0 18px 40px -12px rgba(224, 185, 119, 0.30);

  color-scheme: dark;
}

/* --- 2. Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--t-norm), color var(--t-norm);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* --- 3. Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); letter-spacing: -0.018em; }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h4 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); }

p { margin: 0; color: var(--text-soft); }

.text-gradient {
  background: linear-gradient(135deg, var(--brand-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

html[data-theme-active="dark"] .text-gradient {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(212, 163, 82, 0.12);
  color: var(--gold-strong);
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 1rem;
}

html[data-theme-active="dark"] .eyebrow {
  color: var(--gold);
  background: rgba(224, 185, 119, 0.14);
}

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 60ch;
}

/* --- 4. Layout shells --- */
.shell {
  width: var(--shell);
  margin-inline: auto;
}

.section {
  padding-block: clamp(4rem, 8vw, 7rem);
  position: relative;
}

.section--soft { background: var(--bg-soft); }
.section--surface { background: var(--bg-surface); }

.grid-2 {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* --- 5. Decorative blobs --- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-blobs::before,
.bg-blobs::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.bg-blobs::before {
  top: -12%;
  left: -10%;
  width: 48vw;
  height: 48vw;
  background: rgba(27, 73, 56, 0.16);
}

.bg-blobs::after {
  bottom: -14%;
  right: -10%;
  width: 42vw;
  height: 42vw;
  background: rgba(212, 163, 82, 0.14);
}

html[data-theme-active="dark"] .bg-blobs::before { background: rgba(52, 130, 101, 0.18); }
html[data-theme-active="dark"] .bg-blobs::after  { background: rgba(224, 185, 119, 0.16); }

/* --- 6. Navbar (always dark glass) --- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 90;
  background: rgba(10, 18, 15, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: height var(--t-norm), background var(--t-norm), box-shadow var(--t-norm);
  color-scheme: dark;
}

.nav.is-scrolled {
  height: var(--nav-h-shrunk);
  box-shadow: 0 6px 24px -8px rgba(0, 0, 0, 0.45);
  background: rgba(7, 14, 12, 0.92);
}

.nav__inner {
  width: var(--shell);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.nav__brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav.is-scrolled .nav__brand img { height: 34px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__link {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
  padding-block: 0.4rem;
  transition: color var(--t-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  transition: width var(--t-norm);
}

.nav__link:hover,
.nav__link.is-active {
  color: #ffffff;
}

.nav__link:hover::after,
.nav__link.is-active::after {
  width: 100%;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  align-items: center;
  justify-content: center;
}

@media (max-width: 980px) {
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
}

/* Mobile sidebar (v1 polish) */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(7, 18, 15, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-norm);
}

.mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 86vw);
  z-index: 100;
  background: var(--bg-surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--t-norm);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 0.75rem;
}

body.menu-open .mobile-backdrop { opacity: 1; pointer-events: auto; }
body.menu-open .mobile-panel { transform: translateX(0); }
body.menu-open { overflow: hidden; }

.mobile-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}

.mobile-panel__close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-panel a {
  display: block;
  padding: 0.85rem 0.6rem;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-strong);
  transition: background var(--t-fast), color var(--t-fast);
}

.mobile-panel a:hover,
.mobile-panel a.is-active {
  background: var(--bg-soft);
  color: var(--brand);
}

html[data-theme-active="dark"] .mobile-panel a:hover,
html[data-theme-active="dark"] .mobile-panel a.is-active {
  color: var(--gold);
}

/* --- 7. Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: var(--brand-soft);
  box-shadow: var(--shadow-md);
}

.btn--accent {
  background: var(--gold);
  color: #1a1a1a;
  box-shadow: var(--shadow-md);
}

.btn--accent:hover {
  background: var(--gold-strong);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold-strong);
}

.btn--ghost-light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
}

/* --- 8. Cards --- */
.card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 2vw, 2.25rem);
  transition: transform var(--t-norm), border-color var(--t-norm), box-shadow var(--t-norm);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(212, 163, 82, 0.05), transparent 60%);
  opacity: 0;
  transition: opacity var(--t-norm);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.card:hover::before { opacity: 1; }

.card--soft {
  background: var(--bg-soft);
  border-color: transparent;
}

.card--soft:hover {
  border-color: var(--gold);
  background: var(--bg-soft);
}

/* Inner pillar panels (used inside flagship card) */
.pillar {
  transition: transform var(--t-norm), border-color var(--t-norm), box-shadow var(--t-norm), background-color var(--t-norm);
}
.pillar:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

/* Bridge row (about page positioning) */
.bridge-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
  align-items: stretch;
  max-width: 1080px;
  margin: 0 auto 2rem;
}
@media (max-width: 720px) {
  .bridge-row { grid-template-columns: 1fr; }
  .bridge-row__arrow { transform: rotate(90deg); justify-self: center; }
}

/* Founder rows (about page leadership) - alternating photo/content layout */
.founder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.founder-row__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.founder-row__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}
@media (max-width: 820px) {
  .founder-row,
  .founder-row--reverse {
    grid-template-columns: 1fr;
  }
  /* On mobile, force photo above content for both rows */
  .founder-row--reverse > div:first-child { order: 2; }
  .founder-row--reverse > .founder-row__photo { order: 1; }
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(27, 73, 56, 0.12), rgba(212, 163, 82, 0.18));
  color: var(--brand-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

html[data-theme-active="dark"] .card__icon {
  color: var(--gold);
  background: linear-gradient(135deg, rgba(52, 130, 101, 0.22), rgba(224, 185, 119, 0.18));
}

.card__icon svg { width: 28px; height: 28px; }

.card h3 { margin-bottom: 0.85rem; }

.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--brand-soft);
  transition: gap var(--t-fast), color var(--t-fast);
}

.card__cta:hover {
  gap: 0.45rem;
  color: var(--gold-strong);
}

html[data-theme-active="dark"] .card__cta { color: var(--gold); }

/* Pill chips for variety lists */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-strong);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.chip:hover {
  border-color: var(--gold);
  color: var(--gold-strong);
}

html[data-theme-active="dark"] .chip:hover { color: var(--gold); }

.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* Trust signal block */
.trust {
  display: grid;
  gap: 0.85rem;
}

.trust__item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.trust__check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(212, 163, 82, 0.18);
  color: var(--gold-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-theme-active="dark"] .trust__check { color: var(--gold); }

.trust__label { display: block; font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--text-strong); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.trust__value { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); font-weight: 600; word-break: break-all; }

/* --- 9. Hero --- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 2rem) 0 4rem;
  overflow: hidden;
  isolation: isolate;
}

.hero--compact {
  min-height: 60vh;
  padding: calc(var(--nav-h) + 4rem) 0 3rem;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  filter: brightness(0.62) saturate(110%);
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, rgba(7, 18, 15, 0.92) 0%, rgba(7, 18, 15, 0.66) 38%, rgba(7, 18, 15, 0.22) 80%);
}

.hero__content {
  max-width: 760px;
  color: #ffffff;
}

.hero__content h1 { color: #ffffff; }
.hero__content .lead { color: rgba(255, 255, 255, 0.86); margin-block: 1.25rem 2rem; max-width: 60ch; }
.hero__content .eyebrow { color: var(--gold-soft); background: rgba(255, 255, 255, 0.10); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__metrics {
  margin-top: 3rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-strong);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
}

html[data-theme-active="dark"] .metric {
  background: rgba(18, 26, 23, 0.86);
  color: var(--text-strong);
  border: 1px solid var(--line);
}

.metric strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.metric span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}

/* --- 10. CTA banner --- */
.cta-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #ffffff;
  padding: clamp(2rem, 4vw, 3.5rem);
  display: grid;
  gap: 1.5rem;
}

.cta-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 0%, rgba(212, 163, 82, 0.35), transparent 60%);
  pointer-events: none;
}

.cta-banner h2 { color: #ffffff; }
.cta-banner p { color: rgba(255, 255, 255, 0.84); max-width: 60ch; }

.cta-banner__row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  z-index: 1;
}

/* --- 11. Footer --- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  padding-block: 3.5rem 1.75rem;
  margin-top: 2rem;
}

.footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.5fr 1fr 1fr;
}

@media (max-width: 720px) {
  .footer__grid { grid-template-columns: 1fr; }
}

.footer h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer li a {
  color: var(--text-soft);
  font-weight: 500;
  transition: color var(--t-fast);
}
.footer li a:hover { color: var(--gold-strong); }
html[data-theme-active="dark"] .footer li a:hover { color: var(--gold); }

.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- 12. Forms --- */
.form-grid {
  display: grid;
  gap: 1.25rem;
}

.field { display: grid; gap: 0.4rem; }

.field__label {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.field__input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-page);
  color: var(--text-strong);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.field__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 163, 82, 0.18);
  background: var(--bg-surface);
}

.field--span2 { grid-column: 1 / -1; }

.form-status {
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  display: none;
}

.form-status.is-success {
  display: block;
  background: rgba(27, 73, 56, 0.10);
  color: var(--brand-soft);
  border-color: rgba(27, 73, 56, 0.30);
}

.form-status.is-error {
  display: block;
  background: rgba(189, 60, 60, 0.10);
  color: #b13b3b;
  border-color: rgba(189, 60, 60, 0.30);
}

/* --- 13. Theme toggle (simple circle, v2 style) --- */
.theme-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.theme-toggle:hover {
  transform: scale(1.04);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
}

body.menu-open .theme-toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --- 14. Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1),
              transform var(--t-norm) cubic-bezier(0.4, 0, 0.2, 1),
              border-color var(--t-norm) cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow var(--t-norm) cubic-bezier(0.4, 0, 0.2, 1),
              background-color var(--t-norm) cubic-bezier(0.4, 0, 0.2, 1),
              color var(--t-norm) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal.delay-1 { transition-delay: 60ms; }
.reveal.delay-2 { transition-delay: 120ms; }
.reveal.delay-3 { transition-delay: 180ms; }
.reveal.delay-4 { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- 15. Utilities --- */
.headline-block { max-width: 760px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.center { text-align: center; margin-inline: auto; }
.divider { width: 60px; height: 4px; border-radius: 4px; background: var(--gold); margin: 1.25rem 0 1.5rem; }

.hero--compact .hero__content .lead { margin-top: 1rem; margin-bottom: 0; }

.kbh-rule { height: 1px; background: var(--line); border: 0; margin-block: 2rem; }

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head .lead { margin-top: 1rem; }

/* --- 16. Small screens --- */
@media (max-width: 640px) {
  .hero { min-height: 88vh; }
  .hero__metrics { grid-template-columns: 1fr 1fr; }
}
