:root {
  --paper: #f7efe2;
  --ink: #312620;
  --muted: #605449;
  --border: #dfcdb4;
  --white: #fffbf2;
  --velvet: #10231b;
  --champagne: #f4d599;
  --pine: #10291f;
  --pine-deep: #0c1d16;
  --cream: #fff1d9;
  --default-scene: url("/images/app-calendar/christmas-world.jpg");
}

html { scroll-padding-top: 72px; background: var(--pine-deep); }
body, body[data-app-look] {
  min-height: 100svh;
  isolation: isolate;
  color: var(--cream);
  background: var(--pine-deep);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, #0b1b166e 0%, #0c1d164a 48%, #0a180fda 100%),
    linear-gradient(90deg, #0b1a14d9, #0e211955 62%, #1824192b),
    var(--app-scene, var(--default-scene)) center 42% / cover no-repeat;
}
body:not([data-app-look]):has(.pocket-board:is(#preview, #calendar-board)[data-theme="snowy"]) { --app-scene: url("/images/app-calendar/christmas-snowy.jpg"); }
body:not([data-app-look]):has(.pocket-board:is(#preview, #calendar-board)[data-theme="candy"]) { --app-scene: url("/images/app-calendar/christmas-candy.jpg"); }
.header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #10231be8;
  border-color: #e1bd7e3d;
}
.masthead { min-height: 68px; gap: clamp(12px, 2vw, 28px); }
.masthead .brand { gap: 10px; min-width: 0; color: var(--cream); }
.masthead .brand img { border-radius: 11px; box-shadow: 0 0 0 1px #ffd18960; }
.skip:focus { z-index: 10; }
.masthead nav a { color: #f7e8cd; }
.masthead .desktop-nav { margin-inline-start: auto; gap: 4px; }
.masthead .desktop-nav a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 11px; border-radius: 8px; }
.masthead .desktop-nav a:hover, .masthead .mobile-menu a:hover { background: #f8deb61a; text-decoration: none; }
.header-actions { display: flex; align-items: center; flex: none; gap: 8px; }
.header-actions > button, .header-actions .home-languages summary, .mobile-menu summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #e4ba7559;
  border-radius: 9px;
  background: #f6ddb00c;
  color: var(--cream);
}
.header-actions .home-languages summary, .mobile-menu summary { list-style: none; cursor: pointer; }
.header-actions .home-languages summary::-webkit-details-marker, .mobile-menu summary::-webkit-details-marker { display: none; }
.header-actions .home-languages summary::after {
  content: "";
  width: .38rem;
  height: .38rem;
  margin: -.2rem .15rem 0 .14rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  rotate: 45deg;
}
.header-actions .home-languages[open] summary::after { rotate: 225deg; margin-top: .17rem; }
.header-actions .home-languages ul, .masthead .mobile-menu nav { background: #152c23; border-color: #e4ba7580; box-shadow: 0 8px 24px #09140dbd; }
.mobile-menu { display: none; position: relative; padding: 0; margin: 0; background: none; border: 0; }
.menu-lines, .menu-lines::before, .menu-lines::after { display: block; width: 17px; height: 1.5px; border-radius: 2px; background: currentColor; }
.menu-lines { position: relative; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -5px; }
.menu-lines::after { top: 5px; }
.masthead .mobile-menu nav { display: grid; gap: 3px; position: absolute; inset: calc(100% + 6px) 0 auto auto; min-width: 10rem; padding: 6px; border: 1px solid #e4ba7580; border-radius: 10px; }
.masthead .mobile-menu nav a { min-height: 44px; display: flex; align-items: center; padding: 8px 10px; border-radius: 6px; }
.garland { background: radial-gradient(ellipse, #ffe7a7 0 1px, transparent 2px) center / 24px 8px repeat-x, var(--pine); }

#home.hero, #calendar.hero {
  position: relative;
  isolation: isolate;
  color: var(--cream);
  width: 100%;
}
#home.hero {
  min-height: 0;
  padding: clamp(12px, 3vw, 38px) clamp(12px, 3vw, 40px);
  margin-block: clamp(8px, 1.5vw, 20px) clamp(16px, 3vw, 40px);
  background: none;
  box-shadow: none;
}
#home.hero::before,
#calendar.hero::before {
  content: none;
}
#home.hero::after, #calendar.hero::after {
  inset: 0;
  width: auto;
  height: auto;
  opacity: .78;
  border-radius: inherit;
  background:
    radial-gradient(circle, #ffe6a9b0 0 1px, transparent 2px) 10px 12px / 113px 137px,
    radial-gradient(circle, #fff3d277 0 1px, transparent 2px) 22px 34px / 161px 173px;
  mask-image: linear-gradient(90deg, transparent, #000 42%);
  animation: candlelight 4s ease-in-out both;
}
#home.hero .intro {
  min-width: 0;
  position: relative;
  padding: 0;
  box-shadow: none;
  border: 0;
  background: none;
}
#home .home-season { margin-bottom: 12px; color: #f3d18d; }
#home .intro h1 {
  max-width: 22ch;
  color: #fff3de;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.1rem, 3.55vw, 3.55rem);
  line-height: 1.04;
  letter-spacing: -.047em;
  text-wrap: balance;
  margin-bottom: 10px;
}
#home .lead { max-width: 49ch; color: #f1e2c8; margin: 0; }
#main .product-identity { max-width: 90ch; margin: 24px 0; color: #e2d0ae; font-size: .79rem; line-height: 1.55; text-shadow: 0 1px 5px #07130c; }
#home #create {
  padding: clamp(12px, 2vw, 20px);
  border-radius: 19px;
  border: 1px solid #eccb8b57;
  box-shadow: inset 0 1px #ffffff13, 0 12px 30px #050e0940;
  background: #132e23c9;
}
#home #create :is(label, legend, .subtle) { color: #fff0d5; }
#home .themes { gap: 7px; }
#home .themes span { border-color: #e6c08256; background: #f6e4c711; }
#home .themes input:checked + span { color: #382419; background: #f2dcac; border-color: #fae4b7; }
#home #create input[name="name"] { background: #fff9e9; border-color: #e7cfa5; }
#home #create .primary { width: 100%; justify-content: center; }
#home #create .subtle:last-child { margin-bottom: 0; }
#home #preview {
  --pocket-fabric: #784635;
  --pocket-seam: #efc587;
  position: relative;
  width: 100%;
  margin-top: 0;
  padding: clamp(14px, 2.4vw, 25px);
  border: 0;
  background: transparent;
  box-shadow: none;
  animation: board-arrival .65s cubic-bezier(.2,.7,.25,1) both;
}
#home #preview[data-theme="snowy"] { --pocket-fabric: #34585a; --pocket-seam: #bce1e4; }
#home #preview[data-theme="candy"] { --pocket-fabric: #854654; --pocket-seam: #ffd4d1; }
#preview .card-title {
  font: 700 clamp(1.55rem, 2.7vw, 2.55rem)/1.03 Georgia, serif;
  color: #fff3da;
  margin-block: 4px 12px;
}
#preview header, .pocket-toolbar .card-footer, #pocket-countdown, #pocket-feedback { text-shadow: 0 1px 5px #07130c, 0 2px 8px #07130c; }
#home #preview .door { min-height: 49px; aspect-ratio: 1.28; }

#calendar.hero {
  grid-template-columns: minmax(0, 1fr) minmax(285px, 355px);
  align-items: start;
  padding: clamp(18px, 3vw, 37px);
  margin-block: 24px 34px;
  background: none;
  box-shadow: none;
}
#calendar.hero::after { mask-image: linear-gradient(180deg, #000, transparent 65%); }
#calendar .calendar-main { padding-top: 0; min-width: 0; }
#calendar .calendar-heading {
  color: var(--cream);
  padding: 17px 18px 16px;
  margin: 0 0 14px;
  border-radius: 17px;
  border-bottom: 1px solid #fbe0a750;
  background: #10251b60;
  text-shadow: 0 2px 8px #06130c;
}
#calendar .calendar-heading h1 { color: inherit; margin-bottom: 6px; }
#calendar .calendar-heading .lead { color: #f3d79a; }
#calendar .calendar-mine {
  position: static;
  display: block;
  color: #fff0d5;
  padding: 7px 0 0;
  min-height: 35px;
}
#calendar #calendar-board {
  --pocket-fabric: #754532;
  --pocket-seam: #f4ce91;
  padding: clamp(10px, 1.9vw, 24px);
  background: transparent;
  border: 0;
  box-shadow: none;
}
#calendar #calendar-board[data-theme="snowy"] { --pocket-fabric: #345e62; --pocket-seam: #b6d8df; }
#calendar #calendar-board[data-theme="candy"] { --pocket-fabric: #873f4d; --pocket-seam: #ffcabd; }
#calendar #calendar-board.golden { --pocket-fabric: #8b6033; --pocket-seam: #ffdb91; }
#calendar .calendar-sidebar { margin: 0; align-self: start; }
#calendar .calendar-sidebar #calendar-actions { margin-top: 10px; }
#calendar .calendar-sidebar #calendar-actions:first-child,
#calendar .calendar-sidebar #note-entry[hidden] + #calendar-actions { margin-top: 0; }
#calendar .calendar-how { color: var(--cream); }

.pocket-board .doors { gap: clamp(6px, 1vw, 12px); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pocket-board .door:nth-of-type(4n + 2) { --pocket-palette: #3c6160; }
.pocket-board .door:nth-of-type(4n + 3) { --pocket-palette: #855831; }
.pocket-board .door:nth-of-type(4n + 4) { --pocket-palette: #774652; }
.pocket-board .pocket-art::before { background: #111c18; border-radius: 8px 8px 12px 12px; }
.pocket-board .pocket-art::after {
  inset: 37% 0 0;
  border-radius: 6px 6px 13px 13px;
  border-color: color-mix(in srgb, var(--pocket-seam) 72%, #49331b);
  background: repeating-linear-gradient(130deg, #ffffff0d 0 1px, transparent 1px 4px),
    linear-gradient(#ffffff18, #170c0d5e), var(--pocket-palette, var(--pocket-fabric));
}
.pocket-board .door[data-filled="true"] .pocket-art::after { box-shadow: 0 2px 4px #0a100b8f, inset 0 -4px 9px #e7b96e22; }
.pocket-board .pocket-gift, #calendar-board[data-app-wrap] .door .pocket-gift {
  top: 0;
  width: 72%;
  height: 66%;
  padding: 7% 0 0;
  color: #fff4da;
  border: 0;
  border-radius: 0;
  background: url("/images/app-calendar/featured-present.png") top center / contain no-repeat;
  box-shadow: none;
  text-shadow: 0 1px 2px #17100c;
  rotate: -8deg;
  filter: drop-shadow(0 2px 3px #100904bd);
}
.pocket-board .door[data-wrap="gold"] .pocket-gift { filter: sepia(.72) saturate(1.3); }
.pocket-board .door[data-wrap="frost"] .pocket-gift { filter: hue-rotate(170deg) saturate(.7); }
.pocket-board .door[data-wrap="aurora"] .pocket-gift { filter: hue-rotate(255deg) saturate(.7); }
.pocket-board .door[data-viewed="true"] .pocket-art::after { box-shadow: inset 0 -3px 10px #ffda9361; }
.pocket-board .door[aria-disabled="true"] { cursor: default; }
.pocket-board .door[aria-disabled="true"]:hover { filter: none; transform: none; box-shadow: none; }
.pocket-board .door[aria-expanded="true"] { z-index: 1; outline: 2px solid #f9d380; outline-offset: 3px; }
.pocket-board .door[aria-expanded="true"] .pocket-gift { animation: pocket-lift .46s ease-out both; }
.pocket-letter {
  grid-column: 1 / -1;
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid #d9b684;
  border-radius: 15px;
  background: linear-gradient(150deg, #fffaed, #f6e7cb);
  color: #432b24;
  box-shadow: 0 12px 25px #0b160e70;
  animation: pocket-letter-in .33s ease-out both;
}
.pocket-letter-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pocket-letter-head h3 { margin: 0; font-family: Georgia, serif; text-align: start; }
.pocket-letter-close { min-width: 44px; margin: 0; padding: 5px; }
.pocket-letter-content { margin-top: 8px; overflow-wrap: anywhere; }
.pocket-letter-content .opened-note { margin-block: 0 8px; }
.pocket-letter-content .note { animation: none; }
#preview .pocket-letter-head { color: #432b24; text-shadow: none; }
.pocket-board .door:focus-visible, #calendar-board .door[aria-current="true"] { outline: 2px solid #ffe3a1; }
#calendar-board .door.today-door { animation: pocket-ready 2.2s ease-in-out 2; }
.pocket-toolbar .card-footer, #pocket-countdown { color: #f9e2b4; }
.pocket-sound { background: #142b22; color: #fff1d0; border-color: #edc88385; }
.pocket-sound[aria-pressed="true"] { background: #f1d69b; color: #32291c; }
.pocket-toolbar { flex-wrap: wrap; }
.calendar-background-music button { min-height: 44px; }

.primary, .hero .primary, .information .primary {
  color: #fff8e9;
  border-color: #be815f;
  background: linear-gradient(145deg, #ab5548, #853832);
  box-shadow: inset 0 1px #ffffff2b, 0 3px 0 #5027204d;
}
.primary:hover:not(:disabled) { filter: brightness(1.1); }
.secondary, .hero .secondary { color: #473327; background: #fff8e9; border-color: #d8ba93; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid #ad6836; outline-offset: 3px; }
#home :is(button, a, input, summary):focus-visible,
#calendar-board :is(button, a):focus-visible,
.header :is(button, a, summary):focus-visible { outline-color: #ffe0a2; }

#main > .information {
  --muted: #e3d5bc;
  color: #fff1d9;
  padding: clamp(19px, 3.8vw, 43px);
  margin-block: clamp(15px, 3vw, 32px);
  border: 1px solid #d9b8784a;
  border-radius: clamp(17px, 2.4vw, 26px);
  background: linear-gradient(145deg, #10281feb, #13261cde);
  box-shadow: 0 8px 24px #050d09a8;
}
#main > .information :is(h2, h3, .season), .document :is(h1, h2, h3) { color: #ffe0a7; }
#main > .information a:not(.primary), .document a:not(.primary) { color: #ffe0a7; text-underline-offset: .2em; }
#main > .information > h2 { max-width: 29ch; text-wrap: balance; }
#main > .information p { max-width: 78ch; }
#main > :is(#calendar-audience, #fill-before-december) > section {
  padding-block: 15px;
  border-top: 1px solid #d8bf9b44;
}
#main > :is(#calendar-audience, #fill-before-december) > section:last-child { padding-bottom: 0; }
#main > :is(#calendar-audience, #fill-before-december) > section p:last-child { margin-bottom: 0; }
.steps article, .guide header, .closing aside, .idea-grid li, #discussion .comment-list li { background: #ffedc90e; border-color: #dfc5a055; }
.idea-grid li::marker { color: #ffd893; }
.steps img { box-shadow: 0 6px 16px #422e2230; }
#faq details, #community { color: var(--cream); background: #12281fe8; border-color: #d9c2a05c; }
#faq details[open] { background: #2c3c2a; }
#faq summary::after { color: #f6d59d; }
#faq details[open] > p { animation: answer-appear .3s ease-out both; }
.document {
  --muted: #e3d5bc;
  color: var(--cream);
  background: linear-gradient(145deg, #10281ff2, #13261cee);
  border-color: #dec3977a;
}
.document .guide-jump, .document blockquote { color: var(--cream); background: #ffedc913; }
#modal, .note-entry, .owner-panel {
  color: #432b24;
  background: linear-gradient(150deg, #fffaf1, #f5e7cc);
  border-color: #dabb8a;
}
#modal::backdrop { background: #101e17bc; }
#modal .modal-head h2 { color: #633d29; }
#modal .modal-head { border-color: #e3cba6; }
.owner-today, .owner-code, .note-entry .door-caption { color: #403824; background: #ede6d0; border-color: #d9c595; }
.owner-today :is(h2,h3), .owner-code :is(h2,h3) { color: #503726; }
.note-entry .idea-chip, .guide-jump { color: #513a23; background: #f1e4c9; border-color: #dac099; }
.opened-note { border-color: #dec092; background-color: #fff7e6; }
.gift-reveal[data-wrap="classic"] {
  --scene-edge: #0d1d17;
  --scene-middle: #25370f;
  --scene-glow: #785439;
  --spark: #ffe0a0;
  --glow-edge: #e2a65b75;
  --foil-light: #f3bc97;
  --foil-mid: #bc6b59;
  --foil-dark: #703e35;
  --foil-line: #f3bc89;
}
.footer { color: #e9d6b2; border-color: #e5be7d65; text-shadow: 0 1px 5px #08140d; }
.tabbar { background: #12281f; border-color: #dbb5756e; }
.tabbar > * { color: #f8ead4; }

@keyframes candlelight { 0%, 100% { opacity: .72; } 55% { opacity: .38; } }
@keyframes board-arrival { from { opacity: .65; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pocket-ready { 50% { box-shadow: 0 0 17px #ffd790c2; } }
@keyframes answer-appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pocket-lift {
  0% { translate: -50% 0; rotate: -8deg; }
  55% { translate: -50% -26%; rotate: 3deg; }
  100% { translate: -50% -14%; rotate: 0deg; }
}
@keyframes pocket-letter-in { from { transform: translateY(-7px) scaleY(.98); } to { transform: none; } }

@supports (animation-timeline: scroll()) {
  body::after {
    content: "";
    position: fixed;
    z-index: 8;
    pointer-events: none;
    inset: 0 0 auto;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, #c58e49, #f8d991, #d39b56);
    animation: festive-scroll-progress linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes festive-scroll-progress { to { transform: scaleX(1); } }
}

@media (min-width: 820px) {
  #home.hero {
    grid-template-columns: minmax(0, 1.19fr) minmax(0, 1fr);
    column-gap: clamp(20px, 5vw, 70px);
    row-gap: 16px;
    align-items: start;
  }
  #home.hero #preview { grid-area: 1 / 1 / span 2; align-self: start; margin: 0; padding: 0; }
  #home.hero .intro { grid-area: 1 / 2; }
  #home.hero #create { grid-area: 2 / 2; margin: 0; }
  #calendar .calendar-heading { display: grid; align-items: start; column-gap: 12px; grid-template-columns: minmax(0, 1fr) auto; }
  #calendar .calendar-heading h1 { grid-column: 1; }
  #calendar .calendar-heading .lead { grid-column: 1; grid-row: 2; }
  #calendar .calendar-mine { grid-column: 2; grid-row: 1 / span 2; }
}

@media (min-width: 820px) and (max-width: 1010px) {
  .calendar-main .pocket-board .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 819px) {
  html { scroll-padding-top: 64px; scroll-padding-bottom: 76px; }
  .masthead { min-height: 60px; gap: 8px; }
  .masthead .brand img { width: 34px; height: 34px; }
  .header-actions { gap: 5px; }
  .header-actions > button { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu summary { justify-content: center; width: 44px; min-height: 44px; }
  .header-actions .home-languages summary { min-height: 44px; padding-inline: 7px; }
  #home.hero { gap: 13px; }
  #home.hero .intro { order: 0; }
  #home.hero #preview { order: 1; padding: 2px 0 0; }
  #home.hero #create { order: 2; margin: 0; }
  body::before {
    background:
      linear-gradient(180deg, #0e231b3d, #10251b78 42%, #10231bdb),
      var(--app-scene, var(--default-scene)) center center / cover no-repeat;
  }
  #home .intro .home-season { margin: 0 0 7px; }
  #home .intro h1 { font-size: clamp(1.9rem, 7vw, 3.1rem); }
  #home .intro .lead { font-size: .93rem; line-height: 1.44; }
  #home #preview .door { aspect-ratio: 1.25; }
  #home .mobile-create { display: inline-flex; margin-top: 9px; min-height: 44px; align-items: center; }
  #calendar.hero { padding: 12px; gap: 12px; border-radius: 21px; margin-block: 14px 24px; }
  #calendar .calendar-heading { padding: 13px 12px 9px; }
  #calendar .calendar-heading h1 { font-size: clamp(1.42rem, 6.1vw, 2.4rem); }
  #calendar .calendar-mine { padding-top: 3px; }
  #calendar .calendar-sidebar { margin-top: 1px; }
  #calendar .calendar-main .door { aspect-ratio: 1.35; }
  .pocket-board .doors, .calendar-main .pocket-board .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pocket-board .door { min-height: 49px; }
}
@media (max-width: 360px) {
  #home.hero, #calendar.hero { padding-inline: 11px; }
  #home #preview { padding-inline: 10px; }
  #home #create { padding-inline: 10px; }
  .masthead .brand { font-size: .92rem; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #home.hero::after, #calendar.hero::after, #home #preview, #calendar-board .door.today-door,
  #faq details[open] > p, .pocket-letter, .pocket-board .door[aria-expanded="true"] .pocket-gift { animation: none; }
  body::after { display: none; }
}
