@font-face {
  font-family: ElegantlySimple;
  src: url("assets/elegantly-simple.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Baloo;
  src: url("assets/baloo-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Baloo2;
  src: url("assets/baloo2-latin-variable.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Roboto;
  src: url("assets/roboto-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
:root {
  --cream: #fef3e3;
  --ink: #302920;
  --blue: #82c9d0;
  /* Figma's 48px title and 20px supporting text scale with its 1122px house. */
  --byline-size: calc(var(--house-width) * 20 / 1122);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --house-width: min(760px, 100vw, calc((100svh - 110px) * 1122 / 1728));
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  background: #030303;
  scrollbar-color: #6d665a #111;
}
body {
  margin: 0;
  color: var(--cream);
  font-family: Roboto, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
}
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #286d72;
  outline-offset: 2px;
}
::selection {
  background: #82c9d0;
  color: #142b2c;
}
.sky-knit {
  position: fixed;
  inset: 0;
  background: url("assets/black-knit.webp") repeat;
  background-size: 512px;
  opacity: 0.38;
  pointer-events: none;
  z-index: -1;
}
#calendar {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.masthead {
  position: relative;
  flex: none;
  width: var(--house-width);
  height: calc(var(--house-width) * 326 / 1122);
  margin-inline: auto;
  text-align: center;
}
h1 {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--house-width) * 50 / 1122);
  font-family: ElegantlySimple, cursive;
  font-weight: 400;
  font-size: calc(var(--house-width) * 48 / 1122);
  line-height: calc(var(--house-width) * 65 / 1122);
  margin: 0;
  text-wrap: balance;
}
.byline {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--house-width) * 115 / 1122);
  font-size: var(--byline-size);
  font-weight: 200;
  margin: 0;
  line-height: calc(var(--house-width) * 23 / 1122);
}
.progress {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--house-width) * 258 / 1122);
  font-weight: 700;
  font-size: var(--byline-size);
  line-height: calc(var(--house-width) * 23 / 1122);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.landscape {
  position: relative;
  flex: 1;
  display: grid;
  align-items: start;
  justify-items: center;
  padding-bottom: 38px;
  isolation: isolate;
}
.house {
  position: relative;
  width: var(--house-width);
  max-width: 100%;
  container-type: inline-size;
  isolation: isolate;
}
.house-art {
  display: block;
  width: 100%;
  height: auto;
}
.ground {
  position: absolute;
  inset-inline: 0;
  top: calc(var(--house-width) * 1362 / 1122);
  bottom: 0;
  /* Begin at native y=1362, below the final stair at y=1350. */
  height: auto;
  pointer-events: none;
  z-index: 3;
}
.ground svg {
  display: block;
  width: 100%;
  height: 100%;
}
.doors {
  position: absolute;
  inset: 0;
}
.door {
  position: absolute;
  min-width: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  border-radius: var(--arch);
  isolation: isolate;
}
.is-building .door.filled::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  box-shadow: 0 0 7px #e9ba6260;
  pointer-events: none;
}
.door::after {
  content: "";
  position: absolute;
  left: var(--hover-x, var(--light-x, 0));
  top: var(--hover-y, var(--light-y, 0));
  width: var(--hover-width, var(--light-width, 100%));
  height: var(--hover-height, var(--light-height, 100%));
  mask-image: var(--hover-mask, var(--light-mask, none));
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  background: #ffe5a3;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.door-number {
  position: absolute;
  right: var(--number-right);
  bottom: var(--number-bottom);
  font:
    400 clamp(14px, 3.03cqw, 34px) / 1.59 Baloo,
    sans-serif;
  color: var(--number-color);
  white-space: nowrap;
  text-shadow: 0 1px 2px #0005;
}
.door-check {
  position: absolute;
  right: 8%;
  top: var(--check-top);
  width: clamp(12px, 2.2cqw, 22px);
  height: clamp(12px, 2.2cqw, 22px);
  border-radius: 50%;
  background: #ffe3a7;
  display: grid;
  place-items: center;
  color: #4f3922;
  font-size: clamp(9px, 1.6cqw, 16px);
  line-height: 1;
}
.lamp-glow {
  position: absolute;
  top: 63.8%;
  width: 6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ffd58f75, transparent 68%);
  opacity: 0.8;
  pointer-events: none;
}
.lamp-left {
  left: 1.2%;
}
.lamp-right {
  right: 1.2%;
}
.calendar-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 14px 18px 20px;
  background: #f5e5c9;
  color: #46372a;
  font-size: 0.875rem;
}
#date-control {
  display: flex;
  align-items: center;
  gap: 9px;
}
#preview-date {
  color-scheme: light;
  font-size: 0.875rem;
  padding: 5px 7px;
  border: 1px solid #ad9c83;
  border-radius: 5px;
  background: #fff9ef;
  color: #46372a;
  max-width: 145px;
}
.snowfall {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}
.flake {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #fff6e6;
  opacity: var(--flake-opacity);
  width: var(--size);
  height: var(--size);
  left: var(--start);
}
.notice {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  margin: 0;
  padding: 14px 22px;
  background: #fff4dc;
  color: #45372a;
  border-radius: 8px;
  box-shadow: 0 8px 28px #0006;
  z-index: 20;
  max-width: calc(100% - 32px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.notice.visible {
  opacity: 1;
}
.door-dialog {
  color-scheme: light;
  width: min(900px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  padding: 24px 28px;
  border: 1px solid #e7d5b6;
  border-radius: 18px;
  background: #adcbda;
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 80px #0008;
}
.door-dialog::backdrop {
  background: #030606d9;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
h2 {
  font:
    400 28px/1.3 ElegantlySimple,
    cursive;
  margin: 0;
}
.door-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
}
.door-layout.editing {
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.1fr);
}
.reveal-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding: 10px 18px 16px;
  perspective: 1100px;
}
.window-frame {
  position: relative;
  width: min(280px, 78%);
  aspect-ratio: var(--window-ratio);
  isolation: isolate;
  background-color: #edd9b6;
  border-radius: var(--frame-radius);
  box-shadow: 0 6px 14px #4e382b32;
  perspective: 1100px;
  background-image: url("assets/plush-wool.webp");
  background-size: 210px;
}
.window-interior {
  position: absolute;
  inset: var(--opening-inset-y) var(--opening-inset-x);
  overflow: hidden;
  border-radius: var(--opening-radius);
  background: #a4d4d3;
  box-shadow: inset 0 4px 20px #58432d55;
  display: grid;
  place-items: center;
}
.window-interior::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/black-knit.webp") center / 300px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 1;
}
#inside-note {
  padding: 15px;
  text-align: center;
  font:
    400 clamp(18px, 3vw, 25px) / 1.2 ElegantlySimple,
    cursive;
  color: #2d3430;
  margin: 0;
  white-space: pre-wrap;
  max-height: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}
#door-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  max-width: none;
}
.shutters {
  position: absolute;
  inset: var(--opening-inset-y) var(--opening-inset-x);
  pointer-events: none;
  perspective: 1100px;
  transform-style: preserve-3d;
  z-index: 2;
}
.shutter {
  position: absolute;
  width: 50%;
  height: 100%;
  background-color: var(--panel-color, #82c9d0);
  background-image: url("assets/plush-wool.webp");
  background-blend-mode: multiply;
  background-size: 210px;
  backface-visibility: visible;
  transform: rotateY(0deg);
  transition: transform 1200ms var(--ease-out);
  box-shadow:
    inset 0 0 0 2px #ffffff28,
    3px 3px 0 #73503955;
}
.window-frame.has-3d {
  background: transparent;
  box-shadow: none;
}
.has-3d .shutters {
  visibility: hidden;
}
.knitted-window-canvas {
  position: absolute;
  width: 180%;
  height: 130%;
  left: -40%;
  top: -15%;
  pointer-events: none;
  z-index: 5;
}
.left-shutter {
  left: 0;
  transform-origin: left center;
  border-radius: 100% 0 0 0 / var(--leaf-arch) 0 0 0;
}
.right-shutter {
  right: 0;
  transform-origin: right center;
  border-radius: 0 100% 0 0 / 0 var(--leaf-arch) 0 0;
}
.window-frame.is-open .left-shutter {
  transform: rotateY(-112deg);
}
.window-frame.is-open .right-shutter {
  transform: rotateY(112deg);
}
.received-content {
  text-align: center;
  width: 100%;
  max-width: 460px;
}
#full-note {
  white-space: pre-wrap;
  line-height: 1.65;
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}
.received-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.received-item {
  display: flex;
  flex: 0 1 120px;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--ink);
  font-family: Baloo2, sans-serif;
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none;
}
.received-item img {
  display: block;
  width: 120px;
  height: 96px;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}
.received-item span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.received-item:focus-visible {
  outline: 2px solid #286d72;
  outline-offset: 3px;
}
@media (hover: hover) {
  .received-item:hover {
    background: #fef3e366;
    box-shadow: 0 4px 12px #4b352018;
  }
}
.door-editor {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.door-editor label,
.photo-crop legend {
  font-size: 14px;
}
.door-editor input[type="url"],
.door-editor textarea {
  width: 100%;
  border: 1px solid #b8a58b;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fffaf0;
  color: #302920;
  line-height: 1.5;
  font-size: 1rem;
  caret-color: #285c53;
}
.door-editor textarea:disabled {
  background: #d7dde0;
  color: #69757b;
  border-color: #a7b4bb;
  cursor: not-allowed;
  opacity: 1;
}
.door-editor textarea {
  resize: vertical;
  min-height: 110px;
}
.message-tools,
.bible-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.field-hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #2a2a2a;
}
.field-hint:empty {
  display: none;
}
.photo-option {
  margin-top: 12px;
  align-self: flex-start;
}
.photo-option .field-hint {
  margin-top: 4px;
}
.bible-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid #7599aa;
  border-radius: 12px;
  background: #c7dce6;
}
.bible-fields select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px;
  font: inherit;
  font-size: 16px;
  color: #302920;
  background: #fffaf0;
  border: 1px solid #b8a58b;
  border-radius: 6px;
}
.bible-actions a {
  font-size: 12px;
  color: #285c53;
  text-underline-offset: 3px;
}
.photo-crop {
  border: 0;
  padding: 7px 0;
  margin: 0;
}
.photo-crop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.window-interior.crop-mode {
  touch-action: none;
  cursor: grab;
}
.window-interior.crop-mode.is-dragging {
  cursor: grabbing;
}
.window-interior.crop-mode:focus-visible {
  outline: 2px solid #2a2a2a;
  outline-offset: -3px;
}
.window-interior.crop-mode img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.add-items {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}
.link-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.link-fields p {
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
  color: #66553e;
}
.link-fields .quiet-button {
  align-self: start;
}
.editor-error {
  color: #9b2d24;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}
.editor-error:empty {
  display: none;
}
.save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #cfbfa4;
}
body:has(dialog[open]) {
  overflow: hidden;
}
body:has(dialog[open]) .snowfall {
  opacity: 0.15;
}
body.page-hidden .flake,
body.page-hidden .lamp-glow {
  animation-play-state: paused;
}
@media (hover: hover) and (pointer: fine) {
  .door:hover {
    outline: none;
  }
  .door:hover::after {
    opacity: 0.27;
  }
  .door:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 5px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .flake {
    animation: snow-drift var(--duration) linear infinite;
    animation-delay: var(--delay);
  }
  .lamp-glow {
    animation: lamp-warmth 5200ms ease-in-out infinite alternate;
  }
  .lamp-right {
    animation-duration: 6700ms;
    animation-delay: -1700ms;
  }
  @keyframes snow-drift {
    to {
      transform: translate3d(var(--drift), calc(100dvh + 24px), 0);
    }
  }
  @keyframes lamp-warmth {
    0%,
    100% {
      opacity: 0.58;
    }
    24% {
      opacity: 0.76;
    }
    40% {
      opacity: 0.63;
    }
    63% {
      opacity: 0.84;
    }
    78% {
      opacity: 0.72;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .snowfall {
    display: none;
  }
  .shutter {
    transition: none;
  }
  .window-frame.is-open .shutter {
    opacity: 0;
    transform: none;
  }
}
@media (max-width: 620px) {
  .calendar-tools {
    gap: 8px 18px;
    padding: 10px 12px 16px;
    font-size: 0.8rem;
  }
  #date-control {
    font-size: 0.8rem;
  }
  .door-dialog {
    padding: 18px 15px;
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
  }
  .door-layout.editing {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .reveal-column {
    padding: 12px 12px 8px;
  }
  .window-frame {
    width: min(240px, 70%);
  }
  .dialog-top {
    margin-bottom: 8px;
  }
  h2 {
    font-size: 25px;
  }
  .door-editor {
    padding: 0 5px;
  }
  #inside-note {
    font-size: 21px;
  }
  .save-row {
    flex-wrap: wrap;
  }
}
