:root { --header-height: 4.5rem; --header-pad: clamp(1.25rem, 2.2vw, 3rem); --header-gold: #dfc69e; }
.masthead {
  position: fixed;
  z-index: 8;
  inset: 0 0 auto;
  height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "links tools";
  gap: clamp(.7rem, 1.2vw, 1.5rem);
  align-items: center;
  padding-inline: var(--header-pad);
  background: #0e0e0e;
  border-bottom: 1px solid #ffffff30;
  color: var(--paper);
  font-size: clamp(.86rem, 1vw, 1rem);
  font-weight: 500;
  white-space: nowrap;
}
.masthead button, .site-directory button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.masthead .brand { position: absolute; inset: 0 auto 0 50%; transform: translateX(-50%); display: grid; place-items: center; min-height: 44px; }
.masthead .brand img { display: block; width: clamp(7.5rem, 10.1vw, 10rem); height: auto; filter: brightness(0) invert(.95); }
.header-nav { grid-area: links; display: flex; justify-content: space-between; height: 100%; }
.header-groups, .header-submenu, .directory-groups ul { margin: 0; padding: 0; list-style: none; }
.header-groups, .header-group { display: flex; align-items: center; height: 100%; }
.header-groups { gap: clamp(.6rem, 1.35vw, 1.7rem); }
.header-group { position: relative; }
.header-group.is-open { z-index: 1; }
.header-category, .header-expand { display: grid; height: 100%; align-items: center; }
.header-expand { padding: 0 .25rem 0 .44rem; }
.header-expand span { width: .42rem; height: .42rem; border: solid #b6ab9a; border-width: 0 1px 1px 0; transform: translateY(-.12rem) rotate(45deg); }
.masthead :is(.header-category,.header-expand):focus-visible { outline-offset: -2px; }
.header-submenu {
  --panel-width: 10.5rem;
  position: absolute;
  top: calc(100% - 9px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--panel-width);
  padding: .75rem 1rem;
  background: #2c251d;
  color: #ffffffe6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.header-groups:first-child .header-group:first-child .header-submenu { --panel-width: 9.5rem; left: max(50%, calc(var(--panel-width) / 2 - var(--header-pad) + .25rem)); }
.header-group.is-open .header-submenu { visibility: visible; opacity: 1; pointer-events: auto; }
.header-submenu a, .directory-groups li a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 42px; padding: .5rem .75rem; font-size: .9rem; }
.header-submenu a { min-height: 2.1rem; padding: .35rem 0; gap: .35rem; }
.header-submenu a:focus-visible { outline-offset: 2px; }
.header-submenu a[href^="https"]::after, .directory-groups li a[href^="https"]::after { content: "↗" / ""; color: #bcac93; font-size: .8em; }
.header-tools { grid-area: tools; display: flex; align-items: center; justify-self: end; }
.header-faq, .header-consult, .header-phone, .menu-fallback { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.header-contacts { gap: clamp(.65rem, 1vw, 1.15rem); }
.header-consult { gap: .45rem; color: var(--header-gold); }
.header-mail-icon { flex: none; }
.header-phone { gap: clamp(.65rem, 1vw, 1.15rem); font-weight: 650; font-variant-numeric: tabular-nums; }
.header-phone::before { content: ""; width: 1px; height: .9rem; background: #ffffff38; }
.header-phone:is(:hover, :focus-visible) { color: var(--header-gold); }
.masthead .menu-trigger, .directory-close { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; }
.hamburger { width: 1.5rem; height: .65rem; position: relative; }
.hamburger::before, .hamburger::after { content: ""; position: absolute; right: 0; height: 1.5px; background: currentColor; }
.hamburger::before { top: 0; width: 100%; }
.hamburger::after { bottom: 0; width: 72%; }

html:has(.site-directory[open]) { overflow: hidden; }
.site-directory {
  position: fixed;
  inset: 0;
  width: 100%; max-width: none;
  height: 100%; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  overflow: clip;
  background: transparent;
  color: var(--paper);
}
.site-directory::backdrop { background: #080807b8; backdrop-filter: blur(12px); }
.directory-sheet { width: 100%; height: 100%; overflow: auto; overscroll-behavior: contain; background: #161513ee; }
.directory-inner { max-width: 95rem; min-height: 100%; padding: clamp(1.5rem, 4vw, 5rem) var(--gutter); margin-inline: auto; display: flex; flex-direction: column; }
.directory-heading, .directory-tools { display: flex; align-items: center; gap: 1.4rem; }
.directory-heading { justify-content: space-between; border-bottom: 1px solid #ffffff30; padding-bottom: 1.1rem; }
.directory-heading h2 { margin: 0; font-weight: 550; font-size: clamp(1.4rem, 2.5vw, 3.1rem); letter-spacing: -.045em; word-break: keep-all; }
.site-directory .directory-close { flex: none; border: 1px solid #81745e; border-radius: 50%; color: var(--header-gold); font-size: 1.8rem; font-weight: 300; line-height: 1; }
.directory-groups { margin-block: auto; padding-block: clamp(2rem, 6vh, 5rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 3.3rem); }
.directory-groups h3, .directory-groups summary, .directory-direct { margin: 0; padding-bottom: 1rem; border-bottom: 1px solid #796b55; font-size: clamp(1.15rem, 1.8vw, 1.85rem); font-weight: 530; letter-spacing: -.035em; }
.directory-direct { display: block; align-self: start; }
.directory-direct[data-open-self-check] { color: var(--header-gold); }
.directory-direct .header-mail-icon { display: none; }
.directory-groups ul { margin-top: .85rem; }
.directory-groups li a { padding-inline: 0; color: #d0c8bc; font-size: 1rem; }
.directory-groups a:is(:hover, :focus-visible), .directory-tools a:is(:hover, :focus-visible) { color: var(--header-gold); text-decoration: underline; text-underline-offset: .3em; }
.directory-tools { padding-top: 1rem; border-top: 1px solid #ffffff30; font-size: .92rem; }
.directory-tools a { display: inline-flex; gap: .65rem; align-items: center; min-height: 44px; }
.directory-tools a:last-child { margin-left: auto; color: var(--header-gold); }

@media (min-width: 64.001rem) {
  .directory-groups h3 { position: relative; }
  .directory-groups h3::after { content: ""; position: absolute; inset: auto auto -1px 0; width: 3rem; height: 2px; background: var(--header-gold); opacity: 0; }
  .directory-groups section:is(:hover, :focus-within) h3::after { opacity: 1; }
}

@media (min-width: 64.001rem) and (max-width: 76rem) {
  .header-groups:not(.header-contacts) { gap: clamp(.25rem, calc(5vw - 3rem), .65rem); }
  .header-expand { padding-inline: .3rem .15rem; }
}

@media (max-width: 64rem) {
  :root { --header-height: 3.75rem; --header-pad: clamp(.75rem, 3vw, 1.5rem); }
  .masthead { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "links contacts tools"; gap: .3rem; }
  .header-nav, .header-groups:not(.header-contacts), .header-group.header-shortcut { display: contents; }
  .header-group { display: none; }
  .header-faq { grid-area: links; justify-self: start; min-width: 44px; color: var(--header-gold); }
  .header-contacts { grid-area: contacts; }
  .masthead .brand img { width: clamp(6.45rem, 18vw, 7.8rem); }
  .header-consult { font-size: .85rem; }
  .directory-sheet { margin-left: auto; width: min(89%, 31rem); background: #191816; box-shadow: -1.1rem 0 3rem #0004; }
  .directory-inner { padding: 1.2rem clamp(1.25rem, 5vw, 2.5rem) max(1.2rem, env(safe-area-inset-bottom)); }
  .directory-heading { padding-bottom: 1rem; }
  .directory-groups { display: block; margin: 0; padding-block: 1.5rem; }
  .directory-groups details { border-bottom: 1px solid #ffffff26; }
  .directory-direct { display: flex; align-items: center; min-height: 3.65rem; padding-block: .7rem; border-color: #ffffff26; }
  .directory-groups summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.65rem; padding: .7rem 0; border: 0; list-style: none; cursor: pointer; }
  .directory-groups summary::-webkit-details-marker { display: none; }
  .directory-groups summary::after { content: ""; width: .5rem; height: .5rem; margin-right: .3rem; border: solid #baac98; border-width: 0 1px 1px 0; transform: rotate(45deg); }
  .directory-groups details[open] summary { color: var(--header-gold); }
  .directory-groups details[open] summary::after { transform: rotate(225deg); }
  .directory-groups ul { margin: 0 0 .75rem; padding-left: .75rem; border-left: 1px solid #76674f; }
  .directory-groups li a { min-height: 40px; font-size: .94rem; }
  .directory-tools { margin-top: auto; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; }
}

@media (max-width: 40rem) {
  .masthead { grid-template-areas: "brand contacts tools"; }
  .masthead .brand { grid-area: brand; position: static; justify-self: start; transform: none; }
  .header-faq { display: none; }
}

@media (max-width: 25rem) {
  .header-contacts, .header-phone { gap: .35rem; }
}

@media (max-width: 22rem) {
  .masthead { padding-inline: .45rem; gap: .1rem; }
  .masthead .brand img { width: 5.75rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .header-consult .header-mail-icon { animation: consult-mail-pulse 2s ease-in-out infinite; }
  @keyframes consult-mail-pulse { 50% { opacity: .3; } }
  .header-submenu {
    transition: opacity .2s ease-in-out, visibility 0s linear .2s;
  }
  .header-group.is-open .header-submenu { transition-delay: 0s; }
  .hamburger::before, .hamburger::after { transition: transform .26s ease-in-out, width .26s ease-in-out; }
  .menu-trigger[aria-expanded="true"] .hamburger::before { transform: translateY(calc(.325rem - .75px)) rotate(45deg); }
  .menu-trigger[aria-expanded="true"] .hamburger::after { width: 100%; transform: translateY(calc(.75px - .325rem)) rotate(-45deg); }
  .directory-groups h3::after { transition: opacity .35s ease; }
  .site-directory { --sheet-offset: translateY(-1.75rem); }
  .site-directory .directory-sheet {
    opacity: 0;
    transform: var(--sheet-offset);
    transition: transform .28s cubic-bezier(.4,0,.55,1), opacity .28s ease-in-out;
  }
  .site-directory.is-visible .directory-sheet {
    opacity: 1;
    transform: none;
    transition: transform .46s cubic-bezier(.22,.72,.18,1), opacity .36s ease-out;
  }
  .site-directory::backdrop { opacity: 0; transition: opacity .25s ease-in-out; }
  .site-directory.is-visible::backdrop { opacity: 1; transition-duration: .35s; }
  .site-directory[open] .directory-groups > section { animation: group-appear .32s var(--group-delay, 0s) ease-out backwards; }
  @keyframes group-appear { from { opacity: 0; transform: translateY(.35rem); } }
}
@media (max-width: 64rem) and (prefers-reduced-motion: no-preference) {
  .site-directory { --sheet-offset: translateX(100%); }
  .directory-groups details[open] ul { animation: group-appear .22s ease-out; }
}
