/* =============================================
   NAVIGATION
============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem clamp(1.5rem, 5vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244,237,224,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(42,32,26,0.08);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 1px 0 rgba(42,32,26,0.08);
  border-color: rgba(42,32,26,0.12);
}

/* When the mobile menu is open, raise the nav above the menu overlay
   and fade out its background so only the hamburger (close icon) sits
   on top of the parchment menu. The logo and links fade out in sync. */
.nav.menu-open {
  z-index: 1100;
  background: rgba(244,237,224,0);
  backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}
.nav .nav-logo,
.nav .nav-links {
  transition: opacity 0.25s ease;
}
.nav.menu-open .nav-logo,
.nav.menu-open .nav-links {
  opacity: 0;
  pointer-events: none;
}

.nav-logo {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.nav-logo span {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-left: 0.5rem;
  font-family: var(--font-sans);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.nav-links a:not(.nav-cta) {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-mid);
  font-family: var(--font-sans);
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:not(.nav-cta):hover { color: var(--terracotta); }

.nav-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* ---- Services dropdown ---- */
.nav-services-item {
  position: relative;
}

.nav-services-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-mid);
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--transition);
}

.nav-services-trigger:hover,
.nav-services-item.open .nav-services-trigger {
  color: var(--terracotta);
}

.nav-services-trigger svg {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.nav-services-item.open .nav-services-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  background: rgba(244,237,224,0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(42,32,26,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(42,32,26,0.12), 0 1px 0 rgba(42,32,26,0.06);
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

/* Invisible hover bridge fills the gap between trigger and dropdown panel */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: -1.5rem;
  left: -1rem;
  right: -1rem;
  height: 1.5rem;
  pointer-events: none;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 6px;
  background: rgba(244,237,224,0.98);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.nav-services-item.open .nav-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
}

.nav-dropdown-item:hover {
  background: rgba(179,102,72,0.07);
}

.nav-dropdown-item:hover .nav-dropdown-label {
  color: var(--terracotta);
}

.nav-dropdown-icon {
  width: 32px;
  height: 32px;
  background: rgba(179,102,72,0.08);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--terracotta);
  transition: background 0.15s ease;
}

.nav-dropdown-item:hover .nav-dropdown-icon {
  background: rgba(179,102,72,0.15);
}

.nav-dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-dropdown-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.15s ease;
  line-height: 1.2;
}

.nav-dropdown-sub {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--ink-faint);
  line-height: 1.3;
}

.nav-dropdown-divider {
  height: 1px;
  background: rgba(42,32,26,0.07);
  margin: 0.25rem 0.5rem;
}

.nav-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem 0.4rem;
}

.nav-dropdown-footer-link {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.15s ease;
  text-decoration: none;
}

.nav-dropdown-footer-link:hover {
  color: var(--terracotta);
}

.nav-cta {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 0.6rem 1.5rem;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition), color var(--transition);
}

.nav-cta:hover {
  background: var(--ink-mid);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0.5rem;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1060;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 26px;
  height: 1.75px;
  background: var(--ink);
  transition: transform var(--transition), opacity 0.2s ease, background var(--transition);
  transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7.75px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.3);
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7.75px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--parchment);
  z-index: 1050;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 6rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-menu::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: radial-gradient(ellipse at 80% 50%, rgba(179,102,72,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  font-weight: 400;
  color: var(--ink);
  position: relative;
  transition: color var(--transition);
  line-height: 1.1;
}

.mobile-menu a:hover {
  color: var(--terracotta);
}

/* ---- Mobile services submenu ---- */
.mobile-services-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.mobile-services-trigger {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  font-weight: 400;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition);
  padding: 0;
  line-height: 1.1;
}

.mobile-services-trigger:hover,
.mobile-services-group.open .mobile-services-trigger {
  color: var(--terracotta);
}

.mobile-services-trigger svg {
  transition: transform 0.3s ease;
  margin-top: 0.1em;
}

.mobile-services-group.open .mobile-services-trigger svg {
  transform: rotate(180deg);
}

.mobile-services-sub {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.mobile-services-group.open .mobile-services-sub {
  max-height: 400px;
  opacity: 1;
}

.mobile-services-sub-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px solid rgba(42,32,26,0.08);
  margin-top: 0.6rem;
}

.mobile-sub-link {
  display: block !important;
  font-family: var(--font-serif) !important;
  font-size: clamp(1.2rem, 5.5vw, 1.85rem) !important;
  font-weight: 400;
  color: var(--ink-mid) !important;
  background: transparent;
  transition: color 0.15s ease !important;
  text-decoration: none;
  line-height: 1.2 !important;
  padding: 0.35rem 0 !important;
  text-align: center;
}

.mobile-sub-link:hover {
  color: var(--terracotta) !important;
}

.mobile-sub-link-icon {
  display: none;
}

.mobile-sub-link span {
  font-style: normal !important;
}

.mobile-services-section-link {
  font-family: var(--font-mono) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint) !important;
  text-align: center;
  padding: 0.5rem 0 0 !important;
  display: block !important;
  transition: color 0.15s ease !important;
}

.mobile-services-section-link:hover {
  color: var(--terracotta) !important;
}

/* =============================================
   FOOTER
============================================= */
.footer {
  background: #060504;
  padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid rgba(179,102,72,0.12);
  position: relative;
  overflow: hidden;

  /* Entrance: slides up from 24px below, fades in */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer.footer-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .footer { opacity: 1; transform: none; transition: none; }
}

.footer::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179,102,72,0.05) 0%, transparent 55%);
  pointer-events: none;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  opacity: 0.65;
  margin-bottom: 1rem;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 400;
  color: rgba(245,241,234,0.06);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
  /* Prevent wrapping on small screens */
  white-space: nowrap;
}

.footer-cta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.5rem);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-cta {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.5);
  padding: 0.65rem 1.4rem;
  border: 1px solid rgba(245,241,234,0.1);
  border-radius: 100px;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.footer-cta:hover {
  color: var(--terracotta-light);
  border-color: var(--terracotta);
  background: rgba(179,102,72,0.08);
}

.footer-cta--primary {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--cream);
}

.footer-cta--primary:hover {
  background: var(--terracotta-light);
  border-color: var(--terracotta-light);
  color: var(--cream);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.5rem);
}

.footer-social-link {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.2);
  transition: color 0.3s ease;
  padding: 0.35rem 0.5rem;
  position: relative;
}

.footer-social-link::after {
  content: '';
  position: absolute;
  bottom: 0.15rem;
  left: 0.5rem;
  right: 0.5rem;
  height: 1px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.footer-social-link:hover {
  color: rgba(245,241,234,0.65);
}

.footer-social-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(179,102,72,0.12), transparent);
  margin-bottom: 1.25rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-copy {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  color: rgba(245,241,234,0.12);
  letter-spacing: 0.06em;
}

.footer-credit {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.55);
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding: 0.25rem 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), letter-spacing 0.4s ease;
}

.footer-credit::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, #F4A261, #E76F51, #B36648, #D946EF, #F4A261);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.footer-credit:hover,
.footer-credit:focus-visible {
  background: linear-gradient(90deg, #F4A261, #E76F51, #B36648, #D946EF, #C98264, #F4A261);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: footer-credit-flow 4s linear infinite;
  transform: translateY(-1px);
  letter-spacing: 0.22em;
}

.footer-credit:hover::after,
.footer-credit:focus-visible::after {
  opacity: 1;
  animation: footer-credit-flow 4s linear infinite;
}

@keyframes footer-credit-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .footer-credit:hover,
  .footer-credit:focus-visible {
    animation: none;
    background: none;
    -webkit-text-fill-color: var(--terracotta-light);
    color: var(--terracotta-light);
    letter-spacing: 0.18em;
    transform: none;
  }
  .footer-credit:hover::after,
  .footer-credit:focus-visible::after {
    animation: none;
    background: var(--terracotta);
  }
}

/* =============================================
   RESPONSIVE — nav / footer overrides
============================================= */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-menu { display: flex; }
}

@media (max-width: 640px) {
  .footer-name {
    /* Scale down further so it doesn't overflow on narrow phones */
    font-size: clamp(1.6rem, 10vw, 2.5rem);
    white-space: nowrap;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
  }
}
