/* The Wanderer — An Irish Christmas Advent Calendar */
:root {
  --night: #0b1a2e;
  --night-2: #12243b;
  --evergreen: #1f4a36;
  --evergreen-deep: #143326;
  --gold: #e2b869;
  --gold-deep: #b98d3c;
  --amber: #f3b25a;
  --cranberry: #8e2433;
  --cream: #f6efdf;
  --cream-2: #ebe1c9;
  --ink: #2a2118;
  --muted: #b9c3cf;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --display: 'Cinzel', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  background-image: radial-gradient(ellipse at 50% -10%, #1d3a5e 0%, var(--night) 60%);
  color: var(--cream);
  font: 400 16px/1.6 var(--sans);
  overflow-x: hidden;
}
a { color: var(--gold); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Masthead ---------- */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1240px; margin: 0 auto; padding: 14px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-text { font: 600 22px/1 var(--serif); letter-spacing: .01em; color: var(--cream); }
@media (max-width: 420px) { .brand-text { font-size: 18px; white-space: nowrap; } .buy-link { padding: 9px 12px; font-size: 13px; } }
.brand-text sup { font-size: 10px; color: var(--gold); }
.buy-link {
  font: 600 14px/1 var(--sans); color: var(--night); background: var(--gold);
  padding: 10px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}

/* ---------- Intro ---------- */
.intro { max-width: 760px; margin: 0 auto; padding: 8px 16px 18px; text-align: center; }
.eyebrow { font: 500 12px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 6px 0 10px; }
h1 { font: 600 clamp(32px, 6vw, 54px)/1.05 var(--serif); margin: 0 0 12px; color: #fff8ea; }
.lede { font-size: 16px; color: #d7dde5; margin: 0 auto; max-width: 600px; }
.countdown { margin: 14px 0 0; font: italic 500 19px/1.4 var(--serif); color: var(--gold); }

/* ---------- Village scene ---------- */
.village { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.scene {
  position: relative; container-type: inline-size;
  aspect-ratio: 1774 / 887; border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(226,184,105,.25);
}
.scene-art, .scene-art svg, .scene-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.hotspots { position: absolute; inset: 0; }

.hotspot {
  position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; border-radius: 6px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.hotspot .num {
  font: 700 1.9cqw/1 var(--serif); color: #fffaf0;
  text-shadow: 0 0 .3cqw #2a1a0c, 0 0 .6cqw #2a1a0c, 0 .1cqw .1cqw #2a1a0c;
  pointer-events: none;
}
.hotspot.principal .num { font-size: 2.6cqw; color: #fff3cf; }
.hotspot:hover, .hotspot:focus-visible { transform: scale(1.08); box-shadow: 0 0 0 2px var(--gold), 0 0 24px 6px rgba(255,207,122,.55); outline: none; }
.hotspot.is-locked .num { opacity: .78; }
.hotspot.is-opened { box-shadow: inset 0 0 0 2px rgba(226,184,105,.95); background: rgba(11,26,46,.32); }
.hotspot.is-opened .num { color: var(--gold); }
.hotspot.is-today { animation: beckon 2.4s ease-in-out infinite; }
@keyframes beckon { 0%,100% { box-shadow: 0 0 0 2px rgba(226,184,105,.4), 0 0 10px 2px rgba(255,207,122,.3); } 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 28px 8px rgba(255,207,122,.65); } }

.twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.snowfall { position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 60%, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 55% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 75% 75%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 42% 85%, #fff 50%, transparent 51%);
  background-size: 300px 300px; animation: snow 14s linear infinite; }
@keyframes snow { from { background-position: 0 -300px, 40px -300px, 0 -300px, 80px -300px, 0 -300px, 20px -300px; } to { background-position: 40px 300px, 0 300px, 60px 300px, 40px 300px, 30px 300px, 60px 300px; } }

/* ---------- Progress ---------- */
.progress { display: flex; align-items: center; gap: 14px; margin: 16px 0 6px; flex-wrap: wrap; }
.progress-label { margin: 0; font: 600 17px/1 var(--serif); color: var(--cream); }
.progress-label span { color: var(--gold); }
.progress-track { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; flex: 1; min-width: 200px; }
.progress-track span { height: 6px; border-radius: 3px; background: rgba(226,184,105,.18); transition: background .4s ease; }
.progress-track span.on { background: var(--gold); }

/* ---------- Grid (phones) ---------- */
.door-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid-door {
  width: 100%; min-height: 76px; padding: 8px 6px; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  background: linear-gradient(180deg, #1c3550, #13263c); border: 1px solid rgba(226,184,105,.28);
}
.grid-door .num { font: 700 26px/1 var(--serif); color: #fff3cf; }
.grid-door .grid-place { display: none; }
.grid-door .grid-state { font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.grid-door.principal { background: linear-gradient(180deg, #7c2230, #571722); border-color: rgba(226,184,105,.55); }
.grid-door.is-locked { opacity: .72; }
.grid-door.is-opened { background: linear-gradient(180deg, var(--evergreen), var(--evergreen-deep)); border-color: var(--gold); }
.grid-door.is-opened .grid-state { color: var(--gold); }
.grid-door.is-today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255,207,122,.45); }
.grid-door:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (max-width: 759px) {
  .scene { border-radius: 12px; }
  .hotspots { display: none; } /* on phones the picture stays clean; the grid below is the way in */
}
@media (min-width: 760px) {
  .door-grid { display: none; }
}

/* ---------- Sections ---------- */
section h2 { font: 600 clamp(26px, 4vw, 36px)/1.15 var(--serif); color: #fff8ea; margin: 0 0 8px; }
.section-lede { color: #cfd6df; margin: 0 0 18px; }
.samples, .how, .buy, .faq { max-width: 1040px; margin: 0 auto; padding: 44px 16px 0; }

.sample-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .sample-cards { grid-template-columns: repeat(3, 1fr); } }
.sample {
  text-align: left; cursor: pointer; padding: 18px 18px 16px; border-radius: 14px;
  background: var(--evergreen-deep); border: 1px solid rgba(226,184,105,.35);
  display: flex; flex-direction: column; gap: 4px; transition: transform .2s ease, border-color .2s ease;
}
.sample:hover, .sample:focus-visible { transform: translateY(-2px); border-color: var(--gold); outline: none; }
.sample-day { font: 500 11px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.sample-ga { font: italic 600 28px/1.15 var(--serif); color: #fff8ea; margin-top: 6px; }
.sample-en { color: #cfd6df; }
.sample-open { margin-top: 10px; font-weight: 600; font-size: 14px; color: var(--gold); }

.how-list { margin: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .how-list { grid-template-columns: 1fr 1fr; } }
.how-list div { padding: 16px 18px; border-left: 2px solid var(--gold); background: rgba(255,255,255,.03); border-radius: 0 10px 10px 0; }
.how-list dt { font: 600 21px/1.2 var(--serif); color: var(--gold); margin-bottom: 4px; }
.how-list dd { margin: 0; color: #d7dde5; }

.buy-inner, .owned {
  text-align: center; padding: 30px 20px; border-radius: 18px;
  background: linear-gradient(180deg, #1f4a36, #143326); border: 1px solid rgba(226,184,105,.45);
}
.buy-inner p, .owned p { color: #e3e8e4; max-width: 520px; margin: 0 auto 10px; }
.price { font: 600 40px/1 var(--serif) !important; color: var(--gold) !important; margin: 14px auto 16px !important; }
.fine { font-size: 13px; color: #b6c4bb !important; margin-top: 12px !important; }
#copy-msg { overflow-wrap: anywhere; }
.owned-actions { margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 24px;
  border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; font: 600 16px/1.2 var(--sans);
}
.btn-gold { background: var(--gold); color: var(--night); box-shadow: 0 6px 20px rgba(226,184,105,.25); }
.btn-gold:hover { background: #ecc77f; }
.btn-quiet { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }
.btn:focus-visible { outline: 3px solid #fff3cf; outline-offset: 3px; }

.faq details { border-bottom: 1px solid rgba(226,184,105,.22); padding: 14px 0; }
.faq summary { cursor: pointer; font: 600 19px/1.3 var(--serif); color: #fff8ea; }
.faq details p { color: #d7dde5; margin: 8px 0 0; }

.footer { max-width: 1040px; margin: 56px auto 0; padding: 24px 16px 40px; border-top: 1px solid rgba(226,184,105,.2);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; color: #9fb0c1; font-size: 13px; }
.footer p { margin: 0; }
.motion-toggle { background: none; border: 1px solid rgba(226,184,105,.4); color: var(--gold); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 13px; }

/* ---------- The door panel ---------- */
.door-dialog {
  padding: 0; border: 0; background: transparent; color: var(--ink);
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0;
  overflow: visible;
}
.door-dialog::backdrop { background: rgba(4, 10, 20, .72); backdrop-filter: blur(2px); }
.door-dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  position: relative; width: 100%; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--cream); border-radius: 22px 22px 0 0; padding: 24px 20px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.4);
  animation: rise .35s ease-out;
}
@media (min-width: 760px) {
  .door-dialog[open] { align-items: center; }
  .sheet { max-width: 620px; border-radius: 20px; max-height: 86vh; padding: 30px 32px 20px; }
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* door leaves swing open over the panel */
.leaves { position: fixed; inset: 0; display: none; pointer-events: none; z-index: 2; perspective: 1400px; }
.door-dialog.opening .leaves { display: flex; justify-content: center; align-items: center; }
.leaf { width: min(310px, 50vw); height: min(560px, 80vh); background: linear-gradient(180deg, #9a2a3b, #6f1b28);
  border: 3px solid #4a1019; box-shadow: inset 0 0 0 10px rgba(0,0,0,.12); }
.leaf-l { transform-origin: left center; animation: swing-l .9s cubic-bezier(.5,0,.3,1) forwards; border-radius: 8px 0 0 8px; }
.leaf-r { transform-origin: right center; animation: swing-r .9s cubic-bezier(.5,0,.3,1) forwards; border-radius: 0 8px 8px 0; }
@keyframes swing-l { 0% { transform: rotateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: rotateY(-105deg); opacity: 0; } }
@keyframes swing-r { 0% { transform: rotateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: rotateY(105deg); opacity: 0; } }
.door-dialog.opening .sheet { animation: rise .5s ease-out .35s both; }

.sheet-head { padding-right: 4px; }
.sheet-day { font: 500 11px/1.4 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cranberry); margin: 0 0 6px; }
.sheet h2 { font: 600 30px/1.1 var(--serif); color: var(--evergreen-deep); margin: 0 0 6px; outline: none; }
.sheet-intro { color: #5a4c3b; margin: 0 0 14px; }

.phrases { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.phrase { display: flex; gap: 14px; padding: 16px; background: #fffaf0; border: 1px solid var(--cream-2); border-radius: 14px; }
.phrase-num { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--evergreen); color: var(--gold);
  display: grid; place-items: center; font: 700 18px/1 var(--serif); }
.phrase-body { min-width: 0; }
.phrase-body p { margin: 0; }
.phrase-en { font-size: 15px; color: #5a4c3b; }
.phrase-phonics { font: italic 700 27px/1.15 var(--serif); color: var(--evergreen-deep); margin: 4px 0 2px !important; }
.phrase-ga { font: italic 500 18px/1.3 var(--serif); color: #8a7a62; }
.phrase-audio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.audio-btn { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--evergreen); background: transparent;
  color: var(--evergreen); font-weight: 600; font-size: 14px; cursor: pointer; }
.audio-btn.playing, .audio-btn:hover { background: var(--evergreen); color: var(--cream); }
.audio-btn:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 2px; }
.audio-note { font-size: 13px; color: #8a7a62; font-style: italic; }

.try, .surprise { margin-top: 16px; padding: 16px 18px; border-radius: 14px; }
.try { background: #fffaf0; border: 1px solid var(--cream-2); }
.surprise { background: var(--evergreen-deep); color: #eef1ec; }
.try h3, .surprise h3 { font: 500 11px/1.4 var(--display); letter-spacing: .16em; text-transform: uppercase; margin: 0 0 8px; }
.try h3 { color: var(--cranberry); }
.surprise h3 { color: var(--gold); }
.try ol { margin: 0; padding-left: 20px; color: #3d3226; }
.try li + li { margin-top: 4px; }
.surprise p { margin: 0; font: 500 18px/1.45 var(--serif); }
.draft-note { font-size: 12px; color: #9b8a70; margin: 14px 0 0; font-style: italic; }
.wrapped { padding: 26px; text-align: center; border: 1.5px dashed var(--gold-deep); border-radius: 14px; font: italic 600 22px/1.3 var(--serif); color: var(--evergreen); }
.wrapped p { margin: 0; }
.sheet-buy { text-align: center; margin: 18px 0 4px; }

.sheet-foot { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 18px -20px calc(-16px - env(safe-area-inset-bottom));
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(246,239,223,0), var(--cream) 30%); }
.sheet-foot .close-btn { width: 100%; color: var(--evergreen); border-color: var(--evergreen); }
@media (min-width: 760px) {
  .sheet-foot { margin: 18px -32px -20px; padding: 12px 32px 20px; bottom: -20px; }
}

/* ---------- Calmer motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .snowfall { display: none; }
  .door-dialog.opening .leaves { display: none; }
}
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }
html.calm .snowfall, html.calm .door-dialog.opening .leaves { display: none; }
