/* Avril Dutheil book. One theme (off-black), one typeface, photos first. */
:root {
  --bg: #0e0e0e;
  --fg: #ededeb;
  --muted: #8b8b87;
  --line: #2a2a29;
  --panel: #1d1d1c;
  --sheet: #171716;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bar-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --vh: 100vh;
}
@supports (height: 100svh) { :root { --vh: 100svh; } }

* { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--fg);
  scroll-snap-type: y mandatory;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h2, h3, p { margin: 0; }
.label, .bar button, .wordmark, .sheet h2, .overview h2, dt, .units button, .btn, .contact-list span {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- book: mobile, one frame per screen ---------- */
.spread { display: contents; }
.frame {
  position: relative;
  margin: 0;
  height: var(--vh);
  padding: 0 0 calc(var(--bar-h) + var(--safe-b));
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}
.frame picture { display: block; width: 100%; height: 100%; }
.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-touch-callout: default;
}

/* cover: on phones the name and height sit under the photo, never on it */
.cover .frame { padding-bottom: calc(var(--bar-h) + var(--safe-b) + 62px); }
.meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bar-h) + var(--safe-b) + 12px);
  pointer-events: none;
}
.meta-name { font-size: 20px; font-weight: 500; letter-spacing: .01em; }
.meta-name span { color: var(--muted); font-weight: 400; }
.meta-name span + span, .meta-name [data-cm] { color: var(--fg); }
.meta-loc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- digitals ---------- */
.digitals {
  scroll-snap-align: start;
  background: var(--panel);
  min-height: var(--vh);
  padding: 64px 12px calc(var(--bar-h) + var(--safe-b) + 32px);
}
.digitals .label { color: var(--muted); margin: 0 4px 16px; }
.digital-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.digital { display: block; aspect-ratio: 2 / 3; background: var(--c); }
.digital picture, .digital img, .overview picture, .overview img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- closing ---------- */
.closing {
  scroll-snap-align: start;
  min-height: var(--vh);
  display: flex;
  align-items: center;
  padding: 72px 20px calc(var(--bar-h) + var(--safe-b) + 32px);
}
.closing-inner { width: 100%; max-width: 560px; margin: 0 auto; }
.closing-name { font-size: 34px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; }
.closing-status { color: var(--muted); margin-top: 8px; font-size: 14px; }
.closing-stats { margin-top: 28px; }
.closing-contact { margin-top: 28px; display: grid; gap: 6px; font-size: 17px; }
.closing-contact a { text-decoration: none; border-bottom: 1px solid var(--line); padding: 6px 0; }
.closing-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.credits { margin-top: 32px; color: var(--muted); font-size: 12px; }
.fineprint { margin-top: 6px; color: #5d5d5a; font-size: 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #3a3a38;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: #1f1f1e; border-color: #555; }

/* ---------- stats ---------- */
.stats { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.stats div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stats div:last-child { grid-column: 1 / -1; }
dt { color: var(--muted); align-self: center; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.units { display: inline-flex; border: 1px solid #3a3a38; border-radius: 999px; padding: 2px; }
.units button { padding: 7px 14px; border-radius: 999px; color: var(--muted); min-height: 32px; }
.units button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ---------- chrome: progress, bar, wordmark ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; pointer-events: none; }
.progress i { display: block; height: 100%; background: rgba(255, 255, 255, .85); transform-origin: 0 50%; transform: scaleX(0); }

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--bar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(14, 14, 14, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.bar button { height: var(--bar-h); }
.bar button:active { opacity: .6; }
.wordmark { display: none; }

.progress, .bar, .meta, .wordmark { transition: opacity .25s ease; }
.clean .progress, .clean .bar, .clean .meta, .clean .wordmark { opacity: 0; pointer-events: none; }

/* ---------- sheets ---------- */
dialog { color: var(--fg); border: 0; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.sheet {
  margin: auto 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 88vh;
  background: var(--sheet);
  border-radius: 16px 16px 0 0;
  padding: 18px 20px calc(24px + var(--safe-b));
  overscroll-behavior: contain;
}
.sheet[open] { animation: up .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet header, .overview header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.close { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); min-height: 40px; padding: 0 0 0 16px; }
.sheet-note { color: var(--muted); font-size: 13px; margin-top: 18px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--muted); }
.contact-list a { font-size: 16px; text-decoration: none; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.overview {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: var(--bg);
  padding: 16px 12px calc(24px + var(--safe-b));
  overscroll-behavior: contain;
}
.overview .label { color: var(--muted); margin: 24px 2px 10px; }
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ov-grid button { aspect-ratio: 2 / 3; background: var(--c); overflow: hidden; }
.ov-grid button:active { opacity: .7; }

.lightbox { margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: #000; }
.lightbox img { width: 100%; height: 100%; object-fit: contain; display: block; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 8px);
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* ---------- desktop: curated pairs ---------- */
@media (min-width: 900px) and (orientation: landscape) {
  :root { --pad-t: 60px; --pad-b: 36px; }
  .spread {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    gap: 16px;
    height: var(--vh);
    padding: var(--pad-t) 48px var(--pad-b);
    scroll-snap-align: start;
  }
  .frame {
    height: 100%;
    aspect-ratio: 2 / 3;
    max-width: calc(50% - 8px);
    padding: 0;
    scroll-snap-align: none;
  }
  .meta {
    left: auto;
    right: calc(100% + 40px);
    bottom: 0;
    white-space: nowrap;
    text-align: right;
  }
  .cover .frame { padding: 0; }
  .meta-name { font-size: 22px; }
  .meta-loc { color: var(--muted); }

  .bar {
    top: 0;
    bottom: auto;
    left: auto;
    right: 32px;
    height: var(--pad-t);
    padding: 0;
    display: flex;
    gap: 28px;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
  }
  .bar button { height: var(--pad-t); color: var(--muted); transition: color .15s; }
  .bar button:hover { color: var(--fg); }
  .wordmark {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 48px;
    height: var(--pad-t);
    z-index: 20;
    text-decoration: none;
  }

  .digitals { padding: 96px 48px 64px; }
  .digitals .label { margin: 0 0 20px; }
  .digital-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; max-width: 1400px; }
  .digital { cursor: zoom-in; }
  .closing { padding: 96px 48px 64px; }

  .sheet {
    margin: auto;
    width: 440px;
    border-radius: 16px;
    padding: 22px 26px 28px;
  }
  .overview { padding: 24px 48px 48px; }
  .ov-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .toast { bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
