:root {
  color-scheme: light;
  --ink: #41374c;
  --plum: #684e68;
  --ui: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --serif: "Baskerville", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #fcf7f1;
  color: var(--ink);
  font: 16px/1.45 var(--ui);
}
button, a { color: inherit; font: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #44318c; outline-offset: 3px; }

.mast, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: clamp(18px, 4vw, 64px);
}
.mast { min-height: 65px; }
.brand {
  display: flex;
  align-items: center;
  gap: .18em;
  font: 26px var(--serif);
  letter-spacing: -1px;
}
.brand img { width: 34px; margin-right: 6px; }
.brand i { color: var(--plum); }
.mast-note, dt, footer {
  font: 600 11px/1.5 var(--ui);
  text-transform: uppercase;
  letter-spacing: .13em;
}
.mast-note b { margin-inline: .45em; }
footer { min-height: 49px; color: #605365; font-size: 10px; }
.post-stripes {
  width: 47px;
  height: 6px;
  background: repeating-linear-gradient(115deg, #c996aa 0 5px, transparent 5px 9px, #a0b4c7 9px 14px, transparent 14px 18px);
}

.landscape {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 1;
  min-height: 395px;
  margin-inline: clamp(8px, 1.4vw, 24px);
  border: 1px solid #c6b8c9;
  background: linear-gradient(#f4d9e6, #c5e2fa);
}
.flight { position: absolute; inset: 0; overflow: hidden; }
.artboard {
  position: absolute;
  left: 42%;
  top: 32%;
  width: max(100%, var(--art-width, 191.58vh));
  aspect-ratio: 1410/736;
  transform: translate(-42%, -32%);
}
.meadow { display: block; width: 100%; height: 100%; }

/* The ribbon begins at the bird’s beak, even when the artwork is cropped. */
#envelope {
  position: absolute;
  left: 31.6%;
  top: 27%;
  width: clamp(76px, 10%, 138px);
  min-height: 44px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  transform: translate(-30.9%, -4.65%);
  filter: drop-shadow(0 2px 2px #754b6d55);
}
#envelope svg { display: block; width: 100%; }
#envelope:hover { filter: drop-shadow(0 3px 5px #754b6d99); }
body.letter-open #envelope { visibility: hidden; }

.breeze { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.breeze i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--petal-width, clamp(18px, 1.8vw, 29px));
  aspect-ratio: 1;
  background: url(assets/petal-pink.webp) center/contain no-repeat;
  animation: drift var(--speed, 13s) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}
.breeze i:nth-child(3n) {
  background-image: url(assets/petal-blue.webp);
  aspect-ratio: 37/30;
}
.breeze i:nth-child(5n) { --petal-width: clamp(15px, 1.3vw, 23px); }
.breeze i:nth-child(1) { --x: 3%; --y: 15%; --delay: -5s; }
.breeze i:nth-child(2) { --x: 15%; --y: 36%; --delay: -7s; }
.breeze i:nth-child(3) { --x: 76%; --y: 7%; --delay: -9s; }
.breeze i:nth-child(4) { --x: 82%; --y: 70%; --delay: -10s; --speed: 17s; }
.breeze i:nth-child(5) { --x: 1%; --y: 78%; --delay: -2s; }
.breeze i:nth-child(6) { --x: 32%; --y: 5%; --delay: -9s; --speed: 19s; }
.breeze i:nth-child(7) { --x: 88%; --y: 25%; --delay: -3s; }
.breeze i:nth-child(8) { --x: 67%; --y: 82%; --delay: -6s; }
.breeze i:nth-child(9) { --x: 10%; --y: 64%; --delay: -8s; --speed: 18s; }
.breeze i:nth-child(10) { --x: 54%; --y: 44%; --delay: -4s; }
.breeze i:nth-child(11) { --x: 29%; --y: 49%; --delay: -11s; --speed: 18s; }
.breeze i:nth-child(12) { --x: 49%; --y: 65%; --delay: -3s; --speed: 17s; }
.breeze i:nth-child(13) { --x: 64%; --y: 54%; --delay: -8s; --speed: 15s; }
.breeze i:nth-child(14) { --x: 74%; --y: 39%; --delay: -6s; --speed: 20s; }
.breeze i:nth-child(15) { --x: 41%; --y: 79%; --delay: -9s; --speed: 16s; }
.breeze i:nth-child(16) { --x: 21%; --y: 86%; --delay: -4s; --speed: 18s; }
.breeze i:nth-child(17) { --x: 88%; --y: 50%; --delay: -14s; --speed: 20s; }
.breeze i:nth-child(18) { --x: 48%; --y: 19%; --delay: -8s; --speed: 15s; }
.breeze i:nth-child(19) { --x: 37%; --y: 36%; --delay: -3s; --speed: 16s; }
.breeze i:nth-child(20) { --x: 5%; --y: 48%; --delay: -12s; --speed: 19s; }
@keyframes drift {
  from { transform: translate(-2vw, -3vh) rotate(-24deg); }
  50% { transform: translate(2vw, 1vh) rotate(12deg); }
  to { transform: translate(6vw, 7vh) rotate(52deg); }
}

.countdown {
  position: absolute;
  inset-inline: 5%;
  top: 62%;
  transform: translateY(-50%);
  color: #42345a;
  text-align: center;
  text-shadow: 0 1px 10px #fce2edf2;
}
.letter-open .countdown { visibility: hidden; }
.countdown h1 {
  margin: 0 0 8px;
  color: #5f3d60;
  font: italic 400 clamp(22px, 2.4vw, 36px)/1.05 var(--serif);
}
.countdown-digits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 440px;
  margin-inline: auto;
}
.countdown-digits > span { position: relative; }
.countdown-digits > span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 52%;
  right: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #794d6c;
}
.countdown-number {
  display: block;
  font: 400 clamp(39px, 6vw, 80px)/.95 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.04em;
  text-shadow: none;
}
@supports (background-clip: text) {
  .countdown-number {
    background: linear-gradient(135deg, #3d4873 15%, #513c65 55%, #7f3d63 100%);
    background-clip: text;
    color: transparent;
  }
}
.countdown-unit, .countdown-event {
  font: 700 12px/1.5 var(--ui);
  letter-spacing: .08em;
}
.countdown-unit {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  text-transform: uppercase;
}
.countdown-event { margin-top: 12px; }
@media (max-width: 680px) {
  .countdown-number { font-size: clamp(40px, 11vw, 58px); }
  .countdown-event { font-size: 11px; letter-spacing: .02em; }
  .countdown-unit { letter-spacing: .06em; }
}
@media (max-height: 450px) {
  .countdown h1 { margin-bottom: 4px; font-size: 20px; }
  .countdown-number { font-size: 38px; }
  .countdown-event { margin-top: 7px; }
}

dialog {
  width: min(544px, calc(100% - 26px));
  max-width: none;
  max-height: calc(100dvh - 22px);
  margin: auto;
  padding: 8px;
  overflow: auto;
  border: 0;
  background: transparent;
  color: var(--ink);
}
dialog::backdrop { background: transparent; }
dialog.map-mode { width: min(800px, calc(100% - 26px)); }
.sheet {
  position: relative;
  padding: clamp(26px, 4vw, 43px) clamp(24px, 4.4vw, 46px) clamp(20px, 3vw, 34px);
  border: 6px solid transparent;
  background: linear-gradient(135deg, #fff6ed, #fffaf4 60%, #f8eef2) padding-box,
    repeating-linear-gradient(125deg, #c48fa0 0 8px, #fff4ec 8px 14px, #9ab8d2 14px 22px, #fff4ec 22px 28px) border-box;
  box-shadow: 0 5px 18px #51455c28;
}
.meadow-stamp {
  position: absolute;
  top: 20px;
  right: 49px;
  width: 38px;
  height: 44px;
  transform: rotate(6deg);
  border: 3px dotted #fff8ea;
  background: #accdf1 url(assets/meadow-horizon.webp) 77% 28% / 700% auto;
  box-shadow: 0 1px 2px #75596760;
  pointer-events: none;
}
.close {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--plum);
  font: 29px/1 var(--serif);
}
.close:hover { color: #342946; }

h2, p, dl { margin: 0; }
h2 {
  font: 400 clamp(37px, 4vw, 54px)/1.01 var(--serif);
  letter-spacing: -.055em;
}
h2 em { color: #864964; }
.name { margin-top: 6px; font-size: 17px; font-style: italic; }
.name:empty { display: none; }
#letter dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px 14px;
  margin: 15px 0;
  padding: 13px 9px;
  border-block: 1px solid #cc9cab;
  background: linear-gradient(105deg, #f7d7de61, #d7e5fa66);
  text-align: center;
}
dt { color: #79556c; font-size: 10px; }
dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
#arrival-note { margin-bottom: 8px; }
#letter-message { color: #493649; font: 17px/1.38 var(--serif); white-space: pre-line; }
.closing { margin: 10px 0 15px; font: italic 18px var(--serif); }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.letter-actions { justify-content: center; }
.ink-button, .paper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid #aa769e;
  border-radius: 22px 7px 22px 7px;
  background: linear-gradient(125deg, #f9cfdd, #dba8ce 70%, #ceb1e3);
  color: #482d50;
  box-shadow: inset 0 0 0 2px #ffffff59, 0 2px 4px #6c48702b;
  font: 600 13px var(--ui);
  text-decoration: none;
}
#show-campus, #contact-link, .map-mode .paper-button {
  border-color: #8899c6;
  background: linear-gradient(125deg, #dbeaff, #a9c8ec 63%, #cbbce8);
  color: #293855;
}
#calendar-button {
  border-color: #88a99a;
  background: linear-gradient(125deg, #e5f5d9, #b6ddcd 75%, #b4d6d6);
  color: #254739;
}
.ink-button:hover, .paper-button:hover {
  filter: brightness(1.045);
  box-shadow: inset 0 0 0 2px #fff8, 0 3px 8px #65457c40;
}

.back {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #674b62;
  text-decoration: underline;
  text-underline-offset: 4px;
  font: 500 13px var(--ui);
}
.address, .map-caption { margin: 8px 0 12px; font-size: 14px; }
.map-window, iframe { display: block; width: 100%; border: 1px solid #c5b6c3; border-radius: 4px; }
.map-window { overflow: auto; max-height: 49dvh; background: #e8e1da; }
.map-art { position: relative; width: 100%; }
.map-art img { display: block; width: 100%; height: auto; }
.map-window.zoomed .map-art { width: max(155%, 940px); }
.gate-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: #59445c;
  font-size: 12px;
}
.gate-number, .gate-marker {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #fff5ea;
  border-radius: 50%;
  background: #59445c;
  color: #fff7ef;
  font: 700 10px var(--ui);
}
.gate-marker { position: absolute; transform: translate(-50%, -50%); }
.gate-one { left: 19.77%; top: 55.64%; }
.gate-three { left: 80.97%; top: 61.16%; }
.roof {
  position: absolute;
  left: 50.35%;
  top: 45.1%;
  width: 5.3%;
  height: 8.8%;
  border: 2px solid #ab2452;
  background: #f7467355;
}
.map-pin {
  position: absolute;
  left: 53%;
  bottom: 54.6%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 6px;
  background: #8d2852;
  color: white;
  box-shadow: 0 1px 4px #38263755;
  font: bold 15px/1.4 var(--ui);
}
.map-pin::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #8d2852;
}
iframe { height: clamp(160px, 33vh, 310px); margin: 10px 0 14px; background: #e9e6ee; }

@media (max-width: 680px) {
  .mast { min-height: 54px; }
  .brand { font-size: 22px; }
  .brand img { width: 28px; }
  .mast-note { font-size: 9px; }
  .artboard { left: 30%; transform: translate(-30%, -32%); }
  footer { min-height: 44px; font-size: 8px; letter-spacing: .07em; }
  .post-stripes { display: none; }
  .sheet { padding: 24px 22px 19px; }
  .meadow-stamp { top: 11px; width: 27px; height: 32px; }
}

@media (max-height: 620px) {
  .landscape { min-height: 240px; }
  .mast { min-height: 45px; }
  .sheet { padding-block: 19px 14px; }
  .sheet h2 { font-size: 33px; }
  #letter dl { margin: 10px 0; padding: 8px 5px; gap: 7px 10px; }
  .closing { margin: 7px 0 11px; }
  #letter-message { font-size: 16px; }
}

@media (max-width: 380px) {
  dialog { width: calc(100% - 12px); padding: 4px; max-height: calc(100dvh - 12px); }
  .sheet { padding-inline: 13px; }
  .sheet h2 { font-size: 31px; }
  .meadow-stamp { display: none; }
  .letter-actions { gap: 6px; }
  .letter-actions .paper-button { font-size: 12px; }
}

@media (max-width: 380px) and (max-height: 620px) {
  .sheet { padding-block: 14px 10px; }
}
