:root {
  color-scheme: light;
  --ground: #eae8fa;
  --paper: #fffefb;
  --ink: #23234a;
  --secondary: #565575;
  --blue: #2d3fcb;
  --blue-deep: #2533a6;
  --peach: #ffab88;
  --line: #d3d0e3;
  --sans: "Atkinson Hyperlegible Next", "Avenir Next", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 18px; }
body { margin: 0; color: var(--ink); background: var(--ground); font: 1rem / 1.5 var(--sans); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .63; }
:focus-visible { outline: 3px solid #a04326; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-family: var(--display); line-height: 1.06; }
h2 { font-size: clamp(1.6rem, 3vw, 2.18rem); letter-spacing: -.035em; }
.wrap { width: min(1160px, calc(100% - 88px)); margin-inline: auto; }

.masthead { border-bottom: 1px solid #cfcbe4; }
.masthead-inner, .footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 30px;
}
.brand { display: inline-flex; align-items: center; gap: .62rem; font: 750 1.05rem var(--display); text-decoration: none; }
.mail-icon { display: inline-block; width: 21px; height: 15px; border: 1.5px solid currentColor; border-radius: 2px; overflow: hidden; position: relative; }
.mail-icon::after { content: ""; position: absolute; inset: -65% 14% auto; aspect-ratio: 1; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.masthead nav { display: flex; flex-wrap: wrap; gap: .55rem clamp(.9rem, 3vw, 2rem); }
.masthead nav a { font-size: .95rem; text-decoration: none; }
.masthead nav a:hover, .brand:hover { text-decoration: underline; }

.hero { display: grid; grid-template-columns: .98fr 1.12fr; align-items: center; gap: clamp(35px, 5.7vw, 90px); padding-block: clamp(64px, 8vw, 112px) clamp(67px, 8vw, 102px); }
.hero h1 { color: var(--blue-deep); font: 800 clamp(4rem, 7.75vw, 7.6rem) / .89 var(--display); letter-spacing: -.047em; }
.hero h1 span { color: #b4492e; }
.hero-copy p { max-width: 25ch; margin-top: 28px; font-size: clamp(1.14rem, 2.15vw, 1.55rem); line-height: 1.34; }
.text-link { display: inline-block; margin-top: 15px; color: var(--blue-deep); font-weight: 700; }

.envelope {
  position: relative;
  isolation: isolate;
  padding: 0 clamp(14px, 3.3vw, 46px) 54px;
  filter: drop-shadow(0 9px 12px #3b329123);
}
.envelope-back {
  position: absolute;
  z-index: -1;
  inset: 23% 0 0;
  background: var(--blue-deep);
  clip-path: polygon(0 23%, 48% 0, 100% 24%, 100% 100%, 0 100%);
  border-radius: 0 0 12px 12px;
}
.letter {
  position: relative;
  z-index: 1;
  padding: clamp(20px, 3vw, 36px) clamp(16px, 2.5vw, 30px) 34px;
  background: var(--paper);
  border: 1px solid #e0ddef;
  border-radius: 3px;
  transform: rotate(-1.5deg);
  box-shadow: 0 4px 14px #1d22722a;
}
.letter h2 { margin-bottom: 20px; padding-right: 44px; color: var(--ink); }
.stamp {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 45px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--peach);
  border: 3px dotted var(--paper);
  color: #602717;
  font: 800 1.35rem var(--display);
  transform: rotate(9deg);
}
.letter label { display: block; margin-bottom: 6px; font-weight: 650; font-size: .94rem; }
.input-row { display: flex; align-items: stretch; gap: 8px; }
.letter input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  color: var(--ink);
  background: #f7f6fe;
  border: 1px solid #a3a1c2;
  border-radius: 5px;
}
.letter input::placeholder { color: #62607f; }
.button {
  border: 1px solid var(--blue-deep);
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  padding: 9px 13px;
  font-weight: 750;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--blue-deep); }
.button:active:not(:disabled) { transform: scale(.97); }
.button, .filters button { transition: background-color 120ms ease, transform 120ms ease; }
.form-note, .error { margin-top: 10px; font-size: .9rem; line-height: 1.35; }
.form-note { color: var(--secondary); }
.error { color: #9a301e; }
.envelope-pocket {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 67px;
  background: #4051d6;
  border-radius: 0 0 12px 12px;
  clip-path: polygon(0 0, 50% 22%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
  overflow: hidden;
}
.envelope-pocket::before, .envelope-pocket::after { content: ""; position: absolute; inset: 0; }
.envelope-pocket::before { background: #3b4ed7; clip-path: polygon(0 0, 50% 72%, 16% 100%, 0 100%); }
.envelope-pocket::after { background: #3547cc; clip-path: polygon(100% 0, 100% 100%, 17% 100%); }
.envelope-status { position: absolute; z-index: 3; left: 0; right: 0; bottom: 13px; color: #fff; text-align: center; font-size: .84rem; font-weight: 650; }
.trail-result h2 { margin-bottom: 6px; }
.trail-result > p { font-size: .94rem; }
.trail-result code, .private-row code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; color: var(--blue-deep); background: #efedfb; border: 1px solid #dfdbf2; border-radius: 4px; padding: 5px 7px; font-size: .85rem; }
.trail-result code { margin-block: 10px; }
.result-actions, .private-actions { display: flex; gap: 6px 13px; align-items: center; flex-wrap: wrap; }
.link-button { background: transparent; border: 0; padding: 5px 0; text-decoration: underline; text-underline-offset: 3px; color: var(--blue-deep); font-weight: 700; }

.workbench { background: var(--paper); padding-block: 49px 61px; border-top: 1px solid #d5d0ea; }
.details { display: grid; grid-template-columns: 1.64fr 1fr; gap: clamp(35px, 6vw, 90px); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 11px 16px; }
.section-header + p { margin-top: 8px; color: var(--secondary); }
.filters { display: flex; gap: 2px; }
.filters button { border: 0; background: transparent; border-radius: 4px; padding: 4px 9px; font-size: .89rem; }
.filters button:hover { background: #f0eef9; }
.filters button[aria-pressed="true"] { color: var(--blue-deep); background: #e9e6fb; font-weight: 750; }
.trail-table { margin-top: 20px; border-bottom: 1px solid var(--line); }
.table-head, .public-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 12px; align-items: center; padding: 10px 12px; }
.table-head { background: #eeecf8; border-radius: 4px 4px 0 0; font-size: .88rem; font-weight: 750; }
.public-row { border-top: 1px solid var(--line); padding-block: 13px; }
.public-row h3, .private-row h3 { font-size: 1.2rem; overflow-wrap: anywhere; }
.public-row time { color: var(--secondary); font-size: .84rem; }
.public-row .sighting { color: var(--blue-deep); font-weight: 750; }
.empty { padding: 21px 12px; color: var(--secondary); }
.steps { display: grid; gap: 12px; margin: 17px 0 14px; padding-inline-start: 1.4rem; }
.steps li { padding-left: 4px; }
.steps li::marker { color: var(--blue-deep); font-weight: 800; }
.privacy-note { border-left: 3px solid var(--peach); padding-left: 12px; color: var(--secondary); font-size: .93rem; }
.private-section { margin-bottom: 40px; }
.private-row { padding: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 26px; border-bottom: 1px solid var(--line); }
.private-row:first-child { margin-top: 15px; border-top: 1px solid var(--line); }
.private-row p { margin-top: 4px; color: var(--secondary); font-size: .9rem; }
.private-row code { margin-block: 7px 6px; }
.private-events { margin: 0; padding-left: 19px; font-size: .88rem; }
.private-events li + li { margin-top: 5px; }
.private-actions { font-size: .91rem; }
.footer { background: var(--ink); color: var(--paper); }
.footer .contact { overflow-wrap: anywhere; }

@media (max-width: 830px) {
  .wrap { width: min(680px, calc(100% - 48px)); }
  .hero { grid-template-columns: 1fr 1.05fr; gap: 25px; padding-block: 54px; }
  .hero h1 { font-size: clamp(3.25rem, 8vw, 5.3rem); }
  .input-row { flex-wrap: wrap; }
  .letter .button { width: 100%; }
  .details { grid-template-columns: 1.3fr 1fr; gap: 25px; }
}
@media (max-width: 620px) {
  .wrap { width: min(460px, calc(100% - 36px)); }
  .masthead-inner { min-height: 62px; flex-wrap: wrap; gap: 7px 18px; padding-block: 13px; }
  .masthead nav a { font-size: .87rem; }
  .hero, .details { grid-template-columns: 1fr; }
  .hero { gap: 30px; padding-block: 39px 38px; }
  .hero h1 { font-size: clamp(3.7rem, 11vw, 5.1rem); }
  .hero-copy p { margin-top: 15px; }
  .text-link { margin-top: 10px; }
  .input-row { flex-wrap: nowrap; }
  .letter .button { width: auto; }
  .details { gap: 35px; }
  .workbench { padding-block: 32px 39px; }
  .private-row { grid-template-columns: 1fr; }
  .footer-inner { flex-wrap: wrap; gap: 10px 20px; padding-block: 18px; }
}
@media (max-width: 355px) {
  .input-row { flex-wrap: wrap; }
  .letter .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
