/* Bethlehem Live. The page is the passport: cover, data page, map sheet, back cover.
   Inks are the passport's own: burgundy, gold foil, paper. */

:root {
  --night: #1c0b0f;
  --burg: #5a1820;
  --burg-d: #3e0f15;
  --gold: #cfa95a;
  --paper: #f6eedb;
  --paper-2: #ece0c4;
  --ink: #2b211a;
  --soft: #5e4c3b;

  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-text: 'EB Garamond', Garamond, Georgia, serif;

  --step-small: 0.9375rem;
  --step-sub: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem);
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-lead: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  --step-head: clamp(2.2rem, 1.3rem + 3.4vw, 4.4rem);
  --step-display: clamp(3rem, 1rem + 6.6vw, 7.5rem);

  --margin: clamp(1rem, 2.4vw, 2rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(7.5rem, 12vw, 13rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;

  /* scalloped paper edges, drawn as a repeating row of paper-coloured half circles */
  --scallop-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='12'%3E%3Ccircle cx='16' cy='16' r='16' fill='%23f6eedb'/%3E%3C/svg%3E");
  --scallop-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='12'%3E%3Ccircle cx='16' cy='-4' r='16' fill='%23f6eedb'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
body { margin: 0; background: var(--night); color: var(--paper); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: 2rem; }
::selection { background: var(--gold); color: var(--night); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
.wrap { padding-inline: var(--margin); }
.shutter { overflow: clip; }
.head { font-family: var(--font-display); font-size: var(--step-head); line-height: 1.02; letter-spacing: -0.01em; }

/* ---------- controls ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.4rem; border-radius: 0; background: var(--burg); color: var(--paper); font-family: var(--font-text); font-size: var(--step-body); font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button-gold { background: var(--gold); color: var(--night); }
.button-paper { background: var(--paper); color: var(--burg-d); }
.button-block { display: flex; width: 100%; min-height: 3.25rem; }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; }
  .button:hover { background: var(--burg-d); }
  .button-gold:hover { background: var(--paper); }
  .button-paper:hover { background: var(--gold); }
}
.sq { display: grid; place-items: center; width: 48px; height: 48px; background: var(--paper); color: var(--burg-d); transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.sq svg { width: 22px; height: 22px; }
.sq:active { transform: scale(0.94); }
@media (hover: hover) { .sq:hover { background: var(--gold); } }
.diamond { display: inline-block; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); margin: 0 0.9em; vertical-align: 0.12em; }

/* ---------- hero: the cover on the film ---------- */
.hero { position: relative; min-height: 100svh; overflow: clip; display: grid; grid-template-rows: auto 1fr; }
.hero-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--night); }
.hero-scrim { position: absolute; inset: 0; background: rgba(20, 6, 9, 0.62); }
.top { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 22px var(--margin); }
.mono { width: 52px; height: 52px; color: var(--gold); transition: transform 600ms var(--ease-out); }
.mono svg { width: 52px; height: 52px; }
@media (hover: hover) { .mono:hover { transform: rotate(-20deg); } }
.top-links { display: flex; gap: 2rem; font-size: var(--step-body); }
.top-links a { color: var(--paper); }
.top > .button { justify-self: end; }

.cover { position: relative; z-index: 1; align-self: center; justify-self: center; width: min(52rem, 100%); padding: 0 var(--margin) clamp(4rem, 8vh, 6rem); color: var(--gold); text-align: center; }
.cover-province { font-family: var(--font-display); font-size: var(--step-body); letter-spacing: 0.04em; }
.cover-emblem { width: clamp(120px, 12vw, 170px); height: auto; aspect-ratio: 1; margin: 1.6rem auto 1.4rem; }
.display { font-family: var(--font-display); font-size: var(--step-display); line-height: 0.98; letter-spacing: -0.01em; font-weight: 700; }
.display span { display: block; }
.display .l1 { transform: translateX(-6%); }
.display .l2 { transform: translateX(14%); }
.cover-lead { margin: 1.4rem auto 0; max-width: 30ch; color: var(--paper); font-size: var(--step-lead); line-height: 1.3; }
.cover-when { margin: 1.4rem auto 2rem; color: var(--paper); font-size: var(--step-body); }
.cover-when span { white-space: nowrap; }

/* ---------- intro ---------- */
.intro { padding-block: var(--section) calc(var(--section) * 0.8); }
.intro-top { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: end; }
.intro-top .head { grid-column: 1 / 8; color: var(--gold); }
.intro-note { grid-column: 9 / 13; font-size: var(--step-body); }
.facts { margin-top: 7.5rem; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 3rem; }
.facts-row { grid-column: 1 / 13; display: flex; justify-content: space-between; gap: 2rem; }
.facts-row dt { font-family: var(--font-display); font-size: var(--step-sub); line-height: 1.1; color: var(--paper); white-space: nowrap; }
.facts-row dd { margin-top: 0.4rem; font-size: var(--step-body); color: var(--paper-2); max-width: 22ch; }
.intro-film { grid-column: 1 / 13; align-self: end; position: relative; display: block; width: 100%; text-align: left; color: var(--paper); }
.intro-film img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: 50% 50%; transition: transform 700ms var(--ease-out); }
.intro-film .play { position: absolute; left: 0; bottom: 0; display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.25rem; background: var(--gold); color: var(--night); font-weight: 600; font-size: var(--step-body); transition: background-color var(--t-hover) ease; }
.intro-film .play i { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.intro-film { overflow: clip; }
@media (hover: hover) { .intro-film:hover img { transform: scale(1.04); } .intro-film:hover .play { background: var(--paper); } }

/* ---------- good to know ---------- */
.notes { background: var(--burg); padding-block: calc(var(--section) * 0.6); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 2.5rem; align-items: start; }
.notes-title { grid-column: 1 / 4; font-family: var(--font-display); font-size: var(--step-sub); line-height: 1.05; color: var(--gold); }
.notes-list { grid-column: 4 / 13; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--gutter); row-gap: 2rem; }
.notes-list h3 { font-size: var(--step-lead); font-weight: 600; color: var(--paper); line-height: 1.2; }
.notes-list p { margin-top: 0.6rem; color: var(--paper-2); }
@media (max-width: 64em) { .notes-title, .notes-list { grid-column: 1 / 13; } }
@media (max-width: 40em) { .notes-list { grid-template-columns: 1fr; } }

/* ---------- route: the map sheet ---------- */
.route { position: relative; overflow: clip; padding: clamp(5rem, 9vw, 9rem) var(--margin); display: grid; justify-items: end; }
.route-ground { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet { position: relative; width: min(42rem, 100%); margin-right: 8%; background: var(--paper); color: var(--ink); padding: 4rem clamp(1.5rem, 4vw, 4rem); text-align: center; }
.sheet::before, .sheet::after { content: ""; position: absolute; left: 0; right: 0; height: 12px; background-repeat: repeat-x; background-position: center; }
.sheet::before { top: -12px; background-image: var(--scallop-top); }
.sheet::after { bottom: -12px; background-image: var(--scallop-bot); }
.sheet-title { font-family: var(--font-display); font-size: var(--step-sub); line-height: 1.08; color: var(--burg); }
.sheet-note { margin: 0.8rem auto 0; max-width: 34ch; font-size: var(--step-body); color: var(--soft); }
.group { margin-top: 3.5rem; }
.group h3 { font-family: var(--font-display); font-size: var(--step-lead); color: var(--burg); margin-bottom: 1.2rem; }
.items { max-width: 28rem; margin: 0 auto; text-align: left; display: grid; gap: 1rem; }
.items li { display: grid; grid-template-columns: 3rem 1fr auto; column-gap: 0.75rem; align-items: baseline; font-size: var(--step-body); font-variant-numeric: tabular-nums; }
.items .n { font-family: var(--font-display); font-weight: 700; color: var(--soft); }
.items .what small { display: block; font-size: var(--step-body); color: var(--soft); font-style: italic; }
.items .kind { font-size: var(--step-body); color: var(--soft); }
.items .stamp .n, .items .stamp .kind { color: var(--burg); }
.items .stamp .kind { font-weight: 600; }
.items .stamp .n { color: #9a7428; }
.finish { display: flex; gap: 1rem; align-items: center; justify-content: center; max-width: 28rem; margin: 0 auto; text-align: left; font-size: var(--step-body); }
.finish strong { display: block; font-family: var(--font-display); font-weight: 700; color: var(--burg); }
.cane { flex: none; width: 34px; height: 68px; color: #b3262f; }
.sheet-hours { margin-top: 3.5rem; font-size: var(--step-body); color: var(--soft); }

/* ---------- gallery: tiles with tags ---------- */
.gallery { padding-block: var(--section) calc(var(--section) * 0.7); }
.gallery-title { font-family: var(--font-display); font-size: var(--step-sub); color: var(--gold); margin-bottom: 2.5rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 12px; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 700ms var(--ease-out); }
.tile { overflow: clip; }
.tag { position: relative; min-height: 88px; padding: 12px; font-size: var(--step-small); line-height: 1.35; font-variant-numeric: tabular-nums; }
.tag p:first-child { display: flex; justify-content: space-between; }
.tag p:last-child { margin-top: 0.4rem; font-family: var(--font-display); font-size: var(--step-lead); font-weight: 700; }
.t1 .tag { background: var(--paper); color: var(--burg-d); }
.t2 .tag { background: var(--burg); color: var(--paper); }
.t3 .tag { background: var(--gold); color: var(--night); }
.t4 .tag { background: var(--burg-d); color: var(--gold); }
@media (hover: hover) { .tile:hover img { transform: scale(1.04); } }

/* ---------- questions ---------- */
.faq { padding-block: var(--section); background: var(--paper); color: var(--ink); }
.faq-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: start; }
.faq-side { grid-column: 1 / 5; position: sticky; top: 2rem; }
.faq .head { color: var(--burg); }
.faq-side p { margin-top: 1.2rem; max-width: 24ch; }
.qa { grid-column: 6 / 13; display: grid; gap: 0.5rem; }
.qa details { background: var(--paper-2); padding: 0.5rem 1.5rem; }
.qa details[open] { padding-bottom: 1.4rem; }
.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: var(--step-lead); font-weight: 600; color: var(--burg-d); min-height: 56px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform var(--t-hover) var(--ease-out); }
.qa details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.qa details p { margin-top: 0.4rem; color: var(--soft); max-width: 52ch; }
@media (hover: hover) { .qa summary:hover { color: var(--burg); } }
@media (max-width: 64em) { .faq-side { grid-column: 1 / 13; position: static; margin-bottom: 2.5rem; } .qa { grid-column: 1 / 13; } }
@media (max-width: 40em) { .qa details { padding: 0.4rem 1rem; } }

/* ---------- footer: the back cover ---------- */
.back { background: var(--burg); padding: 5rem var(--margin) 2rem; }
.back-panel { position: relative; max-width: 72rem; margin: 0 auto; background: var(--paper); color: var(--ink); padding: 4rem clamp(1.5rem, 4vw, 4rem) 1.5rem; display: grid; grid-template-columns: 1fr 1fr; column-gap: 4rem; row-gap: 3rem; }
.back-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; background: var(--scallop-top) repeat-x center; }
.back-msg h2 { font-family: var(--font-display); font-size: var(--step-sub); color: var(--burg); }
.back-msg p { margin-top: 0.9rem; font-size: var(--step-body); max-width: 40ch; }
.back-msg .joke { color: var(--soft); font-style: italic; }
.back-addr { position: relative; padding-right: 7rem; }
.back-addr ul { display: grid; gap: 12px; font-size: var(--step-body); }
.back-stamp { position: absolute; right: 0; top: 0; width: 88px; aspect-ratio: 3 / 4; object-fit: cover; outline: 6px solid var(--paper); outline-offset: -6px; transform: rotate(4deg); transition: transform 500ms var(--ease-out); }
@media (hover: hover) { .back-stamp:hover { transform: rotate(-3deg) scale(1.06); } }
.imprint { grid-column: 1 / -1; text-align: center; font-size: var(--step-small); color: var(--soft); }

/* ---------- film dialog ---------- */
.film { width: min(1100px, 94vw); padding: 0; border: 0; background: var(--night); }
.film::backdrop { background: rgba(14, 4, 6, 0.86); }
.film video { width: 100%; aspect-ratio: 16 / 9; }
.film-close { position: absolute; top: 10px; right: 10px; }

/* ---------- motion (content stays visible without JavaScript) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(60px); animation: rise 1100ms var(--ease-out) 200ms forwards; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .shutter[data-reveal] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1100ms var(--ease-in-out); transition-delay: calc(var(--i, 0) * 120ms); }
  .js .shutter[data-reveal] img { transform: scale(1.12); transition: transform 1500ms var(--ease-soft); }
  .js .shutter[data-reveal].is-in { clip-path: inset(0); }
  .js .shutter[data-reveal].is-in img { transform: none; }
  .route-ground { animation: drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: scale(1.14) translateY(-3%); } to { transform: scale(1.02) translateY(3%); } }

/* ---------- tablet ---------- */
@media (max-width: 64em) {
  .cover { width: min(40rem, 76vw); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-row { flex-wrap: wrap; display: grid; grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .sheet { margin-right: 0; justify-self: center; }
  .route { justify-items: center; }
}

/* ---------- phone ---------- */
@media (max-width: 40em) {
  .top { grid-template-columns: auto 1fr; padding: 14px var(--margin); }
  .top-links { display: none; }
  .mono, .mono svg { width: 44px; height: 44px; }
  .hero { min-height: 92svh; }
  .cover { padding-bottom: 3rem; }
  .display { font-size: 12.5vw; }
  .display .l1, .display .l2 { transform: none; }
  .cover-when { display: grid; gap: 0.15rem; }
  .cover-when .diamond { display: none; }
  .intro-top .head, .intro-note { grid-column: 1 / 13; }
  .intro-note { margin-top: 1.2rem; }
  .facts { margin-top: 3.5rem; }
  .intro-film img { aspect-ratio: 4 / 3; }
  .facts-row { column-gap: 1rem; }
  .facts-row dt { white-space: normal; }
  .route { padding: 4rem 10px; }
  .sheet { padding: 3rem 1.25rem; }
  .items li { grid-template-columns: 2.6rem 1fr auto; font-size: var(--step-body); }
  .tiles { gap: 20px 8px; }
  .tag { min-height: 0; padding: 10px; font-size: var(--step-small); }
  .tag p:first-child span:last-child { display: none; }
  .tag p:last-child { font-size: var(--step-body); }
  .back { padding: 4rem 0 0; }
  .back-panel { grid-template-columns: 1fr; padding: 3rem 1.25rem 1.5rem; }
  .back-addr { padding-right: 5rem; }
  .back-stamp { width: 64px; }
  .imprint { padding-bottom: 0.5rem; }
}
