/* Approved blue scene and Figma sender/recipient layout. */
:root {
  --scene-height: min(740px, calc((100svh - 18px) / 1.226));
  --scene-width: calc(var(--scene-height) * 1672 / 941);
  --house-width: calc(var(--scene-height) * 0.776);
  --masthead-base: max(130px, calc(var(--house-width) * 326 / 1122));
  --house-drop: clamp(0px, calc((100svh - var(--masthead-base) - var(--scene-height)) * 0.55), 96px);
  --byline-size: max(9px, calc(var(--house-width) * 20 / 1122));
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: light;
}
:root:has(#calendar.is-building) {
  --scene-height: min(740px, calc(100vw * 941 / 730), calc(100svh - 210px));
  --masthead-base: max(190px, calc(var(--house-width) * 326 / 1122));
}
html {
  background: #adcbda;
  scrollbar-color: #7599aa #adcbda;
}
body {
  color: #000;
}
.sky-knit {
  background: #adcbda url("assets/black-knit.webp") repeat 0 0 / 512px;
  background-blend-mode: screen;
  opacity: 1;
}
#calendar,
.zoom-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.masthead {
  width: 100%;
  height: calc(var(--masthead-base) + var(--house-drop));
  z-index: 6;
}
h1 {
  top: calc(var(--house-width) * 166 / 1122 + var(--house-drop));
}
.is-building h1 {
  top: calc(var(--house-width) * 148 / 1122 + var(--house-drop));
  font-size: max(22px, calc(var(--house-width) * 48 / 1122));
  line-height: 1.35;
}
.progress {
  top: calc(var(--house-width) * 246 / 1122 + var(--house-drop));
  font-size: max(12px, calc(var(--house-width) * 20 / 1122));
  font-weight: 500;
  line-height: 1.3;
}
.mode-caption {
  display: block;
  font-weight: 400;
}
.builder-hint {
  display: block;
  margin: 5px auto 0;
  padding-inline: 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
.masthead:has(.progress:not([hidden])) {
  height: calc(var(--masthead-base) + var(--house-drop));
}
.from-name {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--house-width) * 238 / 1122 + var(--house-drop));
  margin: 0;
  font:
    400 calc(var(--house-width) * 32 / 1122)/1.3 ElegantlySimple,
    cursive;
}
.receiver-line {
  display: block;
  margin-top: 4px;
  font:
    300 max(12px, calc(var(--house-width) * 20 / 1122))/1.3 Roboto,
    sans-serif;
}
.page-action {
  position: absolute;
  right: 5%;
  top: calc(var(--house-width) * 130 / 1122);
  z-index: 7;
}
.landscape {
  min-height: var(--scene-height);
  display: block;
  padding: 0;
  overflow: hidden;
}
.house {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--scene-width);
  max-width: none;
  height: var(--scene-height);
  transform: translateX(-50%);
  z-index: 1;
}
.house-art {
  width: 100%;
  height: 100%;
  mask-image: linear-gradient(to bottom, transparent, #000 calc(var(--scene-height) * 0.0085));
}
.ground,
.snow-extensions {
  background: #f9dfc7;
}
.snow-extensions > svg,
.ground > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.snow-extensions {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--scene-height) * 0.905);
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 8px);
}
.ground {
  top: calc(var(--scene-height) * 0.94);
  z-index: 3;
  mask-image: linear-gradient(to bottom, transparent, #000 32px);
}
.byline {
  top: auto;
  bottom: 12px;
  text-align: center;
  font-size: max(9px, var(--byline-size));
  color: #302920;
  z-index: 5;
  pointer-events: none;
}
.door {
  min-width: 0;
}
.seam-light {
  position: absolute;
  left: var(--light-x);
  top: var(--light-y);
  width: var(--light-width);
  height: var(--light-height);
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}
.door.has-opened .seam-light { opacity: .84; }
/* Door 19 follows the same opened-door light as the other dates. */
.door[data-date="19"]:not(.has-opened)::after { opacity: 0; }
.seam-light path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.seam-halo { stroke: #ffe4ba; stroke-width: 5; filter: blur(3.6px); opacity: .52; }
.seam-core { stroke: #fff4d5; stroke-width: 2.4; filter: blur(1.8px); opacity: .38; }
body.page-hidden .seam-light { animation-play-state: paused !important; }
.door-number {
  font-size: clamp(10px, 1.3cqw, 22px);
}
.door-check {
  width: clamp(11px, 1.5cqw, 18px);
  height: clamp(11px, 1.5cqw, 18px);
  font-size: clamp(8px, 1.1cqw, 13px);
}
.lamp-glow {
  top: 59.5%;
  width: 10%;
  height: 17%;
  aspect-ratio: auto;
  background: radial-gradient(
    ellipse,
    #fff4a6b8 0,
    #ffc13e60 27%,
    #ffb33a20 48%,
    transparent 70%
  );
  mix-blend-mode: screen;
  z-index: 2;
}
.lamp-glow::after {
  content: "";
  position: absolute;
  left: 43%;
  top: 21%;
  width: 14%;
  height: 20%;
  border-radius: 50%;
  background: #fff8b5;
  box-shadow: 0 0 9px 4px #ffd26b9c;
}
.lamp-left {
  left: 24.2%;
}
.lamp-right {
  right: 24.2%;
}
.calendar-tools {
  position: fixed;
  left: 18px;
  bottom: 9px;
  z-index: 6;
  background: transparent;
  font-size: 11px;
  padding: 0;
  gap: 12px;
}
#preview-date {
  font-size: 11px;
  padding: 4px;
  max-width: 116px;
  background: #fff8e6bd;
}
.flake {
  background: #fffdf7;
}
body:not(:has(#calendar.is-building)) .snowfall { z-index: 8; }
.featured-wall,
.door13-art {
  display: none;
}

/* Door 13 keeps the photographic wool on softly moving image layers. */
.door-dialog.featured {
  inset: 0;
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #f6d5dc;
  box-shadow: none;
  overflow-x: hidden;
}
.featured::backdrop {
  background: #f6d5dc;
}
.featured .featured-wall {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  filter: none;
  opacity: 1;
  background: #f6d5dc;
}
.featured .featured-wall > svg {
  filter: grayscale(1);
  mix-blend-mode: soft-light;
  opacity: 0.7;
}
.door-dialog.featured.fuzzy-detail,
.featured.fuzzy-detail::backdrop {
  background: #f5b3ac;
}
.featured.fuzzy-detail .featured-wall {
  background: #f8c3bd;
}
.featured.fuzzy-detail .featured-wall > svg {
  filter: none;
  mix-blend-mode: normal;
  opacity: 0.86;
}
.featured .dialog-top {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  padding: 18px 24px;
  z-index: 250;
  margin: 0;
  pointer-events: none;
  justify-content: flex-end;
}
.window-date {
  width: min(280px, 78%);
  aspect-ratio: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px 20px;
  background: url("assets/cream-knit-date-banner-v49.webp") center / contain no-repeat;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  z-index: 3;
  text-shadow: none;
}
.window-date.window-date--knitted {
  --date-height: clamp(104px, 10vw, 140px);
  width: max-content;
  max-width: 100%;
  aspect-ratio: auto;
  margin: 0 auto 12px;
  padding: 0;
  background: none;
  line-height: 0;
}
.knitted-date {
  display: flex;
  align-items: flex-end;
  gap: calc(var(--date-height) * 0.12);
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.24))
    drop-shadow(0 4px 4px rgb(0 0 0 / 0.22));
}
.cord-digits {
  display: flex;
  align-items: flex-end;
  gap: calc(var(--date-height) * 0.06);
  filter: hue-rotate(8deg) saturate(1.35);
}
.cord-digit {
  display: block;
  flex: none;
  height: var(--date-height);
  width: calc(var(--date-height) * var(--asset-ratio));
  overflow: hidden;
}
.cord-ribbon {
  display: block;
  flex: none;
  height: calc(var(--date-height) * 0.58);
  width: calc(var(--date-height) * 0.58 * var(--asset-ratio));
  margin-bottom: calc(var(--date-height) * 0.06);
  overflow: hidden;
}
.entrance-tone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: saturate(0.88) contrast(0.88) brightness(1.08);
}
.featured #close-door {
  pointer-events: auto;
  min-width: 32px;
}
.featured .door-layout {
  position: relative;
  min-height: 100%;
  gap: 0;
}
.featured .reveal-column {
  position: relative;
  padding: 46px 0 16px;
  gap: 0;
  justify-content: center;
}
.featured .door-layout:not(.editing) .reveal-column {
  --heading-height: clamp(104px, 10vw, 140px);
  --window-layout-top: max(54px, calc(50dvh - var(--visible-art-height, 360px) / 2 - var(--heading-height) - 28px));
  justify-content: flex-start;
  padding-top: var(--window-layout-top);
  padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}
.featured .door-layout:not(.editing) .window-date {
  transform: translateY(calc((28px - var(--window-layout-top)) / 2));
}
.featured #replay-opening {
  position: fixed;
  left: 50%;
  bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10;
}
.featured:has(.door-layout.editing) #replay-opening,
.featured:has(#received-content[hidden]) #replay-opening {
  visibility: hidden;
  pointer-events: none;
}
.featured .door-layout:not(.editing) .window-frame.featured-art {
  max-width: calc((100dvh - var(--heading-height) - 190px) / var(--art-height-ratio));
}
.featured:has(.zoom-capture) .window-date {
  visibility: hidden;
}
.window-frame.featured-art {
  width: min(660px, 84vw, calc((100dvh - 180px) * 0.84));
  margin-top: calc(16px - var(--art-top, 0.0223) * var(--actual-door-size, 0px));
  margin-bottom: calc((var(--art-bottom, 0.875) - 1) * var(--actual-door-size, 0px));
  aspect-ratio: 1;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  perspective: 1300px;
}
/* A second perspective projection magnifies the already angled rectangular
   artwork near the end of its turn, then makes it shrink into its final pose. */
.featured-art[data-family="rectangle"],
.featured-art[data-family="balcony"],
.featured .reveal-column:has(.featured-art[data-family="rectangle"]),
.featured .reveal-column:has(.featured-art[data-family="balcony"]) {
  perspective: none;
}
.featured-art[data-family="rectangle"] .leaf-face.front,
.featured-art[data-family="balcony"] .leaf-face.front {
  transform: none;
}
.featured-art:is([data-variant="approved-rectangle"], [data-variant="approved-balcony"]) .art-frame {
  filter: drop-shadow(0 4px 4px #5f251d26);
}
.featured-art:is([data-variant="approved-rectangle"], [data-variant="approved-balcony"]) .leaf-face.front {
  filter: drop-shadow(0 2px 2px #5f251d24);
}
.featured-art .door13-art {
  display: block;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.featured:has(.zoom-capture) .dialog-top {
  visibility: hidden;
}
.art-frame,
.sill-contact-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mask: none;
}
.art-frame {
  opacity: 1;
}
.featured-art .window-interior {
  inset: var(--content-top, 13.88%) var(--content-right, 30.46%) var(--content-bottom, 24%) var(--content-left, 29.5%);
  border-radius: var(--content-radius, 50% 50% 0 0 / 32.3% 32.3% 0 0);
  z-index: 2;
  background: transparent;
  box-shadow: none;
}
.featured-art .window-interior::before {
  display: none;
}
.window-reveal-light {
  display: none;
}
.featured > .window-reveal-light {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}
.light-window {
  position: fixed;
  border-radius: 50% 50% 8% 8% / 32% 32% 6% 6%;
  background: #fff9e8;
  transform: scale(1);
  transform-origin: center;
}
.light-veil {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff9e8;
}
.round-reveal .light-veil {
  display: block;
}
.round-reveal .light-window {
  background: radial-gradient(circle closest-side at center,
    #fff9e8 0%, #fff9e8f2 28%, #fff9e89c 54%, #fff9e833 76%, #fff9e800 100%);
}
.featured-art #inside-note {
  font-family: Baloo2, sans-serif;
  font-weight: 400;
  font-size: clamp(12px, calc(var(--actual-door-size, 390px) * 0.035), 24px);
  line-height: 1.3;
  padding: 6%;
  text-shadow: none;
}
.featured-art .shutters,
.featured-art .knitted-window-canvas {
  display: none !important;
}
.art-leaf {
  display: none;
  position: absolute;
  top: 8.77193%;
  height: 75.75758%;
  z-index: 4;
  transform-style: preserve-3d;
  opacity: 1;
  will-change: transform;
  transition: transform var(--hinge-duration, 1550ms) var(--hinge-easing, linear);
}
.featured-art > .art-leaf {
  display: block;
}
.art-leaf-left {
  left: 1.5949%;
  width: 28.30941%;
  transform-origin: 0 0;
  transform: translateX(var(--left-hinge)) rotateY(var(--start-angle, 180deg))
    translateX(calc(-1 * var(--left-hinge))) var(--left-correction);
}
.art-leaf-right {
  left: 71.92982%;
  width: 26.95375%;
  transform-origin: 0 0;
  transform: translateX(var(--right-hinge)) rotateY(calc(-1 * var(--start-angle, 180deg)))
    translateX(calc(-1 * var(--right-hinge))) var(--right-correction);
}
.leaf-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  backface-visibility: hidden;
}
.leaf-face.front {
  transform: translateZ(2.5px);
  filter: none;
}
.leaf-face.back {
  transform: rotateY(180deg) translateZ(2.5px) scaleX(-1);
  filter: none;
}
.leaf-face.edge1 {
  transform: translateZ(-1.5px);
  backface-visibility: visible;
  filter: brightness(0.85);
}
.leaf-face.edge2 {
  transform: translateZ(0);
  backface-visibility: visible;
  filter: brightness(0.91);
}
.leaf-face.edge3 {
  transform: translateZ(1.5px);
  backface-visibility: visible;
  filter: brightness(0.96);
}
.art-date {
  position: absolute;
  right: 12%;
  bottom: 11%;
  color: #fff9ed;
  font-family: Baloo, sans-serif;
  font-size: clamp(16px, 3vw, 25px);
  transform: translateZ(3px);
  backface-visibility: hidden;
}
.featured-art.is-open .art-leaf-left {
  transform: translateX(var(--left-hinge)) rotateY(0deg)
    translateX(calc(-1 * var(--left-hinge)))
    matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
.featured-art.is-open .art-leaf-right {
  transform: translateX(var(--right-hinge)) rotateY(0deg)
    translateX(calc(-1 * var(--right-hinge)))
    matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
.featured-art.art-still .art-leaf {
  transition: none;
}
.featured .received-content {
  z-index: 3;
  width: min(540px, calc(100% - 36px));
  margin-top: -10px;
  padding: 10px 16px;
  text-align: center;
}
/* Reserve the reveal controls before opening so the art never recenters. */
.featured .door-layout:not(.editing) .received-content[hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}
.featured #full-note {
  font-family: Baloo2, sans-serif;
  background: #fff0dfdb;
  padding: 14px;
  border-radius: 10px;
}
.featured .door-layout.editing {
  width: min(1086px, 100%);
  grid-template-columns: minmax(0, 594fr) minmax(0, 404fr);
  margin: auto;
  padding: 64px 28px 24px;
  gap: 32px;
  align-items: center;
}
.featured .editing .reveal-column {
  padding: 0;
}
.featured .editing .window-frame {
  width: min(100%, calc(100dvh - 170px));
}
.featured .editing :is(.door13-art, .art-leaf, .sill-contact-art, .art-foreground) {
  pointer-events: none;
}
.featured .door-editor {
  position: relative;
  width: 100%;
  max-width: 404px;
  justify-self: center;
  padding: 16px;
  gap: 6px;
  border-radius: 16px;
  background: #adcbda;
  color: #2a2a2a;
}
.featured .door-editor textarea {
  min-height: 84px;
}
.featured .door-editor .photo-option {
  margin-top: 6px;
}
@media (min-width: 1100px) {
  .featured .door-layout:not(.editing) .window-frame {
    width: min(792px, 84vw, calc((100dvh - 180px) * 1.008));
  }
}
@media (min-width: 621px) {
  .featured .window-frame.featured-art[data-family="arch"] {
    width: min(594px, 75.6vw, calc((100dvh - 180px) * 0.756));
  }
  .featured .editing .window-frame.featured-art[data-family="arch"] {
    width: min(594px, 90%, calc((100dvh - 170px) * 0.9));
  }
}
@media (min-width: 1100px) {
  .featured .door-layout:not(.editing) .window-frame.featured-art[data-family="arch"] {
    width: min(712.8px, 75.6vw, calc((100dvh - 180px) * 0.9072));
  }
}
@media (min-width: 621px) and (max-width: 840px) {
  .featured .door-layout.editing {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .featured .editing .window-frame {
    width: min(440px, 100%);
  }
  .featured .editing .window-frame.featured-art[data-family="arch"] {
    width: min(396px, 90%);
  }
}
.zoom-capture {
  position: fixed;
  inset: 0;
  overflow: hidden;
  contain: paint;
  z-index: 100;
  pointer-events: none;
  background: #adcbda;
}
.zoom-page {
  position: absolute;
  inset: 0;
  width: 100vw;
  transform-origin: 0 0;
  pointer-events: none;
  background-blend-mode: normal;
}
.zoom-page button {
  outline: none !important;
}
.zoom-page .calendar-tools {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .door.has-opened .seam-light {
    animation: seam-warmth var(--seam-period, 8.4s) linear var(--seam-delay, 0s) infinite;
  }
  @keyframes seam-warmth {
    0%, 100% { opacity: .86; }
    19% { opacity: .9; }
    25% { opacity: .82; }
    32% { opacity: .88; }
    54% { opacity: .85; }
    71% { opacity: .92; }
    77% { opacity: .8; }
    86% { opacity: .88; }
  }
  .lamp-glow {
    animation: lamp-shine 4.7s linear infinite;
  }
  .lamp-right {
    animation-duration: 5.9s;
    animation-delay: -2.3s;
  }
  @keyframes lamp-shine {
    0%,
    100% {
      opacity: 0.72;
    }
    20% {
      opacity: 0.95;
    }
    24% {
      opacity: 0.61;
    }
    27% {
      opacity: 0.87;
    }
    51% {
      opacity: 0.8;
    }
    67% {
      opacity: 1;
    }
    71% {
      opacity: 0.73;
    }
    76% {
      opacity: 0.93;
    }
  }
}
@media (max-width: 620px) {
  :root {
    --scene-height: min(calc(100vw * 941 / 730), calc((100svh - 18px) / 1.226));
  }
  .page-action {
    right: 12px;
    top: 12px;
  }
  .masthead h1,
  .is-building .masthead h1 {
    top: calc(max(64px, var(--house-width) * 166 / 1122) + var(--house-drop));
  }
  .masthead .from-name,
  .masthead .progress {
    top: calc(max(96px, var(--house-width) * 257 / 1122) + var(--house-drop));
  }
  #calendar:not(.is-building) .masthead h1 {
    top: calc((100% + 44px) / 2 - 24px);
  }
  #calendar:not(.is-building) .masthead .from-name {
    top: calc((100% + 44px) / 2 + 8px);
  }
  .calendar-tools {
    left: 10px;
    bottom: 5px;
    gap: 8px;
  }
  .featured .dialog-top {
    padding: 10px 14px;
  }
  .window-date {
    font-size: 18px;
    padding-inline: 30px;
    padding-bottom: 16px;
  }
  .window-date.window-date--knitted {
    --date-height: 72.7px;
    width: max-content;
  }
  .featured .door-layout.editing {
    grid-template-columns: minmax(0, 1fr);
    padding: 54px 12px 20px;
  }
  .featured .door-editor {
    padding: 16px;
  }
  .featured .reveal-column {
    padding-top: 54px;
  }
  .featured .door-layout:not(.editing) .reveal-column { --heading-height: 72.7px; }
  .featured .editing .window-frame {
    width: min(440px, 100%);
  }
  .featured .window-frame.featured-art {
    max-width: none;
    width: min(94vw, calc((100dvh - 190px) * 0.96));
  }
  .featured .window-frame.featured-art[data-family="balcony"],
  .featured .window-frame.featured-art[data-family="front-door"] {
    width: min(108vw, calc((100dvh - 200px) * 1.08));
  }
}
@media (prefers-reduced-motion: reduce) {
  .art-leaf,
  .window-reveal-light {
    transition: none;
  }
}

/* The balcony stays in front of the content and moving photographic leaves. */
.art-foreground { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

/* One compact knitted circle for every date, including two-digit dates. */
.featured { --date-badge-height: clamp(84px, 8vw, 100px); }
.featured .door-layout:not(.editing) .reveal-column {
  --heading-height: var(--date-badge-height);
}
.knitted-date--badge {
  --date-height: var(--date-badge-height);
  position: relative;
  display: block;
  width: calc(var(--date-height) * 1101 / 1252);
  height: var(--date-height);
}
.date-badge-art { display: block; width: 100%; height: 100%; }
.date-badge-digits {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  align-items: center;
  gap: calc(var(--date-height) * var(--badge-digit-height) * .14);
  filter: none;
}
.date-badge-digits .cord-digit {
  height: calc(var(--date-height) * var(--badge-digit-height));
  width: calc(var(--date-height) * var(--badge-digit-height) * var(--asset-ratio));
}
@media (max-width: 620px) {
  .featured { --date-badge-height: 72px; }
}
@media (prefers-reduced-motion: no-preference) {
  .featured:has(#window-frame[data-phase="open"]) .knitted-date--badge {
    transform-origin: 50% 12%;
    animation: date-badge-entry 500ms var(--ease-out) both;
  }
  @keyframes date-badge-entry {
    0% { transform: rotate(-2deg); }
    30% { transform: rotate(1.5deg); }
    60% { transform: rotate(-.75deg); }
    100% { transform: rotate(0); }
  }
}
body.page-hidden .knitted-date--badge { animation-play-state: paused; }
