/* ==========================================================================
   LI LI'S LITTLE WORLD — styles
   --------------------------------------------------------------------------
   Everything here is quiet on purpose. If a rule does not earn its place,
   it should be removed.

   · logical properties only (inline-start/end) so Arabic and English share
     one layout system
   · nothing is hard-coded left/right
   · one grain, one warmth, no stickers
   ========================================================================== */

/* ── 00 · tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #fff9f2;
  --ink: #403a38;
  --ink-soft: #857a75;
  --ink-faint: #b6aaa3;
  --accent: #a66f72;
  --blush: #f3e2e0;
  --sage: #a9b6a4;
  --powder: #cfd9e2;
  --butter: #f6e6c8;

  --font-serif: "DM Serif Display", "Iowan Old Style", "Palatino Linotype",
    Palatino, Georgia, serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", sans-serif;
  --font-hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;

  /* Arabic voice: Aref Ruqaa — a pretty, solid ruqaa; the Arabic
     answer to Caveat. (The "Ink" variant was tried and rejected: its
     built-in texture renders as loud red strokes against this calm
     palette.) Falls back to naskh, never the Latin stack. */
  --font-ar: "Aref Ruqaa", "Noto Naskh Arabic", "Geeza Pro", "Segoe UI",
    Tahoma, system-ui, sans-serif;

  --page: min(78rem, 100% - 2.5rem);
  --rule: 1px solid rgba(64, 58, 56, 0.16);

  /* the photographic treatment — enhance, never transform.
     turn this off entirely with: --photo-filter: none; */
  --photo-filter: saturate(0.93) contrast(0.985) brightness(1.015) sepia(0.07);
  --grain-opacity: 0.05;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 1100ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.75;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* the world hides things with `hidden` — these rules must never win */
[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 5px;
  border-radius: 1px;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translateY(-120%);
  z-index: 40;
}
.skip:focus {
  transform: none;
}

/* ── 01 · type helpers ───────────────────────────────────────────────── */
.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hand {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.kicker {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(0.6875rem, 0.64rem + 0.2vw, 0.75rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* any string that mixes Arabic and Latin gets isolated per run, so
   «أول سبوع لـ Li Li ♡» never scrambles. */
.ar {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: start;
  line-height: 2.05;
}
.ar [dir],
.ar bdi {
  unicode-bidi: isolate;
}
.iso {
  unicode-bidi: isolate;
  white-space: nowrap;
}

/* ── 02 · the opening ────────────────────────────────────────────────── */
.door {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vh, 5rem) clamp(1.25rem, 5vw, 3rem);
  background: var(--bg);
  transition: opacity 900ms var(--ease), filter 900ms var(--ease);
}
.door__inner {
  text-align: center;
  max-inline-size: 34rem;
}
.door__name {
  font-size: clamp(3.5rem, 13vw, 7.5rem);
  line-height: 0.95;
  margin: 0;
  letter-spacing: 0.02em;
  animation: rise 1400ms var(--ease) both;
}
.door__title {
  font-size: clamp(0.9375rem, 0.8rem + 0.6vw, 1.25rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* optical centring for tracked type */
  color: var(--ink-soft);
  margin: 1.6rem 0 0;
  animation: rise 1400ms var(--ease) 260ms both;
}
.door__date {
  font-size: 0.8125rem;
  letter-spacing: 0.34em;
  color: var(--ink-faint);
  margin: 2.5rem 0 0;
  animation: rise 1400ms var(--ease) 520ms both;
}

.enter {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-block-start: clamp(3rem, 9vh, 5.5rem);
  padding: 0.9rem 0.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  animation: rise 1400ms var(--ease) 760ms both;
}
.enter__label {
  border-block-end: var(--rule);
  padding-block-end: 0.35rem;
  transition: color 400ms var(--ease), border-color 400ms var(--ease);
}
.enter:hover .enter__label,
.enter:focus-visible .enter__label {
  color: var(--accent);
  border-block-end-color: rgba(166, 111, 114, 0.5);
}
.enter__star {
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: transform 700ms var(--ease), opacity 700ms var(--ease);
  opacity: 0.85;
}
.enter:hover .enter__star {
  transform: scale(1.12) rotate(12deg);
  opacity: 1;
}
.enter__arrow {
  display: inline-block;
  transition: transform 500ms var(--ease);
}
.enter:hover .enter__arrow {
  transform: translateX(0.3rem);
}
.door__hint {
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
  color: var(--ink-faint);
  animation: rise 1400ms var(--ease) 1000ms both;
}

/* ── 03 · the world ──────────────────────────────────────────────────── */
.world {
  position: relative;
  z-index: 1;
}
.world > section,
.world > div {
  padding-inline: max(1.25rem, calc((100% - var(--page)) / 2));
}

section {
  position: relative;
}

/* ── 04 · first moment ───────────────────────────────────────────────── */
.moment {
  padding-block: clamp(4rem, 12vh, 9rem) clamp(3rem, 8vh, 6rem);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2.4vw, 2rem);
}
.moment .kicker {
  grid-column: 1 / span 12;
}
.moment__name {
  grid-column: 1 / span 12;
  font-size: clamp(3.25rem, 11vw, 6.5rem);
  line-height: 0.95;
  margin: 0.35rem 0 clamp(2.5rem, 6vh, 4.5rem);
}
.moment__photo {
  grid-column: 2 / span 10;
  margin: 0;
}
.moment__line {
  grid-column: 2 / span 10;
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
}
.moment__line:first-of-type {
  margin-block-start: clamp(2rem, 5vh, 3.5rem);
}
.moment__line--soft {
  color: var(--ink-soft);
  font-style: italic;
  font-weight: 300;
  margin-block-start: 0.6rem;
}

@media (min-width: 60rem) {
  .moment .kicker,
  .moment__name {
    grid-column: 1 / span 6;
  }
  .moment__name {
    align-self: end;
  }
  .moment__photo {
    grid-column: 5 / span 8;
    grid-row: 1 / span 3;
    margin-block-start: 0;
  }
  .moment__line {
    grid-column: 1 / span 4;
  }
  .moment__line--soft {
    grid-row: 4;
  }
}

/* ── 05 · photographs: the shared treatment ──────────────────────────── */
[data-photo-frame] {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--blush);
}
[data-photo-frame] img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  filter: var(--photo-filter);
  transform: scale(1.012);
  transition: transform 1400ms var(--ease), filter 1400ms var(--ease);
}
/* living photographs get the very same treatment as still ones */
[data-photo-frame] video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  filter: var(--photo-filter);
}

/* the gentle parallax lives on its own layer so it never fights the
   reveal, the hover, or the frame edges */
.para {
  block-size: 100%;
  transform: translateY(var(--par, 0px));
  will-change: transform;
}
/* the grain — a whisper of film, never texture you notice */
[data-photo-frame]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* a soft edge, like a print lying on a table */
[data-photo-frame]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 3.5rem rgba(64, 58, 56, 0.07);
}

figcaption {
  margin: 0;
}
.photo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  margin-block-start: 0.85rem;
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.photo-meta .hand {
  font-size: 1.125rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
}
/* shown only while a slot still holds a placeholder frame */
.photo-flag {
  color: var(--accent);
  opacity: 0.75;
}

/* ── a quiet prayer ──────────────────────────────────────────────────── */
.prayer {
  padding-block: clamp(5rem, 12vh, 9rem);
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  border-block: var(--rule);
  background: rgba(243, 226, 224, 0.16);
  text-align: center;
}
.prayer__inner {
  max-inline-size: 38rem;
  margin-inline: auto;
}
.prayer__title {
  margin: 0 0 clamp(1.25rem, 4vw, 2rem);
  font-family: var(--font-ar);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  line-height: 1.7;
  color: var(--accent);
  text-align: center;
}
.prayer__lines {
  font-family: var(--font-ar);
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem);
  line-height: 2.1;
  color: var(--ink);
  text-align: center;
}
.prayer__lines p {
  margin: 0;
  text-align: center;
}

/* ── 06 · the time object ────────────────────────────────────────────── */
.time {
  padding-block: clamp(6rem, 18vh, 13rem);
  text-align: center;
  border-block-start: var(--rule);
}
.time .kicker {
  color: var(--ink-faint);
}
.time__figure {
  margin: clamp(1.75rem, 5vh, 3rem) 0 0;
  line-height: 0.85;
  will-change: transform;
}
.time__num {
  display: inline-block;
  font-size: clamp(5.5rem, 27vw, 17rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.time__caption {
  margin: 0;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}
.time__word {
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--accent);
}
.time__since {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}
/* the quiet breakdown under the big number */
.time__age {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-block-start: 0.35rem;
}
/* and the same age, whispered the way the family says it */
.time__age-ar {
  font-family: var(--font-ar);
  font-size: 1.3125rem;
  line-height: 1.9;
  color: var(--accent);
  margin-block-start: 0.4rem;
}

/* ── 07 · the memory field ───────────────────────────────────────────── */
.field {
  padding-block: clamp(4rem, 12vh, 9rem) clamp(5rem, 14vh, 11rem);
}
.field__head {
  display: grid;
  gap: 1.1rem;
  margin-block-end: clamp(3.5rem, 10vh, 7rem);
  max-inline-size: 46rem;
}
.field__title {
  font-size: clamp(2.75rem, 9vw, 5.25rem);
  line-height: 0.98;
  margin: 0;
}
.field__caption {
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0;
}
.field__intro {
  color: var(--ink-soft);
  margin: 0;
  max-inline-size: 34rem;
}
.field__notes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.15rem;
}
.field__notes li {
  font-family: var(--font-hand);
  font-size: 1.3125rem;
  color: var(--ink-soft);
}

/* the composition. intentional, imperfect, one grid the family can
   keep adding to without redesigning anything. */
.field__layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(0.875rem, 2vw, 1.75rem);
  row-gap: clamp(2.5rem, 7vh, 5.5rem);
}
.shot {
  grid-column: span 12;
  min-inline-size: 0;
}
.shot figure {
  margin: 0;
}
.shot__frame {
  block-size: 100%;
}

/* desktop composition — sizes earn their place */
@media (min-width: 48rem) {
  .shot--hero {
    grid-column: 1 / span 7;
    grid-row: span 2;
  }
  .shot--hero .shot__frame {
    aspect-ratio: 4 / 5;
  }
  .shot--large {
    grid-column: 7 / span 6;
    margin-block-start: clamp(3rem, 9vw, 7rem);
    margin-inline-start: -8%;
    z-index: 2;
  }
  .shot--large .shot__frame {
    aspect-ratio: 4 / 3;
  }
  /* a portrait that keeps its height — for tall memories */
  .shot--tall {
    grid-column: 7 / span 6;
    margin-block-start: clamp(3rem, 9vw, 7rem);
    margin-inline-start: -6%;
    z-index: 2;
  }
  .shot--tall .shot__frame {
    aspect-ratio: 4 / 5;
  }
  .shot--detail {
    grid-column: 9 / span 4;
    margin-block-start: -7rem;
    z-index: 3;
  }
  .shot--detail .shot__frame {
    aspect-ratio: 1 / 1;
  }
  .shot--medium {
    grid-column: 2 / span 5;
  }
  .shot--medium .shot__frame {
    aspect-ratio: 4 / 5;
  }
  .shot--small {
    grid-column: 8 / span 4;
    margin-block-start: 5rem;
  }
  .shot--small .shot__frame {
    aspect-ratio: 4 / 5;
  }
  .shot--wide {
    grid-column: 1 / span 12;
    margin-block-start: 2rem;
  }
  .shot--wide .shot__frame {
    aspect-ratio: 16 / 9;
  }
}

/* mobile keeps its own composition: one column, generous air,
   a small rotation kept where it still reads as intentional */
@media (max-width: 47.99rem) {
  .field__layout {
    row-gap: clamp(2rem, 9vw, 3rem);
  }
  .shot--hero .shot__frame {
    aspect-ratio: 4 / 5;
  }
  .shot--large .shot__frame,
  .shot--wide .shot__frame {
    aspect-ratio: 3 / 2;
  }
  .shot--medium .shot__frame,
  .shot--small .shot__frame,
  .shot--tall .shot__frame {
    aspect-ratio: 4 / 5;
    max-inline-size: 84%;
  }
  .shot--detail .shot__frame {
    aspect-ratio: 1 / 1;
    max-inline-size: 62%;
    margin-inline-start: auto;
  }
  .shot--medium {
    margin-inline-start: 8%;
  }
  .shot--tall {
    margin-inline-start: 14%;
    margin-block-start: -2rem;
  }
  .shot--small {
    margin-inline-start: 22%;
    margin-block-start: -3.5rem;
  }
}

/* rotation is decorative; the frame compensates so nothing overflows */
.shot__frame {
  transform: rotate(var(--tilt, 0deg));
  transform-origin: center;
  transition: transform 900ms var(--ease);
}
.shot__frame:hover {
  transform: rotate(calc(var(--tilt, 0deg) * 0.35));
}
.shot__frame:focus-within {
  transform: rotate(0deg);
}

.shot__open {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  padding: 0;
}

/* ── 07b · every month — one print per month, laid down in order ─────── */
.months {
  padding-block: clamp(4rem, 12vh, 9rem) clamp(5rem, 14vh, 11rem);
  border-block-start: var(--rule);
}
.months__head {
  display: grid;
  gap: 1.1rem;
  margin-block-end: clamp(3rem, 9vh, 6rem);
  max-inline-size: 46rem;
}
.months__title {
  font-size: clamp(2.25rem, 7vw, 4rem);
  line-height: 1;
  margin: 0;
}
.months__caption {
  margin: 0;
  color: var(--ink-soft);
  font-style: italic;
}
.months__caption .ar {
  color: var(--accent);
  font-style: normal;
  font-size: 1.5625rem;
  line-height: 1.9;
}

.months__list {
  display: grid;
  gap: clamp(3rem, 10vh, 6.5rem);
}
.month {
  max-inline-size: min(24rem, 80%);
  margin-inline-start: 4%;
}
.month:nth-child(even) {
  margin-inline-start: auto;
  margin-inline-end: 4%;
}
/* a second print from the same month — smaller, tucked beside its sister */
.month--companion {
  max-inline-size: min(17rem, 62%);
  margin-inline-start: auto;
  margin-inline-end: 10%;
  margin-block-start: calc(-1 * clamp(1.25rem, 5vh, 2.75rem));
}
.month figure {
  margin: 0;
}
.month__open {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  padding: 0;
}
.month__frame {
  block-size: 100%;
  aspect-ratio: 4 / 5;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: center;
  transition: transform 900ms var(--ease);
}
.month__frame:hover {
  transform: rotate(0deg);
}
.month__frame:focus-within {
  transform: rotate(0deg);
}
@media (min-width: 48rem) {
  .month {
    max-inline-size: 44%;
    margin-inline-start: 7%;
  }
  .month:nth-child(even) {
    margin-inline-start: auto;
    margin-inline-end: 7%;
  }
  .month--companion {
    max-inline-size: 30%;
    margin-inline-end: 12%;
  }
}

.months__still {
  margin: clamp(3.5rem, 10vh, 6rem) 0 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── 08 · the memory jar ─────────────────────────────────────────────── */
.jar {
  padding-block: clamp(5rem, 14vh, 10rem);
  border-block-start: var(--rule);
  text-align: center;
}
.jar__inner {
  max-inline-size: 34rem;
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}
.jar__object {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  color: var(--ink);
  transition: transform 900ms var(--ease);
}
.jar__object svg {
  color: var(--accent);
  opacity: 0.9;
  transition: transform 900ms var(--ease);
}
.jar__object:hover svg,
.jar__object:focus-visible svg {
  transform: translateY(-4px) rotate(-2deg);
}
.jar__label {
  font-size: 0.8125rem;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  color: var(--ink-soft);
}
.jar__hint {
  margin: 0;
  color: var(--ink-faint);
  transition: opacity 400ms var(--ease);
}

.jar__slip {
  display: grid;
  gap: 0.35rem;
  padding: 1.75rem clamp(1rem, 4vw, 2rem) 1.25rem;
  margin-block-start: 1.25rem;
  inline-size: 100%;
  border: var(--rule);
  background: rgba(255, 255, 255, 0.55);
  animation: slip 900ms var(--ease) both;
}
.jar__ar {
  margin: 0;
  font-family: var(--font-ar);
  font-size: clamp(1.4375rem, 1.25rem + 0.8vw, 1.875rem);
  line-height: 2.1;
  color: var(--ink);
}
.jar__en {
  margin: 0;
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--ink-soft);
}
.jar__back {
  justify-self: center;
  margin-block-start: 1rem;
  font-family: var(--font-ar);
  font-size: 1.25rem;
  color: var(--accent);
  padding: 0.4rem 0.6rem;
  transition: opacity 300ms var(--ease);
}
.jar__back:hover {
  opacity: 0.7;
}

/* ── 09 · the ending ─────────────────────────────────────────────────── */
.end {
  padding-block: clamp(3rem, 8vh, 6rem) clamp(7rem, 20vh, 14rem);
  text-align: center;
}
.end__photo {
  max-inline-size: min(30rem, 100%);
  margin-inline: auto;
  aspect-ratio: 4 / 5;
}
.end__title {
  margin: clamp(3rem, 9vh, 5.5rem) 0 0;
  display: grid;
  gap: 0.15rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.3rem + 2.2vw, 3.25rem);
  line-height: 1.25;
}
.end__date {
  margin: 2rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.34em;
  color: var(--ink-faint);
}
.end__closing {
  margin: clamp(3.5rem, 10vh, 6rem) 0 0;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.1875rem);
  color: var(--ink-soft);
}
.end__star {
  display: inline-grid;
  place-items: center;
  vertical-align: -0.15em;
  margin-inline-start: 0.35rem;
  color: var(--accent);
  opacity: 0.55;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.end__star:hover,
.end__star:focus-visible {
  opacity: 1;
  transform: scale(1.25);
}

/* ── 10 · the hidden note ────────────────────────────────────────────── */
.note {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(255, 249, 242, 0.94);
  backdrop-filter: blur(2px);
  animation: veil 700ms var(--ease) both;
}
.note__paper {
  max-inline-size: 30rem;
  inline-size: 100%;
  padding: clamp(2rem, 7vw, 3.25rem);
  background: #fffdf9;
  border: var(--rule);
  box-shadow: 0 1.5rem 4rem rgba(64, 58, 56, 0.08);
  text-align: center;
  animation: slip 900ms var(--ease) both;
}
.note__whisper {
  margin: 0;
  font-size: 1.75rem;
  color: var(--accent);
}
.note__found {
  margin: 0;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  letter-spacing: 0.12em;
}
.note__lines {
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  line-height: 1.9;
}
.note__lines p {
  margin: 0;
}
.note__lines .ar {
  font-size: 1.3125rem;
  line-height: 2.1;
}
.note__signed {
  margin: 1.75rem 0 0;
  font-size: 1.375rem;
  color: var(--accent);
}
.note__dismiss {
  margin: 2.5rem 0 0;
  font-size: 1.125rem;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
}

/* ── 11 · the photograph viewer ──────────────────────────────────────── */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  padding-block-end: max(clamp(1rem, 4vw, 3rem), env(safe-area-inset-bottom));
  background: rgba(43, 38, 36, 0.97);
  animation: veil 500ms var(--ease) both;
}
.viewer__media {
  display: grid;
  place-items: center;
  max-inline-size: 100%;
  min-inline-size: min(20rem, 90%);
}
.viewer__img {
  max-inline-size: 100%;
  max-block-size: 82svh;
  object-fit: contain;
  filter: var(--photo-filter);
  animation: slip 700ms var(--ease) both;
}
.viewer__meta {
  position: absolute;
  inset-block-end: max(4.5rem, env(safe-area-inset-bottom));
  inset-inline: 0;
  margin: 0;
  padding-inline: 1.5rem;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 249, 242, 0.55);
}
.viewer__ui {
  position: absolute;
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  inset-inline: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
}
.viewer__btn {
  inline-size: 3rem;
  block-size: 3rem;
  display: grid;
  place-items: center;
  color: rgba(255, 249, 242, 0.72);
  font-size: 1.5rem;
  line-height: 1;
  border: 1px solid rgba(255, 249, 242, 0.22);
  border-radius: 50%;
  transition: color 300ms var(--ease), border-color 300ms var(--ease);
}
.viewer__btn:hover,
.viewer__btn:focus-visible {
  color: #fff9f2;
  border-color: rgba(255, 249, 242, 0.55);
}
.viewer__close {
  font-size: 1rem;
}
.viewer__count {
  position: absolute;
  inset-block-start: max(1.25rem, env(safe-area-inset-top));
  inset-inline-end: 1.5rem;
  margin: 0;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  color: rgba(255, 249, 242, 0.45);
}

/* ── 12 · motion ─────────────────────────────────────────────────────── */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.9rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes slip {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes veil {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
[data-photo-frame] img {
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1600ms var(--ease), transform 1600ms var(--ease);
}
.reveal.in [data-photo-frame] img,
.reveal[data-photo-frame].in img {
  opacity: 1;
  transform: scale(1.012);
}
/* parallax frames keep a little extra scale so the drift never shows
   a gap at the edges — after the reveal rule so it wins the cascade */
.reveal.in[data-parallax] img,
.reveal[data-photo-frame][data-parallax].in img {
  transform: scale(1.06);
}

/* ── 13 · reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  [data-photo-frame] img {
    opacity: 1;
    transform: none;
  }
}

/* ── 14 · fine tuning ────────────────────────────────────────────────── */
@media (max-width: 26rem) {
  :root {
    --page: min(78rem, 100% - 1.75rem);
  }
  .viewer__ui {
    gap: 1.5rem;
  }
}

@media print {
  .door,
  .viewer,
  .note,
  .skip {
    display: none !important;
  }
  [hidden] {
    display: block !important;
  }
}
