/* ============================================
   KAYJAH DESIGN STUDIO — Shared Components
   ============================================ */

/* ---- NAVIGATION ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  min-height: var(--nav-height-desktop);
  padding: 1.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s ease, padding 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease,
              backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(248, 246, 241, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.6rem var(--gutter);
  border-bottom-color: var(--surface-3);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.nav-logo-img {
  transition: height 0.3s ease, width 0.3s ease;
}

.nav.scrolled .nav-logo-img {
  height: 30px;
  width: auto;
}

/* Nav on dark hero pages */
.nav--light .nav-logo,
.nav--light .nav-link {
  color: var(--light);
}

.nav--light.scrolled .nav-logo,
.nav--light.scrolled .nav-link {
  color: var(--ink);
}

.nav--light.scrolled .nav-logo-sub {
  color: var(--accent);
}

.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-logo-text {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.nav-logo-sub {
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.nav-link {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s var(--ease);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease), left 0.4s var(--ease);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

.nav-link.active {
  color: var(--accent);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 28px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: var(--z-nav-toggle);
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}

.nav--light .nav-logo-sub {
  color: rgba(240, 232, 219, 0.7);
}

.nav--light .nav-toggle span {
  background: var(--light);
}

.nav--light.scrolled .nav-toggle span {
  background: var(--ink);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile overlay */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: var(--dark-1);
  z-index: var(--z-mobile-nav);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

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

.nav-mobile .nav-mobile-link {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--light);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color 0.3s;
}

.nav-mobile.open .nav-mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.nav-mobile.open .nav-mobile-link:nth-child(1) { transition-delay: 0.1s; }
.nav-mobile.open .nav-mobile-link:nth-child(2) { transition-delay: 0.2s; }
.nav-mobile.open .nav-mobile-link:nth-child(3) { transition-delay: 0.3s; }
.nav-mobile.open .nav-mobile-link:nth-child(4) { transition-delay: 0.4s; }
.nav-mobile.open .nav-mobile-link:nth-child(5) { transition-delay: 0.5s; }

.nav-mobile-link:hover {
  color: var(--accent-light);
}

/* ---- BUTTONS ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem 2.25rem;
  border-radius: 0;
  transition: all 0.4s var(--ease);
  position: relative;
}

.btn-accent {
  background: var(--accent);
  color: var(--surface-0);
}

.btn-accent:hover {
  background: var(--accent-light);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--surface-0);
}

.btn-outline-light {
  background: transparent;
  color: var(--light);
  border: 1px solid rgba(240, 232, 219, 0.4);
}

.btn-outline-light:hover {
  background: var(--light);
  color: var(--ink);
}

/* Arrow link — editorial text link */
.link-arrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 8px 0;
  transition: gap 0.3s var(--ease);
}

.link-arrow:hover {
  gap: 0.85rem;
}

.link-arrow .arrow {
  transition: transform 0.3s var(--ease);
  font-size: 1.1em;
}

.link-arrow:hover .arrow {
  transform: translateX(3px);
}

/* ---- FOOTER ---- */

.footer {
  background: var(--dark-0);
  color: var(--light-2);
  padding: calc(var(--space-lg) * 2 / 3) 0 var(--space-sm);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-md);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--light);
}

.footer-logo-sub {
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.25rem;
}

.footer-philosophy {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--light-muted);
  max-width: 320px;
  line-height: 1.6;
}

.footer-zbom {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--light-muted);
  display: inline-block;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col-title {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--light-2);
  padding: 0.3rem 0;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: var(--accent-light);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-social-icon.footer-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--light-2);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.footer-social-icon:hover {
  color: var(--accent-light);
  border-color: var(--accent-light);
  background: rgba(200, 169, 126, 0.08);
}

.footer-bottom {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(240, 232, 219, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--light-muted);
}

/* ---- FORM FIELDS ---- */

.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.85rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--surface-3);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.3s var(--ease);
}

.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.form-input:focus:not(:focus-visible),
.form-textarea:focus:not(:focus-visible),
.form-select:focus:not(:focus-visible) {
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-bottom-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%237a6d5e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

/* ---- DIVIDER ---- */

.divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-3);
}

/* ---- PAGE TRANSITION OVERLAY ---- */

.page-transition {
  position: fixed;
  inset: 0;
  background: var(--dark-1);
  z-index: var(--z-transition);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
  pointer-events: none;
}

.page-transition.entering {
  transform: scaleX(1);
  pointer-events: all;
}

.page-transition.exiting {
  transform-origin: right;
  transform: scaleX(0);
  pointer-events: none;
}


/* ---- WHATSAPP FLOAT ---- */

.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: var(--z-whatsapp);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: whatsapp-entrance 0.6s var(--ease) 2s both;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

@keyframes whatsapp-entrance {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 600px) {
  .whatsapp-float {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 50px;
    height: 50px;
  }

  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }
}


/* ---- STUDIO SIGNATURE ---- */

.footer-signature {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}


/* ---- LIGHTBOX ---- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 10, 0.92);
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

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

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 1.5rem;
  color: var(--light);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--sans);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--light);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s, background 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--light-2);
}


/* ---- FILTER PILLS (shared) ---- */

.filter-pill {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--surface-3);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  min-height: 44px;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface-0);
}


/* ---- APPLE HIG: TOUCH TARGETS ---- */

.btn {
  min-height: 44px;
}

.footer-col a {
  padding: 0.5rem 0;
}

.testimonial-dot {
  position: relative;
}

/* 44px touch area via invisible pseudo-element */
.testimonial-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}


/* ---- APPLE HIG: ACTIVE / PRESSED STATES ---- */

.btn:active,
.btn-whatsapp:active,
.filter-pill:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.nav-link:active,
.link-arrow:active {
  opacity: 0.7;
  transition-duration: 0.1s;
}

.portfolio-card:active {
  transform: scale(0.99);
  transition-duration: 0.1s;
}


/* ---- APPLE HIG: FOCUS-VISIBLE ---- */

.btn:focus-visible,
.btn-whatsapp:focus-visible,
.filter-pill:focus-visible,
.nav-link:focus-visible,
.link-arrow:focus-visible,
.whatsapp-float:focus-visible,
.lightbox-close:focus-visible,
.testimonial-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}


/* ---- CUSTOM CURSOR ---- */

.custom-cursor { cursor: none; }
.custom-cursor a, .custom-cursor button { cursor: none; }

.cursor-dot {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  will-change: transform;
}

.cursor-ring {
  position: fixed;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor-ring);
  will-change: transform;
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
              top 0.3s var(--ease), left 0.3s var(--ease),
              border-color 0.3s var(--ease);
}

.cursor-ring.hover {
  width: 52px;
  height: 52px;
  top: -26px;
  left: -26px;
  border-color: var(--accent-light);
}


/* ---- REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  .page-transition {
    transition: none;
  }

  .whatsapp-float {
    animation: none;
  }

  .nav-mobile,
  .nav-mobile .nav-mobile-link {
    transition: none;
  }

  .nav-toggle span {
    transition: none;
  }

  .custom-cursor,
  .custom-cursor a,
  .custom-cursor button {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }

  .lightbox {
    transition: none;
  }

  .nav {
    transition: none;
  }
}
