:root {
  --atelier-header-row: 76px;
  --atelier-cap-height: 25px;
  --atelier-valance-height: 72px;
  --atelier-header-height: calc(var(--atelier-header-row) + var(--atelier-valance-height));
  --atelier-wing: clamp(20px, 4.2vw, 76px);
}

html:has(.atelier-header) { scroll-padding-top: var(--atelier-header-height); }

.atelier-header {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--atelier-header-height);
  padding-top: var(--atelier-valance-height);
  background: #351044;
  color: #fffaf3;
}

.atelier-valance {
  position: absolute;
  inset: 0 0 auto;
  height: var(--atelier-valance-height);
  pointer-events: none;
}

.valance-cap {
  position: absolute;
  inset: 0 0 auto;
  height: var(--atelier-cap-height);
  border-bottom: 2px solid #d7a046;
  background: radial-gradient(ellipse at 40% 0%, #8a1b41, transparent 75%), linear-gradient(#741333, #4c0a2b);
  box-shadow: inset 0 -4px 0 #480a29;
}
.valance-lights {
  position: absolute;
  inset: auto 4% -4px;
  display: flex;
  justify-content: space-between;
}
.valance-lights span {
  width: 6px;
  height: 6px;
  border: 1px solid #fff0ad;
  border-radius: 50%;
  background: #ffdb7e;
  box-shadow: 0 0 8px #f4bf4e;
}

.valance-swags {
  position: absolute;
  inset: calc(var(--atelier-cap-height) - 2px) 0 0;
  display: flex;
  overflow: hidden;
}
.valance-swags span {
  flex: 1;
  margin-inline: -.5px;
  border-bottom: 2px solid #c78b38;
  border-radius: 0 0 50% 50% / 0 0 87% 87%;
  background: radial-gradient(ellipse at 50% -15%, #d17298a6, transparent 64%), linear-gradient(90deg, #480a2d, #961c4b 48%, #500a30);
  box-shadow: inset 0 -7px 12px #36051e70;
}
.valance-swags span:nth-child(even) { height: 83%; }

.atelier-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1240px, calc(100% - clamp(36px, 9vw, 120px)));
  height: var(--atelier-header-row);
  margin-inline: auto;
}


.atelier-header .nav-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding-inline: 18px;
  border: 1px solid #a782aa;
  border-radius: 100px;
  color: #fffaf3;
  font: 750 1.125rem/1.2 "Nunito Sans", system-ui, sans-serif;
  text-decoration: none;
}
.atelier-header .nav-home:hover { color: #ffdb8d; border-color: #e8bc68; }
.atelier-header .nav {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  color: #fffaf3;
  background: transparent;
  font: 700 18px/1.2 "Nunito Sans", system-ui, sans-serif;
}

.atelier-header .nav a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.atelier-header .nav > a:not(.nav-cta):hover { color: #ffd46c; text-decoration: underline; text-underline-offset: 4px; }
.atelier-header .nav .nav-cta { justify-content: center; gap: 17px; min-height: 49px; padding: 0 23px; border-radius: 100px; color: #351044; background: #f2bd58; }
.atelier-header .nav .nav-cta:hover { background: #ffd27b; }
.atelier-header .menu-toggle { display: none; }

@media (max-width: 900px) {
  :root { --atelier-header-row: 63px; --atelier-cap-height: 13px; --atelier-valance-height: 39px; --atelier-wing: clamp(9px, 2.4vw, 20px); }
  .atelier-header .menu-toggle {
    display: grid;
    flex: none;
    place-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #ba852f;
    border-radius: 50%;
    color: #ffe08a;
    background: #351044;
    cursor: pointer;
  }
  .atelier-header .menu-toggle span { width: 17px; height: 2px; border-radius: 100px; background: currentColor; }
  .atelier-header .menu-toggle.active span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .atelier-header .menu-toggle.active span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .atelier-header .nav {
    position: absolute;
    inset: calc(100% + 4px) 0 auto;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
    padding: 13px;
    border: 1px solid #dbc5d4;
    border-radius: 10px;
    color: #351044;
    background: #fffaf3;
    font-size: 18px;
    box-shadow: 0 15px 25px #35104427;
  }
  .atelier-header .nav.open { display: flex; }
  .atelier-header .nav a { padding-inline: 12px; }
  .atelier-header .nav > a:not(.nav-cta):hover { color: #7f1331; }
}


.atelier-header :is(a, button):focus-visible { outline: 3px solid #ffdb7e; outline-offset: 3px; }
@media (max-width: 900px) {
  .valance-lights span:nth-child(even) { display: none; }
  .atelier-header .nav a:focus-visible { outline-color: #7f1331; }
}

/* The same velvet wings surround the home, the gallery and its loading panel. */
.atelier-wings { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.atelier-wing {
  position: absolute;
  inset-block: 0 -2%;
  width: var(--atelier-wing);
  background: linear-gradient(90deg, #430b2d, #7b163f 25%, #5a0c32 46%, #a53859 77%, #6e1338 94%, #4c0b2f);
  border-radius: 0 0 86% 0 / 0 0 78% 0;
  box-shadow: inset -4px 0 9px #430c29a8;
  transform-origin: left center;
}
.atelier-wing:last-child { right: 0; transform: scaleX(-1); transform-origin: center; }
.atelier-wing::before, .atelier-wing::after {
  content: ""; position: absolute; top: 48%; right: 6%;
  border-radius: 6px; transform: rotate(-9deg);
}
.atelier-wing::before { width: 45%; height: 7px; background: linear-gradient(#ffe7a6, #b77b27); }
.atelier-wing::after { width: 4px; height: clamp(16px, 2.4vw, 32px); margin: 5px 3px 0 0; background: repeating-linear-gradient(90deg, #b87d2e 0 1px, #f4ca73 1px 3px); }
@media (max-width: 1100px) and (min-width: 901px) { :root { --atelier-wing: 22px; } }

@media (prefers-reduced-motion: no-preference) {
  .atelier-header .atelier-wing {
    --closed-width: calc(50% + 1px);
    --closed-fold: clamp(60px, 11vw, 160px) 100%;
    animation: atelier-curtain-open 1.05s cubic-bezier(.55, .05, .2, 1);
  }
  .atelier-header .atelier-wing::before { max-width: calc(var(--atelier-wing) * .45); }
  .stage-leaving .atelier-header .atelier-wing {
    animation: atelier-curtain-close .32s cubic-bezier(.4, 0, .6, 1) forwards;
  }
  .motion-paused .atelier-header .atelier-wing,
  .catalog-handoff .atelier-wing { animation: none; }
  @keyframes atelier-curtain-open {
    from { width: var(--closed-width); border-radius: 0; background-size: var(--closed-fold); }
    to { width: var(--atelier-wing); border-radius: 0 0 86% 0 / 0 0 78% 0; background-size: var(--atelier-wing) 100%; }
  }
  @keyframes atelier-curtain-close {
    from { width: var(--curtain-start-width); border-radius: var(--curtain-start-radius); background-size: var(--curtain-start-fold); }
    to { width: var(--closed-width); border-radius: 0; background-size: var(--closed-fold); }
  }
}
