/* =============================================================
   EXCEN — layout.css
   Top bar · sticky header · glass mobile drawer · footer
   ============================================================= */

/* ---------- TOP BAR ---------- */
.ex-topbar {
  background: var(--ex-ink);
  color: rgba(255,255,255,0.82);
  font-size: var(--ex-text-xs);
}
.ex-topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--ex-space-4);
  min-height: var(--ex-bar-height);
  padding-block: 8px;
  flex-wrap: wrap;
}
.ex-topbar__item { display: inline-flex; align-items: center; gap: 7px; }
.ex-topbar__item svg { width: 14px; height: 14px; color: var(--ex-orange); }
.ex-topbar__sep { display: none; }
.ex-topbar__social { margin-left: auto; display: flex; gap: var(--ex-space-3); }
.ex-topbar__social a { display: inline-flex; color: rgba(255,255,255,0.82); transition: color 140ms; }
.ex-topbar__social a:hover { color: var(--ex-orange); }
.ex-topbar__social svg { width: 16px; height: 16px; }
@media (max-width: 600px) {
  .ex-topbar__phone { display: none; }
}
@media (min-width: 600px) { .ex-topbar__sep { display: inline; opacity: 0.4; } }

/* HTMX mount point: `display: contents` removes the wrapper's box so the
   sticky header anchors to the page (not to this ~145px-tall div, which
   would otherwise let the header scroll away once you pass it). */
#site-header { display: contents; }

/* ---------- HEADER ---------- */
.ex-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ex-white);
  border-bottom: 1px solid var(--ex-border);
  transition: box-shadow 200ms ease, background 200ms ease;
}
.ex-header.is-scrolled {
  background: var(--ex-white);
  border-bottom-color: var(--ex-border);
  box-shadow: 0 8px 30px -18px rgba(22,17,14,0.4);
}
.ex-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ex-space-5);
  min-height: var(--ex-header-height);
  padding-block: 12px;
}
.ex-header__logo { display: inline-flex; align-items: center; }
.ex-header__logo img { height: 38px; width: auto; }
@media (min-width: 768px) { .ex-header__logo img { height: 44px; } }

/* desktop nav */
.ex-nav { display: none; }
@media (min-width: 1000px) {
  .ex-nav { display: flex; align-items: center; gap: var(--ex-space-5); }
}
.ex-nav__link {
  position: relative;
  white-space: nowrap;
  font-size: var(--ex-text-sm);
  font-weight: 500;
  color: var(--ex-ink);
  padding: 6px 2px;
  transition: color 140ms;
}
.ex-nav__link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2.5px;
  border-radius: 2px; background: var(--ex-gradient); transition: right 220ms ease;
}
.ex-nav__link:hover { color: var(--ex-red); }
.ex-nav__link:hover::after, .ex-nav__link.is-active::after { right: 0; }
.ex-nav__link.is-active { color: var(--ex-red); }

.ex-header__actions { display: flex; align-items: center; gap: var(--ex-space-3); }
.ex-header__cta { display: none; }
@media (min-width: 1000px) { .ex-header__cta { display: inline-flex; } }

/* hamburger */
.ex-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px; height: 46px;
  padding: 0 11px;
  background: transparent;
  border: 1.5px solid var(--ex-border);
  border-radius: var(--ex-radius);
  cursor: pointer;
}
@media (min-width: 1000px) { .ex-burger { display: none; } }
.ex-burger span { display: block; height: 2.5px; border-radius: 2px; background: var(--ex-ink); transition: transform 240ms ease, opacity 200ms ease; }
.ex-burger span:nth-child(2) { width: 70%; }
body.ex-menu-open .ex-burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
body.ex-menu-open .ex-burger span:nth-child(2) { opacity: 0; }
body.ex-menu-open .ex-burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- GLASS MOBILE DRAWER (slides from right) ---------- */
.ex-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(22,17,14,0.45);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}
body.ex-menu-open .ex-scrim { opacity: 1; visibility: visible; }

.ex-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(86vw, 360px);
  transform: translateX(105%);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
  padding: var(--ex-space-5);
  /* glassmorphism */
  background: var(--ex-glass-bg);
  backdrop-filter: var(--ex-glass-blur);
  -webkit-backdrop-filter: var(--ex-glass-blur);
  border-left: 1px solid var(--ex-glass-border);
  box-shadow: -24px 0 60px -20px rgba(0,0,0,0.6);
  color: #fff;
  overflow-y: auto;
}
body.ex-menu-open .ex-drawer { transform: translateX(0); }
@media (min-width: 1000px) { .ex-scrim, .ex-drawer { display: none; } }

/* subtle red/orange glow inside the glass */
.ex-drawer::before {
  content: ""; position: absolute; top: -80px; right: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(254,126,33,0.45), transparent 70%);
  pointer-events: none; z-index: -1;
}
.ex-drawer::after {
  content: ""; position: absolute; bottom: -60px; left: -50px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(226,10,18,0.40), transparent 70%);
  pointer-events: none; z-index: -1;
}

.ex-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--ex-space-5); }
.ex-drawer__wordmark { font-family: var(--ex-font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.04em; color: #fff; }
.ex-drawer__head img { height: 30px; }
.ex-drawer__close {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 1px solid var(--ex-glass-border);
  color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.ex-drawer__close svg { width: 20px; height: 20px; }
.ex-drawer__nav { display: flex; flex-direction: column; gap: 2px; }
.ex-drawer__link {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--ex-font-display);
  font-size: 1.18rem; font-weight: 500; color: #fff;
  padding: 15px 14px; border-radius: var(--ex-radius);
  transition: background 160ms ease, padding-left 160ms ease;
}
.ex-drawer__link:hover, .ex-drawer__link.is-active { background: rgba(255,255,255,0.10); padding-left: 20px; }
.ex-drawer__link.is-active { color: var(--ex-orange-light); }
.ex-drawer__link svg { width: 18px; height: 18px; opacity: 0.6; }
.ex-drawer__divider { height: 1px; background: rgba(255,255,255,0.14); margin: var(--ex-space-4) 0; }
.ex-drawer__cta { margin-top: auto; padding-top: var(--ex-space-5); }
.ex-drawer__meta { margin-top: var(--ex-space-5); font-size: var(--ex-text-sm); color: rgba(255,255,255,0.7); display: flex; flex-direction: column; gap: 8px; }
.ex-drawer__meta div { display: flex; align-items: center; gap: 9px; }
.ex-drawer__meta svg { width: 15px; height: 15px; color: var(--ex-orange-light); flex-shrink: 0; }

/* ---------- FOOTER ---------- */
.ex-footer { background: var(--ex-charcoal); color: #fff; position: relative; overflow: hidden; }
.ex-footer__accent { height: 4px; background: var(--ex-gradient); }
.ex-footer__inner { padding-block: var(--ex-space-8) var(--ex-space-5); }
.ex-footer__grid { display: grid; grid-template-columns: 1fr; gap: var(--ex-space-7); }
@media (min-width: 680px) { .ex-footer__grid { grid-template-columns: 1.5fr 1fr 1fr; } }
@media (min-width: 1000px) { .ex-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; } }

.ex-footer__brand-row { display: flex; align-items: center; gap: var(--ex-space-3); margin-bottom: var(--ex-space-4); }
.ex-footer__brand-row img { height: 46px; width: auto; }
.ex-footer__wordmark { font-family: var(--ex-font-display); font-weight: 700; font-size: 1.7rem; letter-spacing: 0.04em; color: #fff; }
.ex-footer p { font-size: var(--ex-text-sm); color: rgba(255,255,255,0.62); line-height: var(--ex-lh-relaxed); max-width: 280px; }
.ex-footer__social { display: flex; gap: var(--ex-space-3); margin-top: var(--ex-space-4); }
.ex-footer__social a {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  transition: background 160ms, color 160ms, transform 160ms;
}
.ex-footer__social a:hover { background: var(--ex-gradient); border-color: transparent; transform: translateY(-3px); }
.ex-footer__social svg { width: 18px; height: 18px; }

.ex-footer h5 { font-size: var(--ex-text-base); font-weight: 600; color: #fff; margin: 0 0 var(--ex-space-4); }
.ex-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--ex-space-3); }
.ex-footer li a { font-size: var(--ex-text-sm); color: rgba(255,255,255,0.72); transition: color 140ms, padding-left 140ms; }
.ex-footer li a:hover { color: var(--ex-orange-light); padding-left: 5px; }
.ex-footer__contact { display: flex; flex-direction: column; gap: var(--ex-space-4); }
.ex-footer__contact-item { display: flex; gap: var(--ex-space-3); font-size: var(--ex-text-sm); color: rgba(255,255,255,0.72); line-height: var(--ex-lh-snug); }
.ex-footer__contact-item svg { width: 18px; height: 18px; color: var(--ex-orange-light); flex-shrink: 0; margin-top: 2px; }
.ex-footer__base {
  display: flex; flex-direction: column; gap: var(--ex-space-3);
  padding-top: var(--ex-space-5); margin-top: var(--ex-space-7);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: var(--ex-text-xs); color: rgba(255,255,255,0.5);
}
@media (min-width: 680px) { .ex-footer__base { flex-direction: row; justify-content: space-between; align-items: center; } }
.ex-footer__base a { color: rgba(255,255,255,0.7); }
.ex-footer__base a:hover { color: var(--ex-orange-light); }
