/* =================================================================
   THE TOP OF THE HOME PAGE: the big logo, and the four gift tags on the
   gold ribbon ("Where would you like to start?")

   Its own file, for the same reason get-involved.css and ball.css are
   separate: the shared bundle is on an enforced first paint budget and
   donate.html has almost nothing spare. Built from the "Workshop" prototype.

   Two things this file must leave alone, because the Festive Ball's promotion
   (src/ball/home-promo.ts) leans on them:
   - The nav. It stays transparent until scrolled, as styles.css has it, and
     the promotion's banner starts below it with a margin.
   - The weight of the hero's top padding. The promotion's ".ball-banner + .hero"
     rule stops the hero clearing the nav twice. It is inline, so it comes after
     this file and wins any tie: keep hero padding on ".home .hero" and no heavier.
   ================================================================= */

:root{
  --gold:#D9A93E;
  --maroon-deep:#5E0000;
  --ink-on-tan:#4A0F0F;
  --quilt-line:rgba(248,245,238,.075);
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  --ease:cubic-bezier(.22,1,.36,1);
}

/* ---- the hero: the words, the buttons, and the logo on nothing but cream ---- */
.home .hero{padding-top:calc(var(--nav-h) + clamp(18px,3.4vw,52px));padding-bottom:clamp(30px,4vw,56px)}
.home .hero::before{display:none}
.home .hero h1{max-width:none;font-size:clamp(2.35rem,1.7rem + 3.9vw,4.7rem);line-height:1.02;letter-spacing:-.018em;text-wrap:balance}
.home .hero h1 .allyear{white-space:nowrap;background:linear-gradient(var(--holly),var(--holly)) no-repeat left 96%/100% .07em}
.home .hero-art .logo-big{width:min(100%,clamp(300px,37vw,520px));filter:none}
@media (min-width:981px){
  .home .hero .wrap{grid-template-columns:1.06fr .94fr;gap:clamp(24px,4vw,56px)}
}
/* styles.css stacks the hero here with the logo first. These centre what is under it. On a phone
   the logo is a little smaller than the prototype's, which had no buttons, to bring "Donate now" up.
   It is on the first screen at 375 by 667 with no banner; the Ball banner pushes it just below. */
@media (max-width:980px){
  .home .hero .wrap{grid-template-columns:minmax(0,1fr);text-align:center}
  .home .hero .lede{margin-inline:auto}
  .home .hero-cta{justify-content:center}
  .home .hero-art .logo-big{width:min(74vw,320px)}
}
@media (max-width:600px){
  .home .hero{padding-top:calc(var(--nav-h) + 10px);padding-bottom:18px}
  .home .hero .wrap{gap:12px}
  .home .hero-art .logo-big{width:min(58vw,250px)}
  .home .hero h1{font-size:2rem}
  .home .hero .eyebrow{margin-bottom:8px;letter-spacing:.08em}
  .home .hero .lede{margin-top:.6rem;font-size:.95rem;line-height:1.45}
  .home .hero-cta{gap:10px;margin-top:.8rem}
  .home .hero-cta .btn{padding:.7em 1.3em;font-size:.95rem}
}

/* ---- the band: the site's quilted card back, full width ---- */
.home-lane{position:relative;isolation:isolate;color:var(--cream);padding:clamp(34px,4.4vw,60px) 0 clamp(70px,8vw,120px);
  background:radial-gradient(120% 90% at 18% 0,#8f0a0a 0,var(--maroon) 46%,var(--maroon-deep) 100%)}
.home-lane::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:var(--grain),
  repeating-linear-gradient(45deg,var(--quilt-line) 0 1.5px,transparent 1.5px 26px),
  repeating-linear-gradient(-45deg,var(--quilt-line) 0 1.5px,transparent 1.5px 26px)}
.home-lane h2{color:var(--cream);font-size:clamp(1.85rem,1.4rem + 2.2vw,3.1rem);line-height:1.05;letter-spacing:-.01em;margin:0;text-wrap:balance}
.home-lane .drift{position:absolute;left:0;right:0;bottom:-1px;width:100%;height:clamp(36px,6.5vw,92px);color:var(--cream);display:block;z-index:0;pointer-events:none}

/* ---- the ribbon and the bow ---- */
.ribbon{position:relative;height:13px;margin-top:clamp(18px,2.4vw,30px);background:linear-gradient(180deg,#e4bb5b,var(--gold) 45%,#b8862b);box-shadow:0 8px 14px -6px rgba(30,0,0,.5);z-index:2}
.bow{position:absolute;left:50%;top:50%;width:clamp(86px,9vw,120px);height:auto;transform:translate(-50%,-48%);filter:drop-shadow(0 6px 6px rgba(30,0,0,.35))}

/* ---- the four tags ---- */
.gifts{display:grid;grid-template-columns:1.16fr 1fr 1fr 1fr;gap:clamp(12px,1.6vw,22px);align-items:stretch;position:relative;z-index:1;margin-top:26px;padding-bottom:30px}
.gift{--s:0px;--r:0deg;--i:0;position:relative;translate:0 var(--s);display:flex;transform:rotate(var(--r));transform-origin:50% calc(-26px - var(--s));filter:drop-shadow(0 22px 22px rgba(35,0,0,.42));transition:transform .6s var(--ease);animation:hang .95s var(--ease) backwards;animation-delay:calc(var(--i) * 90ms + 120ms)}
.gift:nth-child(1){--s:0px;--r:-.7deg}
.gift:nth-child(2){--s:26px;--r:.9deg;--i:1}
.gift:nth-child(3){--s:8px;--r:-.6deg;--i:2}
.gift:nth-child(4){--s:30px;--r:.8deg;--i:3}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .gift:hover{transform:rotate(calc(var(--r) * -1.4))}
}
.gift::before{content:"";position:absolute;left:50%;top:calc(-32px - var(--s));height:calc(52px + var(--s));width:2px;margin-left:-1px;background:repeating-linear-gradient(180deg,var(--gold) 0 3px,#b8862b 3px 6px)}
.gift::after{content:"";position:absolute;left:50%;top:9px;width:24px;height:24px;margin-left:-12px;border-radius:50%;border:3px solid var(--gold);box-shadow:0 1px 2px rgba(30,0,0,.4)}
.gift-face{--c:30px;display:flex;flex:1;min-width:0;flex-direction:column;gap:6px;padding:44px clamp(16px,1.7vw,24px) 20px;border-radius:0 0 20px 20px;background:var(--card);color:var(--slate);
  clip-path:polygon(var(--c) 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,0 100%,0 var(--c));
  -webkit-mask:radial-gradient(circle 9.5px at 50% 21px,transparent 97%,#000);mask:radial-gradient(circle 9.5px at 50% 21px,transparent 97%,#000)}
.gift-art{height:clamp(104px,9.4vw,132px);display:flex;align-items:flex-end;justify-content:center;margin-bottom:4px}
.art{display:block;height:100%;width:auto;max-width:100%}
.art-parcel{overflow:visible}
.art-elf{aspect-ratio:150/98;object-fit:cover;object-position:50% 0}
.gift h3{font-family:var(--font-head);font-size:clamp(1.42rem,1.2rem + .75vw,1.85rem);line-height:1.08;margin:0;text-wrap:balance}
.gift-text{margin:0;font-size:.94rem;line-height:1.5;text-wrap:pretty}
.gift-go{margin-top:auto;padding-top:12px}
.gift-go .btn{width:100%;justify-content:center;text-align:center;padding:.8em .6em;font-size:.96rem;line-height:1.2}
.gift-go .btn::after{display:none}
.gift-small{margin:9px 0 0;font-size:.88rem;text-align:center}
.gift-small:empty{display:none}
.gift-small a{display:inline-block;padding-block:3px}
.tlink{color:var(--crimson);font-weight:600;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}
.tlink:hover{color:var(--maroon)}
.btn.paper{--bg:var(--cream);--fg:var(--maroon)}
.btn.paper:hover{--bg:var(--card);--fg:var(--crimson)}
.btn.maroon{--bg:var(--maroon);--fg:var(--cream)}
.btn.maroon:hover{--bg:var(--maroon-deep)}

.g-donate .gift-art{height:clamp(140px,13vw,176px)}
.g-donate h3{color:var(--maroon);font-size:clamp(1.8rem,1.4rem + 1.1vw,2.4rem)}
.g-drop .gift-face{background:var(--crimson);color:var(--cream)}
.g-ref .gift-face{background:var(--holly);color:var(--cream)}
.g-vol .gift-face{background:var(--tan);color:var(--ink-on-tan)}
.g-drop h3,.g-ref h3{color:#FFF8EF}
.g-vol h3{color:var(--maroon)}
.g-drop .tlink,.g-ref .tlink,.g-drop .tlink:hover,.g-ref .tlink:hover{color:var(--cream)}
.g-vol .tlink,.g-vol .tlink:hover{color:var(--maroon)}
.g-ref .btn.paper{--fg:var(--holly)}
.g-drop .btn.paper{--fg:var(--crimson)}
/* The site's green focus ring does not show on the coloured tags. */
.g-drop a:focus-visible,.g-ref a:focus-visible{outline-color:var(--cream)}
.g-vol a:focus-visible{outline-color:var(--maroon)}

@keyframes hang{from{opacity:0;transform:translateY(-34px) rotate(calc(var(--r) * 5))}to{opacity:1;transform:rotate(var(--r))}}

/* ---- narrower ---- */
@media (max-width:1040px){
  .gifts{grid-template-columns:minmax(0,1fr) minmax(0,1fr);row-gap:18px;padding-bottom:10px}
  .gift:nth-child(n+3)::before{display:none}
  .gift:nth-child(1){--s:0px;--r:-.5deg}
  .gift:nth-child(2){--s:0px;--r:.5deg}
  .gift:nth-child(3){--s:0px;--r:.4deg}
  .gift:nth-child(4){--s:0px;--r:-.4deg}
}
@media (max-width:600px){
  .home-lane{padding-top:18px}
  .home-lane h2{font-size:1.42rem}
  .ribbon{margin-top:12px;height:10px}
  .bow{width:70px;left:82%}
  .gifts{gap:10px;margin-top:16px;row-gap:12px}
  .gift{--r:0deg!important}
  .gift::before{top:-22px;height:38px}
  .gift-face{--c:20px;padding:30px 10px 12px;gap:3px;text-align:center;border-radius:0 0 15px 15px;mask:radial-gradient(circle 6.5px at 50% 14px,transparent 97%,#000);-webkit-mask:radial-gradient(circle 6.5px at 50% 14px,transparent 97%,#000)}
  .gift::after{top:6px;width:17px;height:17px;margin-left:-8.5px;border-width:2px}
  .gift-art{height:46px;margin-bottom:2px}
  /* The other tags' words are folded away here, and Drop-off points is the tallest tag beside it.
     A bigger parcel fills the room, and what is left falls evenly above and below. */
  .g-donate .gift-art{height:84px;margin-top:auto;margin-bottom:2px}
  .gift h3,.g-donate h3{font-size:1.14rem}
  .gift-text{display:none}
  .gift-go{padding-top:5px}
  .gift-go .btn{font-size:.8rem;padding:.6em .3em;line-height:1.2;min-height:40px}
  /* Two links do not always fit on one line here, so they wrap as a pair with no stray dot. */
  .gift-small{display:flex;flex-wrap:wrap;justify-content:center;column-gap:10px;font-size:.76rem;margin-top:4px;line-height:1.3}
  .gift-small a{padding-block:6px}
  .gift-small .dot{display:none}
}
@media (prefers-reduced-motion:reduce){
  .gift{animation:none;transition:none}
}
