:root {
  --button-ink: #0a090a;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: .58rem;
}

.error-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}

.theme-toggle {
  display: inline-grid;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid #50454a;
  border-radius: .38rem;
  background: var(--panel);
  color: var(--ink);
  transition: background-color .2s, border-color .2s, color .2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--panel-hover);
  color: var(--accent);
}

.theme-toggle svg { width: 1.21rem; height: 1.21rem; }
.theme-toggle .theme-moon { display: none; }
:root[data-theme="light"] .theme-toggle .theme-sun { display: none; }
:root[data-theme="light"] .theme-toggle .theme-moon { display: block; }

@media (min-width: 761px) and (max-width: 940px) {
  .header-inner { gap: 1rem; }
  .navigation { gap: .94rem; }
}

@media (max-width: 760px) {
  .header-inner { gap: .6rem; }
  .header-actions { order: 1; margin-inline-start: auto; }
  .menu-toggle { order: 2; min-height: 2.75rem; }
  .header-inner .navigation { order: 3; }
}

@media (max-width: 360px) {
  .header-inner { gap: .42rem; }
  .menu-toggle { gap: .35rem; padding-inline: .48rem; }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf9f9;
  --panel: #fff;
  --panel-hover: #fff6f7;
  --ink: #201719;
  --muted: #5c4f53;
  --line: #e2d5d8;
  --accent: #b71e36;
  --accent-solid: #b71e36;
  --button-ink: #fff;
  --surface-soft: #f5eeee;
  --surface-rose: #f9e8eb;
  --rose-line: #e7c2c9;
  --control-line: #a28c92;
  --accent-hover: #931629;
}

:root[data-theme="light"] ::selection {
  background: var(--accent-solid);
  color: var(--button-ink);
}

:root[data-theme="light"] :is(.button:not(.button-quiet), .ac-button-primary) {
  color: var(--button-ink);
  background: var(--accent-solid);
}

:root[data-theme="light"] :is(.button:not(.button-quiet), .ac-button-primary):hover {
  background: var(--accent-hover);
}

:root[data-theme="light"] :is(.button-quiet, .theme-toggle, .menu-toggle, .ac-button-outline) {
  border-color: var(--control-line);
  color: var(--ink);
}

:root[data-theme="light"] :is(.button-quiet, .theme-toggle, .menu-toggle, .ac-button-outline):hover {
  border-color: var(--accent);
  background: var(--surface-rose);
  color: var(--accent-hover);
}

:root[data-theme="light"] :is(.text-link:hover, .form-status[data-error]) {
  color: var(--accent-hover);
}

:root[data-theme="light"] .site-header {
  border-color: var(--line);
  background: #fffdfded;
}


:root[data-theme="light"] .hero {
  background: radial-gradient(ellipse at 78% 48%, #f6d7dc 0%, #f9eef0 42%, var(--bg) 72%);
}

:root[data-theme="light"] .hero-inner::before,
:root[data-theme="light"] .inside-hero::before {
  background-image: linear-gradient(#ab344416 1px, transparent 1px), linear-gradient(90deg, #ab344416 1px, transparent 1px);
}

:root[data-theme="light"] .hero-description { color: var(--muted); }
:root[data-theme="light"] .hero-halo { background: radial-gradient(ellipse, #d24d6842, transparent 66%); }

:root[data-theme="light"] .orb-image {
  mix-blend-mode: normal;
  mask-image: radial-gradient(ellipse 34% 39% at 49% 50%, #000 88%, #000e 92%, transparent 100%);
}

:root[data-theme="light"] .orbit { border-color: #b84d6266; }
:root[data-theme="light"] .orbit i::before {
  background: #bd2742;
  box-shadow: 0 0 11px 2px #ca435594;
}

:root[data-theme="light"] :is(.metrics, .site-footer, .catalogue:nth-child(odd), .about-detail, .people-section) {
  background: var(--surface-soft);
}

:root[data-theme="light"] :is(.filter-chip, .ac-filters button) { border-color: var(--control-line); }

:root[data-theme="light"] :is(.filter-chip:is(:hover,.is-active), .inside-jump a:hover, .portfolio-nav a:hover) {
  border-color: var(--accent);
  background: var(--surface-rose);
  color: var(--accent-hover);
}

:root[data-theme="light"] :is(.case, .service-card):is(:hover,:focus-within) {
  border-color: #bc7f8b;
  background: var(--panel-hover);
}

:root[data-theme="light"] :is(.case-image, .person-card img) { background: var(--surface-rose); }

:root[data-theme="light"] :is(.case-body .eyebrow, .process .eyebrow, .ai-panel .eyebrow, .person-role) {
  color: var(--accent);
}

:root[data-theme="light"] :is(.services, .contact) {
  background: radial-gradient(ellipse at 94% 18%, #f7dce0, transparent 61%), var(--surface-soft);
}

:root[data-theme="light"] :is(.service-card, .process, .contact-form, .person-card) {
  background: var(--panel);
}

:root[data-theme="light"] :is(.service-icon, .ai-mark, .icon-button, .portfolio-stat-pair div) {
  border-color: var(--rose-line);
  background: var(--surface-rose);
}

:root[data-theme="light"] .icon-button:hover { background: #f2cfd6; }

:root[data-theme="light"] :is(.home-values-grid article, .value-card) {
  background: linear-gradient(150deg, #fff1f3, var(--panel) 76%);
}

:root[data-theme="light"] .academy-panel {
  border-color: var(--rose-line);
  background: #fff6f7;
}

:root[data-theme="light"] .academy-panel::after {
  background: linear-gradient(90deg, #fff8f9 0%, #fff8f9 34%, #fff8f9f0 43%, #fff8f95c 68%, #fff8f912);
}

:root[data-theme="light"] :is(.academy-promo-copy > p:not(.eyebrow), .contact-links) { color: var(--muted); }

:root[data-theme="light"] :is(.ai-panel, .inside-cta, .portfolio-outreach) {
  border-color: var(--rose-line);
  background: radial-gradient(ellipse at 88% 18%, #f6d6dd, transparent 72%), #fff5f6;
}

:root[data-theme="light"] .contact-form :is(input, select, textarea) {
  border-color: var(--control-line);
  background-color: var(--panel);
}

:root[data-theme="light"] .contact-form select {
  background-image: linear-gradient(45deg, transparent 48%, var(--muted) 50% 71%, transparent 73%), linear-gradient(135deg, transparent 30%, var(--muted) 32% 51%, transparent 53%);
}

:root[data-theme="light"] :is(.project-dialog, .portfolio-lightbox) {
  border-color: var(--rose-line);
  background: var(--panel);
}

:root[data-theme="light"] .inside-hero {
  background: radial-gradient(ellipse at 88% 23%, #f7d8df, transparent 62%), var(--bg);
}

:root[data-theme="light"] :is(.inside-hero-photo, .inside-photo, .portfolio-hero-photo) {
  border-color: var(--rose-line);
  background: var(--panel);
}

:root[data-theme="light"] :is(.inside-hero-photo, .portfolio-hero-photo, .ac-hero-photo, .ac-lab) {
  box-shadow: 0 1.35rem 3rem #5d283024;
}

:root[data-theme="light"] .distinction-item { border-color: #bf8290; }

:root[data-theme="light"] .portfolio-page {
  --portfolio-muted-red: var(--accent);
  --portfolio-raised: var(--panel);
}

:root[data-theme="light"] .portfolio-hero {
  background: radial-gradient(ellipse at 78% 25%, #f5d8dd, transparent 61%), repeating-linear-gradient(90deg, transparent 0 79px, #8f596412 79px 80px), var(--bg);
}

:root[data-theme="light"] :is(.portfolio-nav, .portfolio-band) { background: var(--surface-soft); }

:root[data-theme="light"] :is(.portfolio-feature, .portfolio-editorial) {
  border-color: var(--rose-line);
  background: linear-gradient(125deg, #fff0f3, var(--panel) 74%);
}

:root[data-theme="light"] :is(.portfolio-stat-pair dd, .portfolio-cluster li a) { color: var(--accent); }
:root[data-theme="light"] :is(.portfolio-cluster li, .portfolio-register > div) { border-color: var(--line); }

:root[data-theme="light"] :is(.portfolio-detail, .portfolio-logo-wall li, .portfolio-photo) {
  background: var(--panel);
}

:root[data-theme="light"] :is(.portfolio-photo-portrait img, .portfolio-lightbox img) {
  background: var(--surface-soft);
}

:root[data-theme="light"] .academy-page {
  --ac-ink: var(--ink);
  --ac-muted: var(--muted);
  --ac-deep: var(--bg);
  --ac-panel: var(--panel);
  --ac-line: var(--line);
  --ac-accent: var(--accent);
}

:root[data-theme="light"] .ac-hero {
  background: radial-gradient(ellipse at 75% 27%, #f6dce1 0%, transparent 53%), var(--ac-deep);
}

:root[data-theme="light"] .ac-hero::before {
  background-image: linear-gradient(to right, #bb4a6126 1px, transparent 1px), linear-gradient(to bottom, #bb4a6126 1px, transparent 1px);
}

:root[data-theme="light"] :is(.ac-button-outline, .ac-hero-photo, .ac-lab) { background: var(--panel); }
:root[data-theme="light"] :is(.ac-hero-photo, .ac-lab) { border-color: var(--rose-line); }
:root[data-theme="light"] :is(.ac-hero-photo figcaption, .ac-community-photo figcaption) { color: var(--muted); }
:root[data-theme="light"] .ac-filters button[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-rose); }

:root[data-theme="light"] .ac-course { --ac-track: #a61d35; --ac-track-bg: #fce6e9; }
:root[data-theme="light"] .ac-course-productivity { --ac-track: #7d2850; --ac-track-bg: #f8e6f0; }
:root[data-theme="light"] .ac-course-creative { --ac-track: #81401f; --ac-track-bg: #f8e9de; }
:root[data-theme="light"] .ac-course-essentials { --ac-track: #753b59; --ac-track-bg: #f4e6ee; }
:root[data-theme="light"] .ac-course:is(:hover,:focus-within) { border-color: #bc7f8b; background: var(--panel-hover); }

:root[data-theme="light"] :is(.ac-lab-section, .ac-programmes, .ac-editor-tabs, .ac-lab-preview) {
  background: var(--surface-soft);
}

:root[data-theme="light"] :is(.ac-lab-controls, .ac-editor-tabs, .ac-lab-preview, .ac-preview-label) {
  border-color: var(--line);
}

:root[data-theme="light"] :is(.ac-lab-instruction, .ac-preview-label) { background: var(--surface-rose); }

:root[data-theme="light"] :is(.ac-editor, .ac-editor textarea, .ac-editor-tabs button[aria-selected="true"]) {
  background: var(--panel);
}

:root[data-theme="light"] .ac-editor textarea { color: var(--ink); }
:root[data-theme="light"] .ac-lab-status[data-state="review"] { color: #81401f; }

@media (min-width: 521px) and (max-width: 900px) {
  :root[data-theme="light"] .hero-visual { opacity: .63; }
  :root[data-theme="light"] .hero h1 { text-shadow: 0 0 .2em var(--bg), 0 0 .08em var(--bg); }
}

@media (max-width: 760px) {
  :root[data-theme="light"] .menu-toggle { background: var(--panel); }

  :root[data-theme="light"] .site-header.has-menu .navigation {
    background: var(--panel);
    box-shadow: 0 12px 30px #4f2b3326;
  }
}

@media (max-width: 520px) {
  :root[data-theme="light"] .academy-panel::after {
    background: linear-gradient(0deg, #fff8f9 0%, #fff8f9 28%, #fff8f9f0 43%, #fff8f961 69%, #fff8f900 100%);
  }
}
