@font-face {
  font-family: "Lancelot";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/lancelot-regular-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: oklch(0.25 0.055 222);
  --ink-deep: oklch(0.18 0.05 220);
  --ink-soft: oklch(0.38 0.04 220);
  --painting-blue: #0f1e2d;
  --paper: oklch(0.93 0.035 86);
  --paper-light: oklch(0.97 0.018 86);
  --paper-dark: oklch(0.83 0.045 78);
  --signal: oklch(0.84 0.14 91);
  --rust: oklch(0.46 0.12 25);
  --rose: oklch(0.72 0.08 27);
  --blue-card: oklch(0.44 0.085 236);
  --green-card: oklch(0.56 0.075 147);
  --display: "Bodoni 72", Didot, "Iowan Old Style", Georgia, serif;
  --letter: "Lancelot", "Iowan Old Style", Palatino, Georgia, serif;
  --body: "Avenir Next", Avenir, "Segoe UI Variable", "Gill Sans", sans-serif;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --archive-overlap: clamp(260px, 38vh, 340px);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
textarea,
input {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 4px;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(88px, 10vh, 120px) 24px;
  color: var(--paper-light);
  background: var(--ink-deep) url("/assets/summer-1872-poster.jpg") 42% center / cover no-repeat;
}

.hero__video,
.hero__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__video {
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% center;
}

.hero__veil {
  z-index: -2;
  background:
    linear-gradient(
      to bottom,
      transparent 0,
      rgb(15 30 45 / 0.12) 14%,
      rgb(15 30 45 / 0.34) 34%,
      rgb(15 30 45 / 0.64) 56%,
      rgb(15 30 45 / 0.88) 74%,
      var(--painting-blue) 88%,
      var(--painting-blue) 100%
    ) center bottom / 100% var(--archive-overlap) no-repeat,
    radial-gradient(circle at center, oklch(0.15 0.035 220 / 0.08) 0 28%, oklch(0.12 0.04 220 / 0.54) 100%),
    linear-gradient(180deg, oklch(0.12 0.04 220 / 0.28), transparent 34%, oklch(0.12 0.04 220 / 0.36));
}

.hero--video-static .hero__video {
  display: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0 calc(100% - var(--archive-overlap)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    black 0 calc(100% - var(--archive-overlap)),
    transparent 100%
  );
}

.archive-link {
  position: absolute;
  z-index: 2;
  top: clamp(24px, 4vw, 48px);
  right: clamp(24px, 5vw, 72px);
  padding-bottom: 3px;
  color: var(--paper-light);
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.language-switch {
  position: absolute;
  z-index: 2;
  top: clamp(18px, 3vw, 38px);
  left: clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  gap: 5px;
  color: oklch(0.91 0.025 86 / 0.66);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.language-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: inherit;
}

.language-switch button[aria-pressed="true"] {
  color: var(--paper-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.language-switch button:hover {
  color: var(--paper-light);
}

.archive-link__arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 180ms var(--ease-out-quart);
}

.archive-link:hover .archive-link__arrow {
  transform: translateY(3px);
}

.artwork-credit {
  position: absolute;
  z-index: 2;
  left: clamp(24px, 5vw, 72px);
  bottom: clamp(44px, 7vh, 64px);
  margin: 0;
  color: oklch(0.84 0.14 112);
  font-size: 0.88rem;
}

.artwork-credit cite {
  font-family: var(--display);
  font-style: italic;
}

.composer {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  padding: clamp(24px, 2.5vw, 34px) clamp(24px, 3.3vw, 40px) clamp(20px, 2.4vw, 28px);
  color: oklch(0.27 0.045 76);
  background:
    radial-gradient(circle at 9% 7%, oklch(0.64 0.07 72 / 0.11), transparent 19%),
    radial-gradient(circle at 92% 88%, oklch(0.57 0.065 61 / 0.09), transparent 24%),
    linear-gradient(112deg, oklch(1 0 0 / 0.3), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 4px, oklch(0.28 0.025 70 / 0.016) 4px 5px),
    oklch(0.92 0.042 84);
  border: 1px solid oklch(0.49 0.065 65 / 0.58);
  box-shadow:
    0 36px 100px oklch(0.1 0.03 220 / 0.52),
    0 0 0 4px oklch(0.9 0.035 84 / 0.34) inset,
    0 2px 0 oklch(1 0 0 / 0.38) inset;
  clip-path: polygon(0.25% 0.55%, 99.65% 0, 100% 99.35%, 0.4% 100%);
  transform: rotate(-0.55deg);
  animation: enter-paper 900ms 120ms var(--ease-out-expo) both;
}

.composer::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 11px;
  pointer-events: none;
  border: 3px double oklch(0.39 0.06 65 / 0.34);
  outline: 1px solid oklch(0.58 0.055 75 / 0.16);
  outline-offset: 3px;
}

.composer::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  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='.52' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.composer > * {
  z-index: 1;
}

.composer h1 {
  position: relative;
  max-width: 100%;
  margin: 0 0 4px;
  color: oklch(0.34 0.075 44);
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: 0.005em;
  text-align: left;
}

.composer__actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.composer textarea {
  position: relative;
  display: block;
  width: 100%;
  height: 114px;
  min-height: 114px;
  margin-block: 14px 8px;
  padding: 0;
  resize: none;
  color: oklch(0.25 0.055 237);
  background: repeating-linear-gradient(to bottom, transparent 0 29px, oklch(0.42 0.045 235 / 0.23) 29px 30px);
  border: 0;
  border-radius: 0;
  font-family: var(--letter);
  font-size: clamp(1.2rem, 1.65vw, 1.42rem);
  line-height: 30px;
}

.composer textarea::placeholder {
  color: oklch(0.49 0.04 235 / 0.55);
  font-style: normal;
}

.composer textarea:focus {
  outline: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 29px, oklch(0.34 0.075 44 / 0.42) 29px 30px);
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 20px;
  color: oklch(0.34 0.075 44);
  background: oklch(0.92 0.042 84 / 0.45);
  border: 1px solid oklch(0.34 0.075 44 / 0.82);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  box-shadow: 2px 2px 0 oklch(0.34 0.075 44 / 0.16);
  transition: transform 160ms var(--ease-out-quart), background-color 220ms ease, color 220ms ease;
}

.composer button:hover {
  color: oklch(0.94 0.03 84);
  background: oklch(0.34 0.075 44);
  border-color: oklch(0.34 0.075 44);
  transform: translateY(-2px);
}

.composer button:active {
  transform: translateY(0) scale(0.97);
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.composer button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.form-status {
  position: relative;
  min-height: 1.4em;
  margin: 10px 0 0;
  color: oklch(0.34 0.075 44);
  font-size: 0.88rem;
  font-weight: 650;
}

.form-status:empty {
  min-height: 0;
  margin-top: 0;
}

.privacy-note {
  position: relative;
  max-width: 72ch;
  margin: 8px 0 0;
  color: oklch(0.37 0.04 75);
  font-family: var(--display);
  font-size: 0.74rem;
  line-height: 1.42;
  text-align: left;
}

.archive {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: 70vh;
  padding: clamp(64px, 8vw, 112px) clamp(20px, 7vw, 112px) clamp(96px, 12vw, 180px);
  color: var(--paper-light);
  background: var(--painting-blue);
}

.archive::before,
footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.74' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

.archive::before {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 144px, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0, black 144px, black 100%);
}

.postcards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(38px, 7vw, 105px) clamp(22px, 5vw, 72px);
  width: min(100%, 1380px);
  margin-inline: auto;
}

.postcard {
  --message-size: clamp(1.75rem, 8cqw, 4.25rem);
  position: relative;
  grid-column: span 6;
  align-self: start;
  aspect-ratio: 1.48;
  color: oklch(0.27 0.045 76);
  background:
    radial-gradient(circle at 9% 7%, oklch(0.64 0.07 72 / 0.11), transparent 19%),
    radial-gradient(circle at 92% 88%, oklch(0.57 0.065 61 / 0.09), transparent 24%),
    linear-gradient(112deg, oklch(1 0 0 / 0.3), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 4px, oklch(0.28 0.025 70 / 0.016) 4px 5px),
    oklch(0.92 0.042 84);
  border: 1px solid oklch(0.49 0.065 65 / 0.58);
  box-shadow:
    0 28px 70px oklch(0.1 0.03 220 / 0.36),
    0 0 0 4px oklch(0.9 0.035 84 / 0.34) inset,
    0 2px 0 oklch(1 0 0 / 0.38) inset;
  clip-path: polygon(0.25% 0.55%, 99.65% 0, 100% 99.35%, 0.4% 100%);
  transform: translateY(var(--offset, 0)) rotate(var(--tilt, 0deg));
  transition: transform 280ms var(--ease-out-quint), box-shadow 280ms ease;
  container-type: inline-size;
}

.postcard::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 11px;
  pointer-events: none;
  border: 3px double oklch(0.39 0.06 65 / 0.34);
  outline: 1px solid oklch(0.58 0.055 75 / 0.16);
  outline-offset: 3px;
}

.postcard::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  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='.52' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.postcard--medium {
  --message-size: clamp(1.65rem, 6.5cqw, 3.2rem);
}

.postcard--long {
  --message-size: clamp(1.15rem, 4.8cqw, 2.5rem);
}

.postcard:nth-child(4n + 2) {
  grid-column: 7 / span 5;
  margin-top: clamp(18px, 4vw, 64px);
}

.postcard:nth-child(4n + 3) {
  grid-column: 2 / span 5;
}

.postcard:nth-child(4n) {
  grid-column: 7 / span 6;
  margin-top: clamp(-20px, -2vw, -8px);
}

.postcard:hover {
  z-index: 2;
  box-shadow:
    0 38px 90px oklch(0.1 0.03 220 / 0.46),
    0 0 0 4px oklch(0.9 0.035 84 / 0.34) inset,
    0 2px 0 oklch(1 0 0 / 0.38) inset;
  transform: translateY(calc(var(--offset, 0px) - 7px)) rotate(var(--tilt, 0deg));
}

.postcard__face {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  padding: clamp(32px, 7cqw, 58px);
}

.postcard__message {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.postcard__message p {
  flex: 1;
  margin: 0;
  padding-top: 0.05em;
  overflow-wrap: anywhere;
  color: oklch(0.25 0.055 237);
  background: repeating-linear-gradient(to bottom, transparent 0 1.28em, oklch(0.42 0.045 235 / 0.2) 1.28em calc(1.28em + 1px));
  font-family: var(--letter);
  font-size: var(--message-size);
  line-height: 1.28;
  white-space: pre-wrap;
}

.postcard--arriving {
  opacity: 0;
}

.postcard--flying {
  position: fixed;
  z-index: 100;
  aspect-ratio: 1.52;
  margin: 0;
  pointer-events: none;
  transform: none;
  box-shadow: 0 36px 100px oklch(0.08 0.025 240 / 0.45);
}

.archive__empty {
  position: relative;
  z-index: 1;
  width: min(100%, 1380px);
  margin: 0 auto;
  padding-block: var(--space-4xl);
  color: oklch(0.86 0.025 86);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-style: italic;
  text-align: center;
}

footer {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(320px, 1.45fr) max-content;
  align-items: start;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(56px, 6vw, 80px) clamp(20px, 7vw, 112px) clamp(64px, 7vw, 96px);
  color: var(--paper);
  background: var(--painting-blue);
  font-size: 1rem;
}

footer > * {
  position: relative;
  z-index: 1;
}

.footer__maker {
  display: grid;
  gap: var(--space-sm);
  max-width: 30ch;
}

.footer__maker p {
  margin: 0;
}

.footer__maker p:first-child {
  font-family: var(--display);
  font-size: 1.15rem;
}

.footer__maker p:last-child,
footer details p {
  color: oklch(0.8 0.025 86);
  line-height: 1.55;
}

.footer__maker a {
  color: var(--paper);
  text-underline-offset: 0.2em;
}

footer details p {
  max-width: 70ch;
  margin: var(--space-md) 0 0;
}

footer summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.45;
}

footer > a {
  justify-self: end;
  padding-bottom: 4px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
}

@keyframes enter-paper {
  from { opacity: 0; transform: translate3d(0, 18px, 0) rotate(-1.4deg); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotate(-0.55deg); }
}

@media (max-width: 980px) {
  .hero {
    background-position: 34% center;
  }

  .hero__video {
    object-position: 34% center;
  }

  .composer {
    width: min(100%, 540px);
  }

  .postcard,
  .postcard:nth-child(n) {
    grid-column: span 12;
    width: min(100%, 760px);
    margin: 0 auto;
  }

  .postcard:nth-child(even) {
    width: min(92%, 690px);
    margin-left: auto;
    margin-right: 0;
  }

  footer {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  footer > a {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .hero {
    padding: 82px 14px 76px;
    background-position: 31% center;
  }

  .hero__video {
    object-position: 31% center;
  }

  .artwork-credit {
    left: 16px;
    bottom: 36px;
    font-size: 0.76rem;
  }

  .archive-link {
    top: 22px;
    right: 16px;
    font-size: 0.95rem;
  }

  .language-switch {
    top: 10px;
    left: 12px;
  }

  .composer {
    width: 100%;
    padding: 24px 18px 20px;
  }

  .composer::before {
    inset: 8px;
  }

  .composer h1 {
    margin-bottom: 2px;
    font-size: clamp(1.5rem, 7vw, 1.8rem);
    line-height: 1.14;
  }

  .composer textarea {
    height: 108px;
    min-height: 108px;
    margin-block: 12px 6px;
    font-size: 1.15rem;
  }

  .composer button {
    min-height: 46px;
    padding-inline: 16px;
    font-size: 0.88rem;
  }

  .privacy-note {
    font-size: 0.7rem;
  }

  .archive {
    padding-inline: 16px;
  }

  .postcards {
    display: flex;
    flex-direction: column;
    gap: 48px;
  }

  .postcard,
  .postcard:nth-child(n) {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 250px;
    aspect-ratio: auto;
    margin: 0;
  }

  .postcard__face {
    min-height: inherit;
    padding: 28px 26px;
  }

  .postcard__message p {
    font-size: min(var(--message-size), 2rem);
  }
}

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

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

  .hero__video {
    display: none;
  }
}
