@font-face {
  font-family: "Baskervville";
  src: url("/assets/baskervville.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Baskervville";
  src: url("/assets/baskervville-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
#export-dialog {
  max-width: 440px;
}
#export-preview {
  display: block;
  max-width: 100%;
  max-height: 46dvh;
  margin: 16px auto;
}
#export-dialog .actions {
  justify-content: center;
}
#export-page {
  font: inherit;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
:root {
  color-scheme: light;
  --bg: #faf7f0;
  --ink: #302b34;
  --muted: #655d64;
  --plum: #67394f;
  --line: #d7cfc3;
  --serif: "Baskervville", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
button,
input,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #075c9b;
  outline-offset: 4px;
}
main:focus {
  outline: 0;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.skip {
  position: fixed;
  z-index: 5;
  left: 8px;
  top: -80px;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
.mast,
main,
footer {
  max-width: 1440px;
  margin: auto;
  padding-inline: clamp(20px, 5.6vw, 88px);
}
.mast {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand,
.footer-brand {
  font: 500 24px/1 var(--serif);
  letter-spacing: -1.3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.brand img {
  margin-right: 8px;
  border-radius: 10px;
}
.brand i,
.footer-brand {
  color: var(--plum);
}
nav,
.actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
nav > a:not(.btn),
.text-link,
.back,
.secondary,
footer a {
  font-size: 14px;
  font-weight: 600;
}
nav > a:not(.btn) {
  text-decoration: none;
  padding-block: 12px;
}
.btn,
.secondary,
.scene-action {
  border: 1px solid transparent;
  border-radius: 30px;
  min-height: 46px;
  display: inline-flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font: 600 16px/1.25 var(--sans);
  padding: 12px 24px;
}
.btn {
  background: linear-gradient(160deg, #74485e, #573044 65%, #62364a);
  box-shadow: inset 0 1px 0 #ffffff38;
  color: white;
}
.btn:hover {
  background: #4e2b3e;
}
.btn.compact {
  min-height: 42px;
  padding: 12px 16px;
}
.secondary {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}
.text-link,
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--plum);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.back {
  color: var(--muted);
  text-decoration: none;
}
.text-link:hover,
.back:hover,
footer a:hover {
  text-decoration: underline;
}
.hero {
  display: grid;
  grid-template-columns: 0.93fr 1.07fr;
  align-items: center;
  gap: clamp(32px, 5vw, 90px);
  padding: clamp(44px, 5vw, 84px) 0;
}
.eyebrow,
.scene-location,
.caption,
.counter {
  font: 600 12px/1.45 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.eyebrow {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--plum);
  margin: 0 0 24px;
}
.rule {
  width: 33px;
  height: 1px;
  background: currentColor;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}
h1 {
  margin-bottom: 24px;
  font-size: clamp(54px, 6.1vw, 94px);
  line-height: 1.02;
  letter-spacing: -0.069em;
}
h1 em {
  color: var(--plum);
  font-weight: 400;
}
.intro {
  max-width: 31em;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 32px;
}
.scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #968aa3;
  display: grid;
  place-items: center;
  border-radius: 14px;
  --wax: #a65366;
  --wax-shadow: #713448;
  --wax-light: #ce8494;
}
.scene:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, #29263e0d, #4935530d),
    url("/assets/evening.webp") center 62% / cover;
}
.scene[data-sky="morning"]:before {
  filter: hue-rotate(323deg) saturate(0.57) brightness(1.26);
}
.scene[data-sky="night"]:before {
  filter: hue-rotate(16deg) saturate(0.65) brightness(0.49);
}
.scene[data-ink="sage"] {
  --wax: #748570;
  --wax-shadow: #435744;
  --wax-light: #a9b5a2;
}
.scene[data-ink="blue"] {
  --wax: #65839f;
  --wax-shadow: #37546f;
  --wax-light: #a9b9cf;
}
.feature {
  aspect-ratio: 1.47;
  border-radius: 18px;
  box-shadow: 0 14px 28px -24px #38263880;
}
.scene-location {
  position: absolute;
  top: 20px;
  left: 22px;
  padding: 4px 12px;
  letter-spacing: 0.09em;
  color: #fff;
  background: #342a4282;
  border-radius: 20px;
}
.scene-location span {
  padding-right: 4px;
}
.scene-action {
  position: absolute;
  right: 16px;
  bottom: 16px;
  font-size: 14px;
  min-height: 40px;
  color: #382738;
  background: #fff8efee;
  gap: 12px;
  padding: 8px 16px;
}
.caption {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #57505b;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.caption i {
  font: italic 16px var(--serif);
  text-transform: none;
  letter-spacing: 0;
}
.showpiece {
  display: grid;
  place-items: center;
  width: 72%;
  height: 80%;
  color: inherit;
  text-decoration: none;
}
.mount {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.object {
  display: none;
  position: relative;
}
.scene[data-kind="envelope"] .envelope,
.scene[data-kind="print"] .print,
.scene[data-kind="locket"] .locket {
  display: block;
}
.envelope {
  width: 79%;
  aspect-ratio: 1.58;
  background: linear-gradient(145deg, #fffae9, #e0c7a9);
  transform: rotate(-8deg);
  border-radius: 4px;
  box-shadow:
    0 25px 26px -12px #37222c85,
    0 2px 4px #4f38444d;
  isolation: isolate;
}
.paper-lines,
.flap {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.paper-lines {
  background: conic-gradient(
    from 57deg at 50% 44%,
    #f1dfc8 0 64deg,
    #c9ad92 65deg,
    #efdbc3 66deg 177deg,
    #d0b49a 178deg,
    #f6e7d3 179deg
  );
}
.flap {
  clip-path: polygon(0 0, 100% 0, 100% 3%, 52% 57%, 49% 57%, 0 3%);
  background: linear-gradient(163deg, #fffaeb, #dfc6a9 68%);
  border-top: 1px solid #fff9;
}
.seal {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 18%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(8deg);
  border-radius: 45% 53% 44% 52%;
  background: radial-gradient(
    ellipse at 28% 22%,
    var(--wax-light),
    var(--wax) 38%,
    var(--wax-shadow) 79%,
    var(--wax)
  );
  box-shadow:
    1px 3px 3px #33233088,
    inset 0 1px 2px #ffe0cc99,
    inset -2px -2px 3px #492e3b88;
}
.seal i {
  display: grid;
  place-items: center;
  width: 75%;
  height: 75%;
  border-radius: 50%;
  border: 1px solid var(--wax-shadow);
  box-shadow:
    0 1px 1px var(--wax-light),
    inset 0 1px 1px var(--wax-light);
  font: italic clamp(14px, 2.4vw, 37px) / 1 var(--serif);
  color: var(--wax-shadow);
  text-shadow: 0.5px 1px var(--wax-light);
}
.env-name {
  position: absolute;
  bottom: 7%;
  left: 8%;
  max-width: 83%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #6c5148;
  font: italic clamp(13px, 1.5vw, 23px) / 1.2 var(--serif);
}
.print {
  width: 57%;
  aspect-ratio: 0.94;
  padding: 5% 5% 12%;
  background: #fff9ec;
  transform: rotate(7deg);
  box-shadow: 0 12px 25px #34243859;
}
.memory-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.print-name {
  position: absolute;
  bottom: 3%;
  max-width: 90%;
  left: 5%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font: italic clamp(13px, 1.65vw, 22px) var(--serif);
  color: #5e493f;
}
.locket {
  width: 36%;
  aspect-ratio: 0.8;
  transform: rotate(-9deg);
  filter: drop-shadow(3px 8px 6px #382b3659);
}
.loop {
  position: absolute;
  bottom: 89%;
  left: 40%;
  width: 22%;
  height: 23%;
  border: 4px solid #c49b52;
  border-radius: 50%;
  box-shadow:
    inset 1px 1px #fff3bb,
    1px 2px #674b31;
}
.pendant {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      ellipse at center,
      transparent 0 46%,
      #a98447 47% 48%,
      transparent 49% 55%
    ),
    linear-gradient(
      122deg,
      #ac804d,
      #fbe5a1 27%,
      #c29a55 46%,
      #f3dba1 70%,
      #9c723a
    );
  border: 3px solid #dcb77c;
  box-shadow:
    inset 0 0 0 2px #8f663b,
    inset 0 0 0 5px #efd79a,
    0 3px 2px #66503a;
  display: grid;
  place-items: center;
}
.etch {
  color: #866334;
  text-shadow: 1px 1px #f8e8b2;
  font: normal clamp(25px, 5vw, 72px) var(--serif);
}
#styles {
  padding: 32px 0 64px;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(30px, 3.25vw, 50px);
  letter-spacing: -0.05em;
  line-height: 1.12;
  margin-bottom: 0;
}
.section-head p {
  color: var(--muted);
  margin: 0;
}
.styles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.style-card {
  display: block;
  text-decoration: none;
}
.style-card .scene {
  height: clamp(130px, 15vw, 225px);
  border: 1px solid #0001;
}
.style-card .scene:before {
  background: #e9dddf;
}
.style-card:nth-child(2) .scene:before {
  background: #e3e9e4;
  filter: none;
}
.style-card:nth-child(3) .scene:before {
  background: #e7dece;
  filter: none;
}
.style-card .mount {
  width: 72%;
  height: 80%;
}
.style-card .envelope {
  width: 70%;
}
.style-card .print {
  width: 45%;
  padding: 3% 3% 9%;
}
.style-card .locket {
  width: 26%;
}
.style-card .seal i {
  font-size: 16px;
}
.style-card .etch {
  font-size: 32px;
}
.card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0 0;
  font: 24px var(--serif);
  letter-spacing: -0.025em;
}
.card-label b {
  font: 20px var(--sans);
  color: var(--plum);
}
.card-detail {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0;
}
footer {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  padding-block: 24px;
  color: var(--muted);
  font-size: 14px;
}
.footer-brand {
  font: italic 20px var(--serif);
}
footer a:last-child {
  margin-left: auto;
  padding: 8px 0;
}
.page-title {
  font-size: clamp(42px, 5vw, 72px);
  margin: 12px 0 0;
}
.page-title:focus {
  outline: none;
}
#writer {
  padding: 24px 0 64px;
}
.studio {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: clamp(32px, 6vw, 85px);
}
.studio-preview {
  align-self: start;
  position: sticky;
  top: 25px;
}
.studio-preview .scene {
  aspect-ratio: 1.15;
}
.names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label,
legend {
  font: 600 16px var(--sans);
  color: var(--ink);
}
label {
  display: block;
}
fieldset {
  border: 0;
  margin: 0 0 24px;
  padding: 0;
}
legend {
  padding: 0;
  margin-bottom: 8px;
}
input,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #968a8a;
  border-radius: 8px;
  background: #fffdf9;
  color: var(--ink);
  padding: 12px 12px;
  margin: 8px 0 16px;
}
input::placeholder,
textarea::placeholder {
  color: #756e71;
}
textarea {
  resize: vertical;
  min-height: 144px;
  margin-bottom: 4px;
}
input:user-invalid,
textarea:user-invalid {
  border-color: #96314c;
}
.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.choice span {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #b6aaa8;
  border-radius: 24px;
  padding: 8px 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  background: #fffcf8;
  cursor: pointer;
}
.choice input:checked + span {
  color: var(--plum);
  background: #efe1e6;
  border-color: var(--plum);
  box-shadow: inset 0 0 0 1px var(--plum);
}
.choice input:focus-visible + span {
  outline: 3px solid #075c9b;
  outline-offset: 2px;
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b05b72;
}
.swatch.sage {
  background: #748570;
}
.swatch.blue {
  background: #65839f;
}
.hint,
small,
.counter {
  color: var(--muted);
}
.hint {
  font-size: 14px;
  line-height: 1.55;
}
.counter {
  text-align: right;
  margin-bottom: 16px;
}
.center-wrap,
.reading-wrap {
  max-width: 840px;
  margin: auto;
  padding: 32px 0 64px;
  min-height: 65vh;
}
.center-wrap {
  max-width: 590px;
}
.confirmation {
  padding: clamp(20px, 4vw, 45px);
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.confirmation h1,
.confirmation p {
  margin-bottom: 24px;
}
.confirmation > .back {
  display: block;
  margin-top: 12px;
}
.reading-stage {
  min-height: clamp(320px, 44vw, 530px);
  padding: 48px 24px;
}
.reader-intro,
.reader-heading {
  text-align: center;
}
.reader-heading {
  margin: 4px 0 16px;
  font-size: clamp(37px, 4.6vw, 62px);
  overflow-wrap: anywhere;
}
.reader-intro {
  margin: 0;
  color: var(--plum);
  font-size: 14px;
}
.open-object {
  display: grid;
  place-items: center;
  gap: 24px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  padding: 12px;
}
.open-object .mount {
  height: clamp(140px, 21vw, 230px);
  width: min(76%, 360px);
}
.open-object .print {
  width: 54%;
  padding: 3% 3% 10%;
}
.open-object .locket {
  width: 29%;
}
.open-label {
  background: #fff7ea;
  border: 1px solid #fff9;
  border-radius: 25px;
  padding: 12px 24px;
  font-weight: 600;
}
.letter-sheet {
  width: min(100%, 520px);
  background: #fff9eb;
  padding: clamp(25px, 5vw, 62px);
  box-shadow: 0 16px 36px #36263e42;
  border-radius: 2px;
  overflow-wrap: anywhere;
}
.letter-sheet .address,
.signature {
  font: italic 24px/1.25 var(--serif);
  color: var(--plum);
}
.letter-body {
  font: 20px/1.63 var(--serif);
  white-space: pre-wrap;
}
.letter-sheet img {
  display: block;
  width: min(100%, 300px);
  max-height: 290px;
  object-fit: cover;
  background: #f3e9dc;
  border: 8px solid #fff;
  box-shadow: 0 4px 12px #402d3a25;
  margin: 0 auto 24px;
}
.letter-sheet.locket-sheet img {
  width: 128px;
  height: 154px;
  border: 6px double #ac8a49;
  border-radius: 50%;
}
.read-actions {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.read-actions a:not(.btn) {
  color: var(--plum);
  font-weight: 600;
}
.error-panel {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.error-panel h1 {
  font-size: 40px;
}
dialog {
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  width: min(740px, 94vw);
  max-height: 90dvh;
}
dialog::backdrop {
  background: #231d2bc7;
}
html:has(dialog:modal) {
  overflow: hidden;
}
dialog .close {
  display: flex;
  margin: 0 0 12px auto;
}
#about-dialog {
  max-width: 520px;
}
#about-dialog h2,
#about-dialog h3 {
  margin-bottom: 12px;
}
#about-dialog h3 {
  font-size: 24px;
}
.busy::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(at 30% 25%, #e5c4d2, #82506a 65%);
  margin-right: 8px;
  animation: breathe 1s ease-in-out infinite alternate;
}
@keyframes breathe {
  to {
    opacity: 0.48;
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
.feature,
.letter-sheet,
.confirmation {
  animation: arrive 0.45s ease-out;
}
@media (max-width: 800px) {
  .mast {
    height: 70px;
  }
  .brand {
    font-size: 24px;
  }
  .hero {
    gap: 24px;
  }
  .eyebrow {
    font-size: 12px;
  }
  .feature {
    aspect-ratio: 1.03;
  }
  .hero .actions {
    gap: 12px;
  }
  .studio {
    gap: 24px;
  }
  .styles-grid {
    gap: 12px;
  }
}
@media (max-width: 660px) {
  .mast,
  main,
  footer {
    padding-inline: 24px;
  }
  .mast {
    height: 65px;
  }
  .mast nav > a:first-child {
    display: none;
  }
  .brand {
    font-size: 24px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .btn.compact {
    font-size: 14px;
    padding: 8px 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 32px 0;
    gap: 24px;
  }
  .hero-copy h1 {
    font-size: clamp(49px, 10.8vw, 68px);
  }
  .eyebrow {
    margin-bottom: 16px;
  }
  .intro {
    margin-bottom: 16px;
  }
  .feature {
    aspect-ratio: 1.55;
  }
  .scene-location {
    top: 12px;
    left: 12px;
    font-size: 12px;
  }
  .scene-action {
    bottom: 10px;
    right: 10px;
  }
  .section-head {
    display: block;
  }
  .section-head p {
    margin-top: 8px;
  }
  .styles-grid {
    grid-template-columns: 1fr;
  }
  .style-card {
    display: grid;
    grid-template-columns: 38% 1fr;
    grid-template-rows: 1fr 1fr;
    column-gap: 16px;
  }
  .style-card .scene {
    grid-row: span 2;
    height: 95px;
  }
  .card-label {
    font-size: 24px;
    align-self: end;
  }
  .card-detail {
    align-self: start;
  }
  .studio {
    display: flex;
    flex-direction: column;
  }
  .studio-preview {
    display: none;
  }
  .actions {
    gap: 16px;
  }
  .caption {
    font-size: 12px;
  }
  .confirmation {
    padding: 24px 16px;
  }
  .open-object .mount {
    width: min(94%, 270px);
  }
  .reading-stage {
    padding: 24px 16px;
  }
  .letter-body {
    font-size: 20px;
  }
  .reader-heading {
    font-size: 40px;
  }
  .read-actions {
    flex-wrap: wrap;
  }
  #styles {
    padding-bottom: 32px;
  }
  footer {
    gap: 8px 16px;
  }
  footer a:last-child {
    margin-left: 0;
  }
  .footer-brand {
    font-size: 20px;
  }
  .center-wrap,
  .reading-wrap {
    padding: 24px 0;
  }
  .names {
    gap: 12px;
  }
  dialog {
    padding: 16px;
  }
  .style-card .etch {
    font-size: 20px;
  }
  .style-card .seal i {
    font-size: 12px;
  }
  .style-card .print-name,
  .style-card .env-name {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  html {
    scroll-behavior: auto;
  }
}
