:root {
  --ae-black: #080807;
  --ae-black-soft: #10100e;
  --ae-white: #f7f4ec;
  --ae-muted: #aaa59a;
  --ae-gold: #c4a56b;
  --ae-gold-light: #e3ce9d;
  --ae-line: rgba(255, 255, 255, 0.14);
  --ae-serif: "Cormorant Garamond", Georgia, serif;
  --ae-sans: "Manrope", Arial, sans-serif;
}

/* Hide only legacy theme/page shells. Existing page content remains intact. */
body:not(.wp-admin) :is(
  header.site-header,
  header.wp-block-template-part,
  header.header,
  #masthead,
  .elementor-location-header
):not(.ae-unified-header),
body:not(.wp-admin) :is(
  footer.site-footer,
  footer.wp-block-template-part,
  footer.footer,
  #colophon,
  .elementor-location-footer
):not(.ae-unified-footer) {
  display: none !important;
}

body.ae-unified-menu-open { overflow: hidden !important; }
.ae-container { width: min(91%, 1440px); margin-inline: auto; }

.ae-header.ae-unified-header {
  position: sticky;
  top: 0;
  z-index: 9990;
  color: var(--ae-white);
  background: rgba(8, 8, 7, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
  font-family: var(--ae-sans);
  transition: background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.ae-header.ae-unified-header.is-scrolled {
  background: rgba(8, 8, 7, 0.985);
  border-bottom-color: rgba(196, 165, 107, 0.34);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
}

body.admin-bar .ae-header { top: 32px; }

.ae-header-inner {
  position: relative;
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
}

.ae-logo { position: relative; z-index: 9992; width: 175px; }
.ae-logo img { display: block; width: 100%; height: 60px; object-fit: contain; object-position: left center; filter: invert(1); }

.ae-navigation { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 38px); }
.ae-navigation a { position: relative; padding: 14px 0; color: rgba(255, 255, 255, 0.72) !important; font-family: var(--ae-sans); font-size: 9px; font-weight: 500; letter-spacing: 0.17em; line-height: 1.3; text-decoration: none !important; text-transform: uppercase; transition: color 180ms ease; }
.ae-navigation a::after { content: ""; position: absolute; right: 0; bottom: 6px; left: 0; height: 1px; background: var(--ae-gold); transform: scaleX(0); transform-origin: right center; transition: transform 200ms ease; }
.ae-navigation a:hover, .ae-navigation a[aria-current="page"] { color: var(--ae-gold-light) !important; }
.ae-navigation a:hover::after, .ae-navigation a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left center; }

.ae-header-call { justify-self: end; padding: 14px 18px; color: var(--ae-white) !important; border: 1px solid rgba(255, 255, 255, 0.42); font-size: 9px; letter-spacing: 0.14em; text-decoration: none !important; text-transform: uppercase; transition: color 180ms ease, background 180ms ease; }
.ae-header-call:hover { color: var(--ae-black) !important; background: var(--ae-gold); border-color: var(--ae-gold); }

.ae-unified-header .ae-menu-toggle,
.ae-unified-header .ae-menu-backdrop { display: none; }

.ae-footer { position: relative; z-index: 10; color: var(--ae-white); background: var(--ae-black); border-top: 1px solid var(--ae-line); font-family: var(--ae-sans); }
.ae-footer-main { display: grid; grid-template-columns: 1.2fr 0.7fr 0.7fr; gap: 70px; padding: 75px 0; }
.ae-footer-brand img { display: block; width: 170px; height: 60px; object-fit: contain; object-position: left; filter: invert(1); }
.ae-footer-brand p { max-width: 460px; margin: 25px 0 0; color: rgba(255, 255, 255, 0.58) !important; font-size: 12px; line-height: 1.8; }
.ae-footer h3 { margin: 0 0 22px; color: var(--ae-gold-light) !important; font: 400 25px/1 var(--ae-serif); }
.ae-footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.ae-footer-links a { color: rgba(255, 255, 255, 0.68) !important; font-size: 10px; text-decoration: none !important; }
.ae-footer-links a:hover { color: var(--ae-gold-light) !important; }
.ae-footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0; color: rgba(255, 255, 255, 0.44); border-top: 1px solid var(--ae-line); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; }

@media (max-width: 950px) {
  .ae-unified-header .ae-header-inner { grid-template-columns: 1fr auto; min-height: 78px; }
  .ae-unified-header .ae-logo { width: 145px; }
  .ae-unified-header .ae-logo img { height: 50px; }
  .ae-unified-header .ae-header-call { display: none; }

  .ae-unified-header .ae-menu-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 9993;
    display: inline-grid;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    place-content: center;
    gap: 5px;
    color: var(--ae-white);
    background: rgba(8, 8, 7, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
  }

  .ae-unified-header .ae-menu-toggle span {
    display: block;
    width: 18px;
    height: 1px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .ae-unified-header .ae-menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
  .ae-unified-header .ae-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .ae-unified-header .ae-menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }

  .ae-unified-header .ae-navigation {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9992;
    display: flex !important;
    width: min(86vw, 390px);
    height: 100dvh;
    padding: 112px 30px 36px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    color: var(--ae-white);
    background: radial-gradient(circle at 100% 0, rgba(196, 165, 107, 0.16), transparent 34%), #0d0d0b;
    border-left: 1px solid rgba(196, 165, 107, 0.3);
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.45);
    visibility: hidden;
    transform: translateX(105%);
    transition: transform 240ms ease, visibility 240ms step-end;
  }

  .ae-unified-header .ae-navigation a {
    display: flex;
    width: 100%;
    min-height: 62px;
    padding: 20px 4px;
    align-items: center;
    color: rgba(255, 255, 255, 0.84) !important;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    font-family: var(--ae-sans);
    font-size: 11px;
    letter-spacing: 0.16em;
    line-height: 1.3;
    text-transform: uppercase;
    transition: color 180ms ease, padding-left 180ms ease, background 180ms ease;
  }

  .ae-unified-header .ae-navigation a::after { display: none; }
  .ae-unified-header .ae-navigation a:hover,
  .ae-unified-header .ae-navigation a[aria-current="page"] {
    padding-left: 12px;
    color: var(--ae-gold-light) !important;
    background: rgba(196, 165, 107, 0.07);
  }

  .ae-unified-header .ae-navigation a[aria-current="page"] {
    border-left: 2px solid var(--ae-gold);
  }

  .ae-unified-header .ae-navigation.is-open {
    visibility: visible;
    transform: translateX(0);
    transition: transform 240ms ease, visibility 0s;
  }

  .ae-unified-header .ae-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9991;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(0, 0, 0, 0.68);
    border: 0;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: opacity 240ms ease, visibility 240ms step-end;
  }

  body.ae-unified-menu-open .ae-unified-header .ae-menu-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity 240ms ease, visibility 0s;
  }

  .ae-footer-main { grid-template-columns: 1fr 1fr; }
  .ae-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 782px) {
  body.admin-bar .ae-header { top: 46px; }
}

@media (max-width: 620px) {
  .ae-container { width: calc(100% - 32px); }
  .ae-footer-main { grid-template-columns: 1fr; gap: 42px; padding: 60px 0; }
  .ae-footer-brand { grid-column: auto; }
  .ae-footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .ae-unified-header .ae-navigation,
  .ae-unified-header .ae-menu-backdrop,
  .ae-unified-header .ae-menu-toggle span,
  .ae-footer * { transition: none !important; }
}
