/* Section styles: chooser (#programi): two fight-card offers.
   Unlayered, so it overrides css/base.css. Every selector is scoped under [data-section="chooser"].
   Card anatomy: .offer (li, size container + perspective) > .offer__card (tilts; ticket notches via mask)
   > .offer__art (photo, shade, big decorative number, foil, tag) + .offer__body (solid plate, all reading text)
   + .offer__glare + .offer__edge (holographic hairline). The link is stretched over the whole card. */

[data-section="chooser"] .chooser__cards {
  display: grid;
  gap: clamp(20px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  [data-section="chooser"] .chooser__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}

/* ------------------------------------------------------------ card shell */
[data-section="chooser"] .offer {
  --art-k: 1.25;                       /* art height / card width (4:5) */
  --foil-a: #ff3b30;
  --foil-b: #c9a55a;
  --foil-c: #ffe7a8;
  --foil-d: #5c0b0b;
  container-type: inline-size;
  display: flex;
  min-width: 0;
  perspective: 1100px;
}
[data-section="chooser"] .offer--cardio {
  --foil-a: #d9b46a;
  --foil-b: #5f8fff;
  --foil-c: #f6e6bd;
  --foil-d: #1b2f63;
}
@media (min-width: 1100px) { [data-section="chooser"] .offer { --art-k: 1; } }
@media (min-width: 1280px) { [data-section="chooser"] .offer { --art-k: .8333; } }
/* landscape phones: keep the photo short enough that title + price share the screen with it. The wide crop rides
   high on both portraits so the whole head sits under the tag chip, and the decorative number steps down a size */
@media (orientation: landscape) and (max-height: 520px) {
  [data-section="chooser"] .offer { --art-k: .72; }
  [data-section="chooser"] .offer--system .offer__art { --pos: 50% 3% !important; }
  [data-section="chooser"] .offer--cardio .offer__art { --pos: 62% 10% !important; }
  [data-section="chooser"] .offer .offer__big { font-size: clamp(64px, 25cqw, 140px); }
  [data-section="chooser"] .offer .offer__tag { top: 10px; left: 10px; }
}
/* the smallest landscape phones stack the cards: a wide, short photo so each card's title shares the screen */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 639px) { [data-section="chooser"] .offer { --art-k: .5; } }

[data-section="chooser"] .offer__card {
  --px: 50%;
  --py: 30%;
  --bx: 50%;
  --by: 50%;
  --foil-o: 0;
  --glare-o: 0;
  --edge-o: .32;
  --notch-y: calc(100cqw * var(--art-k));
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transform-origin: 50% 50%;
  /* ticket notches where the photo meets the plate */
  -webkit-mask-image: radial-gradient(circle at 0 var(--notch-y), transparent 10px, #000 10.5px), radial-gradient(circle at 100% var(--notch-y), transparent 10px, #000 10.5px);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(circle at 0 var(--notch-y), transparent 10px, #000 10.5px), radial-gradient(circle at 100% var(--notch-y), transparent 10px, #000 10.5px);
  mask-composite: intersect;
}
[data-section="chooser"] .offer__card.is-tilting { will-change: transform; }

/* ------------------------------------------------------------ art */
[data-section="chooser"] .offer__art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1 / var(--art-k);
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
}
[data-section="chooser"] .offer__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 40%);
  transform: translate3d(var(--ix, 0px), var(--iy, 0px), 0) scale(var(--is, 1.03));
  filter: saturate(var(--sat, .86)) brightness(var(--bri, .9));
  transition: filter .6s var(--ease-out);
}
[data-section="chooser"] .offer__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, .42) 0%, rgba(5, 5, 5, 0) 20%, rgba(5, 5, 5, 0) 48%, rgba(20, 20, 22, .74) 84%, var(--ink-2) 100%),
    radial-gradient(120% 70% at 50% 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .35) 100%);
}
/* perforation line: the card reads as a ticket */
[data-section="chooser"] .offer__art::after {
  content: "";
  position: absolute;
  z-index: 4;
  left: 18px;
  right: 18px;
  bottom: 0;
  border-top: 2px dashed rgba(237, 232, 223, .2);
  pointer-events: none;
}

/* giant decorative number (aria-hidden duplicate of the meta line) with a foil fill */
[data-section="chooser"] .offer__big {
  position: absolute;
  z-index: 1;
  right: 5%;
  bottom: 2%;
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(112px, 36cqw, 290px);
  line-height: .86;
  letter-spacing: -.005em;
  white-space: nowrap;
  color: transparent;
  background-image: linear-gradient(112deg, #4a3812 0%, #b08a42 22%, #f3dfa8 40%, #c9a55a 52%, #6b5220 70%, #d9bb76 86%, #4a3812 100%);
  background-size: 260% 260%;
  background-position: var(--bx) var(--by);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(246, 227, 173, .3);
  opacity: .8;
  transform: translate3d(var(--nx, 0px), var(--ny, 0px), 0);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* holographic foil: colour bands that slide with the pointer, dodged onto the lit parts of the photo */
[data-section="chooser"] .offer__foil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--foil-o);
  background-image:
    repeating-linear-gradient(115deg, var(--foil-d) 0%, var(--foil-a) 6%, var(--foil-b) 12%, var(--foil-c) 18%, var(--foil-b) 24%, var(--foil-d) 30%),
    repeating-linear-gradient(25deg, rgba(255, 255, 255, 0) 0 3px, rgba(255, 255, 255, .12) 3px 4px);
  background-size: 300% 300%, auto;
  background-position: var(--bx) var(--by), 0 0;
  mix-blend-mode: overlay;
  /* the foil shows where the light hits: a soft patch around the pointer */
  -webkit-mask-image: radial-gradient(circle 70cqw at var(--ax, 50%) var(--ay, 40%), #000 0%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 78%);
  mask-image: radial-gradient(circle 70cqw at var(--ax, 50%) var(--ay, 40%), #000 0%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 78%);
}
/* one diagonal sheen band, used for the sweep on touch (and on keyboard focus) */
[data-section="chooser"] .offer__art::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 55%;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 12%, rgba(255, 238, 205, .32) 50%, rgba(255, 255, 255, 0) 88%);
  mix-blend-mode: soft-light;
  transform: translateX(-130%) skewX(-12deg);
  opacity: 0;
}
[data-section="chooser"] .offer__card.is-sweep .offer__art::before { animation: offer-sheen 1.5s var(--ease-in-out) both; }
[data-section="chooser"] .offer__card.is-sweep .offer__foil { animation: offer-foil 1.6s var(--ease-in-out) both; }
@keyframes offer-sheen {
  0% { opacity: 0; transform: translateX(-130%) skewX(-12deg); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(260%) skewX(-12deg); }
}
@keyframes offer-foil {
  0% { opacity: 0; background-position: 100% 30%, 0 0; }
  40% { opacity: .55; }
  100% { opacity: 0; background-position: 0% 70%, 0 0; }
}

[data-section="chooser"] .offer__tag { z-index: 3; top: 14px; left: 14px; }

/* ------------------------------------------------------------ body (solid plate: every line of reading text) */
[data-section="chooser"] .offer__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  padding: clamp(22px, 2.6vw, 34px) clamp(20px, 2.4vw, 32px) clamp(14px, 1.6vw, 22px);
  background: var(--ink-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
[data-section="chooser"] .offer__title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
}
[data-section="chooser"] .offer__title > h3 {
  flex: 1 1 12ch;
  min-width: 0;
  font-size: var(--fs-h3-lg);
  line-height: 1.04;
  letter-spacing: .008em;
}
[data-section="chooser"] .offer__price {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: .14em .3em .12em;
  border: 1px solid rgba(201, 165, 90, .45);
  border-radius: var(--radius);
  background: rgba(201, 165, 90, .07);
  font-size: clamp(28px, 3vw, 40px);
}
[data-section="chooser"] .offer__desc { color: var(--bone); }
[data-section="chooser"] .offer__meta { margin-top: auto; padding-top: 4px; }
[data-section="chooser"] .offer__link { margin-top: 2px; }
[data-section="chooser"] .offer__link > span[aria-hidden] { transition: transform .4s var(--ease-out); }
/* the whole card is the link target */
[data-section="chooser"] .offer__link::after { content: ""; position: absolute; inset: 0; z-index: 6; }
[data-section="chooser"] .offer__link:focus-visible { outline: none; }

/* ------------------------------------------------------------ glare + holographic hairline */
[data-section="chooser"] .offer__glare {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  opacity: var(--glare-o);
  background:
    linear-gradient(105deg, rgba(255, 240, 215, 0) calc(var(--px) - 16%), rgba(255, 240, 215, .11) var(--px), rgba(255, 240, 215, 0) calc(var(--px) + 16%)),
    radial-gradient(farthest-corner circle at var(--px) var(--py), rgba(255, 248, 235, .2) 0%, rgba(255, 248, 235, .06) 22%, rgba(255, 248, 235, 0) 48%);
  mix-blend-mode: screen;
}
[data-section="chooser"] .offer__edge {
  position: absolute;
  inset: -1px;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 210deg at var(--px) var(--py), var(--foil-c), var(--foil-a), var(--foil-d), var(--foil-b), var(--foil-c));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--edge-o);
  transition: opacity .45s var(--ease-out);
}

/* states ------------------------------------------------------------------------------------------- */
/* fine pointer hover (JS drives the variables; this is the no-JS / pre-init baseline) */
@media (hover: hover) and (pointer: fine) {
  [data-section="chooser"] .offer__card:hover { --sat: 1; --bri: 1; --edge-o: .9; }
  [data-section="chooser"] .offer__card:hover .offer__link { color: var(--white); }
  [data-section="chooser"] .offer__card:hover .offer__link > span[aria-hidden] { transform: translateY(3px); }
}
/* touch: the card nearest the middle of the screen is lit */
[data-section="chooser"] .offer__card.is-lit { --sat: 1; --bri: 1; --edge-o: .85; }
/* keyboard focus on the stretched link: a solid bone ring drawn by the edge layer (an outline would be masked) */
[data-section="chooser"] .offer__card:focus-within .offer__edge { --edge-o: 1; padding: 2px; background: var(--bone); }
[data-section="chooser"] .offer__card:focus-within { --sat: 1; --bri: 1; }

/* reduced motion: no tilt or sheen; photos at full colour */
[data-motion="reduced"] [data-section="chooser"] .offer__card { transform: none !important; }
[data-motion="reduced"] [data-section="chooser"] .offer__foil,
[data-motion="reduced"] [data-section="chooser"] .offer__art::before { display: none; }
[data-motion="reduced"] [data-section="chooser"] .offer__img { --sat: 1; --bri: .96; transform: none; }
