/* Advent calendar 2026 — static styles.
   Palette and type come from the imported book artwork: warm ivory paper,
   burgundy ink, gold rules. No webfont requests. Animations live in motion.css. */

:root {
  color-scheme: light;
  --wine: #730e23;
  --deep-wine: #530719;
  --ink: #32231d;
  --muted: #665044;
  --gold: #9b601a;
  --gold-bright: #c6921f;
  --line: #dfc59a;
  --paper: #fffdf8;
  --ivory: #faf6ef;
  --tile: #fcf5e7;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at top, #fffcf6, #f4ebe0 82%);
  min-height: 100svh;
}
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--wine); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #96600f;
  outline-offset: 4px;
}
/* Visually hidden text that screen readers still announce. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
button { font: inherit; }
.shell {
  width: min(100%, 36rem);
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) max(1.3rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

/* Masthead: one compact row with the index and language controls grouped. */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 56px;
  padding: .35rem 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 44px;
  font: 700 clamp(.94rem, 4.4vw, 1.12rem) var(--serif);
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-name { color: var(--wine); }
.star {
  color: var(--gold);
  font-size: .78em;
  line-height: 1;
  transform: translateY(-.12em);
}
.top-link {
  display: inline-grid;
  place-items: center;
  margin-inline-start: auto;
  min-height: 44px;
  padding: .3rem .5rem;
  border-radius: 7px;
  background: var(--tile);
  border: 1px solid var(--line);
  font-weight: 650;
  font-size: clamp(.8rem, 3.4vw, .92rem);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.top-link:active { background: #f6ead6; }
.language-control {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: .24rem;
  min-width: 3.5rem;
  min-height: 44px;
  padding: .3rem .2rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .025em;
}
.language-control::after {
  content: "";
  width: .36rem;
  height: .36rem;
  margin-top: -.18rem;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.language-control:hover { background: var(--tile); color: var(--wine); }
.language-control:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.language-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}
main { padding-top: 1.15rem; }

/* Cover view */
.cover-view { text-align: center; }
.book-stage {
  margin: 0 auto;
  width: min(100%, 350px, 63svh);
}
/* The whole cover image is the opening target. */
.cover-opening {
  display: block;
  width: 100%;
  border-radius: 4px;
  text-decoration: none;
  touch-action: manipulation;
}
.cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
  /* Fore-edge and spine read as a physical volume: dark block on the left,
     paper edge on the right, one soft cast shadow underneath. */
  border-left: 5px solid #4a0b18;
  box-shadow:
    inset 6px 0 10px #2c050f3d,
    inset -3px 0 0 #fffdf859,
    0 14px 30px #45210e2e;
}
.cover-actions {
  display: grid;
  justify-items: center;
  gap: .45rem;
  margin: 1.25rem auto 0;
}
/* The cover action reads uppercase in every date and history state. */
.cover-actions .primary { text-transform: uppercase; }

/* Primary action: bookmark-shaped, gold-ruled, large touch target. */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  min-width: 15rem;
  padding: .8rem 1.6rem;
  border-radius: 9px;
  border: 1px solid #c8912f;
  background: linear-gradient(#8a1329, var(--wine) 58%, var(--deep-wine));
  box-shadow: 0 6px 16px #45210e33, inset 0 1px 0 #ffffff40;
  color: #fff9ef;
  text-decoration: none;
  font: 700 1.06rem var(--serif);
  letter-spacing: .012em;
  white-space: nowrap;
  touch-action: manipulation;
}
.primary:hover { background: var(--deep-wine); }
.primary:active { transform: translateY(1px); box-shadow: 0 3px 9px #45210e2e; }
.cover-caption {
  margin: 0;
  font-size: .9rem;
  line-height: 1.35;
  color: var(--muted);
  text-wrap: balance;
}
.cover-view[data-locked] .cover-caption { color: var(--wine); font-weight: 650; }
.cover-lock,
.lock-emblem {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 2px solid #e5c17a;
  background: var(--wine);
  color: #fff0c7;
  box-shadow: 0 0 0 2px var(--wine), 0 5px 14px #45210e40;
}
.cover-lock {
  position: absolute;
  z-index: 1;
  inset-block-end: 13%;
  inset-inline-end: -.2rem;
  pointer-events: none;
}
.padlock {
  position: relative;
  width: 1.17rem;
  height: .86rem;
  margin-top: .43rem;
  border-radius: .19rem;
  background: currentColor;
}
.padlock::before {
  content: "";
  position: absolute;
  width: .73rem;
  height: .73rem;
  top: -.54rem;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid currentColor;
  border-radius: .55rem .55rem 0 0;
}
.padlock::after {
  content: "";
  position: absolute;
  inset: .23rem auto auto calc(50% - .075rem);
  width: .15rem;
  height: .36rem;
  border-radius: .1rem;
  background: var(--wine);
}

/* Page card */
.page {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 24px #45210e10;
  overflow: hidden;
  padding: clamp(1rem, 5vw, 1.75rem) clamp(.85rem, 5vw, 1.75rem) 0;
  text-align: center;
}
.kicker {
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .875rem;
  font-weight: 750;
}
h1, h2 { font-family: var(--serif); color: var(--wine); text-wrap: balance; }
h1 { margin: .3rem 0 .6rem; font-size: clamp(1.95rem, 8vw, 2.75rem); line-height: 1.1; }
.day-heading:focus { outline: none; }
.day-heading span { display: block; }
.day-heading small { display: block; margin-top: .3rem; color: var(--muted); font: .95rem system-ui, sans-serif; }

/* Scratch card */
.scratch {
  position: relative;
  isolation: isolate;
  margin: 1.05rem auto .55rem;
  width: min(100%, 25rem);
  min-height: 207px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d4a769;
  border-radius: 12px;
  overflow: hidden;
}
.revelation { width: 100%; padding: .55rem .6rem; }
.revelation img { display: block; width: 61px; height: 61px; object-fit: contain; margin: 0 auto .15rem; }
.revelation h2 { margin: .16rem 0 .2rem; font-size: clamp(1.23rem, 5.4vw, 1.6rem); line-height: 1.15; }
.revelation .verse-reference {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  column-gap: .3rem;
  max-width: 100%;
  min-height: 48px;
  padding: .25rem .6rem;
  border: 0;
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.23rem;
  font-weight: 750;
  text-align: center;
}
.revelation .verse-reference-label {
  min-width: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
}

dialog {
  width: min(calc(100% - 2rem), 26rem);
  max-height: min(80svh, 38rem);
  overflow-y: auto;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 16px 45px #45210e44;
}
dialog::backdrop { background: #32121580; }
dialog h2 { margin: 0 0 .55rem; }
dialog blockquote { margin: .75rem 0; font: 1.3rem/1.45 var(--serif); }
dialog .primary { border: 0; cursor: pointer; margin: .35rem auto 0; }
.advent-lock {
  padding: 1.45rem clamp(1rem, 5vw, 1.6rem) .7rem;
}
.lock-emblem {
  width: 2.7rem;
  height: 2.7rem;
  margin: 0 auto .95rem;
  box-shadow: 0 0 0 2px var(--wine);
}
.advent-lock h2 { color: var(--wine); text-wrap: balance; }
#advent-lock-date { margin: 0 0 .9rem; color: var(--muted); text-wrap: balance; }
.launch-actions {
  display: grid;
  gap: .44rem;
  margin: 1.15rem auto .28rem;
  max-width: 19rem;
}
.launch-actions .primary {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: .6rem .75rem;
  white-space: normal;
}
#launch-reminder-hint {
  margin: 0 0 .5rem;
  color: var(--muted);
  font-size: .81rem;
  text-wrap: balance;
}
.launch-visit {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--tile);
  color: var(--wine);
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}
.launch-visit:hover { background: #f7eeda; }
.reading-with-gift .primary {
  min-width: 5rem;
  min-height: 44px;
  padding: .45rem .9rem;
  font-size: .95rem;
}
.gift-trigger {
  display: grid;
  justify-items: center;
  gap: .45rem;
  width: fit-content;
  max-width: 100%;
  margin: .45rem auto .7rem;
  padding: .4rem .8rem .65rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--wine);
  font: 700 1.05rem var(--serif);
  cursor: pointer;
}
.gift-trigger:hover { background: var(--tile); }
.gift-box {
  position: relative;
  width: 4.5rem;
  height: 4.15rem;
}
.gift-box-base, .gift-box-lid {
  position: absolute;
  border: 1px solid #650e24;
  background: linear-gradient(90deg, transparent 42%, #e6b963 42% 58%, transparent 58%),
    linear-gradient(135deg, #b1304c, var(--wine));
  box-shadow: inset 0 1px #fbdfab50, 0 4px 9px #49211735;
}
.gift-box-base {
  inset: 2.15rem .66rem .22rem;
  border-radius: 2px 2px 6px 6px;
}
.gift-box-lid {
  inset: 1.57rem .39rem auto;
  height: .84rem;
  border-radius: 4px;
  transform-origin: 16% 80%;
}
.gift-box-lid::before, .gift-box-lid::after {
  content: "";
  position: absolute;
  bottom: 100%;
  width: 1.05rem;
  height: .63rem;
  border: 3px solid #c18a34;
  border-radius: 60% 60% 12% 60%;
}
.gift-box-lid::before { right: 50%; transform: rotate(20deg); }
.gift-box-lid::after { left: 50%; transform: scaleX(-1) rotate(20deg); }
.gift-box-star { position: absolute; color: var(--gold); line-height: 1; }
.gift-box-star-left { top: .52rem; left: .05rem; }
.gift-box-star-right { top: .14rem; right: .1rem; font-size: .86rem; }

.gift-film,
.easter-film {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #140e0c;
  color: var(--paper);
}
.gift-film[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.gift-film video { display: block; width: 100%; height: 100%; object-fit: contain; }
.gift-film-close {
  position: absolute;
  inset: max(.65rem, env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right)) auto auto;
}
.gift-film-button {
  min-height: 44px;
  padding: .4rem .85rem;
  border: 1px solid #e2c28790;
  border-radius: 7px;
  background: #2c1c16ed;
  color: #fff4dc;
  cursor: pointer;
}
.gift-film-button:hover { background: #452a21; }
.easter-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: #140e0c;
}
.easter-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.easter-toolbar {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: max(.5rem, env(safe-area-inset-top)) max(.6rem, env(safe-area-inset-right)) .5rem max(.6rem, env(safe-area-inset-left));
  border-bottom: 1px solid #e2c28752;
}
.easter-toolbar a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.gift-film-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .75rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  border-top: 1px solid #e2c28752;
  background: #291912;
}
.gift-film-actions p { flex-basis: 100%; margin: 0; }
.gift-film-actions .primary {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: .5rem .9rem;
}
.revelation p { margin: 0; color: var(--muted); font-size: .875rem; }
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
/* Keyboard users scratch the foil with the arrow keys, so the covered card keeps
   a focus ring that stays inside its rounded bounds. */
#foil:focus-visible {
  outline: 3px solid #96600f;
  outline-offset: -6px;
}
.hint { margin: .6rem 0 0; min-height: 1.5em; color: var(--muted); font-size: .95rem; }
.scene { display: block; width: min(100%, 29rem); margin: .65rem auto 0; height: auto; }
.day-nav { display: grid; grid-template-columns: 1fr .75fr 1fr; gap: .4rem; margin: .85rem 0 .2rem; }
.day-nav a {
  display: grid;
  place-items: center;
  min-height: 49px;
  padding: .32rem .2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  font-weight: 680;
  font-size: .92rem;
}
.day-nav a[aria-disabled="true"] { color: var(--muted); opacity: .74; }
.day-nav a.next:not([aria-disabled="true"]) { background: var(--wine); color: white; border-color: var(--wine); }
.progress { text-align: center; color: var(--muted); font-size: .925rem; margin: .85rem 0; }

/* Index view */
.index { padding-bottom: .7rem; }
.index .progress { margin: .8rem 0 1.15rem; }
.index h2 { font-size: 1.22rem; margin: .95rem 0 .56rem; }
.days { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(4px, 1.3vw, 8px); }

.day-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 7px;
  font: 700 1.17rem var(--serif);
  text-decoration: none;
}
.day-cell[data-status="locked"] {
  color: #6f5748;
  background: repeating-linear-gradient(135deg, #efe7db 0 4px, #e7ded1 4px 8px);
  border: 1px dashed #cbb696;
  cursor: pointer;
}
.day-lock {
  position: absolute;
  right: 3px;
  top: 2px;
  color: #a89275;
  font: 650 .62rem system-ui, sans-serif;
  line-height: 1;
}
.day-cell[data-status="available"] {
  color: var(--wine);
  background: var(--tile);
  border: 1px solid var(--line);
}
.day-cell[data-status="available"]:hover { background: #f7eeda; }
.day-cell[data-status="today"] {
  color: #fff9ef;
  background: var(--wine);
  border: 1px solid var(--gold-bright);
  box-shadow: inset 0 0 0 1px #ffffff2e;
}
.day-cell[data-status="revealed"] {
  color: var(--deep-wine);
  background: #f7e6e8;
  border: 1px solid #b67c83;
}
.day-cell[aria-current="date"] { outline: 2px solid var(--wine); outline-offset: 1px; }
.day-cell[aria-current="date"]:focus-visible { outline: 3px solid #96600f; }
.mark { position: absolute; right: 3px; top: 1px; font: 650 .7rem system-ui, sans-serif; }
.index .scene { margin: 1.15rem auto 0; }

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .3rem .55rem;
  margin: 1.15rem 0 .2rem;
}
.social-links {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .25rem .6rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.social-links a:hover { background: var(--tile); color: var(--wine); }
.share-trigger,
.share-close {
  min-height: 44px;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--tile);
  color: var(--wine);
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
}
.share-trigger:hover,
.share-close:hover { background: #f7eeda; }
.share-url {
  width: 100%;
  min-height: 44px;
  padding: .5rem .4rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--ivory);
  color: var(--ink);
  font: .875rem system-ui, sans-serif;
  text-align: center;
}
.share-status {
  min-height: 1.25em;
  margin: .4rem 0 .55rem;
  color: var(--muted);
  font-size: .85rem;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
}
.share-actions .primary {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: .45rem .85rem;
}
.rights-trigger {
  min-height: 44px;
  padding: .55rem .6rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
  font-size: .82rem;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}
.rights-trigger:hover { color: var(--wine); }
.rights-copy { margin: .75rem 0 1rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.rights-copy p { margin: .7rem 0; }
.rights-copy a { overflow-wrap: anywhere; }

@media (max-width: 355px) {
  .days { grid-template-columns: repeat(4, 1fr); }
  .day-nav a { font-size: .84rem; }
  .primary { min-width: 12rem; font-size: 1rem; }
  .masthead { gap: .32rem; }
  .brand { gap: .34rem; }
  .top-link { padding: .3rem .4rem; text-align: center; white-space: normal; }
}
