:root {
  --paper: #f4efe5;
  --paper-light: #fffaf2;
  --paper-deep: #e9dfcf;
  --ink: #292824;
  --ink-soft: #6d6860;
  --brick: #954f40;
  --brick-dark: #713c32;
  --canal: #65858d;
  --canal-light: #b7c9c9;
  --moss: #66745d;
  --rule: rgba(41, 40, 36, 0.18);
  --photo-shadow: 0 18px 42px rgba(57, 45, 32, 0.18);
  --paper-shadow: 0 24px 70px rgba(57, 45, 32, 0.13);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  background-image: radial-gradient(rgba(41, 40, 36, 0.12) 0.45px, transparent 0.6px);
  background-size: 5px 5px;
  content: "";
  opacity: 0.18;
  pointer-events: none;
}

body.is-locked {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--canal);
  outline-offset: 4px;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

h2 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.25rem, 8.2vw, 4.4rem);
  line-height: 1.02;
}

.page-shell {
  width: min(calc(100% - 40px), 1180px);
  margin-inline: auto;
}

.chapter {
  position: relative;
}

.meta {
  margin-bottom: 14px;
  color: var(--brick);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.section-subtitle {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 3.6vw, 1.35rem);
  font-style: italic;
  line-height: 1.5;
}

.chapter-number {
  margin: 0;
  color: rgba(149, 79, 64, 0.16);
  font-family: var(--serif);
  font-size: clamp(4.75rem, 24vw, 11rem);
  line-height: 0.72;
}

/* Opening */
.opening {
  display: none;
}

.js .opening {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background: var(--paper);
  transition: opacity 780ms ease, visibility 780ms ease;
}

.js .opening::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(41, 40, 36, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 40, 36, 0.025) 1px, transparent 1px),
    radial-gradient(rgba(41, 40, 36, 0.16) 0.5px, transparent 0.7px);
  background-size: 70px 70px, 70px 70px, 5px 5px;
  content: "";
  opacity: 0.38;
  pointer-events: none;
}

.opening.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opening-inner {
  position: relative;
  display: grid;
  width: min(100%, 390px);
  justify-items: center;
  text-align: center;
}

.opening-detail {
  position: absolute;
  top: -42px;
  right: 0;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
  transform: rotate(-4deg);
}

.opening-label {
  margin: 0 0 4px;
  color: var(--brick);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.opening-name {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 10vw, 3.25rem);
  line-height: 1;
}

.envelope {
  position: relative;
  width: 204px;
  height: 140px;
  margin: 4px 0 28px;
  filter: drop-shadow(0 22px 22px rgba(57, 45, 32, 0.16));
  perspective: 800px;
}

.envelope-back,
.envelope-front,
.envelope-flap,
.envelope-letter,
.envelope-seal {
  position: absolute;
}

.envelope-back {
  z-index: 2;
  inset: 0;
  border: 1px solid rgba(113, 60, 50, 0.22);
  border-radius: 3px;
  background: #d8bca1;
}

.envelope-letter {
  z-index: 1;
  right: 14px;
  bottom: 8px;
  left: 14px;
  height: 116px;
  padding: 24px 12px;
  border: 1px solid rgba(41, 40, 36, 0.09);
  background: var(--paper-light);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.45;
  transform: translateY(8px);
  transition: transform 800ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.envelope-flap {
  z-index: 4;
  inset: 0;
  border-radius: 3px 3px 0 0;
  background: #e0c7ad;
  clip-path: polygon(0 0, 100% 0, 50% 65%);
  transform-origin: 50% 0;
  transition: transform 680ms cubic-bezier(0.2, 0.7, 0.2, 1), z-index 0ms 310ms;
}

.envelope-front {
  z-index: 2;
  inset: 0;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(34deg, #d7b89a 49.5%, transparent 50%) bottom left / 51% 100% no-repeat,
    linear-gradient(-34deg, #d1ae8e 49.5%, transparent 50%) bottom right / 51% 100% no-repeat,
    linear-gradient(to top, #dec1a3 0 60%, transparent 60%);
}

.envelope-seal,
.mini-envelope-seal {
  z-index: 5;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brick);
  color: #ead2be;
  font-family: var(--serif);
  font-size: 0.78rem;
  box-shadow: inset 0 0 0 2px rgba(255, 250, 242, 0.18);
}

.envelope-seal {
  top: 73px;
  left: 87px;
  transition: opacity 180ms ease;
}

.opening.is-opening .envelope-flap {
  z-index: 0;
  transform: rotateX(172deg);
}

.opening.is-opening .envelope-back {
  z-index: 0;
}

.opening.is-opening .envelope-letter {
  transform: translateY(-54px);
}

.opening.is-opening .envelope-seal {
  opacity: 0;
}

.opening-date {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.85rem;
  font-style: italic;
}

.open-button {
  min-width: 116px;
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper-light);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.open-button:hover {
  background: transparent;
  color: var(--ink);
  transform: translateY(-2px);
}

.paper-particles {
  position: fixed;
  z-index: 105;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.paper-particle {
  position: absolute;
  top: 48%;
  left: 50%;
  color: var(--particle-color, var(--brick));
  font-family: var(--serif);
  font-size: var(--particle-size, 10px);
  animation: paper-float 1000ms ease-out forwards;
}

/* Hero */
.js .site {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 900ms ease, transform 900ms ease;
}

.js .site.is-visible {
  opacity: 1;
  transform: none;
}

.hero {
  display: grid;
  min-height: 88svh;
  align-items: end;
  overflow: hidden;
  padding: 86px 0 54px;
  border-bottom: 1px solid var(--rule);
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 24%;
  background: linear-gradient(to bottom, transparent, rgba(101, 133, 141, 0.09));
  content: "";
  pointer-events: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(41, 40, 36, 0.09);
  stroke-width: 1.1;
}

.hero-grid .canal-line {
  stroke: rgba(101, 133, 141, 0.34);
  stroke-width: 18;
}

.hero-star {
  position: absolute;
  color: var(--brick);
  font-family: var(--serif);
}

.star-one {
  top: 16%;
  right: 13%;
  font-size: 1.15rem;
}

.star-two {
  top: 24%;
  right: 29%;
  color: var(--canal);
  font-size: 0.75rem;
}

.hero-coordinate {
  position: absolute;
  top: 13%;
  left: 20px;
  color: var(--ink-soft);
  font-size: 0.62rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero-postmark {
  position: absolute;
  top: 26%;
  right: 22px;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(149, 79, 64, 0.32);
  border-radius: 50%;
  color: var(--brick);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 0.8;
  text-align: center;
  transform: rotate(9deg);
}

.hero-postmark small {
  font-family: var(--sans);
  font-size: 0.48rem;
}

.hero-bike {
  position: absolute;
  right: 8%;
  bottom: 20%;
  width: 62px;
  color: rgba(41, 40, 36, 0.32);
  transform: rotate(-4deg);
}

.hero-bike svg {
  display: block;
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero h1 {
  width: min(100%, 980px);
  margin-bottom: 34px;
  line-height: 1;
}

.hero h1:focus {
  outline: none;
}

.hero-title-main,
.hero-title-rest {
  display: block;
}

.hero-title-main {
  max-width: 860px;
  font-size: clamp(3rem, 13vw, 7.4rem);
}

.hero-title-rest {
  max-width: 760px;
  margin-top: 22px;
  font-family: var(--sans);
  font-size: clamp(1.14rem, 4.4vw, 2rem);
  font-weight: 450;
  line-height: 1.35;
}

.hero-intro {
  max-width: 540px;
  margin-bottom: 44px;
}

.hero-intro p {
  margin-bottom: 10px;
}

.hero-mantra {
  max-width: 300px;
  color: var(--brick);
  font-family: var(--serif);
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.45;
}

.hero-aside {
  max-width: 410px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.start-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
  text-transform: uppercase;
}

.start-link span {
  border-bottom: 1px solid currentColor;
}

/* Personal letter */
.letter-chapter {
  padding: 90px 0 150px;
}

.letter-layout {
  position: relative;
}

.letter-layout > .chapter-number {
  position: absolute;
  top: -36px;
  left: -6px;
}

.personal-letter {
  position: relative;
  width: min(100%, 760px);
  margin-left: auto;
  padding: 58px 24px 48px;
  border: 1px solid rgba(41, 40, 36, 0.08);
  background:
    linear-gradient(rgba(41, 40, 36, 0.045) 1px, transparent 1px) 0 92px / 100% 32px,
    var(--paper-light);
  box-shadow: var(--paper-shadow);
  transform: rotate(-0.35deg);
}

.personal-letter::before {
  position: absolute;
  top: -15px;
  left: 16%;
  width: 82px;
  height: 28px;
  background: rgba(216, 200, 170, 0.68);
  content: "";
  transform: rotate(-3deg);
}

.personal-letter h2 {
  margin-bottom: 34px;
  font-size: clamp(2.35rem, 9vw, 4.25rem);
}

.letter-copy {
  max-width: 610px;
  font-family: var(--serif);
  font-size: clamp(1rem, 3.6vw, 1.12rem);
  line-height: 1.82;
}

.letter-copy p {
  margin-bottom: 22px;
}

.letter-copy p:first-child {
  font-size: 1.2em;
  font-style: italic;
}

.letter-signoff {
  margin: 36px 0 0;
  color: var(--brick-dark);
  font-family: var(--serif);
  font-size: 1.28rem;
  font-style: italic;
  transform: rotate(-1deg);
}

.letter-postmark {
  position: absolute;
  top: 26px;
  right: 22px;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(149, 79, 64, 0.36);
  border-radius: 50%;
  color: rgba(149, 79, 64, 0.65);
  font-size: 0.56rem;
  line-height: 1.5;
  text-align: center;
  transform: rotate(8deg);
}

/* Contents */
.prepared {
  padding: 30px 0 142px;
}

.prepared h2 {
  margin-bottom: 58px;
}

.prepared-links {
  border-top: 1px solid var(--ink);
}

.prepared-link {
  position: relative;
  display: grid;
  min-height: 132px;
  grid-template-columns: 58px 1fr 26px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: color 180ms ease, padding 180ms ease;
}

.prepared-link:hover {
  padding-left: 8px;
  color: var(--brick);
}

.prepared-number {
  color: var(--brick);
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
}

.prepared-copy {
  display: grid;
  gap: 6px;
}

.prepared-copy strong {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 5.2vw, 2.5rem);
  font-weight: 400;
  line-height: 1.05;
}

.prepared-copy small {
  max-width: 430px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.prepared-arrow {
  align-self: start;
  padding-top: 28px;
  color: var(--canal);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.prepared-city .prepared-number,
.prepared-later .prepared-number {
  font-size: 1.55rem;
}

.prepared-city {
  padding-left: 9%;
}

.prepared-later {
  padding-left: 2%;
}

/* Albums */
.memories {
  overflow: hidden;
  padding: 116px 0 164px;
  border-top: 1px solid var(--rule);
}

.memories::before {
  position: absolute;
  top: 11%;
  right: -120px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(101, 133, 141, 0.18);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.memories-heading,
.groningen-heading {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 4px;
  align-items: start;
}

.memories-heading .chapter-number,
.groningen-heading .chapter-number {
  font-size: 5rem;
  line-height: 0.88;
}

.album-shell {
  margin-top: 62px;
}

.album-meta {
  display: flex;
  min-height: 88px;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--rule);
  padding: 24px 0 8px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
}

.album-meta > div {
  max-width: 550px;
}

.album-meta p {
  margin: 0;
}

.album-meta .album-kicker {
  margin-bottom: 5px;
  color: var(--brick);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.album-meta span {
  flex: 0 0 auto;
  color: var(--brick);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
}

.album-stage {
  position: relative;
  min-height: 500px;
  padding: 28px 0 12px;
}

.photo-composition {
  position: relative;
  display: grid;
  min-height: 470px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
}

.polaroid {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 2px;
  padding: 9px 9px 42px;
  background: #fffefa;
  box-shadow: var(--photo-shadow);
  cursor: zoom-in;
  transform: rotate(var(--rotation, -2deg));
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 260ms ease;
}

.polaroid.is-loading {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.polaroid:hover {
  z-index: 4;
  box-shadow: 0 22px 55px rgba(57, 45, 32, 0.24);
  transform: rotate(0) translateY(-5px);
}

.polaroid:nth-child(2) {
  --rotation: 2.2deg;
  margin-top: 34px;
}

.polaroid:nth-child(3) {
  --rotation: 1deg;
  margin-top: -10px;
}

.polaroid:nth-child(4) {
  --rotation: -2.5deg;
  margin-top: 24px;
}

.polaroid:nth-child(5) {
  --rotation: 1.6deg;
  margin-top: -6px;
}

.polaroid:nth-child(6) {
  --rotation: -1deg;
  margin-top: 30px;
}

.polaroid:nth-child(7) {
  --rotation: -1.8deg;
}

.polaroid:nth-child(8) {
  --rotation: 2.4deg;
  margin-top: 22px;
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  object-fit: cover;
}

.photo-caption {
  position: absolute;
  right: 10px;
  bottom: 12px;
  left: 10px;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-empty {
  position: absolute;
  top: 45%;
  right: 0;
  left: 0;
  width: min(100%, 420px);
  margin: auto;
  padding: 68px 30px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  transform: translateY(-50%);
}

/* Groningen guide */
.groningen {
  padding: 112px 0 154px;
  border-top: 1px solid var(--rule);
}

.guide-layout {
  margin-top: 64px;
}

.mini-map {
  display: none;
}

.place-list {
  border-top: 1px solid var(--ink);
}

.place {
  border-bottom: 1px solid var(--rule);
}

.place summary {
  display: grid;
  min-height: 104px;
  grid-template-columns: 44px 1fr 28px;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.place summary::-webkit-details-marker {
  display: none;
}

.place-number {
  color: var(--brick);
  font-family: var(--serif);
  font-size: 1.1rem;
}

.place-heading {
  display: grid;
  gap: 5px;
}

.place-heading strong {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
}

.place-heading small {
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.place-toggle {
  position: relative;
  width: 24px;
  height: 24px;
}

.place-toggle::before,
.place-toggle::after {
  position: absolute;
  top: 11px;
  right: 3px;
  left: 3px;
  height: 1px;
  background: currentColor;
  content: "";
  transition: transform 180ms ease;
}

.place-toggle::after {
  transform: rotate(90deg);
}

.place[open] .place-toggle::after {
  transform: rotate(0);
}

.place[open] .place-heading strong {
  color: var(--brick-dark);
}

.place-body {
  padding: 0 0 32px 56px;
  animation: quiet-reveal 280ms ease both;
}

.place-body > p:first-child {
  max-width: 580px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.75;
}

.mission {
  max-width: 500px;
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--canal);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.55;
}

.mission span {
  display: block;
  margin-bottom: 2px;
  color: var(--canal);
  font-size: 0.62rem;
  font-weight: 750;
  text-transform: uppercase;
}

/* Side quest */
.side-quest {
  position: relative;
  width: min(100%, 770px);
  margin: 120px auto 0;
  padding: 42px 24px 36px 42px;
  background:
    linear-gradient(90deg, transparent 29px, rgba(149, 79, 64, 0.22) 30px, transparent 31px),
    repeating-linear-gradient(transparent 0 31px, rgba(101, 133, 141, 0.12) 32px),
    #fbf7ed;
  box-shadow: 0 16px 42px rgba(57, 45, 32, 0.1);
  transform: rotate(0.25deg);
}

.side-quest::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(225deg, var(--paper) 49%, #ddd0bd 50%);
  content: "";
}

.quest-binding {
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 15px;
  border-left: 1px dashed rgba(41, 40, 36, 0.24);
}

.quest-heading h3 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
}

.quest-heading > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.92rem;
  font-style: italic;
}

.quest-progress {
  margin: 26px 0 24px;
  color: var(--moss);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.quest-list {
  display: grid;
  gap: 2px;
}

.quest-item {
  display: grid;
  min-height: 46px;
  grid-template-columns: 25px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.35;
}

.quest-item input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--ink-soft);
  border-radius: 1px;
  background: transparent;
  cursor: pointer;
}

.quest-item input:checked {
  border-color: var(--moss);
  background: var(--moss);
}

.quest-item input:checked::after {
  display: block;
  width: 8px;
  height: 4px;
  margin: 4px 0 0 4px;
  border-bottom: 2px solid var(--paper-light);
  border-left: 2px solid var(--paper-light);
  content: "";
  transform: rotate(-45deg);
}

.quest-item:has(input:checked) span {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: rgba(102, 116, 93, 0.55);
}

.quest-complete {
  margin: 30px 0 0;
  color: var(--moss);
  font-family: var(--serif);
  font-size: 1.12rem;
  font-style: italic;
}

/* Small letter */
.later {
  padding: 150px 0 178px;
}

.later-layout {
  display: grid;
  gap: 74px;
}

.later-heading .chapter-number {
  margin-bottom: 44px;
}

.small-letter {
  width: min(100%, 640px);
  margin-inline: auto;
}

.small-letter summary {
  display: grid;
  justify-items: center;
  cursor: pointer;
  list-style: none;
}

.small-letter summary::-webkit-details-marker {
  display: none;
}

.mini-envelope {
  position: relative;
  display: block;
  width: 156px;
  height: 104px;
  border: 1px solid rgba(113, 60, 50, 0.2);
  border-radius: 2px;
  background: #d9baa0;
  box-shadow: var(--photo-shadow);
  transition: transform 260ms ease;
}

.small-letter summary:hover .mini-envelope {
  transform: translateY(-5px) rotate(-1deg);
}

.mini-envelope-flap {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: #dfc5aa;
  clip-path: polygon(0 0, 100% 0, 50% 62%);
  transform-origin: 50% 0;
  transition: transform 500ms ease, z-index 0ms 220ms;
}

.mini-envelope-front {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(34deg, #d6b496 49.5%, transparent 50%) bottom left / 51% 100% no-repeat,
    linear-gradient(-34deg, #cfa98b 49.5%, transparent 50%) bottom right / 51% 100% no-repeat;
}

.mini-envelope-seal {
  top: 53px;
  left: 65px;
  width: 26px;
  height: 26px;
}

.small-letter[open] .mini-envelope-flap {
  z-index: 0;
  transform: rotateX(170deg);
}

.small-letter-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  border-bottom: 1px solid var(--ink);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.small-letter[open] .small-letter-action {
  display: none;
}

.small-letter-paper {
  margin-top: 42px;
  padding: 42px 24px 38px;
  border: 1px solid rgba(41, 40, 36, 0.08);
  background: var(--paper-light);
  box-shadow: var(--paper-shadow);
  font-family: var(--serif);
  line-height: 1.82;
  animation: letter-unfold 650ms ease both;
}

.small-letter-paper p {
  margin-bottom: 20px;
}

.small-letter-paper p:first-child {
  font-size: 1.2rem;
  font-style: italic;
}

/* Countdown */
.countdown-chapter {
  padding: 132px 0 170px;
  background: var(--canal);
  color: var(--paper-light);
}

.countdown-chapter::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 250, 242, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 250, 242, 0.06) 1px, transparent 1px);
  background-size: 74px 74px;
  content: "";
  mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
}

.countdown-inner {
  position: relative;
  text-align: center;
}

.direction {
  position: absolute;
  top: -74px;
  right: 0;
  margin: 0;
  color: rgba(255, 250, 242, 0.7);
  font-family: var(--serif);
  font-size: 0.75rem;
  font-style: italic;
}

.countdown-chapter .meta {
  color: rgba(255, 250, 242, 0.72);
}

.countdown-chapter h2 {
  margin: 0 auto 52px;
}

.countdown-days {
  display: grid;
  justify-items: center;
}

.countdown-days strong {
  font-family: var(--serif);
  font-size: clamp(7rem, 36vw, 17rem);
  font-weight: 400;
  line-height: 0.68;
}

.countdown-days span {
  margin-top: 26px;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.countdown-time {
  margin: 48px 0 0;
  color: rgba(255, 250, 242, 0.76);
  font-size: 0.72rem;
}

.christmas {
  margin: 82px 0 4px;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.closer {
  margin: 0;
  color: rgba(255, 250, 242, 0.7);
  font-family: var(--serif);
  font-size: 0.86rem;
  font-style: italic;
}

/* Letter archive */
.letters-archive {
  overflow: hidden;
  padding: 148px 0 176px;
  border-bottom: 1px solid var(--rule);
}

.letters-archive::before {
  position: absolute;
  top: 39%;
  left: 20px;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(149, 79, 64, 0.2);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.letters-reveal {
  position: relative;
  max-width: 720px;
  margin: 0 auto 160px;
  text-align: center;
}

.letters-reveal p {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 9vw, 5rem);
  line-height: 1.05;
}

.letters-reveal span {
  display: inline-block;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
  transform: rotate(-2deg);
}

.letters-heading {
  max-width: 760px;
  margin-bottom: 68px;
}

.letters-heading h2:focus {
  outline: none;
}

.letter-index {
  position: relative;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.letter-index::before {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 27px;
  width: 1px;
  background: rgba(149, 79, 64, 0.26);
  content: "";
}

.letter-record {
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.letter-record::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 24px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--brick);
  border-radius: 50%;
  background: var(--paper);
  content: "";
  transform: translate(-50%, -50%);
  transition: background 180ms ease, transform 180ms ease;
}

.letter-record a {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 128px;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 24px 0;
  text-decoration: none;
  transition: padding 180ms ease, color 180ms ease;
}

.letter-record a:hover {
  padding-left: 6px;
  color: var(--brick-dark);
}

.letter-record:hover::before,
.letter-record.is-opened::before {
  background: var(--brick);
  transform: translate(-50%, -50%) scale(1.2);
}

.letter-record-number {
  color: var(--brick);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
}

.letter-record-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.letter-record-date,
.letter-record-status {
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 750;
  text-transform: uppercase;
}

.letter-record-date {
  color: var(--ink-soft);
}

.letter-record-copy strong {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 5.2vw, 2.15rem);
  font-weight: 400;
  line-height: 1.1;
}

.letter-record-status {
  grid-column: 2;
  align-self: start;
  color: var(--ink-soft);
}

.letter-record.is-opened .letter-record-status {
  color: var(--moss);
}

.letter-record.is-current {
  background: linear-gradient(90deg, rgba(149, 79, 64, 0.07), transparent 72%);
}

/* Ending */
.ending {
  min-height: 92svh;
  padding: 144px 0 52px;
}

.ending-inner {
  display: flex;
  min-height: calc(92svh - 196px);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ending h2 {
  max-width: 780px;
  margin-bottom: 18px;
}

.ending-pause p {
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.ending-pause .ending-small {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-style: italic;
}

.next-letter {
  margin: 54px 0 104px;
  color: var(--brick);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.made-with-care {
  max-width: 460px;
  margin: auto 0 36px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
}

.footer-line {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.secret-heart {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(149, 79, 64, 0.26);
  cursor: default;
  font-family: var(--serif);
  font-size: 0.55rem;
}

.secret-heart.is-found {
  animation: heart-found 850ms ease both;
}

.secret-message {
  max-width: 510px;
  margin: 34px auto 0;
  color: var(--brick-dark);
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  animation: quiet-reveal 600ms ease both;
}

.secret-message p {
  margin-bottom: 8px;
}

/* Lightbox */
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 68px 22px 24px;
  background: rgba(28, 27, 24, 0.94);
  color: var(--paper-light);
}

.lightbox[open] {
  display: grid;
  place-items: center;
  animation: lightbox-in 240ms ease both;
}

.lightbox::backdrop {
  background: rgba(28, 27, 24, 0.94);
}

.lightbox figure {
  display: grid;
  max-width: min(100%, 980px);
  max-height: 100%;
  justify-items: center;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 76svh;
  border: 10px solid var(--paper-light);
  background: var(--paper-light);
  object-fit: contain;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
}

.lightbox figcaption {
  margin-top: 18px;
  color: rgba(255, 250, 242, 0.78);
  font-family: var(--serif);
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  z-index: 2;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--paper-light);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

@keyframes paper-float {
  from {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.6) rotate(0);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) scale(1) rotate(80deg);
  }
}

@keyframes quiet-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes letter-unfold {
  from { opacity: 0; transform: translateY(-14px) scaleY(0.96); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes heart-found {
  0% { color: rgba(149, 79, 64, 0.26); transform: scale(1); }
  45% { color: var(--brick); transform: scale(2.1) rotate(-8deg); }
  100% { color: var(--brick); transform: scale(1.2); }
}

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

@media (min-width: 640px) {
  .page-shell {
    width: min(calc(100% - 72px), 1180px);
  }

  .hero-coordinate {
    left: 36px;
  }

  .hero-postmark {
    right: 42px;
  }

  .personal-letter {
    padding: 78px 68px 64px;
  }

  .prepared-link {
    min-height: 150px;
    grid-template-columns: 90px 1fr 40px;
  }

  .prepared-number {
    font-size: 4rem;
  }

  .prepared-city .prepared-number,
  .prepared-later .prepared-number {
    font-size: 2.1rem;
  }

  .photo-composition {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .polaroid:nth-child(2) {
    margin-top: 62px;
    margin-left: -16px;
  }

  .polaroid:nth-child(3) {
    margin-top: 4px;
    margin-left: -24px;
  }

  .polaroid:nth-child(4) {
    margin-top: 84px;
    margin-left: -32px;
  }

  .side-quest {
    padding: 58px 56px 52px 74px;
  }

  .quest-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }

  .small-letter-paper {
    padding: 64px 64px 54px;
  }

  .letter-index::before {
    left: 46px;
  }

  .letter-record::before {
    left: 46px;
  }

  .letter-record a {
    min-height: 150px;
    grid-template-columns: 92px minmax(0, 1fr) 120px;
    gap: 24px;
    padding: 30px 8px 30px 0;
  }

  .letter-record-number {
    font-size: 2.4rem;
  }

  .letter-record-status {
    grid-column: 3;
    align-self: center;
    justify-self: end;
  }
}

@media (min-width: 820px) {
  .hero {
    min-height: 84vh;
    padding-block: 110px 72px;
  }

  .hero-coordinate {
    left: 5vw;
  }

  .hero-intro {
    margin-left: 25%;
  }

  .start-link {
    margin-left: 25%;
  }

  .letter-chapter {
    padding: 130px 0 210px;
  }

  .letter-layout > .chapter-number {
    left: 1%;
  }

  .prepared {
    padding-bottom: 190px;
  }

  .prepared-link {
    grid-template-columns: 130px minmax(300px, 1fr) 60px;
  }

  .prepared-home {
    width: 82%;
  }

  .prepared-city {
    width: 88%;
    margin-left: auto;
    padding-left: 0;
  }

  .prepared-later {
    width: 70%;
    margin-left: 12%;
    padding-left: 0;
  }

  .memories,
  .groningen {
    padding-block: 160px 210px;
  }

  .memories-heading,
  .groningen-heading {
    grid-template-columns: 140px 1fr;
  }

  .memories-heading .chapter-number,
  .groningen-heading .chapter-number {
    font-size: 8.5rem;
  }

  .album-shell {
    margin-top: 86px;
  }

  .album-stage {
    min-height: 590px;
  }

  .photo-composition {
    min-height: 560px;
  }

  .guide-layout {
    display: grid;
    grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1fr);
    gap: clamp(48px, 8vw, 110px);
    align-items: start;
    margin-top: 92px;
  }

  .mini-map {
    position: sticky;
    top: 30px;
    display: block;
    aspect-ratio: 0.86;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: rgba(255, 250, 242, 0.42);
  }

  .mini-map::after {
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(41, 40, 36, 0.08);
    content: "";
    pointer-events: none;
  }

  .mini-map svg {
    width: 100%;
    height: 100%;
    fill: none;
  }

  .map-road {
    stroke: rgba(41, 40, 36, 0.16);
    stroke-width: 2;
  }

  .map-canal {
    stroke: rgba(101, 133, 141, 0.38);
    stroke-width: 24;
  }

  .map-canal.thin {
    stroke-width: 10;
  }

  .map-label {
    position: absolute;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.6rem;
    line-height: 1.45;
    text-transform: uppercase;
  }

  .map-label-top {
    top: 28px;
    left: 28px;
  }

  .map-label-top small,
  .map-label-water {
    font-family: var(--serif);
    font-style: italic;
    text-transform: none;
  }

  .map-label-water {
    right: 8%;
    bottom: 17%;
    transform: rotate(-8deg);
  }

  .map-pin {
    position: absolute;
    z-index: 2;
    top: var(--y);
    left: var(--x);
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--paper-light);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 750;
    transform: translate(-50%, -50%);
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .map-pin:hover,
  .map-pin.is-active {
    border-color: var(--brick);
    background: var(--brick);
    color: var(--paper-light);
    transform: translate(-50%, -50%) scale(1.12);
  }

  .later {
    padding-block: 210px 230px;
  }

  .later-layout {
    grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
    gap: clamp(60px, 11vw, 160px);
    align-items: start;
  }

  .small-letter {
    padding-top: 100px;
  }

  .countdown-chapter {
    padding-block: 180px 210px;
  }

  .letters-archive {
    padding-block: 210px 230px;
  }

  .letters-reveal {
    margin-bottom: 210px;
  }

  .letters-heading {
    margin-left: 12%;
  }

  .letter-index {
    width: 84%;
    margin-left: auto;
  }
}

@media (min-width: 1200px) {
  .hero-title-main {
    font-size: 7.4rem;
  }

  .hero-title-rest {
    margin-left: 29%;
  }

  .hero-intro,
  .start-link {
    margin-left: 29%;
  }

  .personal-letter {
    margin-right: 8%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
