:root {
  color-scheme: light;
  --ink: #493930;
  --muted: #89786a;
  --paper: #fffaf0;
  --paper-deep: #f3e4c8;
  --rose: #b96f68;
  --rose-dark: #99544f;
  --gold: #d5a75e;
  --sage: #758d70;
  --blue: #61b9ed;
  --shadow: 0 20px 55px rgba(76, 55, 39, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 80% 12%, rgba(238, 210, 165, 0.36), transparent 33rem),
    linear-gradient(180deg, #f8f2e8 0%, #f4ecdf 55%, #f7f1e8 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(112, 78, 49, 0.018) 0,
    rgba(112, 78, 49, 0.018) 1px,
    transparent 1px,
    transparent 4px
  );
  content: "";
  pointer-events: none;
}

button,
a {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #557fa0;
  outline-offset: 4px;
}

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 22px;
}

.garland {
  position: absolute;
  top: 13px;
  left: 50%;
  display: flex;
  width: min(690px, 76vw);
  height: 37px;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.garland::before {
  position: absolute;
  top: -10px;
  right: 4%;
  left: 4%;
  height: 28px;
  border-top: 1px solid rgba(113, 91, 67, 0.35);
  border-radius: 50%;
  content: "";
}

.garland span {
  position: relative;
  width: 10px;
  height: 12px;
  margin-top: 9px;
  border-radius: 50%;
  background: #f5d98e;
  box-shadow: 0 0 12px 4px rgba(244, 209, 123, 0.56);
  animation: glow 3.2s ease-in-out infinite alternate;
}

.garland span:nth-child(3n) {
  background: #eaa8a1;
  box-shadow: 0 0 12px 4px rgba(234, 168, 161, 0.42);
  animation-delay: 1.2s;
}

.garland span:nth-child(2n) {
  animation-delay: 0.6s;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
}

.wordmark {
  color: #614b4c;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.header-note {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

.header-heart,
.footer-heart {
  color: var(--rose);
}

.welcome {
  display: grid;
  min-height: 590px;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  gap: 4%;
  padding: 24px 4% 44px;
}

.welcome-copy {
  position: relative;
  z-index: 1;
  padding-bottom: 25px;
}

.kicker {
  margin: 0 0 14px;
  color: var(--rose-dark);
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: #57434c;
  font-weight: 500;
}

h1 {
  font-size: clamp(55px, 7.2vw, 84px);
  letter-spacing: -0.045em;
  line-height: 0.91;
}

.welcome-text {
  max-width: 410px;
  margin: 24px 0 12px;
  color: #68574c;
  font-size: 18px;
  line-height: 1.75;
}

.quiet-note {
  margin: 0;
  color: #988879;
  font-size: 13px;
  font-style: italic;
}

.text-link {
  display: inline-block;
  margin-top: 27px;
  color: var(--rose-dark);
  font-size: 15px;
  text-decoration-color: rgba(153, 84, 79, 0.4);
  text-underline-offset: 5px;
}

.text-link span {
  padding-left: 4px;
}

.jar-scene {
  position: relative;
  display: flex;
  min-height: 485px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.jar-scene::before {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 45px;
  left: 0;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(239, 209, 161, 0.4), transparent 70%);
  content: "";
}

.fairy-lights {
  position: absolute;
  top: 18px;
  left: 50%;
  display: flex;
  width: min(380px, 90%);
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.fairy-lights i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f7d782;
  box-shadow: 0 0 16px 7px rgba(248, 210, 126, 0.58);
  animation: glow 2.8s ease-in-out infinite alternate;
}

.fairy-lights i:nth-child(2n) {
  margin-top: 14px;
  background: #e9a09a;
  box-shadow: 0 0 14px 5px rgba(233, 160, 154, 0.38);
  animation-delay: 0.8s;
}

.jar {
  position: relative;
  z-index: 1;
  display: flex;
  width: 282px;
  height: 355px;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 25px 18px rgba(90, 66, 44, 0.12));
  transition: transform 0.35s ease;
}

.jar.is-drawing {
  animation: jar-wiggle 0.65s ease-in-out;
}

.jar-lid {
  z-index: 2;
  width: 155px;
  height: 31px;
  border: 1px solid rgba(133, 96, 62, 0.35);
  border-radius: 9px 9px 5px 5px;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(117, 79, 51, 0.12) 8px 10px),
    linear-gradient(180deg, #c9a979, #9f7a53);
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.32);
}

.jar-neck {
  z-index: 2;
  width: 160px;
  height: 24px;
  margin-top: -2px;
  border: 2px solid rgba(255, 255, 255, 0.64);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(90deg, rgba(255,255,255,.27), rgba(195,221,219,.19), rgba(255,255,255,.48));
}

.jar-glass {
  position: relative;
  width: 256px;
  height: 275px;
  margin-top: -5px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 35px 35px 53px 53px / 30px 30px 37px 37px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.55), rgba(209,230,224,.18) 20%, rgba(255,255,255,.06) 62%, rgba(255,255,255,.37)),
    linear-gradient(180deg, rgba(236,246,237,.36), rgba(212,232,225,.2));
  box-shadow:
    inset 12px 0 20px rgba(255, 255, 255, 0.35),
    inset -10px 0 16px rgba(255, 255, 255, 0.2),
    inset 0 -18px 26px rgba(136, 175, 161, 0.12);
  backdrop-filter: blur(2px);
}

.jar-glass::before,
.jar-glass::after {
  position: absolute;
  z-index: 2;
  content: "";
  pointer-events: none;
}

.jar-glass::before {
  top: 22px;
  bottom: 24px;
  left: 14px;
  width: 15px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.09));
  filter: blur(2px);
}

.jar-glass::after {
  top: 27px;
  right: 14px;
  bottom: 30px;
  width: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.53);
  filter: blur(1px);
}

.jar-shine {
  position: absolute;
  z-index: 1;
  right: 13px;
  bottom: 7px;
  left: 13px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-top: 0;
  border-radius: 0 0 50% 50%;
}

.paper-roll {
  position: absolute;
  width: 60px;
  height: 29px;
  border: 1px solid rgba(137, 102, 68, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8e7, #e9d2a9);
  box-shadow: 0 3px 6px rgba(92, 67, 42, 0.1), inset 0 3px 5px rgba(255,255,255,.85);
}

.paper-roll::before,
.paper-roll::after {
  position: absolute;
  top: 6px;
  width: 4px;
  height: 15px;
  border-radius: 50%;
  background: #c69b64;
  content: "";
}

.paper-roll::before {
  left: 5px;
}

.paper-roll::after {
  right: 5px;
}

.roll-one { top: 42px; left: 28px; transform: rotate(-17deg); }
.roll-two { top: 69px; left: 119px; transform: rotate(12deg); }
.roll-three { top: 102px; left: 38px; transform: rotate(8deg); }
.roll-four { top: 133px; left: 126px; transform: rotate(-11deg); }
.roll-five { top: 166px; left: 31px; transform: rotate(15deg); }
.roll-six { top: 195px; left: 102px; transform: rotate(-7deg); }
.roll-seven { top: 224px; left: 47px; transform: rotate(-14deg); }

.jar-label {
  position: absolute;
  z-index: 2;
  top: 104px;
  left: 52px;
  display: grid;
  width: 146px;
  height: 70px;
  place-content: center;
  border: 1px solid rgba(152, 113, 69, 0.28);
  border-radius: 4px 10px 4px 9px;
  background: rgba(255, 249, 233, 0.91);
  color: #75574b;
  font-size: 16px;
  font-style: italic;
  line-height: 1.25;
  text-align: center;
  transform: rotate(-2deg);
  box-shadow: 0 5px 12px rgba(76, 53, 36, 0.1);
}

.blue-flame {
  position: absolute;
  z-index: 4;
  top: 15px;
  right: 37px;
  width: 15px;
  height: 30px;
  border-radius: 70% 25% 70% 25%;
  background: linear-gradient(180deg, #b9f3ff, #56c9ff 50%, #418aff);
  box-shadow: 0 0 10px 4px rgba(73, 186, 255, 0.45), 0 0 22px 9px rgba(56, 160, 255, 0.23);
  opacity: 0.78;
  transform: rotate(14deg);
  animation: flame-dance 1.1s ease-in-out infinite alternate;
  pointer-events: none;
}

.frog-secret {
  position: absolute;
  z-index: 5;
  right: 29px;
  bottom: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: saturate(0.6);
  font-size: 19px;
  opacity: 0.52;
  transition: transform 0.2s, opacity 0.2s;
}

.frog-secret:hover,
.frog-secret:focus-visible {
  opacity: 1;
  transform: translateY(-4px) rotate(-8deg);
}

.draw-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  margin-top: -2px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #b86e68, #c98270);
  box-shadow: 0 10px 23px rgba(159, 82, 77, 0.22);
  color: #fffaf2;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draw-button:hover {
  box-shadow: 0 13px 26px rgba(159, 82, 77, 0.28);
  transform: translateY(-2px);
}

.draw-button:active {
  transform: translateY(1px);
}

.button-icon {
  font-size: 18px;
}

.draw-hint {
  margin: 10px 0 0;
  color: #9b8879;
  font-size: 13px;
  font-style: italic;
}

.letter-section {
  max-width: 760px;
  margin: 0 auto 40px;
  scroll-margin-top: 20px;
}

.letter-section[hidden],
.memory-reveal[hidden] {
  display: none;
}

.letter-card {
  position: relative;
  overflow: hidden;
  padding: clamp(25px, 6vw, 52px);
  border: 1px solid rgba(140, 111, 78, 0.24);
  border-radius: 5px 14px 6px 13px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(163, 134, 98, 0.08) 31px 32px),
    linear-gradient(135deg, #fffaf0, #f8edda);
  box-shadow: var(--shadow);
}

.letter-pop {
  animation: letter-appear 0.5s ease both;
}

.letter-card::after {
  position: absolute;
  top: -45px;
  right: -35px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(186, 116, 102, 0.16);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.letter-card-top,
.letter-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.letter-kind {
  color: var(--rose-dark);
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.letter-number {
  color: #97836e;
  font-size: 14px;
}

.letter-greeting {
  margin: 38px 0 12px;
  color: #705649;
  font-size: 22px;
  font-style: italic;
}

.letter-message {
  margin: 0;
  color: #4c3b32;
  font-size: clamp(26px, 4.4vw, 39px);
  line-height: 1.35;
}

.letter-card-bottom {
  margin-top: 34px;
  color: #826f62;
  font-size: 16px;
  font-style: italic;
}

.signature-heart {
  color: var(--rose);
  font-size: 23px;
}

.memory-reveal {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed rgba(145, 108, 76, 0.34);
}

.memory-reveal img,
.memory-reveal video {
  display: block;
  width: 100%;
  max-height: 430px;
  border: 6px solid #fffaf1;
  border-radius: 4px;
  background: #e8ddce;
  box-shadow: 0 8px 22px rgba(67, 47, 32, 0.17);
  object-fit: contain;
}

.memory-reveal video {
  object-fit: contain;
}

.memory-caption {
  margin: 12px 0 0;
  color: #78675a;
  font-size: 15px;
  font-style: italic;
  line-height: 1.55;
  text-align: center;
}

.calendar-section {
  position: relative;
  margin: 10px 0 0;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(125, 103, 79, 0.13);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.72);
  box-shadow: 0 15px 38px rgba(76, 55, 39, 0.055);
  scroll-margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading .kicker {
  margin-bottom: 8px;
}

h2 {
  font-size: clamp(35px, 5vw, 48px);
  letter-spacing: -0.025em;
}

.progress-block {
  display: grid;
  min-width: 112px;
  justify-items: end;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.progress-block strong {
  color: var(--rose-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 600;
}

.count-divider {
  color: #b7a89a;
  font-size: 17px;
  font-weight: 400;
}

.calendar-help {
  max-width: 620px;
  margin: 14px 0 20px;
  color: #817165;
  font-size: 14px;
  line-height: 1.6;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 8px;
}

.calendar-day {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(163, 132, 98, 0.18);
  border-radius: 9px;
  background: rgba(238, 222, 196, 0.34);
  color: #8b7763;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.calendar-day:hover {
  border-color: rgba(185, 111, 104, 0.48);
  background: #f7e7d6;
  transform: translateY(-2px);
}

.calendar-day.is-opened {
  border-color: rgba(126, 148, 112, 0.32);
  background: #e6eadb;
  color: #536c4d;
}

.calendar-day.is-special::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c78168;
  content: "";
}

.calendar-day.is-current {
  outline: 2px solid rgba(185, 111, 104, 0.68);
  outline-offset: 2px;
}

.save-note {
  margin: 16px 0 0;
  color: #9a8b7e;
  font-size: 12px;
  font-style: italic;
}

.little-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 34px auto 10px;
  color: #806e60;
  text-align: center;
}

.little-note p {
  max-width: 550px;
  margin: 0;
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
}

.little-note-flower {
  color: #b88178;
  font-size: 21px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 0 12px;
  color: #9b8978;
  font-size: 13px;
  font-style: italic;
}

.frog-dialog {
  position: relative;
  width: min(390px, calc(100% - 28px));
  padding: 24px;
  border: 1px solid rgba(122, 100, 74, 0.22);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow);
}

.frog-dialog::backdrop {
  background: rgba(39, 35, 34, 0.46);
  backdrop-filter: blur(3px);
}

.frog-dialog img {
  display: block;
  width: 100%;
  max-height: 230px;
  margin: 0 auto 20px;
  border-radius: 9px;
  object-fit: cover;
}

.frog-dialog .kicker {
  margin-bottom: 7px;
}

.frog-dialog h2 {
  margin-bottom: 10px;
  font-size: 34px;
}

.frog-dialog p:last-child {
  margin-bottom: 0;
  color: #76665a;
  line-height: 1.6;
}

.dialog-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 11px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.9);
  color: #6f5b4f;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 27px;
  line-height: 1;
}

@keyframes glow {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes flame-dance {
  from { transform: rotate(10deg) scale(0.92); }
  to { transform: rotate(22deg) scale(1.08); }
}

@keyframes jar-wiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-4deg); }
  45% { transform: rotate(3deg); }
  70% { transform: rotate(-2deg); }
}

@keyframes letter-appear {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 28px, 580px);
  }

  .site-header {
    min-height: 70px;
    justify-content: center;
  }

  .header-note {
    display: none;
  }

  .welcome {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 38px 2% 32px;
    text-align: center;
  }

  .welcome-copy {
    padding-bottom: 0;
  }

  h1 {
    font-size: clamp(57px, 14vw, 78px);
  }

  .welcome-text {
    max-width: 490px;
    margin-right: auto;
    margin-left: auto;
    font-size: 16px;
  }

  .jar-scene {
    min-height: 460px;
    margin-top: 4px;
  }

  .fairy-lights {
    top: 12px;
  }

  .jar {
    transform: scale(0.92);
  }

  .jar.is-drawing {
    animation: jar-wiggle-mobile 0.65s ease-in-out;
  }

  .calendar-section {
    padding: 24px 18px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
  }

  .calendar-day {
    border-radius: 8px;
    font-size: 12px;
  }

  .calendar-day.is-special::after {
    right: 3px;
    bottom: 3px;
  }
}

@media (max-width: 420px) {
  .welcome {
    padding-top: 30px;
  }

  .jar-scene {
    min-height: 420px;
  }

  .jar {
    transform: scale(0.83);
  }

  .jar.is-drawing {
    animation: jar-wiggle-mobile-small 0.65s ease-in-out;
  }

  .section-heading {
    align-items: flex-start;
  }

  .progress-block {
    min-width: auto;
    padding-top: 3px;
  }

  .progress-block strong {
    font-size: 20px;
  }

  .progress-block > span {
    max-width: 78px;
    text-align: right;
  }

  .calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    font-size: 11px;
  }

  .calendar-day.is-special::after {
    width: 3px;
    height: 3px;
  }
}

@keyframes jar-wiggle-mobile {
  0%, 100% { transform: scale(0.92) rotate(0deg); }
  20% { transform: scale(0.92) rotate(-4deg); }
  45% { transform: scale(0.92) rotate(3deg); }
  70% { transform: scale(0.92) rotate(-2deg); }
}

@keyframes jar-wiggle-mobile-small {
  0%, 100% { transform: scale(0.83) rotate(0deg); }
  20% { transform: scale(0.83) rotate(-4deg); }
  45% { transform: scale(0.83) rotate(3deg); }
  70% { transform: scale(0.83) rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
