/* Mailroom introductions (the welcome gift, the Wishing Tree, Santa Claws, "There's more inside") and the daily "+50 Wishes" moment.
   One card in the house style: cream airmail letter, Russo One title, gold PLAY-style button. The room dims, a spotlight hole
   opens over the button being introduced (the shade is clipped around it, so the real button stays tappable), gold rings pulse
   round it and a big gold arrow bobs underneath with its name on a tag. post-notes.js places everything from the button's rect. */

.mailNote { position: fixed; inset: 0; z-index: 20; pointer-events: none; }   /* only the shade and the card take taps */
.introShade { position: absolute; inset: 0; pointer-events: auto; background: radial-gradient(ellipse at 50% 60%, rgba(10,12,40,.62), rgba(4,5,22,.86));
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: introFade .45s ease both; }

.introRing { position: fixed; border-radius: 50%; pointer-events: none; box-sizing: border-box; border: 4px solid #ffe27a;
  box-shadow: 0 0 0 3px rgba(120,60,0,.55), 0 0 26px 6px rgba(255,214,90,.75), inset 0 0 18px rgba(255,214,90,.55); animation: introPulse 1.3s ease-in-out infinite; }
.introRing::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; border: 3px solid rgba(255,226,122,.85); animation: introRipple 1.6s ease-out infinite; }
.introRing2 { border-width: 3px; animation-delay: .4s; }
.introRing2::after { animation-delay: .5s; }

.introPointer { position: fixed; width: clamp(34px, 3.6vw, 50px); pointer-events: none; transform: translate(-50%, -50%); filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.introPointer.side { transform: translate(-50%, -50%) rotate(90deg); }
/* "There's more inside" points at a door from whichever side has room */
.introPointer.up { transform: translate(-50%, -50%) rotate(180deg); }
.introPointer.left { transform: translate(-50%, -50%) rotate(-90deg); }
.introPointer.right { transform: translate(-50%, -50%) rotate(90deg); }
.introPointer svg { display: block; width: 100%; height: auto; animation: introBob .9s ease-in-out infinite alternate; }
.introTag { position: fixed; margin: 0; pointer-events: none; white-space: nowrap; padding: 6px 14px 7px; border-radius: 999px;
  font: 400 clamp(14px, 1.3vw, 19px)/1 'Russo One', sans-serif; letter-spacing: .04em; color: var(--gold2, #ffd45a);
  background: linear-gradient(#1b2a66, #0d1640); border: 2px solid #e5b94e; box-shadow: 0 4px 12px rgba(0,0,0,.5); animation: introFade .5s .25s ease both; }
.introTag2 { font-size: clamp(12px, 1vw, 15px); padding: 4px 11px 5px; }

.introStage { position: fixed; left: 0; right: 0; bottom: 0; display: grid; place-items: center; padding: 0 12px calc(var(--safeB, 0px) + 12px); box-sizing: border-box; pointer-events: none; }
.introCard { position: relative; pointer-events: auto; box-sizing: border-box; width: min(520px, 100%); max-height: 100%; overflow: auto; text-align: center;
  padding: clamp(16px, 2.4vh, 28px) clamp(18px, 2.4vw, 34px) clamp(16px, 2.2vh, 26px); color: var(--navy, #14204a);
  background: var(--cream, #fbf3e1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  border: clamp(9px, .9vw, 13px) solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--red, #c8232f) 0 16px, var(--cream, #fbf3e1) 16px 24px, var(--blue, #2a4fb0) 24px 40px, var(--cream, #fbf3e1) 40px 48px) 14;
  box-shadow: 0 22px 60px rgba(0,0,0,.6); animation: introIn .6s cubic-bezier(.2,1.3,.4,1) both; }
.introClose { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(20,32,74,.08); color: var(--navy, #14204a); cursor: pointer; display: grid; place-items: center; }
.introClose svg { width: 20px; height: 20px; }
.introKick { display: flex; align-items: center; gap: 10px; margin: 0 26px 6px; font: 400 clamp(12px, 1.1vw, 15px)/1 'Russo One', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--navy, #14204a); }
.introKick i { flex: 1; height: 0; border-top: 3px double rgba(20,32,74,.45); }
.introKick b { font-weight: 400; color: var(--red, #c8232f); }
.introArt { --a: clamp(84px, 15vh, 150px); width: var(--a); height: var(--a); flex: none; overflow: hidden; margin: 2px auto 4px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #2e3f86, #101a46 72%); border: 4px solid #e5b94e; box-shadow: 0 0 0 3px #fff3c4, 0 8px 18px rgba(40,20,0,.35), 0 0 30px rgba(255,214,90,.55); }
.introArt img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); animation: introBob 1.6s ease-in-out infinite alternate; }
.introTitle { margin: 6px 0 6px; font: 400 clamp(26px, 3vw, 42px)/1.05 'Russo One', sans-serif; color: var(--navy, #14204a); }
.introBody { margin: 0 auto 10px; max-width: 30em; font: 600 clamp(15px, 1.2vw, 18px)/1.35 'Chakra Petch', sans-serif; color: #3a3a5a; }
.introBody b { color: var(--red, #c8232f); white-space: nowrap; }
.introList { list-style: none; margin: 0 auto 14px; padding: 0; display: grid; gap: 6px; width: fit-content; max-width: 100%; text-align: left; }
.introList:empty { display: none; }
.introList li { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(20,32,74,.07); font: 600 clamp(14px, 1.1vw, 16px)/1.2 'Chakra Petch', sans-serif; color: #2a2a4a; }
.introList li b { flex: none; min-width: 3.1em; padding: 5px 8px; border-radius: 999px; text-align: center; font: 400 clamp(14px, 1.1vw, 17px)/1 'Russo One', sans-serif; color: var(--gold2, #ffd45a);
  background: linear-gradient(#1b2a66, #0d1640); border: 2px solid #c89a3a; }
.introGo { display: flex; width: 100%; align-items: center; justify-content: center; gap: 12px; min-height: clamp(54px, 7vh, 78px); padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 3px solid #fff2b0; color: #3a1c00; font: 400 clamp(18px, 1.7vw, 24px)/1.05 'Russo One', sans-serif; letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe46a 30%, #ffc21e 52%, #f09a10 53%, #ffcf3a 100%);
  box-shadow: 0 6px 0 #9a5200, 0 12px 24px rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.9); position: relative; overflow: hidden; transition: transform .12s, filter .12s; }
.introGo::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); animation: shine 2.8s ease-in-out infinite 1s; }
.introGo:hover { filter: brightness(1.06); transform: translateY(-1px); }
.introGo:active { transform: translateY(4px); box-shadow: 0 2px 0 #9a5200, 0 6px 12px rgba(0,0,0,.3); }
.introLater { margin: 10px auto 0; display: block; min-height: 36px; padding: 0 16px; border: 0; background: none; cursor: pointer; font: 700 14px/1 'Chakra Petch', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #5b5b7a; }
.introLater:hover { color: var(--navy, #14204a); text-decoration: underline; }
.introGo:focus-visible, .introLater:focus-visible, .introClose:focus-visible { outline: 3px solid #2a4fb0; outline-offset: 3px; }

/* "There's more inside": the door's own stamp art fills the badge, and the title is the biggest thing on the card */
.mailNote[data-kind="more"] .introArt { --a: clamp(96px, 17vh, 170px); }
.mailNote[data-kind="more"] .introArt img { width: 100%; height: 100%; object-fit: cover; filter: none; animation: none; }
.mailNote[data-kind="more"] .introTitle { font-size: clamp(30px, 3.6vw, 52px); }
.mailNote[data-kind="more"] .introBody { font-size: clamp(16px, 1.35vw, 21px); }
.mailNote[data-kind="more"] .introCard { width: min(560px, 100%); }
.mailNote[data-kind="more"] .introRing::after { animation-name: introRippleNear; }   /* a cubby is big: a shorter ripple */
@keyframes introRippleNear { from { transform: scale(1); opacity: .9; } to { transform: scale(1.12); opacity: 0; } }

/* the daily gift: a gold ticket that pops in at the top for a few seconds */
.dailyDelivery { position: fixed; z-index: 19; top: calc(var(--safeT, 0px) + max(92px, 15vh));   /* under the tool row, never over the Wishes counter */ left: 50%; margin: 0; display: flex; align-items: center; gap: 12px; pointer-events: none;
  padding: 8px 22px 8px 10px; border-radius: 999px; color: var(--navy, #14204a); background: linear-gradient(180deg, #fffbe0, #ffe9a0 60%, #ffd45a); border: 3px solid #fff6c4;
  box-shadow: 0 0 0 3px #c8892a, 0 10px 30px rgba(0,0,0,.5), 0 0 40px rgba(255,214,90,.6); animation: dailyPop 3.6s cubic-bezier(.2,1.3,.4,1) both; }
.dailyDelivery img { width: clamp(40px, 4vw, 56px); height: auto; animation: dailySpin 1.2s .2s ease-out both; }
.dailyDelivery span { display: flex; flex-direction: column; align-items: flex-start; }
.dailyDelivery small { font: 700 clamp(12px, 1vw, 14px)/1.1 'Chakra Petch', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #6a4a1a; }
.dailyDelivery b { font: 400 clamp(22px, 2.2vw, 32px)/1.05 'Russo One', sans-serif; color: var(--red, #c8232f); }

@keyframes introFade { from { opacity: 0; } }
@keyframes introIn { from { opacity: 0; transform: translateY(26px) scale(.9); } }
@keyframes introPulse { 50% { transform: scale(1.06); } }
@keyframes introRipple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes introBob { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes dailyPop { 0% { opacity: 0; transform: translate(-50%, -30px) scale(.7); } 12%, 85% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -16px) scale(.96); } }
@keyframes dailySpin { from { transform: rotateY(540deg) scale(.4); } }

/* short landscape phones: a tighter card */
@media (max-height: 520px) and (orientation: landscape) {
  .introCard { width: min(600px, 100%); padding: 8px 16px 8px; display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px; row-gap: 3px; align-items: center; text-align: left; }
  .introKick { grid-column: 1 / -1; grid-row: 1; margin: 0 40px 4px 0; font-size: 11px; }
  .introArt { --a: 74px; grid-column: 1; grid-row: 2 / 5; margin: 0; border-width: 3px; }
  .introTitle { grid-column: 2 / -1; grid-row: 2; font-size: 22px; margin: 0; }
  .introBody { grid-column: 2 / -1; grid-row: 3; font-size: 13px; margin: 0 0 4px; }
  .introList { grid-column: 2 / -1; grid-row: 4; margin: 0 0 4px; gap: 2px; } .introList li { font-size: 12px; padding: 1px 10px 1px 3px; } .introList li b { font-size: 12px; padding: 3px 6px; }
  .introGo { grid-column: 1 / 3; grid-row: 5; min-height: 42px; font-size: 17px; }
  .introLater { grid-column: 3; grid-row: 5; margin: 0; min-height: 42px; }
  .introPointer { width: 26px; }
  .mailNote[data-kind="more"] .introArt { --a: 74px; }
  .mailNote[data-kind="more"] .introTitle { font-size: 24px; }
  .mailNote[data-kind="more"] .introBody { font-size: 13px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .dailyDelivery { top: auto; bottom: calc(var(--safeB, 0px) + 14px); }
}
@media (prefers-reduced-motion: reduce) {
  .introShade, .introRing, .introRing::after, .introPointer svg, .introTag, .introCard, .introArt img, .introGo::after, .dailyDelivery img { animation: none; }
  .dailyDelivery { animation: introFade .3s both; transform: translateX(-50%); }
}

/* a card that doesn't fit the room left beside a door (portrait phones): art beside the title, everything tighter
   (post-notes.js adds .tight when the card would scroll) */
.mailNote.tight .introCard { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; align-items: center; text-align: left; padding: 10px 14px 10px; }
.mailNote.tight .introKick { grid-column: 1 / -1; margin: 0 38px 2px 0; font-size: 11px; }
.mailNote.tight .introArt { --a: 64px; grid-column: 1; grid-row: 2; margin: 0; border-width: 3px; }
.mailNote.tight .introTitle { grid-column: 2; grid-row: 2; margin: 0; font-size: 24px; }
.mailNote.tight .introBody { grid-column: 1 / -1; margin: 2px 0 6px; font-size: 14px; }
.mailNote.tight .introList { grid-column: 1 / -1; }
.mailNote.tight .introGo { grid-column: 1 / -1; min-height: 48px; font-size: 18px; }
.mailNote.tight .introLater { grid-column: 1 / -1; margin: 2px auto 0; min-height: 32px; }

/* big screens (a 4K TV at 100%): the card, arrow and tags grow with the screen, so they read as they do at 1080p */
@media (min-width: 2400px) and (min-height: 1350px) { .introCard { zoom: 1.33; } .introPointer { width: 66px; } .introTag { font-size: 25px; } .introTag2 { font-size: 20px; } }
@media (min-width: 2880px) and (min-height: 1620px) { .introCard { zoom: 1.5; } .introPointer { width: 75px; } .introTag { font-size: 28px; } .introTag2 { font-size: 22px; } }
@media (min-width: 3400px) and (min-height: 1900px) { .introCard { zoom: 2; } .introPointer { width: 100px; } .introTag { font-size: 38px; padding: 10px 24px 12px; border-width: 3px; } .introTag2 { font-size: 30px; }
  .introRing { border-width: 7px; } }
