/* Valerii & Pauline — v4: an artist page. One changing photograph, then the work. */

:root {
  --bg: #f8f8f6; /* a few points off pure white, neutral with the faintest warmth */
  --ink: #2a2a2a;
  --ink-dim: rgb(42 42 42 / .55);
  --line: rgb(42 42 42 / .85);
  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', serif;
  --sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --odd: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --side: clamp(16px, 4.4vw, 66px);
  --top: 100px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Top ---------- */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--top);
  padding: env(safe-area-inset-top) clamp(16px, 2.5vw, 36px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}
.top-away .top { transform: translateY(-100%); }
.mono {
  font-size: 38px;
  letter-spacing: -.04em;
  line-height: 1;
}
.mono i { font-style: italic; }
.top nav { display: flex; gap: clamp(20px, 2.6vw, 40px); }
/* the small links: a quiet, slightly strange monospace in lowercase */
.top nav, .links, .pager { font-family: var(--odd); font-size: 15px; font-style: normal; letter-spacing: .01em; }
.top nav { align-items: center; }
.top nav > a, .cm-btn { color: var(--ink-dim); transition: color .3s; padding: 8px 0; }
.top nav > a:hover, .cm-btn:hover, .cm-btn[aria-expanded="true"] { color: var(--ink); }
/* Contact: a small menu that drops from the header */
.cm { position: relative; }
.cm-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  animation: cm-in .28s cubic-bezier(.16, 1, .3, 1);
}
@keyframes cm-in { from { opacity: 0; transform: translateY(-6px); } }
.cm-list a { display: grid; gap: 2px; padding: 10px 18px; color: var(--ink); transition: background-color .2s; }
.cm-list a:hover { background: rgb(127 127 127 / .1); }
.cm-list b { font-weight: 500; }
.cm-list span { color: var(--ink-dim); font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--top) + 26px) var(--side) 0; }
.hero-stage {
  position: relative;
  display: block;
  height: min(78vh, 56vw);
}
.hero-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero-stage img.is-on { opacity: 1; }
.caption {
  margin: 26px 0 0;
  font-weight: 400;
  text-align: center;
  font-size: clamp(24px, 2.4vw, 36px);
  letter-spacing: -.03em;
  line-height: 1;
}
.caption i, .c-name i { font-style: italic; padding: 0 .04em; }

/* ---------- Work ---------- */
.works {
  --gap: clamp(24px, 4vw, 64px);
  --w: calc(100vw - 2 * var(--side) - 16px);
  display: grid;
  row-gap: clamp(56px, 9vw, 140px);
  padding: clamp(90px, 16vh, 170px) var(--side) 0;
}
.row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--gap);
}
/* one shared height per row: the pair fills the width or stops at a comfortable height */
.row--pair { --h: min(76vh, calc((var(--w) - var(--gap)) / var(--rs))); }
.row--full { --h: min(80vh, calc(var(--w) / var(--rs))); }
.row--solo { --h: min(88vh, calc(var(--w) / var(--rs))); }
.row--trio { --h: min(64vh, calc((var(--w) - 2 * var(--gap)) / var(--rs))); }
.work { display: block; }
.work img {
  height: var(--h);
  width: calc(var(--h) * var(--r));
  object-fit: cover;
  transition: opacity .4s;
}
.work:hover img { opacity: .88; }

/* ---------- About ---------- */
.about {
  padding: clamp(120px, 22vh, 240px) var(--side) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 40em);
  column-gap: var(--side);
}
.about h2 { margin: 0; font-family: var(--odd); font-size: 15px; font-weight: 400; color: var(--ink-dim); padding-top: .7em; }
.about-body { font-family: var(--odd); font-size: 17px; line-height: 1.6; letter-spacing: 0; }
.about-body p { margin: 0 0 1.1em; }
.about-lead { font-family: var(--serif); font-size: clamp(28px, 2.9vw, 44px); line-height: 1.12; letter-spacing: -.025em; margin-bottom: 1.2em !important; }
.about-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 1.6em; }
.about-pair h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 26px; font-weight: 400; font-style: italic; letter-spacing: -.02em; }
.about-pair p { margin: 0; }
.about-end { color: var(--ink-dim); margin-bottom: 0 !important; }

/* ---------- Contact ---------- */
.contact {
  padding: clamp(110px, 20vh, 220px) var(--side) clamp(48px, 10vh, 100px);
  display: grid;
  gap: 26px;
}
.c-name { margin: 0; font-size: clamp(40px, 5.4vw, 88px); letter-spacing: -.04em; line-height: 1; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 18px; }
.links a, .pager a { display: inline-flex; align-items: center; gap: 18px; }
.links svg, .pager svg { width: 36px; height: 12px; transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.links a:hover svg, .pager-next:hover svg { transform: translateX(6px); }
.pager-all:hover svg { transform: translateX(-6px); }

/* ---------- Series page ---------- */
.viewer {
  position: relative;
  height: 100vh;
  height: 100svh;
  padding: var(--top) clamp(64px, 9vw, 150px) 28px;
}
.stage { position: relative; width: 100%; height: 100%; }
.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity .55s ease, transform .9s cubic-bezier(.16, 1, .3, 1);
  user-select: none;
  -webkit-user-drag: none;
}
.slide.is-on { opacity: 1; transform: none; }
.arrow {
  position: absolute;
  top: var(--top);
  bottom: 28px;
  width: 50%;
  display: flex;
  align-items: center;
  z-index: 2;
}
.arrow--prev { left: 0; justify-content: flex-start; padding-left: clamp(16px, 2.5vw, 36px); }
.arrow--next { right: 0; justify-content: flex-end; padding-right: clamp(16px, 2.5vw, 36px); }
.arrow svg { width: 46px; height: 14px; transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.arrow--prev:hover svg { transform: translateX(-6px); }
.arrow--next:hover svg { transform: translateX(6px); }

.sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(90px, 11vw, 170px), 1fr));
  column-gap: clamp(16px, 2.6vw, 40px);
  row-gap: clamp(20px, 3vw, 48px);
  padding: clamp(60px, 10vh, 120px) clamp(24px, 7vw, 110px) 0;
  align-items: center;
}
.thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 0; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.thumb.is-on::after { opacity: 1; }

.pager {
  display: flex;
  justify-content: space-between;
  padding: clamp(80px, 14vh, 160px) var(--side) clamp(40px, 8vh, 80px);
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  :root { --top: 64px; }
  .mono { font-size: 30px; }
  .top nav { gap: 18px; font-size: 15px; }
  .about { grid-template-columns: 1fr; row-gap: 20px; padding-top: 110px; }
  .about-pair { grid-template-columns: 1fr; gap: 22px; }
  .cm-list { right: -8px; min-width: 240px; }
  .hero-stage { height: 58svh; }
  .caption { margin-top: 14px; }
  /* phones keep the magazine rows: pairs and trios side by side, scaled to the screen width */
  .works { padding-top: 56px; row-gap: 26px; --gap: 8px; --w: calc(100vw - 2 * var(--side)); }
  .row--pair { --h: calc((var(--w) - var(--gap)) / var(--rs)); }
  .row--trio { --h: calc((var(--w) - 2 * var(--gap)) / var(--rs)); }
  .row--full { --h: calc(var(--w) / var(--rs)); }
  .row--solo { --h: min(74svh, calc(var(--w) / var(--rs))); }
  .viewer { padding: var(--top) 12px 64px; height: 88svh; }
  .arrow { top: auto; bottom: 0; height: 56px; }
  .sheet { grid-template-columns: repeat(4, 1fr); column-gap: 12px; row-gap: 18px; padding: 30px 16px 0; }
  .thumb::after { inset: -5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-stage img, .slide { transition: opacity .2s; transform: none; }
}

/* ---------- Editor (?edit) ---------- */
.editing .works { row-gap: 0; padding-bottom: 200px; }
.editing .row { position: relative; padding: 10px 0 10px 44px; justify-content: flex-start; gap: 14px; border-radius: 4px; }
.editing .row--pair, .editing .row--trio, .editing .row--solo, .editing .row--full { --h: 24vh; }
.editing .row.is-over { background: rgb(127 127 127 / .12); }
.editing .work { position: relative; cursor: grab; }
.editing .work:active { cursor: grabbing; }
.editing .work.is-over img { outline: 2px solid var(--ink); outline-offset: 3px; }
.editing .work:hover img { opacity: 1; }
.ed-handle {
  position: absolute;
  left: 4px; top: 50%;
  translate: 0 -50%;
  width: 28px; height: 44px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  cursor: grab;
  border-radius: 4px;
}
.ed-handle span { width: 14px; height: 2px; background: var(--ink-dim); }
.ed-handle:hover { background: rgb(127 127 127 / .15); }
.ed-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.editing .work:hover .ed-tools, .ed-tools:focus-within { opacity: 1; }
.ed-tools button {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgb(255 255 255 / .92);
  color: #111;
  font-family: var(--sans, sans-serif);
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px rgb(0 0 0 / .25);
}
.ed-tools .ed-star { color: #b9b9b9; }
.ed-tools .ed-star.is-on { color: #d4a017; }
.ed-gap {
  height: 18px;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: transparent;
  border-radius: 4px;
  transition: height .15s;
}
.ed-dragging .ed-gap { height: 44px; color: var(--ink-dim); outline: 1px dashed var(--ink-dim); outline-offset: -6px; }
.ed-gap.is-over { background: rgb(127 127 127 / .2); color: var(--ink); }

.ed-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: var(--bg);
  border-top: 1px solid var(--ink-dim);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0;
  box-shadow: 0 -6px 24px rgb(0 0 0 / .12);
}
.ed-controls { display: flex; align-items: center; gap: 14px; padding: 10px 18px; flex-wrap: wrap; }
.ed-hint { color: var(--ink-dim); }
.ed-status { margin-left: auto; color: var(--ink-dim); }
.ed-controls button, .ed-controls a {
  padding: 7px 14px;
  border: 1px solid var(--ink-dim);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
}
.ed-controls button:disabled { opacity: .4; cursor: default; }
.ed-controls .ed-save { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ed-tray { display: flex; align-items: center; gap: 14px; padding: 8px 18px 12px; min-height: 92px; }
.ed-tray.is-over { background: rgb(127 127 127 / .15); }
.ed-tray-label { white-space: nowrap; color: var(--ink-dim); }
.ed-tray-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ed-chip { flex: none; height: 72px; cursor: grab; }
.ed-chip img { height: 100%; width: auto; }
.ed-empty { color: var(--ink-dim); }
.editing .top { transform: none !important; }

/* ---------- Not found ---------- */
.lost { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 28px; padding: var(--top) var(--side); text-align: center; }
.lost h1 { margin: 0; font-weight: 400; font-size: clamp(32px, 4.4vw, 64px); letter-spacing: -.035em; line-height: 1.05; }
.lost a { display: inline-flex; align-items: center; gap: 16px; font-family: var(--odd); font-size: 16px; color: var(--ink-dim); }
.lost a:hover { color: var(--ink); }
.lost svg { width: 36px; height: 12px; }
