/* © 2026 Aaria's Blue Elephant — Thanksgiving card. Built by Aaria and her Friends 💙 */
:root {
  --ink: #16255c; --ink2: #34457e; --muted: #8a7558; --blue: #3a9ad9; --line: #1d5fa3;
  --pumpkin: #e8743b; --gold: #f2b134; --rust: #b4532a; --paper: #fffaf2; --bg: #fdf1de;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(60% 40% at 15% 10%, rgba(242, 177, 52, .18), transparent 70%),
    radial-gradient(50% 40% at 90% 90%, rgba(58, 154, 217, .14), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  display: flex; flex-direction: column; align-items: center;
  -webkit-tap-highlight-color: transparent;
}
#card { width: 100%; max-width: 500px; padding: 16px 16px 0; margin: auto 0; display: flex; flex-direction: column; }

#top { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
#top img { width: 28px; height: 28px; }
#eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* the card itself */
#frame {
  position: relative; width: 100%; aspect-ratio: 400 / 440; border-radius: 30px; overflow: hidden;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 0 0 1px rgba(22, 37, 92, .07),
              0 24px 50px -24px rgba(22, 37, 92, .45), 0 8px 18px -12px rgba(180, 83, 42, .35);
}
#scenes { position: absolute; inset: 0; }
.scene { position: absolute; inset: 0; opacity: 0; transform: scale(1.04); transition: opacity .9s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.scene.on { opacity: 1; transform: none; }
.scene svg { display: block; width: 100%; height: 100%; }

/* caption under the card */
#cap { position: relative; min-height: 150px; padding: 8px 4px 10px; text-align: center; }
.line { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.line + .line { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#cap h1 { margin: 0 0 6px; font-size: clamp(1.65rem, 7vw, 2.2rem); line-height: 1.08; font-weight: 900; letter-spacing: -.015em; }
#cap h2 { margin: 0 0 6px; font-size: clamp(1.15rem, 4.8vw, 1.42rem); line-height: 1.25; font-weight: 900; }
#cap p { margin: 4px 0; font-size: clamp(.98rem, 3.8vw, 1.08rem); line-height: 1.45; color: var(--ink2); }
#cap .note { font-size: .84rem; color: var(--muted); font-style: italic; }
#cap .big { font-size: clamp(1.55rem, 6.6vw, 2.05rem); line-height: 1.12; font-weight: 900; color: var(--ink); margin: 6px 0 0; }
#cap .big em { font-style: normal; color: var(--pumpkin); }

.ctas { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 14px auto 2px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 16px; padding: 14px 18px;
  font-weight: 900; font-size: 1.04rem; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #ffd43b; box-shadow: 0 10px 22px -10px rgba(22, 37, 92, .7); }
.btn.soft { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(22, 37, 92, .14); font-size: .98rem; padding: 12px 16px; }
.save { display: flex; flex-direction: column; align-items: center; gap: 3px; max-width: 360px; margin: 14px auto 2px; padding: 13px 16px;
  border-radius: 18px; background: linear-gradient(135deg, #fff3c4 0%, #ffd56b 55%, #f6b93b 100%);
  box-shadow: inset 0 0 0 2px #d99a1e, 0 12px 26px -12px rgba(180, 110, 10, .75); animation: saveglow 2.8s ease-in-out 1s infinite; }
.save-k { font-size: .76rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: #8a4b08; }
.save-v { font-size: clamp(1.15rem, 5vw, 1.35rem); font-weight: 900; color: var(--ink); line-height: 1.2; text-align: center; }
@keyframes saveglow { 0%, 100% { box-shadow: inset 0 0 0 2px #d99a1e, 0 12px 26px -12px rgba(180, 110, 10, .75); }
  50% { box-shadow: inset 0 0 0 2px #d99a1e, 0 0 0 6px rgba(246, 185, 59, .28), 0 12px 26px -12px rgba(180, 110, 10, .75); } }

/* the last screen: stay connected */
.connect { margin: 18px auto 0; max-width: 380px; padding-top: 16px; border-top: 1.5px dashed rgba(22, 37, 92, .18); }
.site { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; text-decoration: none; text-align: left;
  background: linear-gradient(135deg, #0b1226, #16255c); box-shadow: 0 12px 26px -14px rgba(22, 37, 92, .8); transition: transform .15s ease; }
.site:hover { transform: translateY(-1px); }
.site img { width: 54px; height: 54px; flex: none; border-radius: 14px; background: #fff; padding: 4px; object-fit: contain; }
.sitetxt { display: flex; flex-direction: column; min-width: 0; }
.sitetxt b { color: #5cb8f6; font-size: 1.18rem; font-weight: 900; line-height: 1.1; }
.sitetxt small { color: #fff; font-size: .8rem; font-weight: 800; margin-top: 2px; }
.sitetxt .url { color: #ffd43b; font-size: .84rem; font-weight: 900; margin-top: 5px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 14px; background: #fff;
  color: var(--ink); font-weight: 800; font-size: .8rem; line-height: 1.15; text-align: center; text-decoration: none; box-shadow: inset 0 0 0 1.5px rgba(22, 37, 92, .14); }
.quick a span { font-size: 1.3rem; }
.quick a:hover { box-shadow: inset 0 0 0 1.5px rgba(22, 37, 92, .4); }
.follow { margin: 12px 0 6px !important; font-size: .74rem !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) !important; text-align: center; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #fff; color: var(--c);
  box-shadow: inset 0 0 0 1.5px rgba(22, 37, 92, .12); transition: transform .15s ease; }
.socials a:hover { transform: translateY(-2px); }
.socials svg { width: 20px; height: 20px; fill: currentColor; }

/* quiet links under the card (hidden once the last screen shows the full block) */
#footlinks { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 10px; }
body.atend #footlinks { display: none; }
#footlinks { padding: 0 2px; }
.fl-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.fl-row a { padding: 9px 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: .88rem; font-weight: 800; white-space: nowrap;
  text-decoration: none; box-shadow: inset 0 0 0 1.5px rgba(22, 37, 92, .14); }
#footlinks a.web { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 380px;
  padding: 14px 20px; border-radius: 18px; background: var(--ink); color: #ffd43b !important; font-size: 1.12rem; font-weight: 900;
  text-decoration: none; box-shadow: 0 10px 22px -12px rgba(22, 37, 92, .8); transition: transform .15s ease; }
#footlinks a.web:hover { transform: translateY(-1px); }
.fl-soc a { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 11px; color: var(--c); }
.fl-soc svg { width: 19px; height: 19px; fill: currentColor; }

/* controls */
#bar { display: flex; align-items: center; gap: 10px; padding: 12px 2px 4px; }
#bar button { flex: none; height: 36px; min-width: 36px; padding: 0 10px; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; color: var(--ink); font: inherit; font-weight: 800; font-size: .82rem;
  box-shadow: inset 0 0 0 1.5px rgba(22, 37, 92, .14); }
#bar button:hover { box-shadow: inset 0 0 0 1.5px rgba(22, 37, 92, .35); }
#pp { font-size: .95rem !important; width: 36px; padding: 0 !important; }
#prog { flex: 1; display: flex; gap: 4px; }
#prog i { flex: 1; height: 5px; border-radius: 3px; background: rgba(22, 37, 92, .12); overflow: hidden; position: relative; }
#prog i b { position: absolute; inset: 0; width: 0; background: var(--pumpkin); border-radius: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

#foot { width: 100%; max-width: 500px; margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center;
  padding: 4px 16px 18px; font-size: .74rem; color: var(--muted); }
#foot > a, #foot > span a { color: inherit; }

/* the envelope cover: a letter peeking out of an open envelope, readable without a tap */
#cover { position: absolute; inset: 0; z-index: 5; container-type: size; cursor: pointer; overflow: hidden;
  background: radial-gradient(90% 70% at 50% 30%, #fffaf1, #fbe1bf); transition: opacity .6s ease .9s, visibility 0s linear 1.5s; }
#cover.open { opacity: 0; visibility: hidden; }
#cover .lf { position: absolute; transform-origin: 50% 50%; animation: twinkle 2.8s ease-in-out infinite; }
.env { position: absolute; left: 9%; right: 9%; bottom: 13%; height: 40%; transition: transform .8s cubic-bezier(.5, 0, .3, 1) .15s, opacity .6s ease .3s; }
.env-back { position: absolute; inset: 0; border-radius: 4cqw; background: #e7b170; box-shadow: 0 3cqw 6cqw -3cqw rgba(120, 60, 10, .45); }
.env-flap { position: absolute; left: 0; right: 0; bottom: 100%; height: 46%; margin-bottom: -2px; background: #eebf80;
  clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.env-front { position: absolute; inset: 0; border-radius: 0 0 4cqw 4cqw; background: linear-gradient(180deg, #f8dcae, #f3cd92);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); }
.env-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent 49.6%, rgba(160, 90, 30, .25) 50%, transparent 50.6%),
  linear-gradient(to bottom left, transparent 49.6%, rgba(160, 90, 30, .25) 50%, transparent 50.6%); background-size: 50% 52%; background-repeat: no-repeat;
  background-position: left top, right top; }
.letter { position: absolute; left: 15%; right: 15%; top: 7%; height: 62%; padding: 5cqw 5cqw 0; border-radius: 3cqw; text-align: center;
  background: #fffdf8; box-shadow: 0 2cqw 5cqw -2cqw rgba(22, 37, 92, .35), inset 0 0 0 1px rgba(22, 37, 92, .06);
  transform: rotate(-1.5deg); transition: transform .9s cubic-bezier(.3, 1.2, .4, 1); }
.letter img { width: 12cqw; height: 12cqw; }
.letter h1 { margin: 1.5cqw 0 1.8cqw; font-size: 6.6cqw; line-height: 1.05; font-weight: 900; color: var(--ink); letter-spacing: -.01em; }
.letter p { margin: 0; font-size: 3.8cqw; line-height: 1.4; color: var(--ink2); }
.letter .sig { margin-top: 2.4cqw; font-size: 3.15cqw; font-weight: 800; font-style: italic; color: var(--line); }
.env-btn { position: absolute; left: 50%; bottom: 15%; transform: translateX(-50%); z-index: 2; white-space: nowrap; border: 0; border-radius: 999px;
  padding: 2.8cqw 6cqw; background: var(--ink); color: #ffd43b; font: inherit; font-weight: 900; font-size: 4.4cqw; cursor: pointer;
  box-shadow: 0 2.4cqw 5cqw -2cqw rgba(22, 37, 92, .7); }
.env-btn span { display: inline-block; animation: breathe 2.6s ease-in-out infinite; }
.env-sub { position: absolute; left: 0; right: 0; bottom: 4%; margin: 0; text-align: center; font-size: 3.2cqw; color: var(--muted); }
.peek-nilu { position: absolute; right: 1%; bottom: 10%; width: 25%; z-index: 3; transform-origin: 50% 100%; animation: bob 2.4s ease-in-out infinite; }
#cover.open .letter { transform: translateY(-4%) scale(1.06) rotate(0); }
#cover.open .env-btn { transform: translate(-50%, 70%); }
#cap:empty { min-height: 0; padding: 0; }
#cover.open .env, #cover.open .env-sub, #cover.open .peek-nilu, #cover.open .env-btn { transform: translateY(70%); opacity: 0; transition: transform .8s cubic-bezier(.5, 0, .3, 1) .15s, opacity .6s ease .3s; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* paused: freeze every animation on the card */
#card.paused .scene *, #card.paused .scene { animation-play-state: paused !important; }

/* ── scene animation (runs only on the scene that is showing) ─────────── */
.fall, .sway, .wave, .bob, .grow, .pop, .stretch, .pull, .flap, .flapR, .peek, .faint, .seated,
.heart, .bubble, .later, .stars, .blink, .hop, .twinkle, .kb, .wiggle, .plantsway, .note, .tn, .tf, .dance, .kick, .spin { transform-box: fill-box; }

.on .fall { animation: fall linear infinite; }
@keyframes fall { from { transform: translateY(-40px); } to { transform: translateY(500px); } }
.on .sway { transform-origin: 50% 0; animation: sway ease-in-out infinite alternate; }
@keyframes sway { from { transform: translateX(-14px) rotate(-35deg); } to { transform: translateX(14px) rotate(35deg); } }

.on .wave { transform-origin: 92% 45%; animation: wave 1.5s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
.on .bob { transform-origin: 50% 100%; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-5px) scaleY(1.01); } }
.on .hop { transform-origin: 50% 100%; animation: hop .9s cubic-bezier(.3, 1.6, .5, 1) .3s both; }
@keyframes hop { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.on .blink { transform-origin: 50% 50%; animation: blink 4s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

.on .grow { transform-origin: 50% 100%; animation: grow 1.6s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.vine { stroke-dasharray: 600; stroke-dashoffset: 600; }
.on .vine { animation: draw 2.4s ease-out both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.pop { opacity: 0; }
.on .pop { transform-origin: 50% 50%; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.on .stretch { transform-origin: 0 50%; animation: stretch 1.8s cubic-bezier(.5, 0, .3, 1.15) .4s both; }
@keyframes stretch { from { transform: scaleX(.42); } to { transform: scaleX(1); } }
.on .pull { animation: pull 1.8s cubic-bezier(.5, 0, .3, 1.15) .4s both; }
@keyframes pull { from { transform: translateX(-180px); } to { transform: none; } }
.on .flap { transform-origin: 90% 90%; animation: flap .35s ease-in-out infinite alternate; }
.on .flapR { transform-origin: 10% 90%; animation: flapR .35s ease-in-out infinite alternate; }
@keyframes flap { from { transform: rotate(0); } to { transform: rotate(28deg); } }
@keyframes flapR { from { transform: rotate(0); } to { transform: rotate(-28deg); } }

.on .peek { animation: peek 1s cubic-bezier(.3, 1.3, .5, 1) .2s both; }
@keyframes peek { from { transform: translateX(-160px); } to { transform: none; } }
.on .faint { transform-origin: 50% 100%; animation: faint .7s ease-in 3.6s forwards, gone .25s linear 4.8s forwards; }
@keyframes faint { 40% { transform: rotate(8deg); } to { transform: rotate(-86deg) translate(-6px, 4px); } }
@keyframes gone { to { opacity: 0; } }
.seated { opacity: 0; }
.on .seated { transform-origin: 50% 100%; animation: seat .6s cubic-bezier(.3, 1.5, .5, 1) 4.9s forwards; }
@keyframes seat { from { opacity: 0; transform: translateY(30px) scale(.8); } to { opacity: 1; transform: none; } }
.bubble, .stars, .later { opacity: 0; }
.on .b1 { animation: say .3s ease-out 1s forwards, unsay .3s ease-in 3.5s forwards; }
.on .b2 { animation: say .3s ease-out 2.2s forwards, unsay .3s ease-in 4.6s forwards; }
.on .b3 { animation: say .3s ease-out 6s forwards; }
.on .stars { animation: say .2s 4.2s forwards, unsay .2s 4.8s forwards; }
.on .later { animation: say .5s ease-out 6.6s forwards; }
@keyframes say { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes unsay { to { opacity: 0; } }

.on .heart { animation: heart 3.4s ease-out infinite; opacity: 0; }
@keyframes heart { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-130px) scale(1.1); } }

.on .twinkle { transform-origin: 50% 50%; animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(.55) rotate(0); opacity: .5; } 50% { transform: scale(1.1) rotate(20deg); opacity: 1; } }

/* sticker-art motion */
.on .kb { transform-origin: 50% 60%; animation: kb 11s ease-out both; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.07); } }
.on .wiggle { transform-origin: 50% 100%; animation: wiggle .32s ease-in-out 3.2s infinite alternate; }
@keyframes wiggle { from { transform: rotate(-3deg); } to { transform: rotate(3deg) translateY(-2px); } }
.on .plantsway { transform-origin: 50% 100%; animation: plantsway 3.2s ease-in-out infinite alternate; }
@keyframes plantsway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.on .grow.slow { animation-duration: 2.4s; animation-timing-function: cubic-bezier(.2, .9, .3, 1); }
.note { opacity: 0; }
.on .note { animation: note 1.8s ease-out infinite; }
@keyframes note { 0% { opacity: 0; transform: translate(0, 0) rotate(-10deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -40px) rotate(12deg); } }
.on .tn { transform-origin: 50% 100%; animation: shiver .11s linear 1.2s 20 alternate, out .25s ease-in 3.6s forwards; }
@keyframes shiver { from { transform: translateX(-1.5px) rotate(-1deg); } to { transform: translateX(1.5px) rotate(1deg); } }
@keyframes out { to { opacity: 0; transform: rotate(-40deg) translateY(10px); } }
.tf { opacity: 0; }
.on .tf { transform-origin: 50% 100%; animation: drop .4s cubic-bezier(.3, 1.6, .5, 1) 3.75s forwards, gone .3s linear 4.8s forwards; }
@keyframes drop { from { opacity: 0; transform: translateY(-20px) scale(.9); } to { opacity: 1; transform: none; } }
.on .hop { transform-origin: 50% 100%; animation: hop .9s cubic-bezier(.3, 1.6, .5, 1) .3s both; }

/* Nilu's happy dance: two hops with a squash on each landing, then a wiggle */
.on .dance { transform-origin: 50% 100%; animation: dance 2.2s ease-in-out 1s infinite; }
@keyframes dance {
  0% { transform: none; }
  8% { transform: scale(1.06, .92); }
  20% { transform: translateY(-30px) scale(.96, 1.06) rotate(-4deg); }
  32% { transform: scale(1.08, .9); }
  42% { transform: translateY(-16px) scale(.98, 1.03) rotate(4deg); }
  52% { transform: scale(1.05, .94); }
  62% { transform: rotate(-5deg); }
  74% { transform: rotate(5deg); }
  86% { transform: rotate(-3deg); }
  100% { transform: none; }
}
.kick { opacity: 0; }
.on .kick { transform-origin: 50% 100%; animation: kick 2.2s ease-out infinite; }
@keyframes kick {
  0%, 30% { opacity: 0; transform: none; }
  34% { opacity: 1; transform: translate(calc(var(--kx) * .2), calc(var(--ky) * .2)) rotate(20deg); }
  58% { opacity: 1; transform: translate(var(--kx), var(--ky)) rotate(160deg); }
  70%, 100% { opacity: 0; transform: translate(calc(var(--kx) * 1.15), calc(var(--ky) * .6)) rotate(220deg); }
}
.on .spin { transform-origin: 50% 50%; animation: spin 4.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .line, .on *, #cover *, .env-btn span, .save { animation: none !important; }
  .scene { transition-duration: .4s; }
  .pop, .seated, .b3, .later { opacity: 1 !important; }
  .vine { stroke-dashoffset: 0 !important; }
  .fall, .heart, .stars, .b1, .b2, .faint, .tn, .tf, .note, .kick, .spin { display: none; }
  .scene { transform: none !important; }
  #cover .bob, #cover .twinkle { animation: none !important; }
}

/* share image (rendered from ?og at 1200×630 into og.png) */
body.og { width: 1200px; height: 630px; min-height: 0; overflow: hidden; display: block; }
#og { width: 1200px; height: 630px; display: flex; align-items: center; gap: 44px; padding: 30px 54px;
  background: radial-gradient(120% 90% at 30% 20%, #fff9ef 0%, #fdf1de 55%, #fbe1bf 100%); }
#og .ogart { width: 520px; height: 572px; border-radius: 36px; overflow: hidden; flex: none; background: var(--paper);
  box-shadow: 0 24px 50px -24px rgba(22, 37, 92, .5); }
#og .ogart svg { width: 100%; height: 100%; display: block; }
#og .pop, #og .seated, #og .b3, #og .later { opacity: 1; }
#og .peek, #og .stars, #og .b1, #og .b2, #og .tf, #og .fall { display: none; }
#og .vine { stroke-dashoffset: 0; }
#og .ogtxt img { width: 92px; height: 92px; }
#og .ogtxt h1 { font-size: 58px; line-height: 1.05; margin: 14px 0 18px; font-weight: 900; color: var(--ink); }
#og .ogtxt p { font-size: 40px; line-height: 1.2; margin: 0 0 26px; color: var(--ink2); }
#og .ogtxt p b { color: var(--pumpkin); }
#og .ogtxt span { font-size: 24px; font-weight: 800; color: var(--muted); }

/* wider screens: the picture fills the height, words and controls sit beside it */
@media (min-width: 900px) and (min-height: 560px) {
  #card {
    max-width: 1180px; padding: 20px 32px 0;
    display: grid; column-gap: 44px; align-items: center;
    grid-template-columns: auto minmax(300px, 420px); justify-content: center;
    grid-template-areas: "top top" "frame ." "frame cap" "frame links" "frame bar" "frame .";
    grid-template-rows: auto 1fr auto auto auto 1fr;
  }
  #top { grid-area: top; margin-bottom: 16px; }
  #frame { grid-area: frame; width: min(720px, calc((100dvh - 120px) * 400 / 440)); }
  #cap { grid-area: cap; text-align: left; min-height: 0; padding: 0 0 18px; }
  #bar { grid-area: bar; align-self: start; padding-top: 0; }
  #footlinks { grid-area: links; align-items: flex-start; margin: 4px 0 18px; }
  #footlinks .fl-row { justify-content: flex-start; }
  #cap h1 { font-size: 2.6rem; }
  #cap h2 { font-size: 1.6rem; }
  #cap p { font-size: 1.15rem; }
  #cap .big { font-size: 2.4rem; }
  .ctas { margin-left: 0; }
  .save { margin-left: 0; }
}

/* narrow phones: keep Games · Learning Center · Events on one row */
@media (max-width: 440px) {
  .fl-row:not(.fl-soc) { gap: 5px; }
  .fl-row:not(.fl-soc) a { padding: 9px 10px; font-size: .8rem; }
}
