/* kh-advent · KAINDLHÖNIG design tokens */
@font-face { font-family: "Montserrat"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: italic; font-display: swap; src: url("/assets/fonts/lato-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/lato-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy: #0e2449;
  --gold: #b0a05c;
  --gold-ink: #736528;
  --green: #8fbd05;
  --paper: #f6f3ee;
  --line: #e6ddd2;
  --text: #121a2c;
  --text-dim: #4a5870;
  --card-bg: #faf7f1;
  --card-ink: #3b3631;
  --radius: 18px;
  --head: "Montserrat", system-ui, sans-serif;
  --body: "Lato", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-ink); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; color: var(--navy); line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Hero */
.hero {
  position: relative;
  min-height: 52vh;
  display: flex; align-items: flex-end;
  background: linear-gradient(180deg, var(--navy) 0%, #1b2f53 60%, #2c3e60 100%);
  background-size: cover; background-position: center;
  color: #fff;
  padding: 4rem 1.25rem 3rem;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -64px; height: 64px; background: linear-gradient(180deg, #2c3e60, var(--paper)); pointer-events: none; }
.hero + main { padding-top: 40px; }
.hero.has-cover { background-image: linear-gradient(180deg, rgba(14,36,73,.15) 30%, rgba(14,36,73,.75) 100%), var(--cover); }
.hero-inner { max-width: 760px; margin: 0 auto; width: 100%; text-align: center; }
.hero-title { color: #fff; font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 600; letter-spacing: .01em; margin-bottom: 1rem; }
.hero-sub { color: #fff; font-size: clamp(1.05rem, 3.6vw, 1.3rem); letter-spacing: .04em; margin: 0; }
.hero-sub::before { content: ""; display: block; width: 56px; height: 1px; background: var(--gold); margin: 0 auto 1rem; }

/* Sections */
.section { max-width: 760px; margin: 0 auto; padding: 3rem 1.25rem; }
.section + .section { border-top: 1px solid var(--line); }
.welcome p { font-size: 1.125rem; }
.signature { font-family: var(--body); font-style: italic; color: var(--gold-ink); font-size: 1.2rem; }

/* Registration */
.register { border-top: 0 !important; padding-top: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--radius); padding: 1.75rem 1.25rem; }
#register-form { display: grid; gap: .75rem; margin: 1.25rem 0 1rem; }
input[type="email"] {
  font: inherit; width: 100%; min-height: 48px; padding: .7rem 1rem;
  border: 1px solid #b9ae9f; border-radius: 12px; background: #fff; color: var(--text);
}
input[type="email"]:focus { border-color: var(--navy); outline: 2px solid var(--gold); outline-offset: 1px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1.5rem; border-radius: 999px; border: 0; cursor: pointer; font-family: var(--head); font-weight: 600; font-size: 1rem; text-decoration: none; }
.btn-primary { background: var(--green); color: var(--navy); }
.btn-primary:hover { background: #9fcf0a; color: var(--navy); }
.btn-quiet { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.form-error { color: #8a2a1b; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.note { font-size: .9rem; color: var(--text-dim); margin: 0; }

/* Donation */
.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.75rem 0 1.5rem; }
.number { text-align: center; padding: 1.25rem .5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.big { display: block; font-family: var(--head); font-weight: 600; color: var(--navy); font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; }
.label { display: block; color: var(--text-dim); font-size: .95rem; margin-top: .35rem; }
.progress-label { font-family: var(--head); font-weight: 500; color: var(--navy); margin-bottom: .5rem; }
.progress { height: 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width .8s ease; }
.goal-reached { font-family: var(--head); font-weight: 600; color: var(--gold-ink); margin: .75rem 0 0; }
.everyone { color: var(--text-dim); margin: .75rem 0 1.5rem; }
.small { font-size: .875rem; color: var(--text-dim); }

/* Doors */
.doors-section { max-width: 1080px; }
.doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
@media (min-width: 760px) { .doors { grid-template-columns: repeat(6, 1fr); gap: 1rem; } }
.door {
  width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 500; font-size: clamp(1.3rem, 5vw, 1.9rem);
  background: #fff; color: var(--navy); border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(176,160,92,.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.door:hover { transform: translateY(-2px); }
.door.today { background: var(--navy); color: #fff; box-shadow: inset 0 0 0 4px var(--navy), inset 0 0 0 5px var(--gold); }
.door[aria-disabled="true"] { background: #ece7df; color: #6b6f78; border-color: var(--line); box-shadow: none; cursor: default; transform: none; }

/* Projects */
.project-list { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
@media (min-width: 760px) { .project-list { grid-template-columns: 1fr 1fr; } }
.project { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; }
.project-logo { height: 96px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto 1rem; }
.project .country { color: var(--gold-ink); font-family: var(--head); font-weight: 500; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .5rem; }
.project p { flex: 1; }
.project .btn { align-self: flex-start; background: transparent; border: 1px solid var(--navy); color: var(--navy); }
.project .btn:hover { background: var(--navy); color: #fff; }

/* About */
.about-grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 760px) { .about-grid { grid-template-columns: 2fr 3fr; align-items: start; } }
.about-photo { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.about-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.about-logo { width: 200px; opacity: .8; }
.about-link { display: inline-flex; align-items: center; gap: .75rem; }
.qr { width: 88px; height: 88px; background: #fff; padding: 4px; border-radius: 6px; }

/* Footer */
.footer { text-align: center; padding: 2rem 1rem 6rem; color: var(--text-dim); font-size: .95rem; border-top: 1px solid var(--line); }
.footer a { display: inline-block; padding: .6rem .4rem; }
@media (min-width: 760px) { .footer { padding-bottom: 2rem; } }

/* Sticky share (mobile only) */
.sticky-share {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
  min-height: 48px; padding: .7rem 1.3rem; border-radius: 999px; border: 1px solid var(--gold);
  background: var(--navy); color: #fff; font-family: var(--head); font-weight: 500; font-size: .95rem;
  box-shadow: 0 6px 20px rgba(14,36,73,.25); cursor: pointer; z-index: 5;
}
.sticky-share svg { width: 20px; height: 20px; stroke: var(--gold); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 760px) { .sticky-share { display: none; } }

/* Dialogs */
dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; }
dialog::backdrop { background: rgba(14, 36, 73, .82); }
dialog[open] { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } .progress-bar, .door { transition: none; } }

.door-view { width: 100vw; height: 100dvh; margin: 0; }
.door-view .card-frame { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 8px 16px; }
.close {
  position: fixed; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); background: rgba(14,36,73,.4); color: #fff; cursor: pointer; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
}
.close svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; fill: none; }

/* The card: the wrapper has exactly the card's size, so the buttons line up with the printed strip. */
.card {
  position: relative; margin: 0;
  width: min(100%, calc(85vh * 1080 / 1431), calc((100dvh - 72px) * 1080 / 1431));
  aspect-ratio: 1080 / 1431;
  container-type: inline-size;
  border-radius: 10px; overflow: hidden; background: var(--card-bg);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.card img { width: 100%; height: 100%; object-fit: contain; }
.card-btn {
  position: absolute; top: 97.3%; transform: translateY(-50%);
  min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 1cqw; color: var(--card-ink);
  -webkit-tap-highlight-color: transparent;
}
.card-btn svg { width: 4cqw; height: 4cqw; min-width: 14px; min-height: 14px; stroke: currentColor; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* Heart centred at 47 %, share at 53.4 %. Their tap areas meet at 50.2 % and grow outwards. */
.card-like { right: 49.8%; justify-content: flex-end; padding-right: 1.2cqw; }
.card-share { left: 50.2%; justify-content: flex-start; padding-left: 1.2cqw; }
.card-like[aria-pressed="true"] svg { fill: var(--gold); stroke: var(--gold); }
.card-like .count { font-family: var(--body); font-size: max(11px, 2.6cqw); line-height: 1; color: var(--card-ink); }
.card-btn:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: -2px; border-radius: 8px; }
.missing { max-width: 420px; background: var(--paper); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; font-family: var(--head); color: var(--navy); margin: 0; }

.share-sheet { margin: auto auto 0; width: 100%; max-width: 520px; }
@media (min-width: 760px) { .share-sheet { margin: auto; } }
.sheet { background: var(--paper); border-radius: 22px 22px 0 0; padding: 1.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); display: grid; gap: 1rem; }
@media (min-width: 760px) { .sheet { border-radius: 22px; } }
.sheet h2 { font-size: 1.25rem; text-align: center; margin: 0; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.share-grid button {
  display: flex; flex-direction: column; align-items: center; gap: .35rem; min-height: 72px; padding: .6rem .25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--navy); cursor: pointer; font-size: .8rem; line-height: 1.2; text-align: center;
}
.share-grid button:hover { border-color: var(--gold); }
.share-grid svg { width: 24px; height: 24px; stroke: var(--navy); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.share-grid button:hover svg { stroke: var(--gold-ink); }
.share-native { width: 100%; }

/* Share page /tuer/N */
body.tuer { background: var(--paper); }
.tuer-main { max-width: 520px; margin: 0 auto; padding: 2rem 1rem; display: grid; gap: 1.25rem; justify-items: center; text-align: center; }
.tuer-card { border-radius: 10px; box-shadow: 0 8px 30px rgba(14,36,73,.18); width: min(100%, calc(80vh * 1080 / 1431)); }
.eyebrow { font-family: var(--head); font-weight: 500; color: var(--navy); margin: 0; }
.tuer-sub { color: var(--text-dim); margin: 0; }

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem; }
.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal .back { display: inline-block; margin-bottom: 1.5rem; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.loading main, .loading .footer, .loading .sticky-share { visibility: hidden; }
