@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f8fafc;
  --paper-blue: #f0f6fa;
  --ink: #203d4f;
  --ink-soft: #536c7c;
  --muted: #78909d;
  --accent: #4c91c4;
  --accent-deep: #2f729f;
  --line: rgba(80, 126, 153, 0.22);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
p { text-wrap: pretty; }

html { min-width: 280px; background: var(--paper); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) clamp(22px, 5vw, 64px) 18px;
  animation: header-arrival 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 27px; height: 30px; }
.brand span { font: 400 23px/1 var(--serif); letter-spacing: 0.01em; }

.collection-name {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.share-page { min-height: 100svh; }
.share-page.is-loading { opacity: 0; }

.reader { position: relative; overflow: hidden; }

.artwork {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(330px, 47svh, 560px);
  overflow: hidden;
  background: #e4edf1;
}

.artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  animation: image-settle 1600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.artwork-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.83) 0%, rgba(248, 250, 252, 0.15) 28%, rgba(248, 250, 252, 0.2) 57%, var(--paper) 100%),
    linear-gradient(90deg, rgba(248, 250, 252, 0.26), transparent 45%);
}

.passage {
  position: relative;
  z-index: 1;
  width: min(100% - 44px, 720px);
  margin: 0 auto;
  padding-top: clamp(210px, 36svh, 400px);
  padding-bottom: clamp(80px, 12vw, 148px);
  animation: passage-arrival 900ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.eyebrow,
.invitation-eyebrow {
  margin: 0 0 19px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.passage h1,
.missing h1 {
  max-width: 660px;
  margin: 0;
  font: 400 clamp(42px, 6.5vw, 72px)/0.98 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.fine-line {
  width: 44px;
  height: 1px;
  margin: 32px 0 clamp(34px, 6vw, 56px);
  background: var(--accent);
  opacity: 0.62;
}

.passage-lines { max-width: 600px; }

.passage-lines p {
  margin: 0;
  font: 400 clamp(23px, 3vw, 30px)/1.42 var(--serif);
  letter-spacing: 0.002em;
  text-wrap: pretty;
  opacity: 0;
  animation: line-arrival 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.passage-lines p + p { margin-top: 24px; }
.passage-lines p:nth-child(1) { animation-delay: 280ms; }
.passage-lines p:nth-child(2) { animation-delay: 390ms; }
.passage-lines p:nth-child(3) { animation-delay: 500ms; }
.passage-lines p:nth-child(4) { animation-delay: 610ms; }

.shared-note {
  margin: 48px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.invitation {
  position: relative;
  width: min(100% - 44px, 720px);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 112px) 0 clamp(78px, 12vw, 132px);
  border-top: 1px solid var(--line);
}

.invitation::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 18px;
  right: -38vw;
  width: 74vw;
  height: 340px;
  background: radial-gradient(circle, rgba(196, 221, 235, 0.36), transparent 68%);
  pointer-events: none;
}

.invitation h2 {
  max-width: 610px;
  margin: 0;
  font: 400 clamp(36px, 5.2vw, 57px)/1.02 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.invitation-body {
  max-width: 540px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.65;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 650;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button:focus-visible { outline: 3px solid rgba(76, 145, 196, 0.3); outline-offset: 3px; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-deep); }
.button.secondary { border-color: var(--line); background: rgba(255, 255, 255, 0.6); }
.button.secondary:hover { border-color: rgba(76, 145, 196, 0.45); }

.missing {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 124px 22px 72px;
  overflow: hidden;
}

.missing[hidden] { display: none; }

.missing-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.45), var(--paper) 85%),
    url("/assets/inner-light/inner-light-1.jpg") center / cover;
  opacity: 0.78;
}

.missing-copy {
  position: relative;
  width: min(100%, 610px);
  text-align: center;
}

.missing-copy .eyebrow { margin-bottom: 18px; }
.missing-copy p:not(.eyebrow) { margin: 24px auto 30px; color: var(--ink-soft); line-height: 1.65; }

footer {
  display: flex;
  justify-content: center;
  gap: 11px;
  padding: 22px 22px max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer a:hover { color: var(--ink); }

.noscript {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  left: 18px;
  margin: 0 auto;
  max-width: 560px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 14px;
}

@keyframes header-arrival {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes image-settle {
  from { opacity: 0.75; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes line-arrival {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .site-header { padding-inline: 20px; }
  .collection-name { font-size: 9px; letter-spacing: 0.16em; }
  .artwork { height: 350px; }
  .passage { width: min(100% - 40px, 720px); padding-top: 226px; padding-bottom: 88px; }
  .passage h1 { font-size: clamp(40px, 12vw, 54px); }
  .fine-line { margin-top: 27px; margin-bottom: 34px; }
  .passage-lines p { font-size: clamp(22px, 6.4vw, 27px); line-height: 1.43; }
  .passage-lines p + p { margin-top: 21px; }
  .shared-note { margin-top: 40px; line-height: 1.5; }
  .invitation { width: min(100% - 40px, 720px); }
  .actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .passage-lines p { opacity: 1; }
}
