@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/Unbounded.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/fonts/Onest.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --spruce: #0f3833;
  --spruce-deep: #082823;
  --cranberry: #b62c49;
  --cranberry-dark: #861c36;
  --ice: #eaf2ef;
  --paper: #f9faf5;
  --ochre: #d3a84c;
  --ink: #142923;
  --muted: #5f6f69;
  --line: rgba(15, 56, 51, .2);
  --display: 'Unbounded', sans-serif;
  --body: 'Onest', sans-serif;
  --content: 1200px;
  --focus: #d3a84c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--ice); color: var(--ink); font-family: var(--body); line-height: 1.5; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.is-hidden { display: none !important; }
.snow { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.snowflake { position: absolute; top: -8vh; left: var(--left); width: var(--size); height: var(--size); border-radius: 50%; background: #fff; opacity: 0; animation: snowfall var(--duration) linear var(--delay) infinite; will-change: transform, opacity; }
.snowflake.soft { filter: blur(.7px); }
@keyframes snowfall {
  0% { opacity: 0; transform: translate3d(0, -5vh, 0) rotate(0); }
  12% { opacity: var(--opacity); }
  48% { transform: translate3d(var(--drift), 48vh, 0) rotate(140deg); }
  82% { opacity: var(--opacity); }
  100% { opacity: 0; transform: translate3d(var(--end-drift), 112vh, 0) rotate(320deg); }
}

.auth-screen { min-height: 100vh; overflow: hidden; background: var(--spruce); }
.hat-scene { position: relative; z-index: 20; height: 100vh; height: 100dvh; overflow: hidden; background: var(--spruce); transform: translateY(0); transition: transform .8s cubic-bezier(.76, 0, .24, 1); }
.hat-scene.is-raised { position: fixed; inset: 0 0 auto; height: 100vh; height: 100dvh; transform: translateY(calc(-100% + 72px)); }
.hat-scene.is-raised .hat-hint, .hat-scene.is-raised .hat-poster, .hat-scene.is-raised .hat-login { display: none; }
.hat-interactive { position: absolute; inset: 0; z-index: 1; touch-action: none; user-select: none; overscroll-behavior: contain; }
.santa-hat { position: absolute; top: 52%; left: 56%; display: block; width: min(1100px, 92vw); height: auto; margin: 0; transform: translate(-50%, -50%) rotate(-5deg); filter: drop-shadow(18px 28px 0 rgba(4,34,29,.35)); }
.hat-poster { position: absolute; top: 7vh; left: 5vw; z-index: 2; color: var(--paper); pointer-events: none; }
.hat-poster > p { margin: 0 0 22px; color: #c8d8d2; font-size: 14px; }
.hat-poster h1 { margin: 0 0 24px; color: var(--paper); font-size: clamp(58px, 8.5vw, 126px); font-weight: 650; line-height: .96; letter-spacing: -.075em; }
.hat-poster > span { display: block; max-width: 360px; color: #d9e4df; font-size: 16px; line-height: 1.55; }
.hat-login { position: absolute; top: 28px; right: 4vw; z-index: 3; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid #a9c1b8; background: transparent; color: var(--paper); font-size: 14px; }
.hat-login:hover { border-color: var(--ochre); color: var(--ochre); }
.hat-hint { position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); left: 50%; z-index: 4; padding: 12px 17px; border: 1px solid rgba(255,255,255,.55); background: var(--spruce); color: var(--paper); font-size: 13px; font-weight: 600; white-space: nowrap; transform: translateX(-50%); }
.swipe-arrow { display: inline-block; margin-right: 7px; color: var(--ochre); font-size: 18px; }

.welcome-content { position: relative; min-height: 55vh; padding: 80px 5vw; background: var(--ice); }
.intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8vw; align-items: start; max-width: var(--content); margin: 0 auto; }
.eyebrow { margin: 0 0 18px; color: var(--cranberry); font-size: 13px; font-weight: 650; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); }
h1 { font-size: clamp(44px, 6vw, 88px); font-weight: 580; line-height: 1.04; letter-spacing: -.065em; }
h1 em { font-style: normal; font-weight: inherit; }
h2 { font-size: clamp(32px, 4vw, 54px); font-weight: 540; line-height: 1.12; letter-spacing: -.055em; }
h3 { margin-bottom: 20px; font-size: 22px; font-weight: 560; letter-spacing: -.035em; }
.intro h2 { margin: 0; }
.intro-copy { max-width: 500px; margin-bottom: 30px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 35px; min-height: 56px; padding: 16px 24px; border: 1px solid var(--cranberry-dark); border-radius: 0; background: var(--cranberry); color: #fff; box-shadow: 5px 5px 0 var(--ochre); font-size: 14px; font-weight: 650; transition: background .2s, box-shadow .2s; }
.primary-button:hover { background: var(--cranberry-dark); box-shadow: 2px 2px 0 var(--ochre); }
.primary-button span { color: #fff; font-size: 19px; }
.text-button { display: block; min-height: 44px; margin: 12px auto 0; padding: 8px 5px; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--muted); font-size: 13px; }
.reveal-note { max-width: 420px; margin: 30px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.hat-scene.is-raised ~ .welcome-content { padding-top: 110px; }
.registration-form { max-width: 1050px; margin: 0 auto; }
.form-heading { max-width: 800px; margin-bottom: 55px; }
.form-heading h2 { margin-bottom: 18px; }
.form-heading > p:last-child { color: var(--muted); font-size: 16px; }
.form-section { display: grid; grid-template-columns: 105px 1fr; gap: 25px; padding: 40px 0 48px; border-top: 1px solid var(--line); }
.section-number { display: block; padding-top: 3px; color: var(--cranberry); font-family: var(--display); font-size: 23px; font-weight: 500; }
.credentials-fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.credentials-fields h3 { grid-column: 1 / -1; }
.section-fields label, .login-dialog label { display: block; margin-bottom: 22px; color: var(--ink); font-size: 13px; font-weight: 650; }
input, textarea { display: block; width: 100%; margin-top: 9px; padding: 14px 15px; border: 1px solid #adbbb5; border-radius: 0; background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 400; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus { border-color: var(--spruce); box-shadow: inset 4px 0 0 var(--ochre); }
textarea { min-height: 125px; resize: vertical; line-height: 1.55; }
label small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.wishlist-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.wishlist-heading h3 { margin-bottom: 8px; }
.wishlist-heading p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.wish-count { flex: none; padding: 5px 0; border-bottom: 2px solid var(--cranberry); color: var(--cranberry); font-family: var(--display); font-size: 12px; }
.wish-card { position: relative; margin: 25px 0; padding: 24px 25px; border-left: 4px solid var(--cranberry); background: var(--paper); }
.wish-card .section-fields label { margin-bottom: 16px; }
.remove-wish { position: absolute; top: 4px; right: 6px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
.wish-actions { display: flex; align-items: center; gap: 15px; }
.secondary-button { min-height: 44px; padding: 10px 15px; border: 1px solid var(--spruce); border-radius: 0; background: transparent; color: var(--spruce); font-size: 12px; font-weight: 650; }
.secondary-button:hover { background: var(--spruce); color: #fff; }
.image-status { margin: 0; color: var(--muted); font-size: 11px; }
.image-candidates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.image-candidate { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; border: 3px solid transparent; border-radius: 0; background: #d9e2dc; }
.image-candidate img { width: 100%; height: 100%; object-fit: cover; }
.image-candidate.selected { border-color: var(--ochre); }
.image-candidate.selected::after { content: '✓'; position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; background: var(--spruce); color: white; line-height: 30px; }
.selected-image-label { margin: 12px 0 0; color: var(--spruce); font-size: 12px; }
.form-footer { padding: 25px 0 0 130px; }
.form-footer > small { display: block; margin-top: 15px; color: var(--muted); font-size: 11px; }
.draft-status { color: var(--muted); font-size: 11px; }

.confirmation-panel { position: fixed; top: 55px; left: 50%; z-index: 19; width: min(640px, calc(100vw - 28px)); max-height: calc(100vh - 75px); overflow-y: auto; padding: 42px; border-top: 6px solid var(--cranberry); background: var(--paper); box-shadow: 14px 20px 0 rgba(8,40,35,.22); transform: translate(-50%, -120%); transition: transform .5s cubic-bezier(.76, 0, .24, 1); }
.confirmation-panel.is-visible { z-index: 70; transform: translate(-50%, 0); }
.close-button { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 28px; }
.confirmation-summary { margin: 28px 0; }
.confirmation-summary > div { display: grid; grid-template-columns: 110px 1fr; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }
.confirmation-summary dt { color: var(--muted); font-size: 12px; }
.confirmation-summary dd { max-height: 100px; overflow: auto; margin: 0; white-space: pre-wrap; }
.confirmation-warning { color: var(--muted); font-size: 12px; line-height: 1.55; }
.confirmation-panel .primary-button { width: 100%; }

.member-screen { min-height: 100vh; }
.member-header { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 82px; padding: 0 5vw; border-bottom: 1px solid var(--line); background: var(--paper); }
.mini-brand { color: var(--spruce); font-family: var(--display); font-size: 15px; font-weight: 600; text-decoration: none; }
.mini-brand span { margin-left: 8px; color: var(--ochre); }
.member-actions { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 13px; }
.member-actions .text-button { margin: 0; }
.waiting-view { display: grid; grid-template-columns: .9fr 1.25fr; align-items: center; gap: 5vw; max-width: 1350px; min-height: calc(100vh - 82px); margin: auto; padding: 60px 5vw; }
.waiting-copy h1 { margin-bottom: 30px; font-size: clamp(42px, 5vw, 70px); }
.waiting-copy > p:last-child { max-width: 500px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.countdown-wrap { position: relative; min-height: 490px; overflow: hidden; padding: 70px 25px 35px; background: var(--spruce); color: var(--paper); text-align: center; clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); }
.countdown-wrap > p { position: relative; z-index: 2; margin-bottom: 55px; color: #c7d9d2; font-size: 15px; }
.countdown-wrap > small { position: absolute; right: 30px; bottom: 35px; left: 30px; z-index: 2; color: #b9cdc5; font-size: 11px; }
.countdown { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: center; gap: 10px; }
.countdown div { min-width: 78px; }
.countdown strong { display: block; font-family: var(--display); font-size: clamp(36px, 4vw, 61px); font-weight: 450; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.07em; }
.countdown span { display: block; margin-top: 13px; color: #b9cdc5; font-size: 11px; }
.countdown i { color: var(--ochre); font-family: var(--display); font-size: 30px; font-style: normal; }
.gift { position: absolute; display: block; }
.gift-background { right: -25px; bottom: -100px; left: -25px; height: 330px; opacity: .12; transform: rotate(-6deg); }
.gift-box { position: absolute; right: 15%; bottom: 0; left: 15%; height: 70%; background: var(--ice); }
.gift-lid { position: absolute; top: 16%; right: 11%; left: 11%; z-index: 2; height: 20%; background: var(--paper); }
.gift-box::after, .gift-lid::after { content: ''; position: absolute; top: 0; bottom: 0; left: 45%; width: 10%; background: var(--ochre); }
.gift-bow { position: absolute; top: -2%; left: 50%; z-index: 3; width: 60px; height: 60px; border: 15px solid var(--ochre); border-radius: 50% 50% 0 50%; transform: translateX(-90%) rotate(25deg); }
.gift-bow::after { content: ''; position: absolute; top: -15px; left: 48px; width: 60px; height: 60px; border: 15px solid var(--ochre); border-radius: 50% 50% 50% 0; transform: rotate(-50deg); }

.gift-view { display: flex; min-height: calc(100vh - 82px); flex-direction: column; align-items: center; justify-content: center; padding: 45px 20px; background: var(--cranberry-dark); color: var(--paper); text-align: center; }
.gift-view h1 { margin-bottom: 20px; font-size: clamp(54px, 7vw, 100px); }
.gift-view .eyebrow { color: #efcbd3; }
.gift-button { position: relative; width: min(390px, 88vw); height: 330px; border: 0; background: transparent; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.gift-main { inset: 25px 25px 0; transition: transform .15s; }
.gift-main .gift-box { background: var(--cranberry); box-shadow: 14px 14px 0 rgba(63,8,24,.3); }
.gift-main .gift-lid { background: #cd4962; box-shadow: 14px 8px 0 rgba(63,8,24,.25); }
.gift-button:hover .gift-main { transform: rotate(2deg); }
.gift-button.tapped .gift-main { transform: scale(.94) rotate(-3deg); }
.gift-glow { position: absolute; inset: 10%; border: 1px solid rgba(239,203,211,.3); border-radius: 50%; }
.tap-instruction { margin: 5px 0 20px; color: #efcbd3; font-size: 15px; line-height: 1.6; }
.tap-dots { display: flex; gap: 10px; }
.tap-dots span { width: 12px; height: 12px; border: 1px solid var(--ochre); }
.tap-dots span.active { background: var(--ochre); }

.recipient-view { max-width: var(--content); margin: 0 auto; padding: 60px 5vw 40px; }
.recipient-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 35px; margin: -60px -5vw 0; padding: 60px 5vw 55px; background: var(--spruce); color: var(--paper); }
.recipient-heading .eyebrow { color: #b9cdc5; }
.recipient-heading h1 { margin: 0; font-size: clamp(38px, 5vw, 70px); }
.recipient-heading h1 em { color: var(--paper); overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 3px; text-underline-offset: 10px; }
.my-name { flex: none; min-width: 160px; padding: 18px 20px; background: var(--ochre); color: var(--spruce-deep); }
.my-name span { display: block; margin-bottom: 6px; font-size: 11px; }
.my-name strong { display: block; font-family: var(--display); font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }
.about-recipient { display: grid; grid-template-columns: 105px 1fr; gap: 25px; padding: 50px 0 55px; border-bottom: 1px solid var(--line); }
.about-recipient h2, .recipient-wishes h2 { margin-bottom: 20px; font-size: 30px; }
.about-recipient p { max-width: 780px; margin: 0; color: #42554e; font-size: 18px; line-height: 1.7; white-space: pre-wrap; }
.recipient-wishes { padding-top: 45px; }
.wishlist-title { display: flex; gap: 25px; }
.wishlist-title p { color: var(--muted); font-size: 13px; }
.generated-notice { margin: 20px 0 30px 130px; padding: 16px 18px; border-left: 4px solid var(--cranberry); background: #f1e3c5; color: #5b491f; font-size: 12px; line-height: 1.6; }
.recipient-wishlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 35px 0; }
.recipient-card { min-width: 0; padding-bottom: 18px; border-bottom: 3px solid var(--spruce); }
.recipient-image { position: relative; aspect-ratio: 1; overflow: hidden; background: #d9e2dc; }
.recipient-image img { width: 100%; height: 100%; object-fit: cover; }
.recipient-card h3 { margin: 18px 0 7px; font-family: var(--body); font-size: 17px; font-weight: 650; letter-spacing: 0; overflow-wrap: anywhere; }
.recipient-card a { color: var(--muted); font-size: 12px; text-decoration: none; border-bottom: 1px solid var(--line); }
.empty-state { padding: 30px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.recipient-footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.recipient-footer span { margin-left: 10px; color: var(--ochre); }

.login-dialog { width: min(480px, calc(100vw - 30px)); padding: 42px; border: 0; border-top: 6px solid var(--cranberry); border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: 14px 20px 0 rgba(8,40,35,.25); }
.login-dialog::backdrop { background: rgba(8,40,35,.82); backdrop-filter: blur(4px); }
.login-dialog h2 { margin-bottom: 30px; }
.login-dialog .primary-button { width: 100%; }
.form-error { min-height: 18px; color: var(--cranberry); font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; left: 20px; z-index: 100; max-width: 500px; margin: auto; padding: 15px 20px; border-left: 4px solid var(--ochre); background: var(--spruce); color: white; box-shadow: 8px 8px 0 rgba(8,40,35,.2); font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transform: translateY(15px); transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--cranberry-dark); }

@media (max-width: 760px) {
  .hat-poster { top: 10vh; left: 22px; }
  .hat-poster > p { max-width: 240px; margin-bottom: 17px; font-size: 12px; }
  .hat-poster h1 { font-size: clamp(47px, 14vw, 70px); }
  .hat-poster > span { max-width: 260px; font-size: 13px; }
  .santa-hat { top: 58%; left: 20%; width: 120vw; max-width: none; }
  .hat-login { top: 18px; right: 20px; }
  .hat-hint { bottom: max(22px, env(safe-area-inset-bottom)); }
  .welcome-content { padding: 50px 22px 65px; }
  .hat-scene.is-raised ~ .welcome-content { padding-top: 100px; }
  .intro { grid-template-columns: 1fr; gap: 30px; }
  .intro-copy { font-size: 16px; }
  .form-section { grid-template-columns: 48px 1fr; gap: 10px; padding: 32px 0; }
  .section-number { font-size: 17px; }
  .credentials-fields { grid-template-columns: 1fr; }
  .credentials-fields h3 { grid-column: auto; }
  .image-candidates { grid-template-columns: repeat(3, 1fr); }
  .wish-actions { align-items: flex-start; flex-direction: column; }
  .form-footer { padding-left: 0; }
  .confirmation-panel { padding: 35px 22px; }
  .member-header { height: 72px; padding: 0 20px; }
  .mini-brand { font-size: 12px; }
  .member-actions { gap: 9px; }
  .waiting-view { grid-template-columns: 1fr; min-height: calc(100vh - 72px); padding: 40px 20px; }
  .waiting-copy h1 { font-size: 39px; }
  .countdown-wrap { min-height: 385px; padding: 50px 15px 30px; }
  .countdown-wrap > p { margin-bottom: 50px; }
  .countdown { gap: 4px; }
  .countdown div { min-width: 57px; }
  .countdown strong { font-size: 34px; }
  .countdown i { font-size: 23px; }
  .gift-view { min-height: calc(100vh - 72px); }
  .gift-view h1 { font-size: 56px; }
  .recipient-view { padding-top: 35px; }
  .recipient-heading { display: block; margin-top: -35px; padding-top: 40px; }
  .recipient-heading h1 { font-size: 38px; }
  .my-name { margin-top: 35px; }
  .about-recipient { grid-template-columns: 48px 1fr; gap: 10px; padding: 35px 0; }
  .about-recipient h2, .recipient-wishes h2 { font-size: 25px; }
  .about-recipient p { font-size: 16px; }
  .wishlist-title { gap: 10px; }
  .generated-notice { margin-left: 0; }
  .recipient-wishlist { grid-template-columns: 1fr; gap: 35px; }
  .login-dialog { padding: 35px 24px; }
}

@media (max-width: 390px) {
  .hat-poster h1 { font-size: 44px; }
  .countdown div { min-width: 50px; }
  .countdown strong { font-size: 29px; }
  .countdown i { font-size: 19px; }
  .member-actions > span { display: none; }
  .recipient-heading h1 { font-size: 33px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}
