@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --forest:#153c2d;
  --ink:#193328;
  --muted:#4e6256;
  --paper:#fcf9ef;
  --sage:#d7e5cb;
  --line:#bac9b7;
  --serif:'Instrument Serif',Georgia,serif;
}
html { scroll-padding-top:calc(clamp(92px,24vw,150px) + 62px) }
* { box-sizing:border-box }
[hidden] { display:none!important }
body {
  margin:0;
  min-height:100vh;
  padding:clamp(12px,5vw,54px);
  color:var(--ink);
  background:radial-gradient(ellipse at 65% 0%,#eff4e5,#d3e1cd);
  font:16px/1.5 'DM Sans',sans-serif;
}
main {
  max-width:645px;
  margin:auto;
  overflow:clip;
  border:1px solid #a6bca7;
  border-radius:22px;
  box-shadow:0 18px 52px #153c2d25;
  background:var(--paper);
}
.memory-book header,.cover {
  color:var(--paper);
  background:linear-gradient(135deg,#153c2d 18%,#28563b);
}
.memory-book header { padding:clamp(24px,7vw,44px) }
h1,h2 { font-family:var(--serif);font-weight:400 }
h1 { margin:0 0 10px;font-size:clamp(57px,11vw,89px);line-height:.87;letter-spacing:-.035em }
h1 em { color:#cce7ad }
h2 { margin:0 0 12px;font-size:clamp(34px,6.5vw,49px);line-height:1 }
.memory-book header p { margin:0;color:#e4eddb }
.question-panel,.reply { padding:clamp(20px,5.5vw,37px) }
.progress { display:grid;grid-template-columns:repeat(4,1fr);gap:6px }
.progress span { height:4px;border-radius:10px;background:#dce5d7 }
.progress span.active { background:#376d4b }
#question-number { margin:13px 0 7px;font-size:13px;font-weight:700;color:var(--muted) }
.answers { display:grid;gap:8px }
button {
  border:1px solid transparent;border-radius:10px;background:var(--forest);
  color:#fffdf7;cursor:pointer;padding:12px 15px;min-height:46px;font:700 16px/1.3 'DM Sans',sans-serif;
}
.answers button {
  display:flex;align-items:center;gap:12px;text-align:left;
  background:#fffdf7;color:var(--ink);border-color:var(--line);
}
.answers button:hover { background:#edf3e7 }
.answers button[aria-disabled=true] { cursor:default }
.choice-letter {
  display:grid;place-items:center;flex:0 0 26px;height:26px;
  border:1px solid currentColor;border-radius:50%;font-size:12px;
}
.choice-result { margin-left:auto }
.answers button.incorrect { background:#fbe3e1;color:#8a292c;border-color:#b94c52 }
.answers button.correct { background:#dcefd9;color:#195132;border-color:#3c8052 }
#quiz-feedback { margin:10px 0 0;min-height:1.5em;color:var(--muted);font-size:14px }
#advance,form>button { width:100%;margin-top:12px }
:focus-visible,.chip input:focus-visible+span { outline:2px solid #326643;outline-offset:3px }
.cover { padding:clamp(24px,6vw,42px) }
.cover h1 { font-size:clamp(55px,10vw,76px);margin-top:19px }
.cover p { max-width:34ch;margin:14px 0 0 }
.route { display:flex;align-items:center;gap:9px;color:#e1eddb;font-size:11px;font-weight:700;letter-spacing:.09em }
.route span { width:25px;border-top:1px dashed #cce7ad }
.signature { display:block;margin-top:13px;font:italic 26px var(--serif) }
.intro,.small { color:var(--muted) }
.intro { margin:0 0 14px }
label,legend { font-weight:700 }
label { display:block;margin-top:13px }
textarea,input[type=text] {
  width:100%;margin-top:4px;padding:9px 10px;border:1px solid var(--line);border-radius:8px;
  background:#fffdf7;color:inherit;font:inherit;
}
textarea { resize:vertical }
fieldset { margin:12px 0 0;padding:0;border:0 }
.options,.actions { display:flex;flex-wrap:wrap;gap:7px }
.chip { position:relative;margin:5px 0 0 }
.chip input { position:absolute;opacity:0 }
.chip span {
  display:grid;place-items:center;min-height:44px;border:1px solid var(--line);border-radius:22px;
  padding:5px 11px;cursor:pointer;font-size:14px;
}
.chip input:checked+span { background:var(--sage);border-color:#376d4b }
.small { font-size:13px;margin:8px 0 0 }
#result { margin-top:18px;border-top:1px solid var(--line);padding-top:13px }
#result h3 { margin:0 }
.actions { margin-top:8px }
.secondary { background:var(--sage);color:var(--ink) }
@media(min-width:800px) {
  main:has(.postcard:not([hidden])) { max-width:920px }
  .postcard { display:grid;grid-template-columns: .85fr 1.15fr }
  .cover { display:flex;flex-direction:column;justify-content:center;align-items:flex-start }
}


.journey {
  --trip-progress:0;
  position:sticky;
  top:0;
  z-index:2;
  padding:10px clamp(12px,4vw,30px) 7px;
  background:#e9efd8;
  color:var(--forest);
  border-bottom:1px solid #afc19e;
}
.journey-scene {
  position:relative;
  height:clamp(92px,24vw,150px);
  margin:4px 0 0;
  overflow:hidden;
  border-radius:11px;
  background:
    radial-gradient(ellipse at 14% 116%,#a6bd91 0 34%,transparent 35%),
    radial-gradient(ellipse at 80% 108%,#c1d0a4 0 50%,transparent 51%),
    linear-gradient(#dae7cd,#f6efcd 80%);
}
.journey-house,.journey-car,.journey-road { position:absolute }
.journey-road {
  inset:auto 0 7px;
  height:19%;
  background:#44594a;
  border-block:2px solid #738673;
}
.journey-road::after {
  content:'';
  position:absolute;
  inset:calc(50% - 1px) 0 auto;
  height:2px;
  background:repeating-linear-gradient(to right,#f3e7b9 0 12px,transparent 12px 22px);
}
.journey-house {
  width:34%;
  height:79%;
  right:2%;
  bottom:21%;
  object-fit:contain;
  object-position:right bottom;
}
.journey-car {
  width:41%;
  height:90%;
  left:calc(2% + var(--trip-progress) * 32%);
  bottom:10%;
  object-fit:contain;
  object-position:left bottom;
  transition:left 650ms cubic-bezier(.2,.75,.28,1);
}
.journey-status {
  margin:4px 0 0;
  text-align:center;
  font-size:12px;
  font-weight:700;
}
@media(prefers-reduced-motion:reduce) {
  .journey-car { transition:none }
}

.arrival-card {
  padding:clamp(30px,8vw,60px);
  background:linear-gradient(135deg,#153c2d 18%,#28563b);
  color:var(--paper);
}
.arrival-card p { margin:16px 0;max-width:36ch }
.arrival-card .arrival-receipt {
  margin-top:0;
  color:#cce7ad;
  font-size:13px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.journey[data-stop]:not([data-stop="ga"]) .journey-house { opacity:0 }
.journey-house { transition:opacity .35s ease }
.journey[data-stop="nj"] { --scene-art:url('assets/landscape-nj.webp') }
.journey[data-stop="de"] { --scene-art:url('assets/landscape-de.webp') }
.journey[data-stop="va"] { --scene-art:url('assets/landscape-va.webp') }
.journey[data-stop="nc"] { --scene-art:url('assets/landscape-nc.webp');--scene-y:0% }
.journey[data-stop]:not([data-stop="ga"]) .journey-scene {
  background-image:linear-gradient(#c4cebb24,#c4cebb24),var(--scene-art);
  background-size:cover;
  background-position:center var(--scene-y, 50%);
  background-repeat:no-repeat;
}
@media(prefers-reduced-motion:reduce) {
  .journey-house { transition:none }
}

.journey-scene {
  height:clamp(116px,28vw,172px);
  background:
    radial-gradient(ellipse at 13% 22%,#fff9e7 0 5%,transparent 5.5%),
    radial-gradient(ellipse at 19% 23%,#fff9e7 0 6%,transparent 6.5%),
    radial-gradient(ellipse at 72% 15%,#fff9e7 0 5%,transparent 5.5%),
    radial-gradient(ellipse at 78% 16%,#fff9e7 0 6%,transparent 6.5%),
    radial-gradient(ellipse at 14% 116%,#a6bd91 0 34%,transparent 35%),
    radial-gradient(ellipse at 80% 108%,#c1d0a4 0 50%,transparent 51%),
    linear-gradient(#dae7cd,#f6efcd 80%);
}
html { scroll-padding-top:calc(clamp(116px,28vw,172px) + 62px) }
.journey-car {
  --drive-end:65%;
  width:34%;
  height:85%;
  left:calc(2% + var(--trip-progress) * 54%);
  transition:none;
}
.journey[data-stop="ga"] .journey-car {
  --drive-end:32%;
  width:40%;
  height:91%;
  left:calc(2% + var(--trip-progress) * 30%);
}
.journey[data-stop="ga"] .journey-scene {
  background:
    radial-gradient(ellipse at 8% 81%,#719366 0 8%,transparent 8.5%),
    radial-gradient(ellipse at 16% 84%,#8aa579 0 8%,transparent 8.5%),
    radial-gradient(ellipse at 94% 76%,#78976e 0 13%,transparent 13.5%),
    radial-gradient(ellipse at 20% 102%,#a7be91 0 53%,transparent 53.5%),
    linear-gradient(#dae7cd,#f6efcd 80%);
}
.journey.is-driving .journey-car { animation:drive-across 3.4s linear forwards }
.journey.is-driving .journey-road::after { animation:rolling-road .65s linear 5 }
@keyframes drive-across {
  from { left:2% }
  to { left:var(--drive-end) }
}
@keyframes rolling-road {
  to { background-position:-22px 0 }
}
@media(prefers-reduced-motion:reduce) {
  .journey.is-driving .journey-car,.journey.is-driving .journey-road::after { animation:none }
}

.state-name {
  position:absolute;
  top:8px;
  left:8px;
  z-index:1;
  padding:4px 8px;
  border-radius:4px;
  background:#17372bf0;
  color:#fffbe9;
  font-size:11px;
  font-weight:700;
  line-height:1.3;
}
