/* ================================================================
   Portfolio — Nicolás Biondi Fotógrafo  v3
   - Unified typography: Montserrat (Gotham-like geometric sans)
   - Responsive home: horizontal scroll desktop / masonry grid mobile
   - Lightbox v2: thumbnail strip, zoom, preload, polished transitions
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

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

:root {
  /* Palette */
  --black:      #111;
  --ink:        #2a2a2a;
  --grey:       #6b6b6b;
  --muted:      #999;
  --light:      #e0e0e0;
  --white:      #fff;
  --off-white:  #fafaf9;
  /* Single accent — matches landing.css for cross-page brand
     consistency. Used by interactive states (link hover etc).     */
  --accent:     #1AB6FF;

  /* Layout */
  --nav-h:      60px;
  --footer-h:   44px;
  --content-max: 1400px;
  --content-pad-x: 1.5rem;

  /* Motion */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);

  /* Typography — unified Montserrat */
  --font-sans:  'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--black);
  color: var(--white);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  z-index: 999;
  border-radius: 0 0 4px 4px;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 0; }

/* Focus visible (global) */
:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── NAV ──────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
  padding-top: env(safe-area-inset-top, 0);
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
}

.nav.scrolled {
  background: rgba(255,255,255,0.96);
  box-shadow: 0 1px 24px rgba(0,0,0,0.05);
}

.nav-logo { display: flex; align-items: center; }
.nav-logo img {
  height: 22px;
  width: auto;
  transition: opacity .2s var(--ease);
}
.nav-logo:hover img { opacity: 0.65; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--black);
  padding: 0;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  transition: background .15s var(--ease);
}
.nav-toggle:hover { background: rgba(0,0,0,0.05); }
.nav-toggle:active { background: rgba(0,0,0,0.08); }

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
  align-items: center;
}
.nav-toggle-icon span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--black);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.125rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--grey);
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
  position: relative;
  transition: color .2s var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0.85rem;
  right: 0.85rem;
  height: 1px;
  background: var(--black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}

.nav-links a:hover,
.nav-links a.active { color: var(--black); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ── Animations ───────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════
   GALLERY — Mobile-first masonry design
   Base: single column vertical
   ≥540px: 2-col masonry (CSS columns, no stretching/white space)
   ≥1024px AND landscape ratio: horizontal scroll editorial
   ═══════════════════════════════════════════════════════════════ */

.gallery {
  margin-top: var(--nav-h);
  display: block;
  column-count: 1;
  column-gap: 4px;
  width: 100%;
  padding: 0;
}

.gallery-item {
  display: block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 4px 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--off-white);
  animation: fadeIn .55s var(--ease-out) both;
}

.gallery-item:nth-child(1)  { animation-delay: .02s; }
.gallery-item:nth-child(2)  { animation-delay: .06s; }
.gallery-item:nth-child(3)  { animation-delay: .10s; }
.gallery-item:nth-child(4)  { animation-delay: .14s; }
.gallery-item:nth-child(5)  { animation-delay: .18s; }
.gallery-item:nth-child(6)  { animation-delay: .22s; }
.gallery-item:nth-child(7)  { animation-delay: .26s; }
.gallery-item:nth-child(8)  { animation-delay: .30s; }

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s var(--ease), filter .35s var(--ease);
  will-change: transform;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.035);
  filter: brightness(0.88);
}

/* ── ≥540px: 2-col masonry ────────────────────────────────────── */
@media (min-width: 540px) {
  .gallery {
    column-count: 2;
    column-gap: 4px;
    padding: 0;
  }
}

/* ── ≥1024px landscape viewports: horizontal scroll editorial ── */
@media (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  .gallery {
    display: flex;
    column-count: unset;
    align-items: center;
    height: calc(100svh - var(--nav-h) - var(--footer-h));
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: clamp(2rem, 6vh, 4.5rem) 1.5rem;
    gap: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .gallery::-webkit-scrollbar { height: 4px; }
  .gallery::-webkit-scrollbar-thumb { background: var(--light); border-radius: 2px; }
  .gallery::-webkit-scrollbar-track { background: transparent; }

  /* Horizontal mode: container has fixed height + aspect ratio,
     image fills container via object-fit cover */
  .gallery-item {
    flex: none;
    height: min(70vh, 640px);
    width: auto;
    margin: 0;
    scroll-snap-align: start;
  }

  .gallery-item.landscape { aspect-ratio: 3 / 2; }
  .gallery-item.portrait  { aspect-ratio: 2 / 3; }

  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* ── SUB-GALLERY (project sets: Comercial / Personal / Eventos) ── */
.project-header {
  margin: calc(var(--nav-h) + 1rem) auto 0;
  max-width: var(--content-max);
  width: 100%;
  padding: 0 var(--content-pad-x) 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  animation: fadeUp .5s var(--ease-out) both;
}

/* Breadcrumb: typographically consistent with the .nav above it
   (Montserrat 400, sentence case, no letter-spacing). The path
   links sit at the nav's --grey, the current item bumps to --ink
   and 500 weight so it has presence without competing with the H1
   below. Hover uses the brand --accent for a subtle lift that
   matches the landing page.                                       */
.project-breadcrumb {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--grey);
  margin: 0;
  line-height: 1.4;
}

.project-breadcrumb a {
  color: var(--grey);
  text-decoration: none;
  transition: color .2s var(--ease);
}

.project-breadcrumb a:hover,
.project-breadcrumb a:focus-visible {
  color: var(--accent);
}

.project-breadcrumb .sep {
  color: var(--light);
  font-size: 1em;
  letter-spacing: 0;
  display: inline-block;
  font-weight: 300;
  user-select: none;
}

/* Current item: dark enough to be clearly the active node, with a
   slight weight bump. Still smaller than the H1 below — the H1
   carries the visual weight of the page.                          */
.project-breadcrumb .current {
  color: var(--ink);
  font-weight: 500;
}

.project-header h1 {
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
}

.project-header p {
  font-size: 0.85rem;
  color: var(--grey);
  font-weight: 400;
  margin: 0;
  line-height: 1.4;
}

/* ── SUB-GALLERY: CSS columns masonry — preserves natural aspect ratios ──
   Default: 1-col mobile
   ≥540px:  2-col masonry
   ≥1024px: 3-col masonry */
.gallery.sub-gallery {
  display: block;
  column-count: 1;
  column-gap: 8px;
  height: auto;
  min-height: 0;
  overflow: visible;
  flex: 0 1 auto;
  padding: 0.5rem var(--content-pad-x) 3rem;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  scroll-snap-type: none;
  animation: fadeUp .6s .1s var(--ease-out) both;
}

@media (min-width: 540px) {
  .gallery.sub-gallery { column-count: 2; }
}

@media (min-width: 1024px) {
  .gallery.sub-gallery {
    column-count: 3;
    column-gap: 10px;
  }
}

.gallery.sub-gallery .gallery-item {
  display: block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 8px 0;
  width: 100%;
  height: auto;
  background: var(--off-white);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery.sub-gallery .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s var(--ease), filter .35s var(--ease);
}

.gallery.sub-gallery .gallery-item:hover img {
  transform: scale(1.025);
  filter: brightness(0.9);
}

/* ── LIGHTBOX v2 ──────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.98);
  z-index: 9999;
  isolation: isolate;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
  flex-direction: column;
}

/* Hide nav while lightbox is open (visual fallback if z-index conflicts) */
body.lightbox-open .nav { visibility: hidden; }

.lightbox.open {
  display: flex;
  animation: fadeIn .25s var(--ease-out);
}

.lb-img-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4rem 5rem 0.5rem;
  min-height: 0;
}

#lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  cursor: zoom-in;
  transition: transform .35s var(--ease), opacity .2s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

#lb-img.loading { opacity: 0; }
#lb-img.zoomed {
  cursor: zoom-out;
  transform: scale(1.6);
  max-width: none;
  max-height: none;
}

/* Counter top bar */
.lb-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 202;
  pointer-events: none;
}

.lb-counter {
  color: rgba(255,255,255,0.65);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
}

.lb-close, .lb-prev, .lb-next, .lb-zoom {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
  transition: opacity .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
  z-index: 201;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover, .lb-zoom:hover {
  opacity: 1;
  background: rgba(255,255,255,0.16);
}

.lb-close:active, .lb-prev:active, .lb-next:active, .lb-zoom:active {
  transform: scale(0.94);
}

.lb-close svg, .lb-prev svg, .lb-next svg, .lb-zoom svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.lb-close { margin-left: auto; }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

.lb-prev:hover { transform: translateY(-50%) scale(1.05); }
.lb-next:hover { transform: translateY(-50%) scale(1.05); }
.lb-prev:active, .lb-next:active { transform: translateY(-50%) scale(0.94); }

/* Thumbnail strip */
.lb-thumbs {
  height: 78px;
  display: flex;
  gap: 6px;
  padding: 8px 1.5rem 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  flex-shrink: 0;
  width: 100%;
  justify-content: flex-start;
}

.lb-thumbs::-webkit-scrollbar { height: 4px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.lb-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
  background: rgba(255,255,255,0.05);
}

.lb-thumb:hover { opacity: 0.85; }
.lb-thumb.active {
  opacity: 1;
  border-color: var(--white);
}

.lb-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Keyboard hint */
.lb-keyboard-hint {
  position: absolute;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  pointer-events: none;
  animation: fadeIn .5s .3s both;
}
.lb-keyboard-hint kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.6rem;
  font-family: var(--font-sans);
  margin-right: 4px;
}

/* ── ABOUT ────────────────────────────────────────────────────── */
.about-page {
  margin-top: var(--nav-h);
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 3.5rem;
  padding: 4rem 3rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp .6s var(--ease-out) both;
}

.about-img {
  flex: 0 0 320px;
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}

.about-img img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1.1;
  object-fit: cover;
  filter: grayscale(8%);
  transition: filter .4s var(--ease);
  border-radius: 2px;
}
.about-img img:hover { filter: grayscale(0%); }

.about-text { flex: 1; }

.about-text h1 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.75em;
  line-height: 1.2;
}

.about-text p {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--grey);
  margin-bottom: 1.4em;
  text-wrap: pretty;
}

/* ── PROJECTS ─────────────────────────────────────────────────── */
/* When used standalone (proyectos.html): own top spacing.
   When used after .project-header (comercial/personal/eventos): no extra margin. */
.projects-page {
  margin: var(--nav-h) auto 0;
  max-width: var(--content-max);
  width: 100%;
  padding: 2.5rem var(--content-pad-x) 4rem;
  flex: 1;
  box-sizing: border-box;
}
.project-header + .projects-page {
  margin-top: 0;
  padding-top: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 100%;
  margin: 0;
}

.project-card {
  display: block;
  background: var(--off-white);
  text-decoration: none;
  color: inherit;
  animation: fadeUp .6s var(--ease-out) both;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.project-card:nth-child(2) { animation-delay: .1s; }
.project-card:nth-child(3) { animation-delay: .2s; }
.project-card:nth-child(4) { animation-delay: .3s; }
.project-card:nth-child(5) { animation-delay: .4s; }

.project-card:hover,
.project-card:focus-visible {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}

.project-card .img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
  will-change: transform;
  display: block;
}

.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.04);
}

.project-card-label {
  display: block;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--grey);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
  transition: color .2s var(--ease);
}

.project-card:hover .project-card-label,
.project-card:focus-visible .project-card-label {
  color: var(--black);
}

/* ── INSTAGRAM PAGE ───────────────────────────────────────────── */
.ig-page {
  margin: var(--nav-h) auto 0;
  flex: 1;
  padding: 2rem var(--content-pad-x) 4rem;
  max-width: var(--content-max);
  width: 100%;
  box-sizing: border-box;
  animation: fadeUp .6s var(--ease-out) both;
}

.ig-header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--off-white);
}

.ig-avatar {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: var(--off-white);
  transition: transform .3s var(--ease);
}
.ig-avatar:hover, .ig-avatar:focus-visible { transform: scale(1.04); }
.ig-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.ig-handle { flex: 1; min-width: 0; }
.ig-handle h1 {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--black);
}
.ig-bio {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--grey);
  margin: 0 0 0.75rem;
  white-space: normal;
}
.ig-stats {
  font-size: 0.875rem;
  color: var(--grey);
  margin: 0 0 1rem;
}
.ig-stats strong { color: var(--black); font-weight: 500; }
.ig-follow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.ig-follow:hover, .ig-follow:focus-visible {
  background: #333;
  transform: translateY(-1px);
}
.ig-follow svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.ig-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  text-decoration: none;
  color: inherit;
  border: 1px solid #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
  animation: fadeUp .5s var(--ease-out) both;
}
.ig-card:nth-child(1) { animation-delay: .05s; }
.ig-card:nth-child(2) { animation-delay: .10s; }
.ig-card:nth-child(3) { animation-delay: .15s; }
.ig-card:nth-child(4) { animation-delay: .20s; }
.ig-card:nth-child(5) { animation-delay: .25s; }
.ig-card:nth-child(6) { animation-delay: .30s; }
.ig-card:nth-child(7) { animation-delay: .35s; }
.ig-card:nth-child(8) { animation-delay: .40s; }
.ig-card:nth-child(9) { animation-delay: .45s; }

.ig-card:hover, .ig-card:focus-visible {
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  transform: translateY(-3px);
}

.ig-card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--off-white);
  overflow: hidden;
}
.ig-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease);
}
.ig-card:hover .ig-card-thumb img,
.ig-card:focus-visible .ig-card-thumb img { transform: scale(1.05); }

.ig-card-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  fill: rgba(255,255,255,0.95);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  pointer-events: none;
}

.ig-card-meta {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.ig-card-stats {
  display: flex;
  gap: 1rem;
  color: var(--grey);
  font-size: 0.8rem;
}
.ig-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.ig-stat svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

.ig-card-caption {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--black);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.ig-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--grey);
  margin-top: 3rem;
  letter-spacing: 0.02em;
}

/* ── CONTACT ──────────────────────────────────────────────────── */
.contact-page {
  margin-top: var(--nav-h);
  flex: 1;
  display: flex;
  gap: 6rem;
  align-items: flex-start;
  padding: 5rem 4rem;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp .6s var(--ease-out) both;
}

.contact-info {
  flex: 0 0 200px;
  padding-top: 0.25rem;
}

.contact-info h1 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.contact-role {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.contact-info a {
  font-size: 0.875rem;
  color: var(--grey);
  transition: color .2s var(--ease), border-color .2s var(--ease);
  display: inline-block;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.contact-info a:hover { color: var(--black); border-bottom-color: var(--black); }

.contact-form { flex: 1; }

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}
.form-group label span { color: var(--black); }

.form-group input,
.form-group textarea {
  border: none;
  border-bottom: 1px solid var(--light);
  border-radius: 0;
  padding: 0.65rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  outline: none;
  transition: border-color .25s var(--ease);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus { border-bottom-color: var(--black); }
.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--black);
  box-shadow: 0 1px 0 var(--black);
}

.btn-send {
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 0.95rem 3rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background .25s var(--ease), transform .15s var(--ease);
  min-height: 44px;
}

.btn-send::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  transform: translateX(-100%);
  transition: transform .35s var(--ease);
}
.btn-send:hover::before { transform: translateX(0); }
.btn-send:active { transform: scale(0.98); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.form-status {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--grey);
  min-height: 1.2em;
}
.form-status.success { color: #2e7d32; }
.form-status.error   { color: #c62828; }

/* ── SOCIAL FOOTER ────────────────────────────────────────────── */
.social-footer {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 2rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  height: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px));
}

.social-footer a {
  color: var(--muted);
  transition: color .2s var(--ease), transform .2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  width: 36px;
  height: 36px;
}
.social-footer a:hover { color: var(--black); transform: translateY(-2px); }

.social-footer svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── prefers-reduced-motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── RESPONSIVE: Tablet ──────────────────────────────────────── */
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .project-card img { height: 320px; }
  .about-page { padding: 3rem 2rem; gap: 3rem; }
  .about-img { flex: 0 0 300px; }
}

/* ── RESPONSIVE: Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 1rem; }
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0.25rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    animation: fadeIn .15s var(--ease-out);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: 0;
    min-height: 44px;
  }
  .nav-links a::after { display: none; }

  /* GALLERY mobile: tap feedback (layout handled by mobile-first base) */
  .gallery-item:hover img { transform: none; }
  .gallery-item:active img { transform: scale(0.99); }

  .about-page {
    flex-direction: column;
    padding: 2rem 1.25rem 3rem;
    gap: 2rem;
  }
  .about-img {
    flex: 0 0 auto;
    position: static;
    max-width: 280px;
    margin: 0 auto;
  }
  .about-img img { aspect-ratio: 4/5; }
  .about-text h1 { font-size: 1.25rem; margin-bottom: 1.25em; }
  .about-text p { font-size: 0.9rem; line-height: 1.7; }

  .contact-page {
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    gap: 2rem;
  }
  .contact-info { flex: 0 0 auto; }
  .contact-info h1 { font-size: 1.35rem; }

  .projects-page { padding: 1.5rem 1rem 3rem; }
  .projects-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .project-card img { height: 280px; }

  /* Instagram page mobile */
  .ig-page { padding: 1.5rem 1rem 3rem; }
  .ig-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .ig-avatar { width: 88px; height: 88px; }
  .ig-handle h1 { font-size: 1.4rem; }
  .ig-bio { font-size: 0.875rem; }
  .ig-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .ig-card-meta { padding: 0.6rem 0.75rem 0.75rem; }
  .ig-card-caption { font-size: 0.75rem; -webkit-line-clamp: 2; }
  .ig-card-stats { font-size: 0.7rem; gap: 0.65rem; }

  /* Project header mobile: tighter still */
  .project-header {
    margin-top: calc(var(--nav-h) + 0.5rem);
    padding: 0 1rem 0.5rem;
    gap: 0.3rem;
  }
  .project-header h1 { font-size: 1.25rem; }
  .project-header p  { font-size: 0.8rem; }
  /* Slightly larger on mobile than before because we dropped the
     uppercase + letter-spacing — sentence case at 0.65rem reads
     too cramped. */
  .project-breadcrumb { font-size: 0.72rem; gap: 0.4rem; }
  .gallery.sub-gallery { padding: 0.5rem 1rem 2rem; }

  /* LIGHTBOX mobile */
  .lb-img-wrap { padding: 3.5rem 0.5rem 0.5rem; }
  .lb-prev { left: 0.5rem; width: 44px; height: 44px; }
  .lb-next { right: 0.5rem; width: 44px; height: 44px; }
  .lb-close, .lb-zoom { width: 44px; height: 44px; }
  .lb-keyboard-hint { display: none; }
  .lb-thumbs { padding: 6px 0.5rem 10px; height: 64px; }
  .lb-thumb { width: 44px; height: 44px; }
  .social-footer { padding: 0 1rem; }
}

/* Tablet/desktop-tall layouts handled by base mobile-first rules */

/* ── Extra tight phones ──────────────────────────────────────── */
@media (max-width: 380px) {
  .nav { padding: 0 0.75rem; }
  .nav-logo img { height: 22px; }
}
