/* Fonts */
@font-face {
  font-family: 'Aeonik';
  src: url('fonts/Aeonik-Regular-Web/Aeonik-Regular.woff2') format('woff2'),
       url('fonts/Aeonik-Regular-Web/Aeonik-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Aeonik';
  src: url('fonts/Aeonik-Medium-Web/Aeonik-Medium.woff2') format('woff2'),
       url('fonts/Aeonik-Medium-Web/Aeonik-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Aeonik';
  src: url('fonts/Aeonik-MediumItalic-Web/Aeonik-MediumItalic.woff2') format('woff2'),
       url('fonts/Aeonik-MediumItalic-Web/Aeonik-MediumItalic.woff') format('woff');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Aeonik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: #000;
  background: #fff;
  padding-top: 58px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Subtle page-load content animation */
body > header,
body > section,
body > .gallery,
body > footer {
  opacity: 0;
  transform: translateY(6px);
  animation: pageContentIn 0.5s ease-out forwards;
}

body > header { animation-delay: 0.05s; }
body > section:nth-of-type(1) { animation-delay: 0.1s; }
body > section:nth-of-type(2) { animation-delay: 0.15s; }
body > section:nth-of-type(3) { animation-delay: 0.2s; }
body > .gallery { animation-delay: 0.12s; }
body > footer { animation-delay: 0.25s; }

@keyframes pageContentIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Nav — fixed, always visible, inverted via mix-blend-mode */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 20px;
  pointer-events: auto;
  opacity: 1 !important;
  transform: none !important;
  mix-blend-mode: difference;
  color: #fff;
}

.nav-logo {
  position: relative;
}

.nav-logo-img {
  display: block;
  height: 12px;
  width: auto;
  filter: invert(1);
}

.nav-link {
  font-size: 12px;
  font-weight: 400;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.24px;
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Page Header */
.page-header {
  padding: 156px 20px 180px;
}

.page-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
  line-height: 14px;
}

.page-label-dot {
  color: rgba(0, 0, 0, 0.35);
  font-size: 12px;
  vertical-align: middle;
  line-height: 0;
}

.page-label-link {
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.03em !important;
  transition: color 0.4s ease-in-out;
}

.page-label-link:hover {
  color: rgba(0, 0, 0, 1);
  letter-spacing: 0.03em !important;
  margin-bottom: 4px;
  letter-spacing: -0.28px;
}

.page-description {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  max-width: 600px;
  letter-spacing: -0.01em;
}

/* Split header — left description, right credit */
.page-header-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.page-header-left {
  flex: 1;
}

.page-header-right {
  text-align: right;
  flex-shrink: 0;
}

/* Inline pill badge */
.page-label-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
  vertical-align: middle;
  position: relative;
  top: -1px;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.page-label-badge:hover {
  border-color: rgba(0, 0, 0, 0.35);
  color: rgba(0, 0, 0, 0.7);
}

/* Location with pulse */
.page-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-header-pulse {
  width: 5px;
  height: 5px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0% { opacity: 0; transform: rotate(0deg) scale(0.85); }
  50% { opacity: 1; transform: rotate(180deg) scale(1.15); }
  100% { opacity: 0; transform: rotate(360deg) scale(0.85); }
}

.page-header-location {
  font-size: 10px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Floating Nav — shell */
.floating-nav {
  position: fixed;
  --viewport-offset: 0px;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px) + var(--viewport-offset));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  isolation: isolate;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50px;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              bottom 0.3s ease;
  will-change: width, height;
  /* collapsed size */
  width: 82px;
  height: 32px;
  /* Suppress mobile tap highlight + selection blinks */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.floating-nav *,
.floating-nav button {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

.floating-nav button:focus,
.floating-nav a:focus {
  outline: none;
}

/* Trigger — always visible in collapsed, positioned on top */
.floating-nav-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 20px;
  font-family: inherit;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.floating-nav-label {
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.floating-nav-dot {
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Expanded menu content — hidden by default, no flash on load */
.floating-nav-menu {
  display: flex;
  align-items: center;
  padding: 0 4px 0 12px;
  height: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  visibility: hidden;
}

/* Only show menu when explicitly opened — prevents flash during page transitions */
.floating-nav[data-open="true"] .floating-nav-menu {
  visibility: visible;
}

/* Suppress all transitions on initial load — prevents glitch/flash */
.floating-nav.nav-loading,
.floating-nav.nav-loading * {
  transition: none !important;
  animation: none !important;
}

/* Ensure nav never shifts position */
.floating-nav {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Welcome intro — first-load only; same pill size, no dot */
.floating-nav.nav-welcome .floating-nav-dot {
  display: none;
}

.floating-nav.nav-welcome-fading .floating-nav-trigger {
  opacity: 0;
}

.floating-nav-link {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  padding: 0 10px;
  line-height: 32px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

.floating-nav-link.active {
  color: #fff;
}

.floating-nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.floating-nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.floating-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: -2px;
  margin-right: -2px;
  flex-shrink: 0;
  transition: background 0.2s ease;
  color: rgba(255, 255, 255, 0.4);
}

.floating-nav-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
}

/* ── Open state: desktop (horizontal) ── */
.floating-nav[data-open="true"] {
  width: var(--nav-expanded-width, 340px);
}

.floating-nav[data-open="true"] .floating-nav-trigger {
  opacity: 0;
  pointer-events: none;
}

.floating-nav[data-open="true"] .floating-nav-menu {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease 0.1s;
}

/* ── Mobile: vertical expand ── */
@media (max-width: 520px) {
  .floating-nav {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  /* Collapsed pill — bigger again so "Menu" sits comfortably */
  .floating-nav {
    width: 124px;
    height: 52px;
  }

  /* "Menu" label — bigger, baseline-aligned with the dot */
  .floating-nav-label {
    font-size: 16px;
    line-height: 1;
  }

  /* Items inside the expanded pill — slightly further apart, with tighter padding above + below */
  .floating-nav-menu {
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    height: 100%;
    justify-content: center;
    gap: 6px;
  }

  .floating-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    height: 36px;
    line-height: 36px;
    font-size: 16px;
    width: 100%;
  }

  /* Close button matches the links exactly: same height, same padding, no box */
  .floating-nav-close {
    position: static;
    margin: 0;
    width: 100%;
    height: 36px;
    line-height: 36px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    flex-shrink: 0;
  }
  .floating-nav-close:hover,
  .floating-nav-close:focus,
  .floating-nav-close:active {
    background: transparent;
    box-shadow: none;
    outline: none;
  }

  /* Expanded pill — height tuned so the 5 items sit tightly equidistant */
  .floating-nav[data-open="true"] {
    width: 220px;
    height: 250px;
    border-radius: 24px;
  }
}

/* View Control */
.view-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0 20px;
  margin-bottom: 12px;
}

.view-step {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  color: rgba(0, 0, 0, 0.25);
  transition: color 0.2s ease;
}

.view-step:hover {
  color: rgba(0, 0, 0, 0.7);
}

.view-count {
  font-size: 11px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.4);
  width: 16px;
  text-align: center;
  letter-spacing: -0.02em;
  user-select: none;
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 10px;
  row-gap: 100px;
  padding: 0 20px;
  align-items: start;
}

.gallery-item {
  min-width: 0;
}

.gallery-image {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 2px;
  background: #e8e8e8;
}

.gallery-item-clickable .gallery-image {
  cursor: pointer;
}

.gallery-title {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.gallery-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.25;
  margin-top: 1px;
  letter-spacing: -0.01em;
}

/* Only image sizes change with column count, text stays 12px */
.gallery[data-cols="2"] { row-gap: 120px; }
.gallery[data-cols="4"] { row-gap: 80px; }
.gallery[data-cols="5"] { row-gap: 64px; }
.gallery[data-cols="6"] { row-gap: 52px; }

/* Hide title + description at 5+ columns — images speak for themselves */
.gallery[data-cols="5"] .gallery-title,
.gallery[data-cols="6"] .gallery-title,
.gallery[data-cols="5"] .gallery-subtitle,
.gallery[data-cols="6"] .gallery-subtitle { display: none; }

/* Footer */
.footer {
  margin-top: 200px;
  padding: 0 20px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-left {
  flex-shrink: 0;
}

.footer-left p {
  font-size: 11px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: -0.24px;
  line-height: 17px;
}

.footer-dot {
  display: none;
}

.footer-right {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-col a {
  font-size: 11px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: -0.24px;
  line-height: 17px;
}

.footer-col a:hover {
  color: rgba(0, 0, 0, 0.6);
}

.footer-bottom {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .view-control {
    display: none;
  }

  /* Top nav — bigger pill + larger logo + larger link text */
  .nav {
    padding: 30px 14px;
  }
  .nav-logo-img {
    height: 16px;
  }
  .nav-link {
    font-size: 14px;
  }

  /* Page header — equal breathing room above the heading and below the description */
  .page-header {
    padding: 120px 14px 120px;
  }

  .page-header-split {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
  }

  .page-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  /* When the location block is relocated below the gallery on mobile —
     equidistant between the last entry and the footer */
  body > .page-header-right {
    padding: 120px 14px 120px;
  }

  /* Bump small text up by 1px on mobile (previously-tiny ones included) */
  .page-label { font-size: 11px; }
  .page-label-dot { font-size: 13px; }
  .page-header-location { font-size: 11px; }
  .gallery-title { font-size: 15px; }
  .gallery-subtitle { font-size: 12px; }

  .page-description {
    font-size: 20px;
    max-width: 100%;
  }

  .gallery {
    grid-template-columns: 1fr !important;
    row-gap: 72px;
    padding: 0 14px;
  }

  /* Footer — align flush with the rest of the mobile content (14px from edge) */
  .footer {
    margin-top: 0;
    padding-left: 14px;
    padding-right: 14px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 56px;
    padding: 0;
  }

  /* All rights reserved centered, sits below the link block with breathing room above */
  .footer-left {
    order: 2;
    width: 100%;
    text-align: center;
  }
  /* Two-column block: long page list (left) + socials/Client Access stacked (right) */
  .footer-right {
    order: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    column-gap: 24px;
    row-gap: 0;
    width: 100%;
  }
  /* Long page list (Ad Studio / Gallery / About / Contact / Terms / Privacy) — left, full height */
  .footer-col:nth-child(3) {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  /* Socials (Instagram, LinkedIn) — top right */
  .footer-col:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  /* Client Access — bottom right, exactly one blank line below LinkedIn */
  .footer-col:nth-child(1) {
    grid-column: 2;
    grid-row: 2;
    margin-top: 22px;
  }
  /* Wider line spacing in the long page list */
  .footer-col { min-width: 0; gap: 8px; }
  /* Footer link size matches Client Access in the top nav (14px on mobile) */
  .footer-col a { font-size: 14px; line-height: 22px; }
  .footer-left p { font-size: 14px; line-height: 22px; }

  .floating-nav {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

/* Page Transition — content only, nav stays visible */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9997;
  pointer-events: none;
}

.page-transition-panel {
  position: absolute;
  inset: 0;
  background: inherit;
  opacity: 0;
  /* Match the current page background */
  background: var(--page-bg, #fff);
}

.page-transition.entering .page-transition-panel {
  animation: crossfade-in 0.12s ease forwards;
}

.page-transition.exiting .page-transition-panel {
  opacity: 1;
  animation: crossfade-out 0.15s ease forwards;
}

@keyframes crossfade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes crossfade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
