:root {
  --bg: #faf7f2;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-hover: #fdfcfa;
  --border: rgba(35, 28, 20, 0.08);
  --border-strong: rgba(35, 28, 20, 0.14);
  --ink: #1a1816;
  --ink-secondary: #6b6560;
  --ink-tertiary: #9a9490;
  --accent: #1f6c69;
  --accent-soft: rgba(31, 108, 105, 0.08);
  --accent-medium: rgba(31, 108, 105, 0.14);
  --bg-glow: rgba(255, 255, 255, 0.96);
  --bg-start: #fdfaf5;
  --bg-end: #faf7f2;
  --header-bg: rgba(250, 247, 242, 0.9);
  --control-surface: rgba(255, 255, 255, 0.86);
  --control-surface-hover: rgba(255, 255, 255, 0.98);
  --control-border: rgba(35, 28, 20, 0.12);
  --wordmark-ink: #1d2436;
  --shadow-soft: 0 18px 36px rgba(27, 35, 52, 0.08);
  --shadow-strong: 0 24px 48px rgba(27, 35, 52, 0.1);
  --page-max: 1100px;
  --radius-xl: 2rem;
  --radius-lg: 1.35rem;
  --header-h: 4.6rem;
}

:root[data-theme="dark"] {
  --bg: #121922;
  --surface: rgba(19, 25, 34, 0.94);
  --surface-strong: #18202a;
  --surface-hover: #202a36;
  --border: rgba(173, 189, 208, 0.14);
  --border-strong: rgba(173, 189, 208, 0.24);
  --ink: #edf2fb;
  --ink-secondary: #b1bfd1;
  --ink-tertiary: #7f90a7;
  --accent: #44d2ca;
  --accent-soft: rgba(68, 210, 202, 0.12);
  --accent-medium: rgba(68, 210, 202, 0.22);
  --bg-glow: rgba(53, 90, 104, 0.22);
  --bg-start: #18222d;
  --bg-end: #121922;
  --header-bg: rgba(12, 18, 25, 0.88);
  --control-surface: rgba(21, 29, 39, 0.9);
  --control-surface-hover: rgba(27, 37, 49, 0.98);
  --control-border: rgba(173, 189, 208, 0.18);
  --wordmark-ink: #f1f6ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--bg-glow), transparent 32%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 110;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 1rem;
  overflow: hidden;
  background: none;
  box-shadow: none;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.wordmark {
  font-family: "Playfair Display", serif;
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--wordmark-ink);
  text-decoration: none;
  white-space: nowrap;
}

.header-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-context {
  color: var(--ink-tertiary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.header-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control-surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.header-icon-button:hover,
.header-icon-button.active {
  border-color: var(--accent-medium);
  background: var(--control-surface-hover);
  color: var(--accent);
  transform: translateY(-1px);
}

.header-icon-button svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle-icon {
  position: absolute;
  transition: opacity 160ms ease, transform 160ms ease;
}

.theme-toggle-icon--sun {
  opacity: 0;
  transform: scale(0.68) rotate(-24deg);
}

:root[data-theme="dark"] .theme-toggle-icon--sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

:root[data-theme="dark"] .theme-toggle-icon--moon {
  opacity: 0;
  transform: scale(0.68) rotate(24deg);
}

.header-link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.header-link-pill:hover {
  border-color: var(--accent-medium);
  background: var(--surface-hover);
  color: var(--accent);
  transform: translateY(-1px);
}

.header-link-pill.is-primary {
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(31, 108, 105, 0.2);
}

.header-link-pill.is-primary:hover {
  background: #185b58;
  color: #ffffff;
}

.page-hero {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  margin: 0;
  color: var(--ink-tertiary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(2.05rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--ink);
  text-wrap: balance;
}

.page-intro {
  max-width: 60ch;
  margin: 0;
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.72;
}

@media (max-width: 900px) {
  .header-inner {
    padding: 0 1rem;
    min-height: 4rem;
  }

  .wordmark {
    font-size: 1.8rem;
  }

  .brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: static;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.85rem 0.9rem;
  }

  .header-center {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .header-actions {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-link-pill {
    min-height: 2.45rem;
    padding: 0 0.85rem;
    font-size: 0.72rem;
  }

  .page-title {
    font-size: clamp(1.85rem, 9vw, 2.8rem);
  }
}
