:root {
  color-scheme: light;
  --paper: #f1eadc;
  --ink: #351b20;
  --wine: #711f31;
  --muted: #8b756a;
  --rule: rgba(53, 27, 32, 0.22);
  --portrait-w: min(39vw, 58.5vh);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.poster {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 73% 20%, rgba(255, 253, 244, 0.92), transparent 27%),
    linear-gradient(115deg, #eee4d2 0%, #f6f0e5 44%, #e5d5bf 100%);
}

.poster::before,
.poster::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(113, 31, 49, 0.14);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.poster::before {
  top: -24vw;
  left: -16vw;
  width: 57vw;
  height: 57vw;
}

.poster::after {
  right: -19vw;
  bottom: -30vw;
  width: 64vw;
  height: 64vw;
}

.grain {
  position: absolute;
  z-index: 10;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.masthead {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(24px, 3.4vw, 52px) clamp(24px, 4.4vw, 72px);
  animation: enter-down 900ms 80ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.wordmark {
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 4.2rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.8;
  text-decoration: none;
}

.edition {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.edition span {
  padding: 0 0.55rem;
  color: var(--wine);
}

.intro {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: clamp(24px, 7vw, 112px);
  width: min(43vw, 620px);
  transform: translateY(-48%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 clamp(16px, 2vw, 30px);
  color: var(--wine);
  font-size: clamp(0.58rem, 0.65vw, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  animation: enter-up 900ms 350ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

h1 {
  margin: 0;
  max-width: 8ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.6rem, 9.4vw, 10rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.78;
  animation: enter-up 1100ms 430ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dek {
  margin: clamp(28px, 4vw, 58px) 0 0 0.4vw;
  color: #6f5b52;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.18vw, 1.3rem);
  font-style: italic;
  line-height: 1.55;
  animation: enter-up 900ms 590ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dek span {
  color: var(--wine);
}

.portrait {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 66%;
  width: var(--portrait-w);
  aspect-ratio: 9 / 16;
  margin: 0;
  overflow: hidden;
  background: #cbb69f;
  box-shadow:
    0 44px 100px rgba(67, 36, 28, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.5) inset;
  transform: translate(-50%, -50%);
  clip-path: inset(0 0 100% 0);
  animation: portrait-unveil 1450ms 130ms cubic-bezier(0.77, 0, 0.18, 1) forwards;
  cursor: crosshair;
}

.source-photo,
.flower-canvas,
.portrait-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.source-photo {
  display: block;
  opacity: 0;
  object-fit: cover;
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 2.2s ease;
  user-select: none;
}

.flower-canvas {
  z-index: 1;
  display: block;
  opacity: 1;
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 700ms ease;
}

.portrait-vignette {
  z-index: 2;
  box-shadow:
    inset 0 0 70px rgba(52, 28, 25, 0.13),
    inset 0 -110px 90px rgba(47, 21, 20, 0.13);
  pointer-events: none;
  transition: opacity 500ms ease;
}

.portrait.is-revealed .source-photo {
  opacity: 1;
  transform: scale(1.018);
}

.portrait.is-revealed .flower-canvas {
  opacity: 0;
  filter: blur(3px);
}

.portrait.is-revealed .portrait-vignette {
  opacity: 0.5;
}

figcaption {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  padding: 22px;
  color: rgba(255, 250, 239, 0.78);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  mix-blend-mode: screen;
}

.margin-note {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: clamp(24px, 3.2vw, 52px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  animation: fade-in 900ms 1200ms both;
}

.margin-note i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--wine);
}

.reveal {
  position: absolute;
  z-index: 6;
  right: clamp(24px, 5vw, 80px);
  bottom: clamp(72px, 9vh, 110px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  animation: enter-up 900ms 1050ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reveal-icon {
  display: grid;
  width: 43px;
  height: 43px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  place-items: center;
  color: var(--wine);
  font-size: 0.78rem;
  transition: color 250ms ease, transform 450ms ease, background-color 250ms ease;
}

.reveal:hover .reveal-icon,
.reveal:focus-visible .reveal-icon,
.reveal.is-active .reveal-icon {
  background: var(--wine);
  color: var(--paper);
  transform: rotate(45deg);
}

.reveal-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reveal strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-style: italic;
  font-weight: 400;
}

.reveal small {
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer {
  position: absolute;
  z-index: 4;
  right: clamp(24px, 4.4vw, 72px);
  bottom: clamp(22px, 3.4vw, 46px);
  left: clamp(24px, 4.4vw, 72px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 13px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: fade-in 1000ms 900ms both;
}

footer p {
  margin: 0;
}

.coordinates span {
  padding: 0 0.55rem;
  color: var(--wine);
}

@keyframes portrait-unveil {
  0% {
    clip-path: inset(0 0 100% 0);
    transform: translate(-50%, -50%) scale(1.04);
  }
  100% {
    clip-path: inset(0);
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes enter-down {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  :root {
    --portrait-w: min(54vw, 58.5vh);
  }

  .intro {
    left: 5vw;
  }

  h1 {
    font-size: clamp(4.2rem, 11vw, 7rem);
  }

  .portrait {
    left: 68%;
  }

  .margin-note {
    display: none;
  }

  .reveal {
    right: 4vw;
  }
}

@media (max-width: 680px) {
  .poster {
    min-height: 168svh;
    background:
      linear-gradient(to bottom, rgba(241, 234, 220, 0.12), var(--paper) 74%),
      #d4c0aa;
  }

  .masthead {
    position: fixed;
    padding: 23px 20px;
    mix-blend-mode: multiply;
  }

  .edition {
    font-size: 0.5rem;
  }

  .intro {
    position: absolute;
    top: 18svh;
    left: 20px;
    width: calc(100% - 40px);
    transform: none;
  }

  .eyebrow {
    margin-bottom: 15px;
  }

  h1 {
    max-width: none;
    color: #fff9ed;
    font-size: clamp(4.6rem, 24vw, 7.7rem);
    line-height: 0.78;
    text-shadow: 0 2px 30px rgba(40, 20, 20, 0.22);
  }

  .dek {
    margin-top: 25px;
    color: rgba(255, 249, 237, 0.82);
    text-shadow: 0 1px 14px rgba(40, 20, 20, 0.3);
  }

  .dek span {
    color: inherit;
  }

  .portrait {
    top: 0;
    left: 0;
    width: 100%;
    height: 124svh;
    aspect-ratio: auto;
    transform: none;
    clip-path: inset(0);
    animation-name: portrait-unveil-mobile;
    animation-duration: 650ms;
  }

  .portrait-vignette {
    background:
      linear-gradient(to bottom, rgba(39, 18, 18, 0.08), transparent 34%),
      linear-gradient(to bottom, transparent 65%, var(--paper) 100%);
    box-shadow: none;
  }

  figcaption {
    bottom: 12svh;
    padding: 20px;
  }

  .reveal {
    right: auto;
    bottom: 21svh;
    left: 20px;
  }

  footer {
    right: 20px;
    bottom: 24px;
    left: 20px;
  }

  footer > p:first-child {
    max-width: 20ch;
    line-height: 1.5;
  }
}

@keyframes portrait-unveil-mobile {
  from {
    opacity: 0.55;
    clip-path: inset(0);
    transform: scale(1.018);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }

  .flower-canvas,
  .source-photo {
    transition-duration: 1ms;
  }
}
