/* css/pages/gifts.css: the Gift Cards page (prefix gc-). Redesigned on Ry's word, 11 Nov 2026, live at 2:25 PM: "incredible, interactive,
   fun, with 3D animation, movement" and "a show off page while also remaining extremely smooth and easy".
   The page is the hand of Gift Cards and, under it, three short notes: only what a buyer needs (Ry, 2:10 PM 11 Nov).
   The hero is main's own block (css/hero.css, css/program.css). Every motion
   lives in js/pages/gifts.js and moves only transform and opacity. With no script, in calm mode or with reduced
   motion the page is whole and still, the hand fanned.
   3D rule kept everywhere here: an element that holds 3D children (transform-style: preserve-3d) never has overflow,
   opacity below 1, a filter or container-type; those live on the flat faces at the ends. */

/* ---------- 0. The hero: the present and the ball in the middle ----------
   Ry, 7:57 PM Fri 13 Nov 2026: "the present, the ball, and all of that stuff should be nicely centered on the screen".
   Upright screens wear gc_hero_tall and an iPad on its side (up to 4 to 3) gc_hero_mid: both cut from the left so the
   present sits at the file's centre (work/2026-11-13-gift-hero-centre, crop.py and crop-mid.py), and the section's
   --pgh-shape is the mid file's own height at full width. Laptops keep the wide file aimed right of centre: the
   words sit at the left there and the present balances them. */
.hero.pgh { --pgh-aim: 66% 50%; }
@media (max-aspect-ratio: 4/3) { .hero.pgh { --pgh-aim: 50% 50%; } }

/* ---------- 1. Pick an amount: a hand of real Gift Cards ---------- */
.gc-amounts { overflow-x: clip; }
.gc-amounts .sec-head { margin-bottom: var(--s-3); }

/* Wide screens: the stage is the camera; the hand fans from its centre. --sp is the step between two cards, so the
   fan always fits the column (the script measures the same thing). */
.gc-stage {
  --cw: clamp(180px, calc(19vw / var(--vz, 1)), 290px);
  --ch: calc(var(--cw) / 1.585);
  --sp: min(calc(var(--cw) * 0.66), calc((100cqi - var(--cw) * 1.1) / 4));
  position: relative;
  container-type: inline-size;
  height: calc(var(--cw) * 1.25);
  perspective: 1500px;
  perspective-origin: 50% 30%;
}
.gc-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(6deg); }
.gc-hand { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; transform-style: preserve-3d; }
.gc-slot {
  --k: 0;
  --n: 0;
  position: absolute;
  left: 50%;
  top: 46%;
  width: var(--cw);
  height: var(--ch);
  margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2);
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--k) * var(--sp)), calc(var(--k) * var(--k) * var(--cw) * 0.035), calc(var(--n) * 2px)) rotateZ(calc(var(--k) * 5.5deg));
}
.gc-slot:nth-child(1) { --k: -2; --n: 0; }
.gc-slot:nth-child(2) { --k: -1; --n: 1; }
.gc-slot:nth-child(3) { --k: 0; --n: 2; }
.gc-slot:nth-child(4) { --k: 1; --n: 3; }
.gc-slot:nth-child(5) { --k: 2; --n: 4; }

/* The card: two faces back to back. Colours: green, navy, blue, black with gold, and pearl for Another amount. */
.gc-card {
  --c1: #2f8a5e; --c2: #1a5139; --c3: #0b2a1d;
  --on: #ffffff; --mark: #ffffff; --kind: rgb(255 255 255 / 0.8); --dot: rgb(255 255 255 / 0.07); --rim: rgb(255 255 255 / 0.16);
  position: absolute;
  inset: 0;
  display: block;
  border-radius: calc(var(--cw) * 0.06);
  color: var(--on);
  text-decoration: none;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.gc-slot:nth-child(4n+2) .gc-card { --c1: #3558a6; --c2: #16295a; --c3: #0a1430; }
.gc-slot:nth-child(4n+3) .gc-card { --c1: #4a86ff; --c2: #2456cf; --c3: #12318a; }
.gc-slot:nth-child(4n+4) .gc-card { --c1: #34353c; --c2: #141518; --c3: #050506; --on: #e9cd8b; --mark: #e3c27a; --kind: rgb(227 194 122 / 0.86); --dot: rgb(227 194 122 / 0.06); --rim: rgb(227 194 122 / 0.3); }
.gc-slot .gc-card.gc-card--other { --c1: #ffffff; --c2: #f3efe6; --c3: #e2dccd; --on: #15171c; --mark: #15171c; --kind: rgb(21 23 28 / 0.66); --dot: rgb(21 23 28 / 0.045); --rim: rgb(21 23 28 / 0.1); }

.gc-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  container-type: inline-size;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.24), rgb(255 255 255 / 0) 2px),
    radial-gradient(circle, var(--dot) 0 1.1px, transparent 1.5px) 0 0 / 9px 9px,
    radial-gradient(120% 95% at 10% 0%, var(--c1), rgb(0 0 0 / 0) 62%),
    linear-gradient(155deg, var(--c2), var(--c3));
  box-shadow: var(--depth-2);
  transition: opacity 420ms var(--ease);
}
/* a fine frame inside the edge, as on a printed card */
.gc-face::before {
  content: "";
  position: absolute;
  inset: 4cqi;
  border: 1px solid var(--rim);
  border-radius: 3.4cqi;
  pointer-events: none;
}
/* a slow band of light that crosses each card in turn */
.gc-front::after {
  content: "";
  position: absolute;
  inset: -30% -70%;
  background: linear-gradient(105deg, rgb(255 255 255 / 0) 42%, rgb(255 255 255 / 0.2) 50%, rgb(255 255 255 / 0) 58%);
  transform: translate3d(-62%, 0, 0);
  pointer-events: none;
}
.gc-logo {
  position: absolute;
  left: 7.5cqi;
  top: 7.5cqi;
  width: 21cqi;
  aspect-ratio: 261 / 180;
  background: var(--mark);
  -webkit-mask: url("../../media/brand/dfga_logo_stacked_white.svg?v=20261112") center / contain no-repeat;
  mask: url("../../media/brand/dfga_logo_stacked_white.svg?v=20261112") center / contain no-repeat;
}
.gc-kind {
  position: absolute;
  right: 7.5cqi;
  top: 8.6cqi;
  font-family: var(--f-text);
  font-size: 15px;         /* the type scale, readable at arm's length (round 2, R25) */
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kind);
}
.gc-n {
  position: absolute;
  left: 7cqi;
  bottom: 6cqi;
  font-family: var(--f-head);
  font-size: 25cqi;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
  color: var(--on);
  white-space: nowrap;
  display: flex;           /* the site's one price look (css/base.css .gc-cur): a small $ raised to the top of the digits */
  align-items: baseline;
}
.gc-cur { margin-right: 0; }   /* at this size the round 5 and 2 already leave their own air after the $ */
.gc-n--words { bottom: 8.5cqi; font-size: 11.5cqi; line-height: 1; letter-spacing: -0.01em; }
.gc-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(75% 75% at var(--gx, 30%) var(--gy, 18%), rgb(255 255 255 / 0.5), rgb(255 255 255 / 0) 62%);
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 360ms var(--ease);
  pointer-events: none;
}
.gc-card.is-hot .gc-glare, .gc-card:focus-visible .gc-glare { opacity: 1; }
.gc-card.is-hot .gc-front, .gc-card:focus-visible .gc-front { box-shadow: var(--depth-3); }
.gc-card:focus-visible .gc-front { outline: 2.5px solid var(--ink-dark); outline-offset: 3px; }
.gc-back { display: grid; place-items: center; transform: rotateY(180deg); }
.gc-back .gc-logo--big { position: relative; left: auto; top: auto; width: 40cqi; margin-top: -6cqi; }
.gc-kind--back { top: auto; right: 0; left: 0; bottom: 9cqi; text-align: center; }
/* Only the cards take the pointer: a tilted card dips behind its holder's flat plane, which must not catch the click */
.gc-tilt, .gc-hand, .gc-slot { pointer-events: none; }
.gc-card { pointer-events: auto; }
/* In the hand only the top card shows its label; a card under the pointer shows its own (no cut off letters) */
.gc-slot:not(:last-child) .gc-front .gc-kind { opacity: 0; transition: opacity 320ms var(--ease); }
.gc-slot .gc-card.is-hot .gc-front .gc-kind, .gc-slot .gc-card:focus-visible .gc-front .gc-kind, .gc-slot.is-picked .gc-front .gc-kind { opacity: 1; }
/* a pick: the other cards step back */
.gc-stage.is-picking .gc-slot:not(.is-picked) .gc-face { opacity: 0.28; }

.gc-floor {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, calc(var(--cw) * 3.8));
  height: calc(var(--cw) * 0.2);
  transform: translate3d(-50%, 0, 0);
  background: radial-gradient(50% 50% at 50% 50%, rgb(14 15 17 / 0.16), rgb(14 15 17 / 0) 72%);
  pointer-events: none;
}
.gc-hole { position: absolute; inset: -8% 0 0; pointer-events: none; }

html.js:not(.calm) .gc-stage.is-live .gc-hand { animation: gc-breathe 7s ease-in-out infinite; }
html.js:not(.calm) .gc-stage.is-live .gc-front::after { animation: gc-sheen 9s var(--ease) infinite; animation-delay: calc(var(--n) * 0.45s + 1.6s); }
@keyframes gc-breathe { 50% { transform: translate3d(0, -6px, 0) rotateX(1.5deg); } }
@keyframes gc-sheen { 0%, 74% { transform: translate3d(-62%, 0, 0); } 100% { transform: translate3d(62%, 0, 0); } }

/* Phones: a sideways row of cards that turn in 3D as you swipe (the one sideways carousel that may snap) */
@media (max-width: 767px) {
  .gc-stage {
    --cw: min(calc(72vw / var(--vz, 1)), 300px);
    height: auto;
    margin-inline: calc(var(--gutter) * -1);
    container-type: normal;
    perspective: none;
  }
  .gc-tilt { position: relative; inset: auto; transform: none; transform-style: flat; }
  .gc-hand {
    position: relative;
    inset: auto;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;                 /* sideways only: a row a few px taller than its frame would drift under the thumb */
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 18px calc((100% - var(--cw)) / 2) 46px;
    transform-style: flat;
  }
  .gc-hand::-webkit-scrollbar { display: none; }
  .gc-slot {
    position: relative;
    left: auto;
    top: auto;
    flex: 0 0 var(--cw);
    margin: 0;
    transform: none;
    transform-style: flat;
    scroll-snap-align: center;
  }
  .gc-floor { display: none; }
  .gc-hole { inset: 0; }
  .gc-tilt, .gc-hand, .gc-slot { pointer-events: auto; }
  .gc-slot:not(:last-child) .gc-front .gc-kind { opacity: 1; }
  html.js:not(.calm) .gc-stage.is-armed .gc-slot { opacity: 0; transform: translate3d(56px, 0, 0); }
  html.js:not(.calm) .gc-stage.is-armed.is-dealt .gc-slot {
    opacity: 1;
    transform: none;
    transition: opacity 700ms var(--ease), transform 1000ms var(--ease);
    transition-delay: calc(var(--n) * 90ms);
  }
}

/* ---------- 2. Under the hand: what a buyer needs, three short notes ----------
   The first names the card in view ("Your $150 Gift Card arrives ..."): the slot opens to the amount's width, so the
   words after it slide. Each icon draws itself once as the notes come in, about a second, then still for good (Ry,
   2:17 PM 11 Nov: "Build both"). Calm mode, reduced motion or no script: the icons are simply drawn. */
.gc-notes {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: var(--s-2);
}
.gc-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: clamp(20px, calc(2.6vw / var(--vz, 1)), 40px);
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--ink);
}
/* wide: the long first note on its own line, the two short ones together under it */
.gc-note:first-child { flex-basis: 100%; justify-content: center; }
.gc-note:nth-child(3) { border-left: 1px solid var(--line); }
.gc-note svg { flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gc-note-amt { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: top; font-weight: 600; transition: width 320ms var(--ease); }
html.calm .gc-note-amt { transition: none; }
/* the draw: each stroke is one unit long (pathLength="1"); the gap is a little longer, so nothing shows before it starts.
   Envelope, then its flap; printer, then the page it feeds out; the loop traced end to end. */
/* The site's reveal hands a list's rise to each of its rows (js/base.js), so a row's own is-in starts its draw; keyed on the
   list alone the icons stayed blank (Dave, 21 Nov 2026: "a little funky"). */
html.js:not(.calm) .gc-notes:not(.is-in) .gc-note:not(.is-in) svg > * { stroke-dasharray: 1 1.1; stroke-dashoffset: 1.01; }
html.js:not(.calm) .gc-notes.is-in .gc-note svg > *, html.js:not(.calm) .gc-note.is-in svg > * {
  stroke-dasharray: 1 1.1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--t, 650ms) var(--ease);
  transition-delay: calc(var(--d, 0ms) + var(--k, 0) * 260ms + 250ms);
}
.gc-paper { transform-box: fill-box; }
html.js:not(.calm) .gc-notes:not(.is-in) .gc-note:not(.is-in) .gc-paper { transform: translateY(-4px); }
html.js:not(.calm) .gc-notes.is-in .gc-paper, html.js:not(.calm) .gc-note.is-in .gc-paper { transform: none; transition: stroke-dashoffset var(--t, 650ms) var(--ease), transform 650ms var(--ease); transition-delay: calc(var(--d, 0ms) + var(--k, 0) * 260ms + 250ms); }
/* phones: a short list, left aligned, under the row of cards */
@media (max-width: 767px) {
  .gc-notes { flex-direction: column; align-items: flex-start; width: fit-content; max-width: 100%; margin: var(--s-1) auto 0; }
  .gc-note { align-items: flex-start; padding-inline: 0; }
  .gc-note:first-child { flex-basis: auto; justify-content: flex-start; }
  .gc-note:nth-child(3) { border-left: 0; }
}

/* ---------- 3. What it buys (G6, 13 Nov 2026) ----------
   Four things a Gift Card pays for, in the site's one price look (css/base.css .rt-price): four across on wide
   screens, two by two on a phone. Separation by space and one hairline, no boxes. The prices are the home page's.
   The block keeps its first layout and spacing; only its ground changed, a sand band of its own so it reads apart
   from the card picker (Ry, 13 Nov 2026: "Just change it to this new background, but keep the same thing"). */
.gc-buys-sec { position: relative; padding-block: var(--s-6); }
.gc-amounts { padding-bottom: var(--s-6); }   /* the notes sit 64 above the band, as they sat 64 above the title */
.gc-buys { margin: 0 auto; max-width: 1040px; text-align: center; }
.gc-buys .sec-head { margin-bottom: 0; }   /* the site's section head (css/base.css); the list keeps its own gap below */
.gc-buys-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gc-buys-list li { display: grid; justify-items: center; align-content: start; gap: 12px; min-width: 0; padding: var(--s-1) var(--s-2); }
.gc-buys-list li + li { border-left: 1px solid var(--line); }
.gc-buys-list .rt-price { font-size: clamp(44px, calc(4vw / var(--vz, 1)), 56px); }
.gc-buys-what { max-width: 15ch; font-size: var(--fs-body); line-height: 1.35; color: var(--ink); text-wrap: balance; }
.gc-buys-fine { margin: var(--s-3) 0 0; font-size: var(--fs-small); line-height: 1.5; color: var(--muted); }
.gc-buys-fine a { position: relative; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gc-buys-fine a::after { content: ""; position: absolute; inset: -13px -6px; }   /* a 44 px target, the line unmoved (client looks audit, 23 Nov 2026) */
@media (max-width: 767px) {
  .gc-buys-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-3); }
  .gc-buys-list li { padding: 0 var(--s-1); }
  .gc-buys-list li:nth-child(3) { border-left: 0; }
}

/* ---------- 4. A touch screen as wide as an iPad (G6, Ry's call) ----------
   With no pointer to lift a card out of the hand, every card must be whole to the finger: the five lie side by side
   with a small gap, turned a little less, each showing its own label where it has room. The tilt, the deal and the
   pick's turn stay. The script measures the same step (js/pages/gifts.js). */
@media (min-width: 768px) and (hover: none) and (pointer: coarse) {
  .gc-stage {
    --cw: min(290px, calc(min(calc(100vw / var(--vz, 1)) - 2 * var(--gutter), var(--max)) / 5.4));
    --sp: calc((100cqi - var(--cw)) / 4);
    height: calc(var(--cw) * 1.5);
  }
  .gc-slot { transform: translate3d(calc(var(--k) * var(--sp)), calc(var(--k) * var(--k) * var(--cw) * 0.035), calc(var(--n) * 2px)) rotateZ(calc(var(--k) * 3deg)); }
  .gc-floor { width: 100%; }
  .gc-slot:not(:last-child) .gc-front .gc-kind { opacity: 1; }
  @container (max-width: 169px) { .gc-front .gc-kind { display: none; } }
  /* Round 2 (R25, a grandfather on an iPad): "Another amount" was half hidden behind the $200 card and too small to
     read. The hand lies flat here, so each card is painted over the one before it and is never cut by it as it turns
     over in the deal; each card keeps its own perspective for the turn. A pick still comes to the front. The words
     on the last card wrap to two lines at the type scale's 17, 20 or 24, whatever the card's width. */
  .gc-hand { transform-style: flat; perspective: 1500px; perspective-origin: 50% 30%; }
  .gc-slot.is-picked { z-index: 6; }
  .gc-n--words { right: 7cqi; white-space: normal; font-size: 17px; line-height: 1.05; }
  @container (min-width: 190px) { .gc-n--words { font-size: 20px; } }
  @container (min-width: 240px) { .gc-n--words { font-size: 24px; } }
}

/* Safari 15 (iPhones and iPads that stopped at iOS 15) has no container units, so every size on the face was dropped
   and the card fell apart (no logo, a small amount at the corner), and the fan's step was lost (the cards in one
   pile). There each size is read as a part of the card's width --cw, and the step from the column's width (the
   every screen check, 16 Nov 2026) */
@supports not (width: 1cqi) {
  .gc-stage { --sp: min(calc(var(--cw) * 0.66), calc((min(calc(100vw / var(--vz, 1)) - 2 * var(--gutter), var(--max)) - var(--cw) * 1.1) / 4)); }
  .gc-face { --q: calc(var(--cw) / 100); }
  .gc-face::before { inset: calc(var(--q) * 4); border-radius: calc(var(--q) * 3.4); }
  .gc-logo { left: calc(var(--q) * 7.5); top: calc(var(--q) * 7.5); width: calc(var(--q) * 21); }
  .gc-kind { right: calc(var(--q) * 7.5); top: calc(var(--q) * 8.6); }
  .gc-n { left: calc(var(--q) * 7); bottom: calc(var(--q) * 6); font-size: calc(var(--q) * 25); }
  .gc-n--words { bottom: calc(var(--q) * 8.5); font-size: calc(var(--q) * 11.5); }
  .gc-back .gc-logo--big { width: calc(var(--q) * 40); margin-top: calc(var(--q) * -6); }
  .gc-kind--back { top: auto; right: 0; bottom: calc(var(--q) * 9); }
  @media (min-width: 768px) and (hover: none) and (pointer: coarse) {
    .gc-stage { --sp: calc((min(calc(100vw / var(--vz, 1)) - 2 * var(--gutter), var(--max)) - var(--cw)) / 4); }
    .gc-n--words { right: calc(var(--q) * 7); font-size: 17px; }
  }
}
