.thermolio-site-header {
  --thermolio-header-bg: #ffffff;
  --thermolio-header-fg: #232323;
  --thermolio-header-muted: #4f4f4f;
  --thermolio-header-border: rgb(0 0 0 / 10%);
  --thermolio-header-hover: #147d3f;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border: 0;
  box-shadow: inset 0 -1px 0 var(--thermolio-header-border);
  background: var(--thermolio-header-bg);
  backdrop-filter: none;
  color: var(--thermolio-header-fg);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

html[data-scheme="dark"] .thermolio-site-header {
  --thermolio-header-bg: #232323;
  --thermolio-header-fg: #e5e5e5;
  --thermolio-header-muted: #b8b8b8;
  --thermolio-header-border: rgb(255 255 255 / 10%);
  --thermolio-header-hover: #27ae60;
}

@media (prefers-color-scheme: dark) {
  html:not([data-scheme]) .thermolio-site-header,
  html[data-scheme="auto"] .thermolio-site-header {
    --thermolio-header-bg: #232323;
    --thermolio-header-fg: #e5e5e5;
    --thermolio-header-muted: #b8b8b8;
    --thermolio-header-border: rgb(255 255 255 / 10%);
    --thermolio-header-hover: #27ae60;
  }
}

body.thermolio-shared-header-fixed > .thermolio-site-header {
  position: fixed;
  inset: 0 0 auto;
}

body.thermolio-shared-header-fixed #root > div > nav:first-child {
  display: none !important;
}

body.thermolio-shared-header-flow > .thermolio-original-header {
  display: none !important;
}

.thermolio-site-header *,
.thermolio-site-header *::before,
.thermolio-site-header *::after {
  box-sizing: border-box;
}

.thermolio-site-header a {
  color: inherit;
  text-decoration: none;
}

.thermolio-site-header button,
.thermolio-site-header summary,
.thermolio-site-header input {
  font: inherit;
}

.thermolio-site-header button,
.thermolio-site-header summary {
  color: inherit;
}

.thermolio-site-header summary {
  list-style: none;
}

.thermolio-site-header summary::-webkit-details-marker {
  display: none;
}

.thermolio-site-header__inner {
  display: flex;
  width: 100%;
  height: 68px;
  align-items: center;
  padding-inline: 50px;
}

.thermolio-site-header__brand {
  position: relative;
  display: block;
  width: 155px;
  height: 36px;
  flex: 0 0 155px;
}

.thermolio-site-header__logo {
  position: absolute;
  inset: 0;
  display: block;
  width: 155px;
  height: auto;
}

.thermolio-site-header__logo--light {
  display: none;
}

html[data-scheme="dark"] .thermolio-site-header__logo--dark {
  display: none;
}

html[data-scheme="dark"] .thermolio-site-header__logo--light {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-scheme]) .thermolio-site-header__logo--dark,
  html[data-scheme="auto"] .thermolio-site-header__logo--dark {
    display: none;
  }

  html:not([data-scheme]) .thermolio-site-header__logo--light,
  html[data-scheme="auto"] .thermolio-site-header__logo--light {
    display: block;
  }
}

.thermolio-primary-nav {
  display: flex;
  height: 100%;
  align-items: center;
  gap: clamp(20px, 6vw, 80px);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.thermolio-primary-nav > a,
.thermolio-primary-nav > details > summary {
  display: flex;
  height: 100%;
  align-items: center;
  cursor: pointer;
}

.thermolio-primary-nav > :first-child {
  padding-right: 5px;
}

.thermolio-primary-nav > :not(:first-child):not(:last-child) {
  padding-inline: 5px;
}

.thermolio-primary-nav > :last-child {
  padding-left: 5px;
}

.thermolio-primary-nav > a:hover,
.thermolio-primary-nav > a:focus-visible,
.thermolio-primary-nav summary:hover,
.thermolio-primary-nav summary:focus-visible,
.thermolio-nav-dropdown a:hover,
.thermolio-nav-dropdown a:focus-visible,
.thermolio-mobile-menu a:hover,
.thermolio-mobile-menu a:focus-visible,
.thermolio-mobile-menu summary:hover,
.thermolio-mobile-menu summary:focus-visible {
  color: var(--thermolio-header-hover);
}

.thermolio-nav-disclosure {
  position: relative;
  height: 100%;
}

.thermolio-nav-dropdown {
  position: absolute;
  top: calc(100% - 1px);
  z-index: 20;
  display: none;
  min-width: 240px;
  overflow: hidden;
  border: 1px solid var(--thermolio-header-border);
  border-top: 0;
  background: var(--thermolio-header-bg);
  box-shadow: 0 12px 28px rgb(0 0 0 / 24%);
}

.thermolio-nav-disclosure[open] > .thermolio-nav-dropdown {
  display: flex;
  flex-direction: column;
}

.thermolio-nav-dropdown--submenu {
  left: -20px;
}

.thermolio-nav-dropdown--more {
  right: -12px;
  min-width: 280px;
}

.thermolio-nav-dropdown a {
  display: block;
  padding: 15px 20px;
  border-bottom: 1px solid var(--thermolio-header-border);
  background: var(--thermolio-header-bg);
  color: var(--thermolio-header-fg);
  letter-spacing: 0.14em;
}

.thermolio-nav-dropdown a:last-child {
  border-bottom: 0;
}

.thermolio-nav-dropdown a:hover,
.thermolio-nav-dropdown a:focus-visible {
  background: color-mix(in srgb, var(--thermolio-header-fg) 6%, transparent);
}

.thermolio-more-menu > summary {
  width: 30px;
  justify-content: center;
}

.thermolio-header-actions {
  display: flex;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  margin-left: auto;
}

.thermolio-icon-button {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border: 0;
  background: transparent;
  color: currentColor;
  cursor: pointer;
}

.thermolio-icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
  fill: currentColor;
}

[data-site-theme-toggle] svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

[data-site-theme-toggle] svg path {
  fill: currentColor;
  stroke: none;
}

.thermolio-search-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.thermolio-icon-button:hover,
.thermolio-icon-button:focus-visible {
  color: var(--thermolio-header-hover);
}

.thermolio-site-header a:focus-visible,
.thermolio-site-header button:focus-visible,
.thermolio-site-header summary:focus-visible,
.thermolio-site-header input:focus-visible {
  outline: 2px solid var(--thermolio-header-hover);
  outline-offset: 3px;
}

.thermolio-mobile-menu {
  display: none;
}

.thermolio-search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: 640px;
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--thermolio-header-border);
  border-radius: 16px;
  background: var(--thermolio-header-bg);
  color: var(--thermolio-header-fg);
  box-shadow: 0 24px 80px rgb(0 0 0 / 38%);
}

.thermolio-search-dialog::backdrop {
  background: rgb(0 0 0 / 62%);
  backdrop-filter: blur(5px);
}

.thermolio-search-dialog__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
}

.thermolio-search-dialog__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.thermolio-search-dialog__eyebrow {
  margin: 0 0 5px;
  color: var(--thermolio-header-hover);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.thermolio-search-dialog h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.thermolio-search-dialog__close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--thermolio-header-border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.thermolio-search-dialog__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.thermolio-search-dialog__label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thermolio-search-dialog input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--thermolio-header-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--thermolio-header-fg) 5%, transparent);
  color: var(--thermolio-header-fg);
  font-size: 16px;
}

.thermolio-search-dialog input::placeholder {
  color: var(--thermolio-header-muted);
}

.thermolio-search-results {
  display: grid;
  max-height: min(440px, 52dvh);
  gap: 6px;
  overflow: auto;
}

.thermolio-search-results a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
}

.thermolio-search-results a:hover,
.thermolio-search-results a:focus-visible {
  border-color: var(--thermolio-header-border);
  background: color-mix(in srgb, var(--thermolio-header-fg) 6%, transparent);
  color: var(--thermolio-header-hover);
}

.thermolio-search-results span {
  font-weight: 700;
}

.thermolio-search-results small {
  color: var(--thermolio-header-muted);
  font-size: 13px;
  text-align: right;
}

.thermolio-search-dialog__empty {
  margin: 0;
  padding: 20px 0 4px;
  color: var(--thermolio-header-muted);
  text-align: center;
}

@media (max-width: 1240px) and (min-width: 1100px) {
  .thermolio-site-header__inner {
    padding-inline: 32px;
  }

  .thermolio-site-header__brand,
  .thermolio-site-header__logo {
    width: 142px;
  }

  .thermolio-site-header__brand {
    height: 33px;
    flex-basis: 142px;
  }

  .thermolio-primary-nav {
    gap: clamp(20px, 4.4vw, 55px);
  }

  .thermolio-header-actions {
    gap: 30px;
  }
}

@media (min-width: 1100px) {
  .thermolio-site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .thermolio-site-header__brand {
    grid-column: 1;
    justify-self: start;
  }

  .thermolio-primary-nav {
    grid-column: 2;
    justify-self: center;
    margin-left: 0;
  }

  .thermolio-header-actions {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }
}

@media (max-width: 1099px) {
  .thermolio-site-header__inner {
    height: 56px;
    padding-inline: 20px;
  }

  .thermolio-primary-nav {
    display: none;
  }

  .thermolio-mobile-menu {
    position: relative;
    display: block;
    flex: 0 0 24px;
  }

  .thermolio-mobile-menu > summary {
    width: 24px;
    height: 24px;
    padding: 2px;
  }

  .thermolio-mobile-menu__drawer {
    position: fixed;
    top: 56px;
    left: 0;
    z-index: 50;
    display: none;
    width: min(380px, 100vw);
    max-height: calc(100dvh - 56px);
    overflow: auto;
    border-top: 1px solid var(--thermolio-header-border);
    border-right: 1px solid var(--thermolio-header-border);
    background: var(--thermolio-header-bg);
    box-shadow: 16px 24px 48px rgb(0 0 0 / 24%);
  }

  .thermolio-mobile-menu[open] > .thermolio-mobile-menu__drawer {
    display: block;
  }

  .thermolio-mobile-menu nav {
    display: flex;
    flex-direction: column;
    padding-block: 8px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .thermolio-mobile-menu nav > a,
  .thermolio-mobile-submenu > summary {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid var(--thermolio-header-border);
    cursor: pointer;
  }

  .thermolio-mobile-submenu > summary::after {
    content: "+";
    float: right;
    color: var(--thermolio-header-muted);
    font-size: 18px;
    line-height: 1;
  }

  .thermolio-mobile-submenu[open] > summary::after {
    content: "−";
  }

  .thermolio-mobile-submenu > div {
    display: none;
    border-bottom: 1px solid var(--thermolio-header-border);
    background: color-mix(in srgb, var(--thermolio-header-fg) 5%, transparent);
  }

  .thermolio-mobile-submenu[open] > div {
    display: flex;
    flex-direction: column;
  }

  .thermolio-mobile-submenu > div a {
    padding: 14px 32px;
  }

  .thermolio-site-header__brand {
    width: 120px;
    height: 28px;
    flex: 0 0 120px;
    margin-left: 16px;
  }

  .thermolio-site-header__logo {
    width: 120px;
  }

  .thermolio-header-actions {
    gap: 16px;
  }

  .thermolio-header-actions .thermolio-icon-button {
    width: 24px;
    height: 24px;
    padding: 2px;
  }

  .thermolio-header-actions [data-site-theme-toggle] svg {
    width: 17px;
    height: 17px;
  }

  .thermolio-header-actions .thermolio-search-button svg {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 430px) {
  .thermolio-header-actions {
    gap: 12px;
  }

  .thermolio-search-dialog__panel {
    padding: 22px 18px;
  }

  .thermolio-search-results a {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .thermolio-search-results small {
    text-align: left;
  }
}

@media (max-width: 360px) {
  .thermolio-site-header__brand {
    width: 108px;
    flex-basis: 108px;
    margin-left: 12px;
  }

  .thermolio-site-header__logo {
    width: 108px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thermolio-site-header *,
  .thermolio-site-header *::before,
  .thermolio-site-header *::after {
    scroll-behavior: auto !important;
  }
}
