:root {
  --shell-top-pad: clamp(12px, 2vw, 20px);
  --shell-side-pad: clamp(16px, 3vw, 30px);
  --shell-max-width: 1200px;
  --surface-dark: rgba(8, 17, 31, 0.68);
  --surface-light: rgba(154, 184, 214, 0.58);
  --stroke-dark: rgba(166, 213, 255, 0.26);
  --stroke-light: rgba(40, 74, 116, 0.28);
  --text-dark: #e8f2ff;
  --text-light: #112b45;
  --muted-dark: #b5cee5;
  --muted-light: #2f506f;
  /* Compatibility tokens retained for brand-constraint checks. */
  --hero-glow-blue: rgba(64, 167, 255, 0.24);
  --hero-glow-green: rgba(47, 230, 179, 0.18);
  --hero-glow-orange: rgba(255, 154, 61, 0.18);
  --shell-shadow-dark: 0 18px 52px rgba(4, 12, 24, 0.34);
  --shell-shadow-light: 0 18px 52px rgba(28, 58, 96, 0.2);
}

html[data-theme-v1="on"][data-theme="light"] {
  --text-dark: var(--text-light);
  --muted-dark: var(--muted-light);
}

@media (prefers-color-scheme: light) {
  html[data-theme-v1="on"]:not([data-theme="dark"]) {
    --text-dark: var(--text-light);
    --muted-dark: var(--muted-light);
  }
}

html[data-theme-v1="on"] .container {
  width: min(var(--shell-max-width), 100% - (var(--shell-side-pad) * 2));
  margin-inline: auto;
  padding-inline: 0;
}

html[data-theme-v1="on"] .skip-link {
  position: absolute;
  left: var(--shell-side-pad);
  top: 0;
  transform: translateY(-140%);
  z-index: 220;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: rgba(10, 22, 40, 0.94);
  color: #f4fbff;
  border: 1px solid rgba(173, 221, 255, 0.42);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  transition: transform 160ms ease;
}

html[data-theme-v1="on"] .skip-link:focus,
html[data-theme-v1="on"] .skip-link:focus-visible {
  transform: translateY(16px);
}

html[data-theme-v1="on"][data-theme="light"] .skip-link {
  background: rgba(244, 250, 255, 0.98);
  color: #143455;
  border-color: rgba(52, 96, 143, 0.34);
}

@media (prefers-color-scheme: light) {
  html[data-theme-v1="on"]:not([data-theme="dark"]) .skip-link {
    background: rgba(244, 250, 255, 0.98);
    color: #143455;
    border-color: rgba(52, 96, 143, 0.34);
  }
}

html[data-theme-v1="on"] .header {
  position: sticky;
  top: 0;
  z-index: 110;
  background: var(--header-glass-rest);
  border-bottom: 1px solid var(--header-border-rest);
  box-shadow: var(--header-shadow-rest);
  -webkit-backdrop-filter: saturate(198%) blur(var(--header-blur-rest));
  backdrop-filter: saturate(198%) blur(var(--header-blur-rest));
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    -webkit-backdrop-filter 220ms ease,
    backdrop-filter 220ms ease;
}

html[data-theme-v1="on"] .header.header--scrolled {
  background: var(--header-glass-scrolled);
  border-bottom-color: var(--header-border-scrolled);
  box-shadow: var(--header-shadow-scrolled);
  -webkit-backdrop-filter: saturate(224%) blur(var(--header-blur-scrolled));
  backdrop-filter: saturate(224%) blur(var(--header-blur-scrolled));
}

html[data-theme-v1="on"] .header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 22px;
  pointer-events: none;
  background: linear-gradient(180deg, color-mix(in oklab, var(--header-border-rest) 24%, transparent), rgba(0, 0, 0, 0));
}

html[data-theme-v1="on"] .header.header--scrolled::after {
  opacity: 0.34;
}

html[data-theme-v1="on"] .header .container.nav {
  min-height: 88px;
  padding-block: var(--shell-top-pad);
  padding-right: clamp(86px, 10vw, 116px);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.3vw, 28px);
}

html[data-theme-v1="on"] .header .brand {
  flex: 0 0 auto;
}

html[data-theme-v1="on"] .header .brand img {
  width: clamp(58px, 7vw, 72px);
  height: clamp(58px, 7vw, 72px);
  max-width: 72px;
  max-height: 72px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* Logo Motion */
html[data-theme-v1="on"] .site-logo {
  --site-logo-pop-scale: 1.28;
  display: block;
  will-change: transform, filter;
  transform-origin: 50% 50%;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

html[data-theme-v1="on"] .site-logo--motion-ready {
  backface-visibility: hidden;
}

html[data-theme-v1="on"] .site-logo--intro {
  animation: logoIntroSettle 640ms cubic-bezier(0.22, 0.8, 0.24, 1) 1 both;
}

html[data-theme-v1="on"] .site-logo--shimmer {
  animation: logoGlassShimmer 1200ms cubic-bezier(0.22, 0.8, 0.24, 1) 1 both;
}

html[data-theme-v1="on"] .site-logo--spin {
  animation: logoEasterSpin 580ms cubic-bezier(0.2, 0.85, 0.2, 1) 1 both;
}

html[data-theme-v1="on"] .site-logo--no-motion {
  animation: none !important;
  transition: none !important;
  transform: none !important;
  filter: none !important;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme-v1="on"] .site-logo--motion-ready:hover {
    transform: translateY(-1px) scale(1.015);
    filter: saturate(1.06) brightness(1.03);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.24);
  }
}

html[data-theme-v1="on"] .site-logo--motion-ready:active {
  transform: translateY(0) scale(1.005);
  filter: saturate(1.03) brightness(1.01);
}

@keyframes logoIntroSettle {
  0% {
    transform: translateY(0) scale(1);
    filter: none;
  }
  38% {
    transform: translateY(-2px) scale(var(--site-logo-pop-scale, 1.28));
    filter: saturate(1.12) brightness(1.06);
  }
  74% {
    transform: translateY(0) scale(0.995);
    filter: saturate(1.02) brightness(1.01);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes logoGlassShimmer {
  0% {
    transform: translateY(0) scale(1);
    filter: none;
  }
  46% {
    transform: translateY(-0.4px) scale(1.008);
    filter: saturate(1.06) brightness(1.03) drop-shadow(0 0 6px rgba(155, 236, 255, 0.22));
  }
  100% {
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes logoEasterSpin {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    filter: none;
  }
  44% {
    transform: translateY(-1px) scale(1.02) rotate(210deg);
    filter: saturate(1.08) brightness(1.04);
  }
  78% {
    transform: translateY(0) scale(1.008) rotate(360deg);
    filter: saturate(1.03) brightness(1.02);
  }
  100% {
    transform: translateY(0) scale(1) rotate(360deg);
    filter: none;
  }
}

html[data-theme-v1="on"] .header .links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

html[data-theme-v1="on"] .header .links a:not(.ui-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(178, 219, 255, 0.34);
  color: var(--text-dark);
  text-decoration: none;
  font-size: clamp(0.98rem, 0.9rem + 0.15vw, 1.06rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 7px 18px rgba(2, 10, 20, 0.25);
  transition: transform 150ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

html[data-theme-v1="on"] .header .links a:not(.ui-btn):hover,
html[data-theme-v1="on"] .header .links a:not(.ui-btn):focus-visible {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 10px 22px rgba(3, 14, 31, 0.32);
}

html[data-theme-v1="on"][data-theme="light"] .header .links a:not(.ui-btn) {
  color: var(--text-light);
  border-color: rgba(56, 98, 145, 0.34);
  background: linear-gradient(180deg, rgba(205, 223, 241, 0.68), rgba(176, 200, 226, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(235, 245, 255, 0.72),
    0 8px 18px rgba(24, 50, 82, 0.22);
}

@media (prefers-color-scheme: light) {
  html[data-theme-v1="on"]:not([data-theme="dark"]) .header .links a:not(.ui-btn) {
    color: var(--text-light);
    border-color: rgba(56, 98, 145, 0.34);
    background: linear-gradient(180deg, rgba(205, 223, 241, 0.68), rgba(176, 200, 226, 0.58));
    box-shadow:
      inset 0 1px 0 rgba(235, 245, 255, 0.72),
      0 8px 18px rgba(24, 50, 82, 0.22);
  }
}

html[data-theme-v1="on"] .nav-toggle {
  min-width: 44px;
  min-height: 44px;
}

html[data-theme-v1="on"] .hero {
  padding-top: clamp(32px, 7vw, 72px);
  padding-bottom: clamp(20px, 4vw, 44px);
}

html[data-theme-v1="on"] .hero-row {
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
}

html[data-theme-v1="on"] .hero .glass-card,
html[data-theme-v1="on"] .now-hero-card {
  border-radius: clamp(20px, 3.4vw, 30px);
  padding: clamp(24px, 4vw, 44px);
}

html[data-theme-v1="on"] .hero-headline,
html[data-theme-v1="on"] .hero-title {
  letter-spacing: -0.02em;
  line-height: 1.08;
}

/* Slightly boost hero body-copy contrast on translucent cards. */
html[data-theme-v1="on"][data-theme="light"] .hero .glass-card p:first-of-type {
  color: rgba(12, 18, 32, 0.84);
}

html[data-theme-v1="on"][data-theme="dark"] .hero .glass-card p:first-of-type {
  color: rgba(245, 245, 245, 0.95);
}

@media (prefers-color-scheme: light) {
  html[data-theme-v1="on"]:not([data-theme="dark"]) .hero .glass-card p:first-of-type {
    color: rgba(12, 18, 32, 0.84);
  }
}

@media (prefers-color-scheme: dark) {
  html[data-theme-v1="on"]:not([data-theme="light"]) .hero .glass-card p:first-of-type {
    color: rgba(245, 245, 245, 0.95);
  }
}

html[data-theme-v1="on"] .hero .btn-row,
html[data-theme-v1="on"] .btn-row {
  gap: 12px;
  flex-wrap: wrap;
}

html[data-theme-v1="on"] .btn-row--spaced {
  margin-top: 10px;
}

html[data-theme-v1="on"] .section {
  padding-top: clamp(18px, 3.6vw, 34px);
  padding-bottom: clamp(18px, 3.6vw, 34px);
  padding-left: clamp(28px, 4vw, 44px);
  padding-right: clamp(28px, 4vw, 44px);
}

html[data-theme-v1="on"] :is(.hero + .section, .section + .section) {
  margin-top: clamp(18px, 2.8vw, 28px);
}

html[data-theme-v1="on"] body.newsletter-page main {
  display: grid;
  gap: clamp(0.75rem, 1.6vw, 1rem);
}

html[data-theme-v1="on"] body.newsletter-page .hero {
  margin-bottom: 0;
}

html[data-theme-v1="on"] body.newsletter-page main > .section {
  margin-top: 0;
  padding-top: clamp(12px, 1.8vw, 18px);
  padding-bottom: clamp(12px, 1.8vw, 18px);
}

html[data-theme-v1="on"] body.newsletter-page .section-title {
  margin: 0;
}

html[data-theme-v1="on"] .trust-rail-section {
  padding-top: clamp(10px, 2vw, 18px);
}

html[data-theme-v1="on"] .trust-rail-card {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 2.6vw, 28px);
}

html[data-theme-v1="on"] .trust-metrics {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

html[data-theme-v1="on"] .trust-metrics li {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(170, 214, 255, 0.26);
  background: rgba(10, 28, 52, 0.42);
}

html[data-theme-v1="on"] .metric-value {
  font-size: clamp(1.1rem, 1rem + 0.7vw, 1.5rem);
  font-weight: 700;
  color: var(--text-dark);
}

html[data-theme-v1="on"] .metric-label {
  font-size: 0.86rem;
  color: var(--muted-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme-v1="on"] .trust-note {
  margin: 0;
  color: var(--muted-dark);
}

html[data-theme-v1="on"] .operating-model-card {
  margin-bottom: 12px;
}

html[data-theme-v1="on"] .operating-model-card h3 {
  margin: 0 0 10px;
}

html[data-theme-v1="on"] .operating-model-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
}

html[data-theme-v1="on"] .contact-pathways {
  margin: 14px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
}

html[data-theme-v1="on"] .contact-pathways li {
  color: var(--muted-dark);
}

html[data-theme-v1="on"] .insights-cadence-inline {
  margin: 0;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted-dark);
}

html[data-theme-v1="on"] .section-title,
html[data-theme-v1="on"] .lede-eyebrow {
  letter-spacing: 0.18em;
}

html[data-theme-v1="on"][data-theme="dark"] .section-title {
  color: #96ffdc;
  text-shadow: 0 0 10px rgba(150, 255, 220, 0.28);
}

@media (prefers-color-scheme: dark) {
  html[data-theme-v1="on"]:not([data-theme="light"]) .section-title {
    color: #96ffdc;
    text-shadow: 0 0 10px rgba(150, 255, 220, 0.28);
  }
}

html[data-theme-v1="on"] .glass-panel,
html[data-theme-v1="on"] .glass-card {
  border-radius: clamp(18px, 2vw, 26px);
}

html[data-theme-v1="on"] .cards {
  gap: 14px;
}

html[data-theme-v1="on"] .card {
  min-height: 188px;
  transition: transform 180ms ease, box-shadow 200ms ease;
}

html[data-theme-v1="on"] .card:hover {
  transform: translateY(-3px);
}

html[data-theme-v1="on"] .footer {
  margin-top: clamp(30px, 5vw, 64px);
  padding-block: clamp(18px, 3vw, 26px);
  border-top: 1px solid rgba(174, 219, 255, 0.2);
}

html[data-theme-v1="on"] .footer .container {
  width: min(var(--shell-max-width), 100% - (var(--shell-side-pad) * 2));
}

/* Resume page redesign */
html[data-theme-v1="on"] body.resume-page .resume-container {
  align-items: stretch;
  gap: clamp(16px, 2.6vw, 24px);
  padding-block: clamp(26px, 4.8vw, 46px);
}

html[data-theme-v1="on"] body.resume-page .resume-intro,
html[data-theme-v1="on"] body.resume-page .resume-highlights {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding: clamp(20px, 3.4vw, 34px);
}

html[data-theme-v1="on"] body.resume-page .resume-kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--muted-dark);
}

html[data-theme-v1="on"] body.resume-page .resume-title {
  margin-top: 0.35rem;
  margin-bottom: 0.7rem;
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
}

html[data-theme-v1="on"] body.resume-page .resume-title::after {
  display: none;
}

html[data-theme-v1="on"] body.resume-page .resume-summary {
  margin: 0;
  max-width: 100%;
  text-wrap: pretty;
  color: var(--muted-dark);
}

html[data-theme-v1="on"] body.resume-page .resume-actions {
  margin-top: 1rem;
}

html[data-theme-v1="on"] body.resume-page .resume-highlight-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.6rem;
}

html[data-theme-v1="on"] body.resume-page .resume-highlight-list li {
  color: var(--muted-dark);
  line-height: 1.55;
}

/* Insights refresh */
html[data-theme-v1="on"] .insights-feed-card,
html[data-theme-v1="on"] .now-card {
  padding: clamp(20px, 2.6vw, 28px);
}

html[data-theme-v1="on"] .insights-feed-item,
html[data-theme-v1="on"] .insights-archive-item {
  border-radius: 16px;
  background: rgba(8, 24, 44, 0.5);
  border-color: rgba(160, 212, 255, 0.28);
}

html[data-theme-v1="on"][data-theme="light"] .insights-feed-item,
html[data-theme-v1="on"][data-theme="light"] .insights-archive-item {
  background: rgba(139, 171, 203, 0.44);
  border-color: rgba(48, 85, 128, 0.3);
}

html[data-theme-v1="on"][data-theme="light"] .trust-metrics li {
  background: rgba(136, 168, 199, 0.42);
  border-color: rgba(49, 89, 134, 0.3);
}

html[data-theme-v1="on"][data-theme="light"] .metric-value {
  color: var(--text-light);
}

@media (prefers-color-scheme: light) {
  html[data-theme-v1="on"]:not([data-theme="dark"]) .insights-feed-item,
  html[data-theme-v1="on"]:not([data-theme="dark"]) .insights-archive-item {
    background: rgba(139, 171, 203, 0.44);
    border-color: rgba(48, 85, 128, 0.3);
  }

  html[data-theme-v1="on"]:not([data-theme="dark"]) .trust-metrics li {
    background: rgba(136, 168, 199, 0.42);
    border-color: rgba(49, 89, 134, 0.3);
  }

  html[data-theme-v1="on"]:not([data-theme="dark"]) .metric-value {
    color: var(--text-light);
  }
}

/* Theme switch: smaller, non-overlapping */
html[data-theme-v1="on"] .theme-switch {
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  padding: 2px 5px;
  transform: scale(0.92);
  transform-origin: top right;
}

html[data-theme-v1="on"] .theme-switch button {
  min-width: 22px;
  min-height: 22px;
}

html[data-theme-v1="on"] .theme-switch .icon {
  font-size: 9px;
}

html[data-theme-v1="on"] .theme-switch .pill {
  width: 22px;
  height: 12px;
}

html[data-theme-v1="on"] .theme-switch .pill .knob {
  width: 9px;
  height: 9px;
}

@media (max-width: 900px) {
  html[data-theme-v1="on"] .header .container.nav {
    min-height: 74px;
    padding-right: var(--shell-side-pad);
  }

  html[data-theme-v1="on"] .header .links {
    display: none;
    right: 0;
    margin-left: 0;
    max-width: min(90vw, 310px);
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(175, 219, 255, 0.34);
    background: rgba(8, 22, 42, 0.88);
    box-shadow: var(--shell-shadow-dark);
  }

  html[data-theme-v1="on"] .header .links.open,
  html[data-theme-v1="on"] .header.is-open .links {
    display: flex;
    flex-direction: column;
  }

  html[data-theme-v1="on"] .header .links a {
    width: 100%;
    justify-content: flex-start;
  }

  html[data-theme-v1="on"] .theme-switch {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    transform: scale(0.84);
  }

  html[data-theme-v1="on"] .section {
    padding-left: clamp(18px, 5.2vw, 28px);
    padding-right: clamp(18px, 5.2vw, 28px);
  }

  html[data-theme-v1="on"] .trust-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme-v1="on"][data-theme="light"] .header .links {
    border-color: rgba(69, 108, 151, 0.32);
    background: rgba(184, 207, 229, 0.84);
    box-shadow: var(--shell-shadow-light);
  }

  @media (prefers-color-scheme: light) {
    html[data-theme-v1="on"]:not([data-theme="dark"]) .header .links {
      border-color: rgba(69, 108, 151, 0.32);
      background: rgba(184, 207, 229, 0.84);
      box-shadow: var(--shell-shadow-light);
    }
  }
}

@media (max-width: 560px) {
  html[data-theme-v1="on"] .hero {
    padding-top: 22px;
  }

  html[data-theme-v1="on"] .trust-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html[data-theme-v1="on"] .header,
  html[data-theme-v1="on"] .glass-panel,
  html[data-theme-v1="on"] .glass-card,
  html[data-theme-v1="on"] .theme-switch,
  html[data-theme-v1="on"] .ui-btn,
  html[data-theme-v1="on"] .cta:not(.ui-btn),
  html[data-theme-v1="on"] .cta-btn:not(.ui-btn) {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  html[data-theme-v1="on"] .header {
    background: rgba(12, 32, 58, 0.9);
  }

  html[data-theme-v1="on"] .header.header--scrolled {
    background: rgba(12, 32, 58, 0.78);
  }

  html[data-theme-v1="on"][data-theme="light"] .header {
    background: rgba(188, 210, 233, 0.9);
  }

  html[data-theme-v1="on"][data-theme="light"] .header.header--scrolled {
    background: rgba(188, 210, 233, 0.74);
  }

  @media (prefers-color-scheme: light) {
    html[data-theme-v1="on"]:not([data-theme="dark"]) .header {
      background: rgba(188, 210, 233, 0.9);
    }

    html[data-theme-v1="on"]:not([data-theme="dark"]) .header.header--scrolled {
      background: rgba(188, 210, 233, 0.74);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme-v1="on"] .card,
  html[data-theme-v1="on"] .header .links a,
  html[data-theme-v1="on"] .ui-btn,
  html[data-theme-v1="on"] .theme-switch,
  html[data-theme-v1="on"] .site-logo,
  html[data-theme-v1="on"] .site-logo--intro,
  html[data-theme-v1="on"] .site-logo--shimmer,
  html[data-theme-v1="on"] .site-logo--spin,
  html[data-theme-v1="on"] .site-logo--motion-ready {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }
}
