/* =========================================================
   Kewin Korzen — Portfolio & Sedcard
   Design: Editorial Monochrome
   ========================================================= */

:root {
  --ink: #111110;
  --ink-soft: #2a2927;
  --paper: #f3f1ec;
  --paper-2: #e9e6df;
  --white: #fbfaf8;
  --muted: #7a766f;
  --line: rgba(17, 17, 16, .14);
  --line-light: rgba(243, 241, 236, .2);

  --serif: "Cormorant Garamond", "Cormorant", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  --gap: clamp(16px, 2vw, 32px);
  --header-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
ul { list-style: none; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 200; background: var(--ink); color: var(--paper); padding: .7em 1.1em; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.skip-link:focus { left: 12px; }

.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .26em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 60;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  transition: background-color .6s var(--ease), color .6s var(--ease), border-color .6s var(--ease), height .6s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(243, 241, 236, .88);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-color: var(--line);
  height: calc(60px + env(safe-area-inset-top));
}
.brand { font-size: 12px; font-weight: 500; letter-spacing: .34em; text-transform: uppercase; white-space: nowrap; }

.nav ul { display: flex; gap: clamp(20px, 3vw, 48px); }
.nav a {
  position: relative; display: inline-block; padding-block: 6px;
  font-size: 11px; font-weight: 400; letter-spacing: .26em; text-transform: uppercase;
}
.nav a::after, .footer__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right center;
  transition: transform .6s var(--ease-out);
}
.nav a:hover::after, .nav a.is-active::after, .footer__links a:hover::after { transform: scaleX(1); transform-origin: left center; }

.menu-toggle { display: none; font-size: 11px; font-weight: 400; letter-spacing: .26em; text-transform: uppercase; padding: 10px 0 10px 12px; }
.menu-toggle__close { display: none; }

/* ---------- Shared CTA ---------- */
.cta { display: inline-flex; align-items: center; gap: 18px; font-size: 11px; font-weight: 400; letter-spacing: .26em; text-transform: uppercase; padding-block: 8px; }
.cta__line { display: block; width: 56px; height: 1px; background: currentColor; transform-origin: left; transition: width .7s var(--ease-out); }
.cta:hover .cta__line { width: 96px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap);
  padding: var(--header-h) var(--gutter) var(--gutter);
}
.hero__text {
  grid-column: 1 / span 5;
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: clamp(24px, 6vh, 72px);
  position: relative; z-index: 2;
}
.hero__kicker { color: var(--muted); }
.hero__name {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3.4rem, 8.6vw, 11rem);
  line-height: .86; letter-spacing: -.015em; text-transform: uppercase;
  margin-bottom: clamp(24px, 4vh, 40px);
}
.hero__name .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__name .line > span { display: inline-block; }
.hero__name .line--indent { padding-left: .62em; font-style: italic; }
.hero__sub { margin-bottom: clamp(32px, 7vh, 72px); }
.hero__sub i { font-style: normal; color: var(--muted); margin-inline: .5em; }

.hero__media {
  grid-column: 6 / -1;
  position: relative; overflow: hidden;
  background: var(--paper-2);
  min-height: 480px;
}
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s var(--ease); }
.hero__slide.is-active { opacity: 1; z-index: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.07); transition: transform 8s linear; }
.hero__slide.is-active img { transform: scale(1); }

.hero__counter {
  position: absolute; z-index: 3; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 2vw, 24px);
  display: flex; align-items: center; gap: 14px; color: var(--white);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}
.hero__bar { width: 64px; height: 1px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.hero__bar span { display: block; width: 100%; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; }
.hero__bar span.is-running { transform: scaleX(1); transition: transform var(--slide-ms, 6000ms) linear; }

/* Intro animation (only with JS) */
.js .hero__name .line > span { transform: translateY(105%); transition: transform 1.4s var(--ease-out); }
.js .hero__name .line--indent > span { transition-delay: .12s; }
.js .hero__kicker, .js .hero__sub, .js .hero .cta, .js .site-header { opacity: 0; transition: opacity 1.4s var(--ease) .5s; }
.js .hero__media { clip-path: inset(100% 0 0 0); transition: clip-path 1.6s var(--ease-out) .1s; }
.is-loaded .hero__name .line > span { transform: none; }
.is-loaded .hero__kicker, .is-loaded .hero__sub, .is-loaded .hero .cta, .is-loaded .site-header { opacity: 1; }
.is-loaded .hero__media { clip-path: inset(0 0 0 0); }

/* ---------- Sections ---------- */
.section { padding: clamp(96px, 16vh, 200px) var(--gutter) 0; }

.section-head {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap);
  align-items: end;
  margin-bottom: clamp(48px, 10vh, 120px);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.section-head__index { grid-column: 1 / span 1; color: var(--muted); padding-bottom: .9em; }
.section-head__title {
  grid-column: 2 / span 5;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.8rem, 6vw, 6.5rem); line-height: .9; letter-spacing: -.01em;
}
.section-head__note { grid-column: 9 / -1; justify-self: end; color: var(--muted); padding-bottom: .9em; }
.section-head--stack { display: block; border: 0; padding: 0; margin-bottom: clamp(32px, 6vh, 64px); }
.section-head--stack .section-head__index { display: block; padding: 0 0 18px; }
.section-head--stack .section-head__note { display: block; padding: 14px 0 0; }

/* ---------- Portfolio ---------- */
.filters { grid-column: 7 / -1; justify-self: end; display: flex; flex-wrap: wrap; gap: 6px clamp(14px, 1.8vw, 28px); padding-bottom: .9em; }
.filter { position: relative; color: var(--muted); padding-block: 4px; transition: color .4s var(--ease); }
.filter::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out); }
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); }
.filter[aria-pressed="true"]::after { transform: scaleX(1); }

.grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap); row-gap: clamp(56px, 9vw, 140px);
  align-items: start;
  transition: opacity .45s var(--ease);
}
.grid.is-switching { opacity: 0; }

.work { position: relative; }
.work[hidden] { display: none; }
.work__frame { display: block; width: 100%; overflow: hidden; background: var(--paper-2); cursor: zoom-in; position: relative; }
.work__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease-out), filter 1s var(--ease); }
.work__frame::after {
  content: "View"; position: absolute; left: 16px; bottom: 14px;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--white);
  opacity: 0; transform: translateY(6px); transition: opacity .6s var(--ease), transform .6s var(--ease-out);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .3);
}
.work__frame:focus-visible img { transform: scale(1.035); }
.work__frame:focus-visible::after { opacity: 1; transform: none; }
@media (hover: hover) {
  .work__frame:hover img { transform: scale(1.035); }
  .work__frame:hover::after { opacity: 1; transform: none; }
}
.work figcaption { display: flex; justify-content: space-between; padding-top: 14px; color: var(--muted); font-size: 10px; }

/* Asymmetric slots (assigned by JS, cycled) */
.work[data-slot="1"] { grid-column: 1 / span 5; }
.work[data-slot="1"] .work__frame { aspect-ratio: 4 / 5; }
.work[data-slot="2"] { grid-column: 7 / span 4; margin-top: clamp(80px, 22vh, 260px); }
.work[data-slot="2"] .work__frame { aspect-ratio: 2 / 3; }
.work[data-slot="3"] { grid-column: 2 / span 4; }
.work[data-slot="3"] .work__frame { aspect-ratio: 3 / 4; }
.work[data-slot="4"] { grid-column: 7 / span 6; margin-top: clamp(40px, 10vh, 140px); }
.work[data-slot="4"] .work__frame { aspect-ratio: 4 / 5; }
.work[data-slot="5"] { grid-column: 1 / span 4; }
.work[data-slot="5"] .work__frame { aspect-ratio: 2 / 3; }
.work[data-slot="6"] { grid-column: 6 / span 3; margin-top: clamp(80px, 24vh, 300px); }
.work[data-slot="6"] .work__frame { aspect-ratio: 3 / 4; }
.work[data-slot="7"] { grid-column: 10 / span 3; margin-top: clamp(40px, 10vh, 120px); }
.work[data-slot="7"] .work__frame { aspect-ratio: 2 / 3; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: end; }
.about__media { grid-column: 1 / span 5; overflow: hidden; background: var(--paper-2); }
.about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; }
.about__text { grid-column: 7 / span 5; max-width: 34rem; }
.about__lead {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.8rem, 2.9vw, 2.9rem); line-height: 1.12; letter-spacing: -.005em;
  margin-bottom: 1.4em;
}
.about__text > p:not(.about__lead) { color: var(--ink-soft); max-width: 28rem; }

.facts { margin-top: clamp(40px, 7vh, 72px); border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts dt { color: var(--muted); }

/* empty values → em dash, never invented */
dd:empty::after { content: "—"; color: var(--muted); }

/* ---------- Sedcard ---------- */
.sedcard { background: var(--paper-2); margin-top: clamp(96px, 16vh, 200px); padding-bottom: clamp(96px, 16vh, 200px); }
.sedcard__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: start; }
.sedcard__media { grid-column: 1 / span 4; overflow: hidden; background: var(--paper); position: sticky; top: 96px; }
.sedcard__media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%; }
.sedcard__body { grid-column: 6 / -1; }

.measures { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 64px); border-top: 1px solid var(--line); }
.measures > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.measures dt { color: var(--muted); }
.measures dd { font-family: var(--serif); font-size: clamp(1.4rem, 1.9vw, 1.85rem); font-weight: 400; line-height: 1; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.measures dd small { font-family: var(--sans); font-size: 10px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.sedcard__foot { margin-top: 32px; color: var(--muted); }

/* ---------- Polaroids ---------- */
.polaroids { padding-bottom: clamp(96px, 16vh, 200px); }
.polaroid-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(40px, 5vw, 80px) clamp(24px, 4vw, 64px); max-width: 1180px; margin-inline: auto; }
.polaroid {
  background: var(--white);
  padding: clamp(10px, 1.1vw, 16px) clamp(10px, 1.1vw, 16px) 0;
  box-shadow: 0 1px 1px rgba(17, 17, 16, .04), 0 18px 40px -22px rgba(17, 17, 16, .28);
  transform: rotate(var(--r, 0deg));
  transition: transform .9s var(--ease-out), box-shadow .9s var(--ease-out);
}
.polaroid:nth-child(6n+1) { --r: -1.2deg; }
.polaroid:nth-child(6n+2) { --r: .8deg;  margin-top: 28px; }
.polaroid:nth-child(6n+3) { --r: -.5deg; }
.polaroid:nth-child(6n+4) { --r: 1deg; }
.polaroid:nth-child(6n+5) { --r: -.9deg; margin-top: 28px; }
.polaroid:nth-child(6n+6) { --r: .4deg; }
@media (hover: hover) {
  .polaroid:hover { transform: rotate(0deg) translateY(-6px); box-shadow: 0 1px 1px rgba(17, 17, 16, .04), 0 28px 50px -24px rgba(17, 17, 16, .35); }
}
.js .polaroid.reveal { transform: rotate(var(--r, 0deg)) translateY(110px); }
.js .polaroid.reveal.is-in { transform: rotate(var(--r, 0deg)); }
@media (hover: hover) { .js .polaroid.reveal.is-in:hover { transform: rotate(0deg) translateY(-6px); } }

.polaroid__img, .polaroid__ph { display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #dedad2; }
.polaroid__img { cursor: zoom-in; }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(.98); }
.polaroid__ph {
  display: grid; place-items: center; position: relative;
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), rgba(17,17,16,.1) 50%, transparent calc(50% + .5px)),
    linear-gradient(to top left, transparent calc(50% - .5px), rgba(17,17,16,.1) 50%, transparent calc(50% + .5px)),
    #e4e0d8;
}
.polaroid__ph span { background: #e4e0d8; padding: 6px 12px; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.polaroid figcaption {
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(16px, 2vw, 24px) 2px clamp(18px, 2.2vw, 28px);
  font-family: var(--serif); font-style: italic; font-size: clamp(1rem, 1.25vw, 1.2rem); color: var(--ink-soft);
}
.polaroid figcaption span:last-child { font-family: var(--sans); font-style: normal; font-size: 10px; letter-spacing: .26em; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--paper); padding: clamp(96px, 18vh, 220px) var(--gutter) 0; }
.contact__inner { max-width: 1400px; }
.contact .section-head__index { color: rgba(243, 241, 236, .5); }
.contact__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3.6rem, 13vw, 14rem); line-height: .86; letter-spacing: -.02em;
  margin: 28px 0 clamp(56px, 10vh, 120px);
}
.contact__title a { display: inline-block; transition: opacity .6s var(--ease); }
.contact__title em { font-style: italic; padding-left: .08em; }
.contact__title a:hover { opacity: .7; }

.contact__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px var(--gap); padding-top: 28px; border-top: 1px solid var(--line-light); margin-bottom: clamp(48px, 8vh, 96px); }
.contact__grid .label { color: rgba(243, 241, 236, .5); margin-bottom: 14px; }
.contact__link { font-family: var(--serif); font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.2; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .7s var(--ease-out); word-break: break-word; }
.contact__link:hover { background-size: 100% 1px; }
.contact__text { color: rgba(243, 241, 236, .72); max-width: 22rem; }

.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  margin-top: clamp(96px, 16vh, 180px);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-light);
  color: rgba(243, 241, 236, .55);
}
.footer__links { display: flex; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; }
.footer__links a { position: relative; padding-block: 4px; transition: color .4s var(--ease); }
.footer__links a:hover { color: var(--paper); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 14, 13, .97); color: var(--paper);
  display: grid; grid-template-rows: 1fr auto;
  opacity: 0; transition: opacity .5s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__stage { display: grid; place-items: center; padding: clamp(16px, 4vw, 56px) clamp(16px, 8vw, 120px) 0; min-height: 0; }
.lightbox__img {
  max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100svh - 120px);
  width: auto; height: auto; object-fit: contain;
  opacity: 0; transform: scale(.985); transition: opacity .6s var(--ease), transform .8s var(--ease-out);
}
.lightbox__img.is-ready { opacity: 1; transform: none; }
.lightbox__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom)); color: rgba(243, 241, 236, .6); }
.lightbox__cap { text-align: center; color: var(--paper); }
.lightbox__close { justify-self: end; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--paper); padding: 8px 0; }
.lightbox__nav {
  position: absolute; top: 0; bottom: 80px; width: clamp(56px, 8vw, 120px);
  display: grid; place-items: center; font-size: 20px; color: rgba(243, 241, 236, .55);
  transition: color .4s var(--ease);
}
.lightbox__nav:hover { color: var(--paper); }
.lightbox__nav--prev { left: 0; }
.lightbox__nav--next { right: 0; }
.has-lightbox { overflow: hidden; }

/* ---------- Floating contact button ---------- */
.contact-fab {
  position: fixed; z-index: 55;
  right: var(--gutter); bottom: calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px 14px 18px;
  font-size: 11px; font-weight: 400; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink);
  background: rgba(243, 241, 236, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px -18px rgba(17, 17, 16, .45);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .7s var(--ease-out), visibility 0s linear .6s, background-color .4s var(--ease), color .4s var(--ease);
}
.contact-fab.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease), transform .7s var(--ease-out), background-color .4s var(--ease), color .4s var(--ease); }
.contact-fab__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.menu-open .contact-fab, .has-lightbox .contact-fab { opacity: 0; visibility: hidden; }

/* Contact in the header nav: subtle outline */
.nav .nav__contact { padding: 7px 16px; border: 1px solid currentColor; border-radius: 999px; transition: background-color .4s var(--ease), color .4s var(--ease); }
.nav .nav__contact::after { display: none; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.2s var(--ease), transform 1.4s var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Images rise from below: block slides up, frame wipes open bottom→top, photo settles */
.js .work.reveal, .js .about__media.reveal, .js .sedcard__media.reveal { transform: translateY(110px); transition: opacity 1s var(--ease), transform 1.6s var(--ease-out); transition-delay: var(--d, 0s); }
.js .work.reveal.is-in, .js .about__media.reveal.is-in, .js .sedcard__media.reveal.is-in { transform: none; }
.js .work.reveal .work__frame, .js .about__media.reveal, .js .sedcard__media.reveal { clip-path: inset(100% 0 0 0); }
.js .work.reveal .work__frame { transition: clip-path 1.5s var(--ease-out); transition-delay: var(--d, 0s); }
.js .about__media.reveal, .js .sedcard__media.reveal { transition-property: opacity, transform, clip-path; }
.js .work.reveal.is-in .work__frame, .js .about__media.reveal.is-in, .js .sedcard__media.reveal.is-in { clip-path: inset(0 0 0 0); }
.js .reveal:not(.is-in) .work__frame img, .js .about__media.reveal:not(.is-in) img, .js .sedcard__media.reveal:not(.is-in) img, .js .polaroid.reveal:not(.is-in) img { transform: scale(1.18); }
.about__media img, .sedcard__media img, .polaroid__img img { transition: transform 1.8s var(--ease-out); }
.js .polaroid.reveal { transition: opacity 1s var(--ease), transform 1.6s var(--ease-out), box-shadow .9s var(--ease-out); transition-delay: var(--d, 0s); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .work[data-slot="2"], .work[data-slot="6"] { margin-top: 14vh; }
  .work[data-slot="4"], .work[data-slot="7"] { margin-top: 6vh; }
  .facts > div { grid-template-columns: 9rem 1fr; }
  .nav ul { gap: 22px; }
}

/* Tablet landscape (e.g. iPad 1024–1180): keep editorial layout, tighten hero */
@media (min-width: 900px) and (max-width: 1180px) {
  .hero__text { grid-column: 1 / span 6; }
  .hero__media { grid-column: 7 / -1; }
  .hero__name { font-size: clamp(3.4rem, 9.4vw, 7rem); }
  .sedcard__media { grid-column: 1 / span 5; }
  .sedcard__body { grid-column: 6 / -1; }
  .measures { grid-template-columns: 1fr; }
}

/* Tall tablets in portrait (iPad Pro 1024×1366): don't let the hero become a skyscraper */
@media (min-width: 900px) and (orientation: portrait) {
  .hero { min-height: 0; height: 78vh; height: 78svh; }
}

@media (max-width: 899px) {
  :root { --header-h: 64px; }

  /* Header becomes light over the hero image */
  .site-header:not(.is-scrolled) { color: var(--white); }
  .menu-toggle { display: block; position: relative; z-index: 2; }
  .nav {
    position: fixed; inset: 0; z-index: 1;
    background: var(--paper); color: var(--ink);
    display: flex; align-items: flex-end;
    padding: 0 var(--gutter) calc(48px + env(safe-area-inset-bottom));
    opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s linear .5s;
  }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a { font-family: var(--serif); font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 300; letter-spacing: 0; text-transform: none; line-height: 1.15; padding: 0; }
  .nav a::after { display: none; }
  .nav .nav__contact { border: 0; border-radius: 0; padding: 0; font-style: italic; }
  .nav li { transform: translateY(16px); opacity: 0; transition: transform .7s var(--ease-out), opacity .7s var(--ease); }
  .menu-open .nav { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
  .menu-open .nav li { transform: none; opacity: 1; }
  .menu-open .nav li:nth-child(2) { transition-delay: .05s; }
  .menu-open .nav li:nth-child(3) { transition-delay: .1s; }
  .menu-open .nav li:nth-child(4) { transition-delay: .15s; }
  .menu-open .nav li:nth-child(5) { transition-delay: .2s; }
  .menu-open .site-header { color: var(--ink); background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .menu-open .brand { position: relative; z-index: 2; }
  .menu-open .menu-toggle__open { display: none; }
  .menu-open .menu-toggle__close { display: inline; }
  .menu-open { overflow: hidden; }

  /* Hero: fullscreen image, name overlaid */
  .hero { display: block; padding: 0; height: 100vh; height: 100svh; min-height: 560px; color: var(--white); }
  .hero__media { position: absolute; inset: 0; min-height: 0; }
  .hero__media::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 45%, rgba(0,0,0,.6) 100%); }
  .hero__text { position: absolute; inset: 0; padding: calc(var(--header-h) + 8px) var(--gutter) calc(64px + env(safe-area-inset-bottom)); z-index: 3; }
  .hero__kicker { color: rgba(255,255,255,.75); }
  .hero__name { font-size: clamp(3.4rem, 17vw, 6.5rem); margin-bottom: 18px; }
  .hero__sub { margin-bottom: 28px; }
  .hero__sub i { color: rgba(255,255,255,.6); }
  .hero__counter { left: var(--gutter); right: auto; bottom: calc(24px + env(safe-area-inset-bottom)); }

  .section-head { grid-template-columns: 1fr auto; row-gap: 20px; }
  .section-head__index { grid-column: 1 / -1; padding: 0; }
  .section-head__title { grid-column: 1; }
  .section-head__note { grid-column: 2; }
  .filters { grid-column: 1 / -1; justify-self: start; padding: 0; }

  .about__grid, .sedcard__grid { display: block; }
  .about__media { margin-bottom: 48px; }
  .about__text { max-width: none; }
  .sedcard__media { position: relative; top: 0; margin-bottom: 56px; max-width: 520px; }

  .polaroid-row { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr 1fr; }

  /* Comfortable touch targets */
  .filter { padding-block: 10px; }
  .filters { gap: 2px 22px; }
  .footer__links a, .lightbox__close { display: inline-block; padding-block: 12px; }

  /* Tablet portrait (iPad 768–899): sedcard side by side still fits */
  .sedcard__media { width: 100%; }
}

@media (min-width: 700px) and (max-width: 899px) {
  .sedcard__grid { display: grid; }
  .sedcard__media { grid-column: 1 / span 5; position: sticky; top: 88px; margin: 0; }
  .sedcard__body { grid-column: 6 / -1; }
  .measures { grid-template-columns: 1fr; }
  .about__grid { display: grid; align-items: start; }
  .about__media { grid-column: 1 / span 6; margin: 0; }
  .about__text { grid-column: 7 / -1; }
  .about__lead { font-size: 1.7rem; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Phones in landscape */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 0; height: 100vh; height: 100svh; }
  .hero__name { font-size: clamp(2.6rem, 9vw, 4.2rem); margin-bottom: 10px; }
  .hero__sub { margin-bottom: 14px; }
  .hero__text { padding-bottom: 20px; }
  .hero__counter { display: none; }
  .hero__slide img { object-position: 50% 20% !important; }
}

@media (max-width: 699px) {
  .grid { grid-template-columns: repeat(6, 1fr); row-gap: 44px; }
  .work[data-slot] { margin-top: 0; }
  .work[data-slot="1"], .work[data-slot="4"] { grid-column: 1 / -1; }
  .work[data-slot="2"], .work[data-slot="6"] { grid-column: 2 / -1; }
  .work[data-slot="3"], .work[data-slot="5"], .work[data-slot="7"] { grid-column: 1 / span 5; }

  .measures { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .contact__grid { grid-template-columns: 1fr; }
  .lightbox__nav { bottom: 80px; width: 48px; }
  .lightbox__stage { padding-inline: 12px; }
  .lightbox__bar { grid-template-columns: auto 1fr auto; }
  .lightbox__cap { font-size: 10px; }
  .contact-fab { padding: 12px 18px 12px 15px; font-size: 10px; }
}

@media (max-width: 480px) {
  .polaroid-row { grid-template-columns: 1fr; max-width: 340px; }
  .polaroid:nth-child(n) { margin-top: 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .hero__slide img { transform: none !important; }
}
