/* ==========================================================================
   Build Edge — layout.css
   Header, navigation, mobile menu, page hero, footer, floating actions
   ========================================================================== */

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  color: var(--c-on-dark);
  transition: background-color 0.35s var(--ease), height 0.35s var(--ease),
    transform 0.45s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  --header-h: 72px;
  background: rgba(13, 13, 13, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--c-line-dark);
}

@media (max-width: 1024px) {
  .site-header.is-scrolled { --header-h: 64px; }
}

.site-header.is-hidden { transform: translateY(-100%); }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--c-on-dark);
  margin-right: auto;
}

.brand-mark {
  width: 44px;
  height: 44px;
  color: var(--c-accent);
  transition: transform 0.6s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.04); }

.brand-text { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; }

.brand-name {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-tag {
  margin-top: 0.35rem;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-on-dark-2);
}

@media (max-width: 1024px) {
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 1.1rem; }
  .brand-tag { font-size: 0.52rem; letter-spacing: 0.24em; }
}

/* Logo image (light version for the dark header/footer) */
.brand-logo {
  display: block;
  width: auto;
  height: 58px;
  transition: height 0.35s var(--ease);
}
.site-header.is-scrolled .brand-logo { height: 50px; }
.brand-logo--footer { height: 66px; }

@media (max-width: 1024px) {
  .brand-logo { height: 44px; }
  .site-header.is-scrolled .brand-logo { height: 40px; }
  .brand-logo--footer { height: 52px; }
}

/* Primary nav (desktop) */
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.2vw, 2.25rem);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding-block: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-on-dark);
  opacity: 0.86;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.nav-link:hover,
.nav-link[aria-current="page"] { opacity: 1; }

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link[aria-current="page"]::after { right: 35%; }

/* Hamburger */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  color: var(--c-on-dark);
  z-index: 110;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.45s var(--ease), top 0.45s var(--ease), width 0.45s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 26px; left: 18px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 21.5px; left: 10px; transform: rotate(-45deg); }

@media (max-width: 1024px) {
  .site-header .primary-nav,
  .site-header .header-cta { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 2rem) var(--gutter) max(2rem, env(safe-area-inset-bottom));
  background: var(--c-ink);
  color: var(--c-on-dark);
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease), opacity 0.3s var(--ease), visibility 0s linear 0.6s;
}

.menu-open .mobile-menu {
  visibility: visible;
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.6s var(--ease), opacity 0.2s var(--ease), visibility 0s;
}

.mobile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 60% at 100% 0%, rgba(192, 144, 98, 0.14), transparent 60%);
  pointer-events: none;
}

.mobile-nav-list { display: grid; gap: 0.25rem; }

.mobile-nav-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.6rem;
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  border-bottom: 1px solid var(--c-line-dark);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.25s;
  transition-delay: calc(0.15s + var(--i, 0) * 0.05s);
}

.mobile-nav-list a small {
  font-family: var(--ff-sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--c-accent);
}

.mobile-nav-list a[aria-current="page"] { color: var(--c-accent); }

.menu-open .mobile-nav-list a { opacity: 1; transform: none; }

.mobile-menu-foot {
  margin-top: auto;
  padding-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.45s;
}
.menu-open .mobile-menu-foot { opacity: 1; }

.mobile-menu-foot .contact-list { color: var(--c-on-dark-2); }

@media (min-width: 1025px) {
  .mobile-menu { display: none; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(320px, 48vh, 460px);
  padding: calc(var(--header-h) + 3rem) 0 clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  isolation: isolate;
}

.page-hero-media,
.page-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.94) 0%, rgba(10, 10, 10, 0.78) 45%, rgba(10, 10, 10, 0.55) 100%),
    linear-gradient(0deg, rgba(10, 10, 10, 0.6), transparent 50%);
}

.page-hero-title {
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.page-hero-sub {
  max-width: 540px;
  margin-top: 1rem;
  color: var(--c-on-dark-2);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: var(--fs-sm);
  color: var(--c-on-dark-2);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  opacity: 0.5;
}
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb [aria-current="page"] { color: var(--c-on-dark); }

@media (prefers-reduced-motion: no-preference) {
  .page-hero-media { animation: hero-zoom 2.2s cubic-bezier(0.25, 1, 0.5, 1) both; }
  .page-hero-title,
  .page-hero-sub,
  .breadcrumb { animation: rise 0.9s var(--ease) both; }
  .page-hero-title { animation-delay: 0.1s; }
  .page-hero-sub { animation-delay: 0.25s; }
  .breadcrumb { animation-delay: 0.4s; }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding-top: clamp(4rem, 3rem + 4vw, 6rem);
  border-top: 1px solid var(--c-line-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: clamp(3rem, 5vw, 4.5rem);
}

.footer-brand p {
  max-width: 320px;
  margin-block: 1.5rem;
  font-size: var(--fs-sm);
}

.footer-motto {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--ff-serif);
  font-size: 1.35rem;
  font-weight: 500;
  font-style: italic;
  color: var(--c-on-dark);
}

.footer-title {
  margin-bottom: 1.25rem;
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 0.7rem;
  font-size: var(--fs-sm);
}

.footer-links a {
  position: relative;
  transition: color 0.25s var(--ease), padding 0.35s var(--ease);
}
.footer-links a:hover { color: var(--c-accent); padding-left: 0.5rem; }

.footer-bottom {
  max-width: var(--container);
  padding-inline: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--c-line-dark);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}
.footer-bottom a:hover { color: var(--c-accent); }

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 1320px) {
  .footer-bottom { width: auto; margin-inline: var(--gutter); max-width: none; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { padding-bottom: calc(1.5rem + 64px); }
}

/* ---------- Floating WhatsApp ---------- */
.wa-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1f8f4e;
  color: var(--c-white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.wa-fab .icon { width: 28px; height: 28px; }
.wa-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38); }

.wa-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid #1f8f4e;
  animation: wa-pulse 2.6s var(--ease) infinite;
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  80%, 100% { transform: scale(1.6); opacity: 0; }
}

.menu-open .wa-fab { opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
  .wa-fab { width: 50px; height: 50px; }
  .wa-fab .icon { width: 25px; height: 25px; }
}
