/* PHONE — a countdown that fills the first screen, then a string hanging 24 tags down the page. */

#login {
  min-height: 100svh; display: grid; align-content: center; justify-items: center; gap: 1.3rem; text-align: center;
  padding: 2rem 16px calc(2rem + env(safe-area-inset-bottom));
}
#login .title { font-size: clamp(2.5rem, 12vw, 3.6rem); }
.who-q { margin: .4rem 0 0; font-style: italic; font-weight: 300; color: var(--paper-dim); }
.who { display: grid; gap: 1.1rem; justify-items: center; }
.tag { font-size: 1.2rem; min-width: 12rem; }
#login-form { display: grid; gap: 1.1rem; width: 100%; max-width: 320px; justify-items: center; animation: screen-in .5s var(--ease-out); }
#login-form .field { width: 100%; }
#login-form input { font-size: 18px; } /* ≥16px: no iOS zoom */

#app { padding: calc(10px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; padding: 6px 0; margin: 0 -16px; padding-inline: 16px;
  background: linear-gradient(var(--night) 60%, transparent); }

.hero {
  min-height: calc(100svh - 70px); display: grid; align-content: center; justify-items: center; gap: 1.1rem; text-align: center;
}
.hero .count { gap: 4vw; flex-wrap: wrap; }
.hero .digits { font-size: clamp(2.6rem, 15vw, 4.2rem); letter-spacing: -.03em; }
.hero .unit small { font-size: .78rem; }
.hero .scroll-cue { margin-top: 2rem; padding: .6em 1.2em; border: 1px solid var(--paper-faint); border-radius: 999px; }

.side { display: grid; gap: 1.2rem; justify-items: center; text-align: center; padding: 2.4rem 0 1.4rem; }
.side-title { font-size: clamp(2.2rem, 11vw, 3rem); }
.legend { justify-items: start; }
.side-hint { margin: 0; max-width: 30ch; }

/* the string */
.calendar { position: relative; padding: 1.5rem 0 3rem; }
.tree { display: none; }
.string {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 24px; transform: translateX(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='120'%3E%3Cpath d='M12 0 C 4 30, 20 90, 12 120' fill='none' stroke='%232f7a4e' stroke-width='1.6'/%3E%3C/svg%3E") repeat-y;
  opacity: .8;
}
.gifts { position: relative; display: grid; gap: 6px; }
.gifts > li {
  position: relative; display: flex; justify-content: flex-end; padding-right: calc(50% + 22px);
  scroll-margin: 40vh;
}
.gifts > li:nth-child(even) { justify-content: flex-start; padding: 0 0 0 calc(50% + 22px); }
.gifts > li::before { /* the little thread from the string to the gift */
  content: ""; position: absolute; top: 18px; height: 1.5px; width: 34px; background: var(--pine-2); right: 50%;
}
.gifts > li:nth-child(even)::before { left: 50%; right: auto; }
.gifts > li::after { content: ""; position: absolute; top: 14px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--berry); }
.gifts > li:nth-child(4n+2)::after, .gifts > li:nth-child(4n+3)::after { background: var(--frost); }

.gift { --w: 84px; --rot: 0deg; transform-origin: 50% -10%; animation: sway calc(3.2s + var(--i) * 90ms) ease-in-out infinite alternate; }
.gift.is-for-me.is-ready { animation: sway 3s ease-in-out infinite alternate, glow 2.6s ease-in-out infinite; }
.gifts > li:nth-child(even) .gift { animation-direction: alternate-reverse; }
.gift .g-state { font-size: 12px; top: auto; bottom: -10px; right: 50%; transform: translateX(50%); }
.gift:active { transform: scale(.94); }
.foot { margin-top: 1rem; }

/* bottom sheet */
.sheet {
  left: 0; right: 0; bottom: 0; max-height: 92svh; overflow: auto;
  padding: 2.6rem 16px calc(1.4rem + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; border-width: 1px 0 0;
  animation: slide-up .45s var(--ease-out);
}
.sheet::before { content: ""; position: absolute; top: 10px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 4px; background: var(--paper-faint); }
.sheet-title { font-size: 1.55rem; }
.note { min-height: 40svh; font-size: 1.5rem; }
.sheet-row .btn { flex: 1 1 100%; padding-block: .85em; }
.sheet-row .counter { margin: 0 auto; }
.field input { font-size: 18px; }
.letter { padding: 1.4rem 1.2rem 1rem; }
.letter-text { font-size: 1.6rem; }

@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes slide-up { from { transform: translateY(100%); } }
