/* ============================================================
   AUGUSTIN AGAPII — Portfolio
   Editorial fashion aesthetic — Cormorant Garamond + Inter
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --cream: #f5f0eb;
  --mid: #888888;
  --light: #d4d0cb;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --nav-h: 64px;
  --max-w: 1440px;
  --pad-x: clamp(24px, 5vw, 80px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s;
}
#nav.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--white);
  transition: color 0.4s;
  z-index: 10;
  white-space: nowrap;
}
#nav.scrolled .nav-logo { color: var(--black); }

.nav-links {
  display: flex;
  gap: clamp(20px, 3vw, 48px);
}
.nav-links a {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  transition: color 0.3s, opacity 0.3s;
}
.nav-links a:hover { color: var(--white); opacity: 1; }
#nav.scrolled .nav-links a { color: var(--black); }
#nav.scrolled .nav-links a:hover { opacity: 0.55; }

/* Mobile burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 28px;
  z-index: 10;
}
.nav-burger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--white);
  transition: background 0.4s, transform 0.3s, opacity 0.3s;
  transform-origin: center;
}
#nav.scrolled .nav-burger span { background: var(--black); }
#nav.menu-open .nav-burger span:first-child { transform: translateY(7px) rotate(45deg); }
#nav.menu-open .nav-burger span:last-child  { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--black);
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
}
.hero-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-vid.active {
  opacity: 0.7;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.2) 50%,
    rgba(0,0,0,0.65) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 0 var(--pad-x);
}
.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 20px;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(72px, 10vw, 148px);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 24px;
}
.hero-campaign {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scroll-line {
  display: block;
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.4);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50% { transform: scaleY(0.4); opacity: 0.8; }
}

/* ============================================================
   SHARED SECTION STYLES
   ============================================================ */
section { padding: clamp(80px, 12vw, 140px) var(--pad-x); }

.section-header {
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ============================================================
   DSQUARED FEATURE
   ============================================================ */
#dsquared {
  background: var(--black);
  padding: 0;
}
.dsq-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.dsq-img {
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #111;
}
.dsq-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.9s var(--ease-out);
  will-change: transform;
}
.dsq-img:hover img { transform: scale(1.03); }
.dsq-credit {
  text-align: center;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 20px var(--pad-x);
}

@media (max-width: 640px) {
  .dsq-split { grid-template-columns: 1fr; gap: 2px; }
  .dsq-img { aspect-ratio: 4/5; }
}

/* ============================================================
   PORTFOLIO
   ============================================================ */
#portfolio {
  background: var(--cream);
  padding-bottom: clamp(60px, 8vw, 120px);
}
#portfolio .section-header {
  text-align: center;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.filter-btn {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}
.filter-btn:hover { color: var(--black); }
.filter-btn.active {
  color: var(--black);
  border-bottom-color: var(--black);
}

/* Portfolio Grid — CSS Masonry via columns */
.portfolio-grid {
  columns: 3;
  column-gap: 12px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.grid-item {
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--light);
}
.grid-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s var(--ease-out), opacity 0.4s;
  will-change: transform;
}
.grid-item:hover img { transform: scale(1.04); }
.grid-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px;
  transition: background 0.4s var(--ease-out);
}
.grid-item:hover .grid-item-overlay { background: rgba(10,10,10,0.35); }
.grid-item-label {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 300;
  color: var(--white);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
}
.grid-item:hover .grid-item-label {
  opacity: 1;
  transform: translateY(0);
}
.grid-item.hidden { display: none; }

/* Load More */
.load-more-wrap {
  text-align: center;
  margin-top: clamp(32px, 5vw, 56px);
}
.btn-outline {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--black);
  border: 1px solid var(--black);
  padding: 14px 40px;
  transition: background 0.3s, color 0.3s;
}
.btn-outline:hover { background: var(--black); color: var(--white); }

/* ============================================================
   CAMPAIGNS
   ============================================================ */
#campaigns {
  background: var(--white);
}
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.campaign-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.campaign-img-wrap {
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--light);
}
.campaign-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}
.campaign-item:hover .campaign-img-wrap img { transform: scale(1.04); }
.campaign-info {
  padding: 16px 0 0;
}
.campaign-info h3 {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 300;
  margin-bottom: 4px;
}
.campaign-info p {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}

/* ============================================================
   ABOUT
   ============================================================ */
#about {
  background: var(--black);
  color: var(--white);
  padding: clamp(80px, 12vw, 140px) 0;
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: var(--max-w);
  margin: 0 auto;
}
.about-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #1a1a1a;
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(100%);
  transition: transform 0.9s var(--ease-out);
}
.about-image:hover img { transform: scale(1.03); }

.about-text {
  padding: clamp(48px, 6vw, 96px) var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.about-eyebrow {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}
.about-name {
  font-family: var(--font-serif);
  font-size: clamp(44px, 6vw, 88px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}
.about-bio {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255,255,255,0.65);
  margin-bottom: 16px;
  max-width: 480px;
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 16px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 300;
  color: var(--white);
}
.about-links {
  margin-top: 40px;
}
.about-link {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.about-link:hover { color: var(--white); border-color: var(--white); }

/* ============================================================
   AGENCIES
   ============================================================ */
#agencies {
  background: var(--cream);
}
#agencies .section-header {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}
.agencies-list {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.agency-item {
  padding: clamp(28px, 4vw, 48px) 16px;
  border-right: 1px solid rgba(0,0,0,0.1);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: background 0.3s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.agency-item:last-child { border-right: none; }
.agency-item:hover { background: rgba(0,0,0,0.03); }
.agency-item:hover .agency-name { text-decoration: underline; text-underline-offset: 3px; }
.agency-city {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mid);
}
.agency-name {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 400;
  line-height: 1.1;
}
.agency-country {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  border: 1px solid var(--light);
  display: inline-block;
  padding: 3px 8px;
}

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
#contact {
  background: var(--black);
  color: var(--white);
  padding: clamp(80px, 12vw, 140px) var(--pad-x) clamp(32px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact-inner {
  text-align: center;
  margin-bottom: clamp(48px, 8vw, 100px);
}
.contact-heading {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 40px;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.contact-link {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.contact-link:hover { color: var(--white); border-color: var(--white); }
.footer-bottom {
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.footer-bottom p {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
}

/* Crafted by Kauffen Studios */
.footer-crafted {
  text-align: center;
  margin-bottom: 20px;
}
.crafted-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.3s;
}
.crafted-link:hover { color: rgba(255,255,255,0.7); }
.crafted-logo {
  width: 16px;
  height: 16px;
  display: flex;
  flex-shrink: 0;
}
.crafted-logo svg { width: 100%; height: 100%; }
.crafted-ring-a {
  animation: craftedSpinA 12s linear infinite;
  transform-origin: center;
}
.crafted-ring-b {
  animation: craftedSpinB 8s linear infinite reverse;
  transform-origin: center;
}
@keyframes craftedSpinA { to { transform: rotate(360deg); } }
@keyframes craftedSpinB { to { transform: rotate(360deg); } }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lb-img-wrap {
  max-width: min(90vw, 1000px);
  max-height: 90svh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: 90svh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}
.lightbox.active .lb-img-wrap img { transform: scale(1); }

.lb-close,
.lb-prev,
.lb-next {
  position: fixed;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s, transform 0.2s;
  z-index: 510;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover { color: var(--white); }

.lb-close {
  top: 24px; right: 28px;
  font-size: 32px;
  font-weight: 200;
  line-height: 1;
}
.lb-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  padding: 16px 8px;
}
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  padding: 16px 8px;
}
.lb-next:hover { transform: translateY(-50%) translateX(3px); }

.lb-caption {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  align-items: center;
}
#lbSession {
  font-family: var(--font-serif);
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  font-style: italic;
}
#lbCounter {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.3);
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.9s;
  transition-timing-function: var(--ease-out);
}
.reveal-up    { transform: translateY(32px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.97); }

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Grid items — staggered reveal */
.grid-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.grid-item.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .portfolio-grid { columns: 2; }
  .campaigns-grid { grid-template-columns: 1fr 1fr; }
  .campaigns-grid .campaign-item:last-child { display: none; }
  .agencies-list { grid-template-columns: repeat(3, 1fr); }
  .about-inner { grid-template-columns: 1fr; }
  .about-image {
    aspect-ratio: 3/4;
    width: 100%;
    max-height: 70vh;
  }
  .about-text { padding: 48px var(--pad-x); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
  :root { --pad-x: 20px; }

  .nav-burger { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: var(--black);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
    z-index: 5;
  }
  .nav-links.open {
    opacity: 1;
    pointer-events: all;
  }
  .nav-links a {
    font-size: 24px;
    letter-spacing: 0.15em;
    font-family: var(--font-serif);
    color: var(--white);
  }

  .hero-name { font-size: clamp(56px, 14vw, 80px); }

  .portfolio-grid { columns: 1; }
  .filter-bar { gap: 8px 12px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-btn { white-space: nowrap; }

  .campaigns-grid { grid-template-columns: 1fr; }
  .campaigns-grid .campaign-item:last-child { display: block; }

  .about-stats { grid-template-columns: repeat(2, 1fr); }

  .agencies-list { grid-template-columns: 1fr 1fr; }
  .agency-item:last-child { border-right: none; }
  .agency-item:nth-child(2) { border-right: none; }

  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}
