/* ==========================================================================
   Michalis Anastasakis — main stylesheet
   Mobile first. Breakpoints: 700px (tablet), 1100px (desktop), 1600px (wide).
   ========================================================================== */

/* ---- Fonts (self-hosted, variable) -------------------------------------- */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Muli";
  src: url("../fonts/muli-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */

:root {
  --paper: #ffffff;
  --ink: #11110f;
  --ink-soft: #3b3934;
  --muted: #67645c;
  --line: #e6e3dd;
  --line-strong: #cdc9c1;

  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Muli", "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.55, 0, .75, .2);

  --head-h: 60px;
  --page-pad: 20px;
  --page-max: 1440px;

  color-scheme: light;
}

@media (min-width: 700px) {
  :root { --page-pad: 32px; }
}
@media (min-width: 1100px) {
  :root { --head-h: 84px; --page-pad: 40px; }
}

/* ---- Base ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--head-h) + 12px);
  background: var(--paper);
}

html.is-locked { overflow: hidden; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;               /* 19px */
  font-weight: 500;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--ink);
}

img,
picture,
svg { display: block; max-width: 100%; }

img { height: auto; }

/* photos: no long-press "Save image" / link menu, no dragging out (the right-click menu is blocked in main.js) */
img[src*="/photos/"],
.viewer img,
[data-viewer] {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

h1, h2, h3, p, figure, ul, ol { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  translate: 0 -200%;
}
.skip:focus { translate: 0 0; }

/* ---- Shared pieces ------------------------------------------------------- */

.label {
  font-family: var(--sans);
  font-size: .6875rem;                /* 11px */
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.button .icon { transition: translate .45s var(--ease); }
.button:hover { background: var(--ink); color: var(--paper); }
.button:hover .icon { translate: 2px -2px; }
.button--block { width: 100%; }

.textlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.textlink::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.textlink:hover::after { transform: scaleX(.3); }

.arrow {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.arrow .icon { width: 18px; height: 18px; }
.arrow:hover:not(:disabled) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.arrow:disabled { color: var(--line-strong); cursor: default; }

/* ---- Masthead ------------------------------------------------------------ */

.masthead {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--head-h);
  padding: 0 var(--page-pad);
  padding-left: max(var(--page-pad), env(safe-area-inset-left));
  padding-right: max(var(--page-pad), env(safe-area-inset-right));
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease);
}
.masthead.is-scrolled { border-bottom-color: var(--line); }

.masthead__brand {
  display: block;
  flex: none;
  width: clamp(196px, 56vw, 252px);
}
.masthead__brand img { width: 100%; }

.masthead__nav { display: none; }

.masthead__menu {
  min-height: 44px;
  padding: 0 0 0 16px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

@media (min-width: 1100px) {
  .masthead__brand { width: clamp(280px, 24vw, 350px); }
  .masthead__menu { display: none; }
  .masthead__nav {
    display: flex;
    align-items: center;
    gap: clamp(22px, 2.4vw, 40px);
  }
  .navlink {
    position: relative;
    padding: 14px 0;
    font-family: var(--sans);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
  }
  .navlink::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .45s var(--ease);
  }
  .navlink:hover::after,
  .navlink[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
  }
  .masthead__nav .button { margin-left: clamp(4px, .8vw, 14px); }
}

/* ---- Mobile menu --------------------------------------------------------- */

.menu {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
}
.menu[open] {
  display: flex;
  flex-direction: column;
  animation: menu-in .35s var(--ease) both;
}
.menu::backdrop { background: var(--paper); }

.menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--head-h);
  padding: 0 var(--page-pad);
}
.menu__close {
  min-height: 44px;
  padding-left: 16px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.menu__nav { flex: 1; padding: 12px var(--page-pad) 0; outline: none; }
.menu__list { padding: 0; list-style: none; }
.menu__list li { border-bottom: 1px solid var(--line); }
.menu__list a {
  display: block;
  padding: 14px 0 12px;
  font-size: clamp(2.25rem, 10.5vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.015em;
}
.menu__list a[aria-current="page"] { font-style: italic; }
.menu[open] .menu__list li { animation: menu-item .6s var(--ease) both; animation-delay: calc(60ms + var(--n) * 45ms); }

.menu__foot {
  display: grid;
  gap: 18px;
  padding: 28px var(--page-pad) max(28px, env(safe-area-inset-bottom));
}
.menu__social {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.menu__social a { display: inline-flex; align-items: center; min-height: 44px; }

@keyframes menu-in { from { opacity: 0; } }
@keyframes menu-item { from { opacity: 0; translate: 0 14px; } }

/* ---- The wall (portfolio grid) ------------------------------------------- */

.wall {
  container-type: inline-size;
  padding: 3px env(safe-area-inset-right) 0 env(safe-area-inset-left);   /* edge to edge: white only between photos */
}

.wall__inner {
  --cols: 2;
  /* the space between photos, on every screen size — 0 makes them touch */
  --gap: 3px;
  --tile: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols));
  --drop: calc(var(--tile) * .64);
  position: relative;
}

.wall__grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gap);
  padding: 0 0 var(--drop);
  list-style: none;
}

.wall__item:nth-child(2n) { translate: 0 var(--drop); }

.wall__link {
  display: block;
  overflow: hidden;
  background: var(--paper);
  cursor: zoom-in;
}
.wall__link:focus-visible { outline-offset: 2px; }
.wall__link { aspect-ratio: 2 / 3; }
.wall__link img { width: 100%; height: 100%; object-fit: cover; }

/* the h1 lives in the gap the stagger opens above column 2 */
.wall__intro {
  position: absolute;
  top: 0;
  left: calc(var(--tile) + var(--gap));
  width: var(--tile);
  height: var(--drop);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 4px 14px;
}
.wall__title {
  font-size: clamp(1.25rem, 5.6cqi, 2.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.wall__place {
  font-family: var(--sans);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* "see all" mirrors it, in the gap column 1 leaves at the bottom */
.wall__more {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--tile);
  height: var(--drop);
  padding: 24px 4px 0 16px;
}
.seeall {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .35em;
  font-size: clamp(1.25rem, 5.2cqi, 2.4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.01em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color .35s var(--ease);
}
.seeall .nowrap { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
.seeall .icon { width: .8em; height: .8em; transition: translate .45s var(--ease); }
.seeall:hover { text-decoration-color: var(--ink); }
.seeall:hover .icon { translate: 4px 0; }

@media (max-width: 699px) {
  /* phones: one line, clear of the photo on the right and the screen edge on the left */
  .wall__more { padding: 34px 10px 0 14px; }
  .seeall { flex-wrap: nowrap; white-space: nowrap; font-size: calc(5.3cqi - 2.6px); }
}

@media (min-width: 700px) {
  .wall__inner { --cols: 3; --drop: calc(var(--tile) * .62); }
  .wall__item:nth-child(2n) { translate: none; }
  .wall__item:nth-child(3n + 2) { translate: 0 var(--drop); }
  .wall__item:nth-child(3n) { translate: 0 calc(var(--drop) * .45); }
  .wall__title { font-size: clamp(1.5rem, 3.5cqi, 2.6rem); }
  .seeall { font-size: clamp(1.4rem, 3.2cqi, 2.4rem); }
  .wall__intro { padding: 0 6px 20px; }
  .wall__more { padding: 32px 6px 0 22px; }
}

@media (min-width: 1100px) {
  /* desktop: the wall runs edge to edge, the whole width of the screen */
  .wall { padding: 3px env(safe-area-inset-right) 0 env(safe-area-inset-left); }
  .wall__inner { --cols: 4; --drop: calc(var(--tile) * .6); }
  .wall__item:nth-child(3n + 2),
  .wall__item:nth-child(3n) { translate: none; }
  .wall__item:nth-child(4n + 2) { translate: 0 var(--drop); }
  .wall__item:nth-child(4n + 3) { translate: 0 calc(var(--drop) * .35); }
  .wall__item:nth-child(4n + 4) { translate: 0 calc(var(--drop) * .7); }
  .wall__title { font-size: clamp(1.9rem, 2.6cqi, 3rem); }
  .wall__place { font-size: .6875rem; }
  .seeall { font-size: clamp(1.6rem, 2.3cqi, 2.6rem); }
  .wall__intro { padding: 0 clamp(16px, 1.6vw, 32px) 26px; gap: 12px; }
  .wall__more { padding: 42px clamp(16px, 1.6vw, 32px) 0 clamp(40px, 3.6vw, 72px); }
}

/* ---- Develop: prints emerge from the white page --------------------------
   Only with JS (the inline head script adds .js; it is removed again after
   3s if main.js never ran), so the photos are always visible without it.  */

.ma-dev .wall__link img,
.ma-dev .strip__link img {
  opacity: 0;
  filter: brightness(1.75) contrast(.5) saturate(.15);
  transition:
    opacity 1s var(--ease) var(--d, 0ms),
    filter 1.9s var(--ease) var(--d, 0ms);
}
.ma-dev .is-developed img {
  opacity: 1;
  filter: none;
}

/* on a desk with a mouse, the print you point at lifts a little */
@media (hover: hover) and (pointer: fine) {
  .wall__link img,
  .strip__link img { transition: scale .8s var(--ease); }
  .ma-dev .wall__link img,
  .ma-dev .strip__link img {
    transition:
      opacity 1s var(--ease) var(--d, 0ms),
      filter 1.9s var(--ease) var(--d, 0ms),
      scale .8s var(--ease);
  }
  .wall__link:hover img { scale: 1.03; }
  .strip__link:hover img { scale: 1.018; }
}

/* ---- Story --------------------------------------------------------------- */

.story {
  display: grid;
  gap: 56px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(150px, 16vw, 220px) var(--page-pad) clamp(150px, 16vw, 220px);
}

.story__media {
  position: relative;
  width: min(84%, 420px);
  margin-left: 30px;
}
.story__figure { position: relative; isolation: isolate; }
.story__figure::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -16px;
  right: -16px;
  width: 68%;
  height: 70%;
  border: 1px solid var(--line-strong);
}
.story__img { width: 100%; }

/* "Est. 2016 / 01" — kept exactly in the demo's voice: vertical, tracked sans */
.edition {
  position: absolute;
  bottom: 0;
  left: -30px;
  font-family: var(--sans);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1;
  writing-mode: vertical-rl;
  white-space: nowrap;
}

.story__title {
  max-width: 13ch;
  font-size: clamp(2.75rem, 11.5vw, 6rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.story__lead {
  max-width: 34rem;
  margin-top: 28px;
  font-size: clamp(1.3125rem, 1.15rem + .7vw, 1.75rem);
  line-height: 1.42;
  text-wrap: pretty;
}
.story__what {
  display: grid;
  gap: 10px;
  max-width: 34rem;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.story__what + .story__what { margin-top: 26px; }
.story__what p {
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.story__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 40px;
}

@media (min-width: 700px) {
  .story {
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    align-items: center;
    gap: clamp(56px, 8vw, 150px);
  }
  .story__media { width: auto; margin-left: 34px; }
  .story__figure::before { top: -26px; right: -26px; }
  .edition { left: -34px; }
  .story__title { font-size: clamp(3rem, 6.6vw, 6rem); }
  .story__what { grid-template-columns: 112px 1fr; gap: 28px; }
  .story__what .label { padding-top: 6px; }
}

@media (min-width: 1100px) {
  .story { align-items: stretch; }
  .story__media { max-width: 520px; margin-left: 46px; }
  .story__figure { position: absolute; inset: 0; }
  .story__figure picture { display: block; height: 100%; }
  .story__img { height: 100%; object-fit: cover; object-position: 50% 30%; }
  .edition { left: -46px; }
}

/* "About Michalis" — a spine down the left edge of the portrait, partner of "Est. 2016 / 01" at the bottom */
.story__spine {
  position: absolute;
  top: 0;
  left: -30px;
  margin: 0;
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  writing-mode: vertical-rl;
  rotate: 180deg;
  white-space: nowrap;
}
@media (min-width: 700px) { .story__spine { left: -40px; font-size: 1.75rem; } }
@media (min-width: 1100px) { .story__spine { left: -52px; font-size: 2rem; } }

/* ---- Analogue film ------------------------------------------------------- */

.film {
  max-width: 1840px;
  margin: 0 auto;
  padding: 0 0 clamp(96px, 12vw, 180px);
}

.film__head {
  display: grid;
  gap: 18px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--page-pad);   /* same space above and below the heading */
  border-top: 1px solid var(--line);
}
.film__title {
  font-size: clamp(2.5rem, 10vw, 4.75rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.film__text {
  max-width: 30rem;
  font-size: 1.1875rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.film__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.film__arrows { display: none; gap: 8px; }

.strip {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 var(--page-pad) 18px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--page-pad);
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--line);
}
.strip::-webkit-scrollbar { height: 2px; }
.strip::-webkit-scrollbar-track { background: var(--line); }
.strip::-webkit-scrollbar-thumb { background: var(--ink); }

.strip__item {
  flex: 0 0 74vw;
  scroll-snap-align: start;
}
.strip__link { display: block; cursor: zoom-in; }
.strip__link img { width: 100%; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.strip.is-grabbing { scroll-snap-type: none; cursor: grabbing; }
.strip.is-grabbing .strip__link { cursor: grabbing; }

@media (min-width: 700px) {
  .film__head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    column-gap: 48px;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .film__title { grid-row: span 2; align-self: end; }
  .strip { gap: 12px; }
  .strip__item { flex-basis: 42vw; }
}

@media (min-width: 1100px) {
  .film__head {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
    padding-top: 56px;
    padding-bottom: 56px;
  }
  .film__title { grid-row: auto; }
  .film__actions { justify-content: flex-end; gap: 32px; }
  .film__arrows { display: flex; }
  /* full width, like the wall: edge to edge, 3px apart, about four frames across */
  .strip { gap: 3px; padding-inline: 0; scroll-padding-inline: 0; }
  .strip__item { flex-basis: calc((100% - 3 * 3px) / 4.25); }
  .film { max-width: none; }
}

/* ---- Quote invitation (end of the homepage) ------------------------------- */

.quote {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  text-align: center;
}
.quote__title {
  font-size: clamp(2.5rem, 9vw, 4.75rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.quote__text {
  max-width: 30rem;
  margin: 18px auto 0;
  font-size: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}
.quote__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 64px;
  margin-top: 36px;
  padding: 0 40px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background-color .35s var(--ease), color .35s var(--ease), transform .16s var(--ease);
}
.quote__button .icon { transition: translate .45s var(--ease); }
.quote__button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .quote__button:hover { background: var(--paper); color: var(--ink); }
  .quote__button:hover .icon { translate: 2px -2px; }
}
@media (max-width: 699px) { .quote__button { width: 100%; } }

/* ---- Footer -------------------------------------------------------------- */

.footer {
  display: grid;
  gap: 40px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 56px var(--page-pad) max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.footer__brand .masthead__brand { width: 190px; }
.footer__brand p {
  max-width: 22rem;
  margin-top: 18px;
  font-size: 1.125rem;
  color: var(--ink-soft);
}
.footer__nav,
.footer__contact { display: grid; gap: 2px; justify-items: start; }
.footer__nav a,
.footer__social a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.footer__nav a:hover,
.footer__social a:hover,
.footer__mail:hover { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px; }
.footer__mail { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.3125rem; }
.footer__social { display: flex; flex-wrap: wrap; gap: 0 22px; }
.footer__by { white-space: nowrap; }
@media (max-width: 699px) {
  .footer__sep { display: none; }          /* on phones the credit sits on its own line instead */
  .footer__by { display: block; margin-top: 4px; }
}
.footer__credit { color: var(--ink); text-underline-offset: .25em; text-decoration-thickness: 1px; }
.footer__credit:hover { text-decoration: underline; }
/* every page ends with the same breathing room above the footer as the homepage */
main > :last-child:not(.contact) { padding-bottom: clamp(96px, 12vw, 180px); }

.footer__legal {
  text-align: center;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .01em;
  color: var(--muted);
}

@media (min-width: 700px) {
  .footer { grid-template-columns: 1.3fr .7fr 1.3fr; padding-top: 72px; }
  .footer__legal { grid-column: 1 / -1; }
}

/* ---- Viewer (full-screen photo) ------------------------------------------ */

.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: contain;
}
.viewer::backdrop { background: var(--paper); }
.viewer[open] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "bar bar"
    "stage stage"
    "prev next";
}
/* opening: the viewer fades in and the photo settles from a hair smaller (never from nothing) */
.viewer[open] { animation: viewer-in .2s var(--ease) both; }
.viewer[open] .viewer__frame { animation: frame-in .32s var(--ease); }
@keyframes viewer-in { from { opacity: 0; } }
@keyframes frame-in { from { opacity: 0; scale: .97; } }
/* closing: a quick fade of the viewer and its white backdrop together */
.viewer.is-closing,
.viewer.is-closing::backdrop { animation: viewer-out .18s ease-out forwards; }
@keyframes viewer-out { to { opacity: 0; } }

.viewer__bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--head-h);
  padding: 0 max(var(--page-pad), env(safe-area-inset-right)) 0 max(var(--page-pad), env(safe-area-inset-left));
}
.viewer__count {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .18em;
  font-variant-numeric: tabular-nums;
}
.viewer__bar,
.viewer__nav { opacity: calc(1 - var(--pull, 0)); }
.viewer__close {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: -10px;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.viewer__stage {
  grid-area: stage;
  position: relative;
  container-type: size;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.viewer__frame {
  --ar: .6667;
  --w: min(100cqw - 24px, 100cqh * var(--ar));
  position: absolute;
  inset: 0;
  margin: auto;
  width: var(--w);
  height: calc(var(--w) / var(--ar));
  background: var(--paper);
  will-change: transform;
}
.viewer__ph,
.viewer__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.viewer__pic { position: absolute; inset: 0; }
.viewer__img { opacity: 0; transition: opacity .35s var(--ease); }
.viewer__img.is-loaded { opacity: 1; }

.viewer__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--ink);
}
.viewer__nav .icon { width: 26px; height: 26px; }
.viewer__nav--prev { grid-area: prev; }
.viewer__nav--next { grid-area: next; }
.viewer__nav:hover .icon { scale: 1.12; }
.viewer__nav .icon { transition: scale .3s var(--ease); }

@media (min-width: 700px) {
  .viewer[open] {
    grid-template-columns: 88px minmax(0, 1fr) 88px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "bar bar bar"
      "prev stage next";
  }
  .viewer__frame { --w: min(100cqw, (100cqh - 40px) * var(--ar)); bottom: 40px; }
  .viewer__nav { height: auto; padding-bottom: 40px; }
}

/* ---- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .wall__link:hover img,
  .strip__link:hover img { scale: none; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .ma-dev .wall__link img,
  .ma-dev .strip__link img {
    filter: none;
    transition: opacity .3s linear;
  }
  .button .icon,
  .seeall .icon { transition: none; }
}

/* ==========================================================================
   Inner pages: portfolio, analogue film, couples, contact
   ========================================================================== */

/* ---- Page heading (film, couples, a couple) ----------------------------- */

.pagehead {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--page-pad) clamp(28px, 4vw, 48px);
}
.pagehead__back { margin-bottom: 8px; }
.pagehead__title {
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.pagehead__text {
  max-width: 34rem;
  margin-top: 16px;
  font-size: clamp(1.1875rem, 1.1rem + .4vw, 1.4375rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}
.pagehead__meta {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Justified gallery: full width, 3px apart, every photo uncropped ---- */

.gallery-wrap { padding: 0 3px; }
.gallery {
  --row: 220px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery::after { content: ""; flex-grow: 999999; }          /* the last row keeps its natural size */
.gallery__item {
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * var(--row));
  min-width: 0;
}
.gallery__link {
  display: block;
  overflow: hidden;
  background: var(--paper);
  cursor: zoom-in;
}
.gallery__link img { width: 100%; height: auto; }
@media (min-width: 700px) { .gallery { --row: 300px; } }
@media (min-width: 1100px) { .gallery-wrap { padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); } .gallery { --row: 420px; } }

/* ---- Couples index: full-width covers ----------------------------------- */

.couples { padding: 0 3px; }
.couples__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.couple-card { display: block; }
.couple-card__img {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--paper);
}
.couple-card__img img { width: 100%; height: 100%; object-fit: cover; }
.couple-card__name {
  display: block;
  margin-top: 12px;
  padding: 0 var(--page-pad) 0 12px;
  font-size: clamp(1.375rem, 1.2rem + .8vw, 2rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.couple-card__meta {
  display: block;
  margin-top: 6px;
  padding-left: 12px;
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (min-width: 700px) { .couples__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .couples { padding: 0; }
  .couples__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 40px; }
  .couple-card__name, .couple-card__meta { padding-left: 16px; }
}

/* the same "develop" as the homepage wall */
.ma-dev .gallery__link img,
.ma-dev .couple-card img {
  opacity: 0;
  filter: brightness(1.75) contrast(.5) saturate(.15);
  transition: opacity 1s var(--ease) var(--d, 0ms), filter 1.9s var(--ease) var(--d, 0ms);
}
.ma-dev .gallery__link.is-developed img,
.ma-dev .couple-card.is-developed img { opacity: 1; filter: none; }
@media (hover: hover) and (pointer: fine) {
  .ma-dev .gallery__link img,
  .ma-dev .couple-card img {
    transition: opacity 1s var(--ease) var(--d, 0ms), filter 1.9s var(--ease) var(--d, 0ms), scale .8s var(--ease);
  }
  .gallery__link:hover img,
  .couple-card:hover img { scale: 1.03; }
  .couple-card__name { transition: color .3s var(--ease); }
  .couple-card:hover .couple-card__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
}

/* ---- Next couple --------------------------------------------------------- */

.pager {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 120px) var(--page-pad);
  text-align: right;
}
.pager__link { display: inline-grid; gap: 6px; justify-items: end; }
.pager__label {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager__name {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -.02em;
}
.pager__name .icon { width: .6em; height: .6em; transition: translate .45s var(--ease); }
@media (hover: hover) and (pointer: fine) { .pager__link:hover .icon { translate: 6px 0; } }

/* ---- Contact --------------------------------------------------------------- */

.contact { display: grid; }
.contact__media { margin: 0; overflow: hidden; }
.contact__media picture { display: block; height: 100%; }
.contact__img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 100%; }   /* any trimming happens at the top */
.contact__body {
  max-width: 44rem;
  padding: clamp(40px, 7vw, 96px) var(--page-pad) clamp(64px, 9vw, 128px);
}
.contact__title {
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.025em;
}
.contact__lead { margin-top: 18px; font-size: clamp(1.1875rem, 1.1rem + .4vw, 1.4375rem); color: var(--ink-soft); text-wrap: pretty; }

.form { display: grid; gap: 22px; margin-top: 36px; }
.form__row { display: grid; gap: 22px; }
.form__field { display: grid; gap: 8px; }
.form__label {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.form__req { color: var(--ink); }
.form__opt { font-weight: 400; letter-spacing: .04em; text-transform: none; color: var(--muted); }
.form input,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 16px/1.4 var(--serif);       /* never under 16px: phones must not zoom into the field */
  font-size: clamp(1.3125rem, 1.25rem + .3vw, 1.5rem);   /* 21 → 24px */
  transition: border-color .25s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.form textarea { resize: vertical; min-height: 140px; }
.form input::placeholder, .form textarea::placeholder { color: var(--muted); opacity: .7; }
.form input:focus-visible, .form textarea:focus-visible { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 6px; }
.form__send { min-width: 180px; min-height: 54px; font-size: .8125rem; }
.form__send:active { transform: scale(.97); }
.form__send:disabled { opacity: .55; cursor: progress; }
.form__note { font-family: var(--sans); font-size: .875rem; color: var(--muted); }
.form__status { min-height: 1.5em; font-size: 1.25rem; }
.form__status[data-state="ok"] { color: var(--ink); }
.form__status[data-state="error"] { color: #8a2a1c; }
.form__status a { text-decoration: underline; text-underline-offset: .2em; }

@media (min-width: 700px) { .form__row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) {
  .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
  .contact__media { position: sticky; top: var(--head-h); height: calc(100svh - var(--head-h)); }
  .contact__img { height: 100%; aspect-ratio: auto; }
  .contact__body { padding-left: clamp(48px, 6vw, 112px); }
}

@media (prefers-reduced-motion: reduce) {
  .ma-dev .gallery__link img, .ma-dev .couple-card img { filter: none; transition: opacity .3s linear; }
  .gallery__link:hover img, .couple-card:hover img { scale: none; }
}

/* 404 */
.notfound { padding-top: clamp(96px, 14vw, 200px); }

/* ---- Privacy note under the form, privacy page ------------------------------ */

.form__privacy { margin-top: -6px; font-family: var(--sans); font-size: .8125rem; line-height: 1.6; color: var(--muted); }
.form__privacy a, .legal a { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

.legal {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--page-pad) 0;
}
.legal__title { font-size: clamp(2.5rem, 8vw, 4rem); font-weight: 400; line-height: 1; letter-spacing: -.02em; }
.legal__date { margin: 14px 0 40px; font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.legal h2 { margin: 36px 0 10px; font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.legal p { color: var(--ink-soft); text-wrap: pretty; }

/* ---- Links page (link in bio): one column, thumb-sized rows ---------------------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 100svh;
  max-width: 30rem;
  margin: 0 auto;
  padding: max(36px, env(safe-area-inset-top)) var(--page-pad) max(28px, env(safe-area-inset-bottom));
}
.links__head { display: grid; justify-items: center; gap: 18px; text-align: center; }
.links__portrait { width: min(300px, 76vw); aspect-ratio: 4 / 5; overflow: hidden; background: #f3f1ec; }
.links__portrait picture, .links__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.links__logo img { width: min(270px, 74vw); }
.links__tag { max-width: 17rem; text-wrap: balance; font-family: var(--sans); font-size: .6875rem; font-weight: 700; letter-spacing: .18em; line-height: 1.6; text-transform: uppercase; color: var(--muted); }

.links__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  transition: background-color .25s var(--ease);
}
.links__list a:active { background: #f6f5f2; }
.links__name { display: block; font-size: 1.625rem; line-height: 1.1; }
.links__hint { display: block; margin-top: 5px; font-family: var(--sans); font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.links__list .icon { color: var(--muted); transition: translate .45s var(--ease), color .25s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .links__list a:hover .icon { color: var(--ink); translate: 3px 0; }
}

.links__bar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.links__bar a { color: var(--muted); text-decoration: underline; text-underline-offset: .3em; }
.links__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; list-style: none; margin: 0; padding: 0; }
.links__grid picture, .links__grid img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.links__grid span { display: block; padding-top: 8px; font-size: 1rem; line-height: 1.2; }

.links__foot { display: grid; gap: 10px; margin-top: auto; padding-top: 8px; text-align: center; }
main.links > .links__foot { padding-bottom: 0; }   /* not the inner pages' space above the footer */
.links__social { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 26px; font-family: var(--sans); font-size: 1rem; }
.links__social a { display: inline-flex; align-items: center; min-height: 44px; }
