/*
 * Stage 2 of the redesign (A-80): the membership selection ("climb to Eredità"), the signing
 * steps, the certificate, and the celebration after payment. Dark only.
 *
 * Escalation, chapter by chapter (light, material, type size, tempo):
 *   I   Scoperta  daylight on pale oak     accent #d9c7a3   name up to 6rem    tempo .6s
 *   II  Famiglia  barrel hall, gilt edges  accent #c8a96a   name up to 7rem    tempo .9s
 *   III Eredità   library vault, black and gold leaf, candle light, falling leaf
 *                                          accent #e3c98f   name up to 8.5rem  tempo 1.4s
 * Phone: one column; the choice sits in a sticky bar at the bottom.
 * Desktop: the hero spans the screen; below it, the content and a sticky choice card.
 *
 * Contrast (by hand, WCAG formula): accents on their grounds: #d9c7a3 on #0e0c0a 11.9:1,
 * #c8a96a on #120a06 8.8:1, #e3c98f on #060504 12.1:1. Text over photographs sits on veils of at
 * least 80% at the text's position. Certificate inks: see tokens.css.
 * Reduced motion: elements marked .rmf crossfade; nothing slides, scales or falls.
 */

/* ======================================================================
   Shared: the bar, buttons
   ====================================================================== */
.selbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 56px; padding: 6px 10px; background: rgba(8, 7, 6, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.selbar-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding-right: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.selbar-back:hover { color: var(--gold); }
.selbar-back span { display: none; }
.selbar-nav ol { list-style: none; display: flex; justify-content: center; align-items: center; gap: 2px; }
.selbar-nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 4px; color: var(--ink-3); text-decoration: none; font-family: var(--font-display); font-size: 15px; border-radius: 10px; }
.selbar-nav a:hover { color: var(--ink); }
.selbar-nav a[aria-current="page"] { color: var(--tier-accent, var(--gold)); }
.selbar-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 1px; background: currentColor; }
.sb-r { font-size: 16px; letter-spacing: .04em; }
.sb-name { font-size: 14px; letter-spacing: .04em; }
.selbar-nav li:not(:last-child) .sb-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sb-keep { font-family: var(--font-ui); font-size: 13px; letter-spacing: .04em; }
.selbar-end { display: inline-flex; align-items: center; gap: 12px; justify-self: end; }
.selbar-where { display: none; font-size: 12.5px; color: var(--ink-3); }
.selbar-where a { color: var(--ink-2); }

.tc .btn, .cmp-page .btn, .fin2 .btn, .cele .btn {
  min-height: 52px; font-size: 15px; font-weight: 500; letter-spacing: .05em;
  background-color: var(--red);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--red) 88%, #ffffff 12%), var(--red) 55%, var(--red-deep));
  border-color: var(--red-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 170, .28), inset 0 1px 0 rgba(255, 235, 210, .3), 0 14px 30px -14px rgba(120, 0, 0, .7);
}
.tc .btn:hover, .cmp-page .btn:hover, .fin2 .btn:hover, .cele .btn:hover { background-image: none; background-color: var(--red-deep); }

/* ======================================================================
   A tier chapter
   ====================================================================== */
.tc { --dur: .6s; --tier-accent: #d9c7a3; --tier-line: rgba(217, 199, 163, .4); --ground: #0e0c0a; --name: clamp(3rem, 13vw, 6rem);
  --hero-veil: linear-gradient(180deg, rgba(14,12,10,.15) 0%, rgba(14,12,10,.3) 30%, rgba(14,12,10,.86) 62%, #0e0c0a 100%);
  min-height: 100vh; min-height: 100dvh; background: var(--ground); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.tc-famiglia { --dur: .9s; --tier-accent: #c8a96a; --tier-line: rgba(200, 169, 106, .5); --ground: #120a06; --name: clamp(3.3rem, 14.5vw, 7rem);
  --hero-veil: linear-gradient(180deg, rgba(18,10,6,.2) 0%, rgba(18,10,6,.4) 30%, rgba(18,10,6,.88) 62%, #120a06 100%);
  background: radial-gradient(ellipse at 20% 0%, rgba(170, 96, 40, .16), transparent 50%), repeating-linear-gradient(91deg, rgba(120, 70, 30, .035) 0 2px, transparent 2px 11px), #120a06; }
.tc-eredita { --dur: 1.4s; --tier-accent: #e3c98f; --tier-line: rgba(227, 201, 143, .55); --ground: #060504; --name: clamp(3.6rem, 16vw, 8.5rem);
  --hero-veil: radial-gradient(ellipse 70% 50% at 50% 35%, rgba(6,5,4,.35), rgba(6,5,4,.8) 70%), linear-gradient(180deg, rgba(6,5,4,.4) 0%, rgba(6,5,4,.86) 55%, #060504 100%);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 190, 110, .08), transparent 55%), #060504; }

/* Hero */
.tc-hero { position: relative; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.tc-hero-bg { position: absolute; inset: 0; z-index: -2; background: #050403; }
.tc-hero-bg .ph { position: absolute; inset: 0; background: transparent; }
.tc-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-veil); pointer-events: none; }
.tc-scoperta .tc-hero-bg img { object-position: 60% 45% !important; filter: saturate(.95); }
.tc-famiglia .tc-hero-bg img { filter: brightness(.82) saturate(.9) sepia(.08); }
.tc-eredita .tc-hero-bg img { filter: brightness(.36) saturate(.75) sepia(.3); object-position: 50% 30% !important; }
.tc-hero-in { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 18px 30px; }
.tc-num { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .32em; color: var(--tier-accent); }
.tc-name { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--name); line-height: .88; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); text-shadow: 0 2px 30px rgba(0, 0, 0, .45); }
.tc-name:focus { outline: none; }
.tc-name:focus-visible { outline: 2px solid var(--tier-accent); outline-offset: 6px; }
.tc-meaning { margin: 8px 0 14px; font-family: var(--font-display); font-style: italic; font-size: clamp(1.3rem, 4.6vw, 1.9rem); color: var(--tier-accent); }
.tc-lede { margin: 0 0 18px; max-width: 36ch; font-size: 17px; line-height: 1.5; color: var(--ink); }
.tc-hero-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; padding-top: 14px; border-top: 1px solid var(--tier-line); max-width: 36rem; }
.tc-price { margin: 0; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.tc-price .num { font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1; color: var(--ink); }
.tc-price .per, .tc-side-price .per, .c3-price .per { font-size: 14px; color: var(--ink-2); }
.tc-terms { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; color: var(--ink-2); }
.tc-terms span + span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 10px 2px; border: 1px solid var(--tier-accent, var(--gold)); transform: rotate(45deg); }

/* Famiglia: a gilt double rule under the name */
.tc-famiglia .tc-name::after { content: ""; display: block; width: 110px; height: 4px; margin-top: 14px; border-top: 1px solid var(--tier-accent); border-bottom: 1px solid var(--tier-line); }

/* Eredità: gold leaf name, candle light */
.tc-eredita .tc-name { color: var(--leaf); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tc-eredita .tc-name { background: linear-gradient(100deg, #b8913f 0%, #f3dc9e 28%, #c9a24a 48%, #fbe9b8 66%, #b8913f 100%); background-size: 240% 100%; background-position: 0 0; -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .9)) drop-shadow(0 0 24px rgba(255, 200, 120, .18)); }
}
.tc-eredita .tc-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 45% 35% at 72% 30%, rgba(255, 186, 100, .16), transparent 70%), radial-gradient(ellipse 30% 25% at 18% 70%, rgba(255, 170, 80, .08), transparent 70%); }
html.motion .tc-eredita .tc-hero::before { animation: candle 6s ease-in-out infinite; }

/* The vault: three lit niches, the library line */
.vault { margin: 0 0 20px; max-width: 36rem; }
.niches3 { list-style: none; display: flex; gap: 16px; margin: 4px 0 16px; }
.niche3 { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.niche3-in { position: relative; display: block; width: 78px; aspect-ratio: 1 / 2.2; overflow: hidden; border-radius: 999px 999px 6px 6px; background: radial-gradient(ellipse 90% 60% at 50% 22%, #fff4d6, #e8c98a 52%, #9a6e2c 100%);
  box-shadow: 0 0 0 1px #e3c98f, 0 0 0 5px #060504, 0 0 0 6px rgba(227, 201, 143, .55), 0 0 40px rgba(255, 190, 110, .32); }
.niche3-in img { position: absolute; top: 6%; left: 50%; height: 92%; width: auto; max-width: none; transform: translateX(-50%) scale(1.04); mix-blend-mode: multiply; }
.niche3-in.rk-contain img { top: 8%; height: 86%; transform: translateX(-50%); }
.niche3-y { font-family: var(--font-display); font-size: 1.15rem; color: var(--leaf); letter-spacing: .06em; }
.vault-line { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 44ch; }
.vault-line strong { display: block; margin-bottom: 2px; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--leaf); }
.vault-line span { color: var(--ink); }

/* Falling gold leaf */
.leaves { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.leaves i { position: absolute; top: -20px; left: var(--x); width: var(--sz); height: calc(var(--sz) * .62); opacity: 0; border-radius: 1px 3px 1px 3px; background: linear-gradient(130deg, #fbe9b8, #c9a24a 55%, #8a6a2c); box-shadow: 0 0 6px rgba(255, 210, 140, .5); }

/* Body: the case for the tier, and the choice */
.tc-body { max-width: 1180px; margin: 0 auto; padding: 8px 16px 0; }
.tc-sec { margin: 0 0 44px; }
.tc-h { margin: 0 0 16px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 5.6vw, 2.4rem); line-height: 1.1; color: var(--ink); }

/* (b) the year of wine */
.tc-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; margin: 0 0 18px; }
.tc-facts div { border-top: 1px solid var(--tier-line); padding-top: 8px; }
.tc-facts dt { font-size: 13px; color: var(--ink-2); }
.tc-facts dd { margin: 2px 0 0; font-size: 1.9rem; line-height: 1.05; color: var(--ink); }
.tc-facts .is-lib dd { color: var(--leaf); }
.rack { display: grid; gap: 10px; padding: 12px 10px 6px; border-radius: 10px; background: linear-gradient(180deg, rgba(255, 240, 210, .04), rgba(0, 0, 0, .2)); box-shadow: inset 0 0 0 1px var(--tier-line), 0 30px 60px -30px rgba(0, 0, 0, .8); }
.rack-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 3px; padding-bottom: 7px; border-bottom: 3px solid rgba(120, 80, 40, .55); box-shadow: 0 1px 0 rgba(255, 220, 170, .08); }
.rack-6 { --cols: 6; }
.rack-12 { --cols: 12; }
.rk { position: relative; display: block; aspect-ratio: 1 / 2.15; overflow: hidden; border-radius: 3px 3px 1px 1px; }
.rk img { position: absolute; top: 0; left: 50%; height: 100%; width: auto; max-width: none; transform: translateX(-50%) scale(1.06); mix-blend-mode: multiply; }
.rk-contain img { top: 4%; height: 92%; transform: translateX(-50%); }
.rk-free { background: radial-gradient(ellipse at 50% 30%, #eadfc6, #bfa983); filter: saturate(.85) brightness(.88); }
.rk-premium { background: radial-gradient(ellipse at 50% 25%, #fff3d4, #d8b46a 85%); box-shadow: 0 0 0 1px #e3c98f, 0 0 14px rgba(232, 200, 120, .4); }
.rk-library { background: radial-gradient(ellipse at 50% 25%, #ffe9c2, #c98a3a 85%); box-shadow: 0 0 0 1px #f0d48f, 0 0 0 2px rgba(176, 16, 26, .8), 0 0 22px rgba(255, 190, 110, .55); }
.tc-cap { margin: 10px 0 8px; font-size: 13px; color: var(--ink-3); }
.rack-key { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--ink-2); }
.rack-key li { display: inline-flex; align-items: center; gap: 8px; }
.rk-key { width: 11px; aspect-ratio: 1 / 2; border-radius: 2px; }
html.motion .tc-year:not(.is-in) .rk { opacity: 0; }
html.motion .tc-year.is-in .rk { animation: rkIn .55s calc(var(--i) * 16ms) var(--ease-out) both; }

/* (a) the experiences, as scenes */
.scenes { list-style: none; display: grid; gap: 14px; }
.scene { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 4 / 5; border-radius: 14px; box-shadow: 0 0 0 1px var(--tier-line), 0 30px 60px -30px rgba(0, 0, 0, .9); }
.scene-ph { position: absolute; inset: 0; z-index: -2; }
.scene::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(6, 5, 4, .88) 82%); }
.scene-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 18px 20px; }
.scene-t { margin: 0; font-family: var(--font-display); font-size: 1.45rem; line-height: 1.18; color: #f6efdf; }
.scene-s { margin: 6px 0 0; font-size: 13.5px; color: #d6ccb8; }
.tc-famiglia .scene { box-shadow: 0 0 0 1px var(--tier-accent), 0 0 0 5px var(--ground), 0 0 0 6px var(--tier-line), 0 30px 60px -30px rgba(0, 0, 0, .9); }
.tc-eredita .scene { border-radius: 999px 999px 14px 14px / 160px 160px 14px 14px; box-shadow: 0 0 0 1px var(--tier-accent), 0 0 0 6px var(--ground), 0 0 0 7px var(--tier-line), 0 0 50px rgba(255, 190, 110, .12); }
html.motion .tc-scenes:not(.is-in) .scene { opacity: 0; transform: translateY(26px); }
html.motion .tc-scenes.is-in .scene { animation: sceneIn var(--dur) calc(var(--i) * 140ms) var(--ease-out) both; }

/* Benefits, highlighted */
.tc-bens { position: relative; padding: 22px 18px 10px; border-radius: 16px; background: rgba(255, 240, 210, .025); box-shadow: inset 0 0 0 1px var(--tier-line); }
.tc-famiglia .tc-bens { background: linear-gradient(180deg, rgba(170, 96, 40, .1), rgba(0, 0, 0, .1)); box-shadow: inset 0 0 0 1px var(--tier-accent), inset 0 0 0 5px var(--ground), inset 0 0 0 6px var(--tier-line); }
.tc-eredita .tc-bens { background: radial-gradient(ellipse at 50% 0%, rgba(255, 190, 110, .08), transparent 60%), #0a0806; box-shadow: inset 0 0 0 1px var(--tier-accent), inset 0 0 0 6px #0a0806, inset 0 0 0 7px var(--tier-line), 0 0 60px rgba(255, 190, 110, .06); }
.bf-key { display: flex; align-items: center; gap: 8px; margin: -6px 0 10px; font-size: 13px; color: var(--ink-2); }
.bfs { list-style: none; }
.bf { position: relative; padding: 14px 0 14px 30px; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.4; color: var(--ink-2); }
.bf:first-child { border-top: 0; }
.bf::before, .bf-mark { content: ""; position: absolute; left: 4px; top: 21px; width: 9px; height: 9px; border: 1px solid var(--tier-accent); transform: rotate(45deg); }
.bf-mark { position: static; display: inline-block; flex: none; background: var(--tier-accent); }
.bf.is-new { color: var(--ink); }
.bf.is-new::before { background: var(--tier-accent); box-shadow: 0 0 10px var(--tier-line); }
.bf .bf-t { margin-right: 4px; }

/* Next chapter */
.tc-nextcard { position: relative; display: flex; align-items: flex-end; gap: 12px; min-height: 210px; margin: 0 0 14px; padding: 22px; overflow: hidden; isolation: isolate; border-radius: 16px; color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 1px var(--tier-line); }
.tc-nextcard-ph { position: absolute; inset: 0; z-index: -2; }
.tc-nextcard::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(6, 5, 4, .9), rgba(6, 5, 4, .55) 70%, rgba(6, 5, 4, .35)); }
.tc-nextcard-in { flex: 1; display: flex; flex-direction: column; }
.tc-nextcard-k { font-size: 13px; color: var(--ink-2); }
.tc-nextcard-n { font-family: var(--font-display); font-size: clamp(2rem, 8vw, 3rem); line-height: 1; text-transform: uppercase; letter-spacing: .05em; }
.tc-nextcard-r { color: var(--gold); margin-right: 4px; }
.tc-nextcard-m { font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--gold-hi); }
.tc-nextcard .ico { width: 30px; height: 30px; transition: transform .3s var(--ease); }
.tc-nextcard:hover { color: var(--ink); }
.tc-nextcard:hover .ico { transform: translateX(6px); }
.tc-nextcard:hover .tc-nextcard-ph img { transform: scale(1.04); }
.tc-nextcard-ph img { transition: transform 1.2s var(--ease); }
.tc-next-eredita .tc-nextcard-ph img { filter: brightness(.5) sepia(.3); }
.tc-next-eredita .tc-nextcard-n { color: var(--leaf); }
.tc-next-compare { min-height: 120px; background: radial-gradient(ellipse at 80% 0%, rgba(227, 201, 143, .14), transparent 60%), #0a0806; box-shadow: inset 0 0 0 1px var(--tier-accent); }
.tc-next-compare::after { display: none; }
.tc-also { margin: 0 0 30px; font-size: 14px; }
.tc-also a { color: var(--ink-2); }
.tc-notes { margin: 0 0 24px; max-width: none; text-align: left; }

/* The choice: a sticky bar on phones */
.tc-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "price btn" "terms btn"; align-items: center; column-gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(8, 7, 6, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--tier-line); }
.tc-side-name, .tc-side-cmp, .tc-side .tc-mine { display: none; }
.tc-side-price { grid-area: price; margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.tc-side-price .num { font-size: 1.55rem; line-height: 1; }
.tc-side-price .mk { font-size: 9px; padding: 3px 6px; }
.tc-side-terms { grid-area: terms; margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
.tc-choose { grid-area: btn; padding: 0 18px; }
.tc-mine { margin: 0 0 8px; font-size: 13px; font-style: italic; color: var(--ink-2); }
body:has(.tc-side) #controls { bottom: calc(92px + env(safe-area-inset-bottom)); }

/* Chapter transitions */
.tc.is-enter-fwd .tc-hero-in, .tc.is-enter-back .tc-hero-in { animation: selIn var(--dur) var(--ease-out) both; }
.tc.is-enter-fwd .tc-hero-bg, .tc.is-enter-back .tc-hero-bg { animation: selBg calc(var(--dur) * 2) ease-out both; }
.tc.is-enter-fwd .tc-main, .tc.is-enter-back .tc-main { animation: dFade var(--dur) calc(var(--dur) * .4) ease-out both; }
.tc.is-leave-fwd .tc-hero, .tc.is-leave-fwd .tc-body, .cmp-page.is-leave-fwd .cmp-wrap { animation: selOutFwd .34s ease-in both; }
.tc.is-leave-back .tc-hero, .tc.is-leave-back .tc-body, .cmp-page.is-leave-back .cmp-wrap { animation: selOutBack .34s ease-in both; }

/* Eredità, the climax: the leaf name gleams, the niches light one by one, gold leaf falls */
.tc-eredita[class*="is-enter"] .tc-name { animation: leaf 3.2s .5s var(--ease) both; }
.tc-eredita[class*="is-enter"] .niche3 { animation: niche 1.1s calc(.8s + var(--i) * .38s) var(--ease-out) both; }
.tc-eredita[class*="is-enter"] .leaves i { animation: leafFall var(--dur) calc(1.9s + var(--dl)) ease-in both; }
.tc-eredita[class*="is-enter"] .vault-line { animation: dFade 1s 2s ease-out both; }

@keyframes selIn { from { opacity: 0; transform: translateY(34px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes selBg { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes selOutFwd { to { opacity: 0; transform: translateY(-24px); } }
@keyframes selOutBack { to { opacity: 0; transform: translateY(24px); } }
@keyframes rkIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes sceneIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes niche { 0% { opacity: .1; filter: brightness(.25); } 60% { opacity: 1; filter: brightness(1.25); } 100% { opacity: 1; filter: none; } }
@keyframes leafFall { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 10% { opacity: 1; } 85% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), 105vh) rotate(var(--r)); } }
@keyframes candle { 0%, 100% { opacity: 1; } 30% { opacity: .8; } 55% { opacity: .95; } 75% { opacity: .85; } }
@keyframes leaf { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes dFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dOut { from { opacity: 1; } to { opacity: 0; } }

/* ======================================================================
   Compare: all three side by side
   ====================================================================== */
.cmp-page { min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 85% 0%, rgba(227, 201, 143, .1), transparent 50%), #0a0908; }
.cmp-wrap { max-width: 1120px; margin: 0 auto; padding: 22px 10px 48px; }
.cmp-h { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.06; text-align: center; }
.cmp-h:focus { outline: none; }
.cmp-sub { justify-content: center; margin: 0 0 22px; }
.c3 { display: grid; }
.c3-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 6px; }
.c3-label { grid-column: 1 / -1; padding: 14px 6px 6px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); text-align: center; }
.c3-corner { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; border: 0; }
.c3-cell { padding: 2px 6px 14px; text-align: center; font-size: 14px; line-height: 1.35; color: var(--ink); }
.c3-cell .num { font-size: 1.25rem; }
.c3-cell .mk { margin: 4px 0 0; }
.c3-cell.is-none { color: var(--ink-3); }
.c3-cell.c3-eredita { color: var(--leaf); background: rgba(227, 201, 143, .05); }
.c3-cell.c3-famiglia { background: rgba(200, 169, 106, .025); }
.c3-headrow { position: sticky; top: 56px; z-index: 5; background: #0a0908; padding: 8px 0 10px; }
.c3-col { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 4px 12px; border-radius: 14px 14px 0 0; text-align: center; }
.c3-r { font-family: var(--font-display); font-size: .95rem; letter-spacing: .2em; color: var(--ink-3); }
.c3-name { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; font-size: clamp(1rem, 4.2vw, 1.6rem); line-height: 1.1; }
.c3-m { font-family: var(--font-display); font-style: italic; font-size: .95rem; color: var(--ink-2); }
.c3-col.c3-scoperta { box-shadow: inset 0 0 0 1px rgba(217, 199, 163, .4); }
.c3-col.c3-scoperta .c3-m { color: #d9c7a3; }
.c3-col.c3-famiglia { background: linear-gradient(180deg, rgba(170, 96, 40, .18), rgba(0, 0, 0, 0)), #140c07; box-shadow: inset 0 0 0 1px #c8a96a, inset 0 0 0 4px #140c07, inset 0 0 0 5px rgba(200, 169, 106, .5); }
.c3-col.c3-famiglia .c3-m { color: #c8a96a; }
.c3-col.c3-eredita { background: radial-gradient(ellipse at 50% 0%, rgba(255, 190, 110, .18), transparent 70%), #060504; box-shadow: inset 0 0 0 1px #e3c98f, inset 0 0 0 5px #060504, inset 0 0 0 6px rgba(227, 201, 143, .6), 0 0 40px rgba(255, 190, 110, .12); }
.c3-col.c3-eredita .c3-name, .c3-col.c3-eredita .c3-m, .c3-col.c3-eredita .c3-r { color: var(--leaf); }
.c3-foot .c3-cell { padding-top: 10px; }
.c3-price { margin: 0 0 10px; }
.c3-price .num { display: block; font-size: clamp(1.5rem, 6vw, 2.2rem); line-height: 1.05; }
.c3-choose { width: 100%; min-height: 52px; padding: 6px 8px; flex-direction: column; gap: 0; line-height: 1.15; font-size: 13.5px; }
.c3-choose-n { font-family: var(--font-display); font-size: 15px; letter-spacing: .04em; }
.cmp-page .fin-plain { margin-top: 26px; }
html.motion .cmp-page[class*="is-enter"] .c3-col { animation: selIn .8s var(--ease-out) both; }
html.motion .cmp-page[class*="is-enter"] .c3-col.c3-famiglia { animation-delay: .1s; }
html.motion .cmp-page[class*="is-enter"] .c3-col.c3-eredita { animation-delay: .2s; }

/* ======================================================================
   Signing steps: delivery and agreements, the certificate, payment
   ====================================================================== */
.fin2 { position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; }
.fin2-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #050403; }
.fin2-bg .ph { position: absolute; inset: 0; background: transparent; }
.fin2-bg .ph img { filter: brightness(.42) saturate(.85) sepia(.15); }
.fin2-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(8, 7, 6, .55), rgba(8, 7, 6, .88) 75%); }
.fin2-step { margin: 0; justify-self: center; font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--ink-2); }
.fin2-layout { display: grid; gap: 18px; max-width: 980px; margin: 0 auto; padding: 18px 14px 40px; }
.fin2-panel { position: relative; width: 100%; max-width: 520px; margin: 0 auto; padding: 22px 20px 20px; background: var(--glass); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.1); backdrop-filter: blur(var(--blur)) saturate(1.1); border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: var(--shadow-panel); }
.fin2-panel::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold-line); border-radius: 15px; pointer-events: none; opacity: .6; }
.fin2-title { margin-bottom: 14px; }
.fin2-title:focus { outline: none; }
.fin2-h2 { margin: 18px 0 10px; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; color: var(--ink); text-align: left; }
.fin2-cert { margin: 4px 0 18px; }
.fin2-aside { display: none; }
.fin2-after { width: 100%; max-width: 520px; margin: 0 auto; }

/* The certificate: an ivory paper object */
.cert { position: relative; width: 100%; max-width: 420px; margin: 0 auto; padding: 10px; color: var(--cert-ink); border-radius: 3px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .5), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(180, 150, 100, .18), transparent 60%), var(--cert);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 30px 60px -24px rgba(0, 0, 0, .85), 0 2px 6px rgba(0, 0, 0, .3); }
.cert-in { position: relative; padding: 24px 20px 34px; text-align: center; border: 1px solid #b9975a; outline: 1px solid rgba(185, 151, 90, .5); outline-offset: -6px; }
.cert-crest { display: flex; justify-content: center; margin: 0 0 10px; }
.cert .logo-plate { background: transparent; box-shadow: none; padding: 0; }
.cert .logo-md .logo { width: 116px; }
.cert-k { margin: 0 0 12px; font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--cert-ink-2); }
.cert-name { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.1; color: var(--cert-ink); }
.cert-tier { margin: 8px 0 4px; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .22em; font-size: 1.2rem; color: var(--cert-red); }
.cert-term { margin: 0; font-size: 14px; color: var(--cert-ink-2); }
.cert-meta { display: flex; justify-content: center; gap: 24px; margin: 14px 0 0; font-size: 13px; }
.cert-meta dt { color: var(--cert-ink-2); }
.cert-meta dd { margin: 0; font-family: var(--font-display); font-size: 1.05rem; color: var(--cert-ink); }
.cert-spot { position: absolute; right: 14px; bottom: -22px; width: 76px; height: 76px; border-radius: 50%; border: 1px dashed rgba(122, 16, 24, .35); }
.cert.is-sealed .cert-spot { border: 0; }
.cert-wax { width: 76px; height: 76px; }
.cert-wax .wax-roman { font-size: 1.6rem; }
.cert-compact { max-width: 340px; }
.cert-compact .cert-in { padding: 18px 16px 28px; }
.cert-compact .cert-name { font-size: 1.5rem; }

/* ======================================================================
   The celebration: seal, toast, welcome, doors
   ====================================================================== */
.cele { --T: 4.1s; position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; isolation: isolate; padding: 64px 16px 40px; }
.cele-bg { position: fixed; inset: 0; z-index: -2; background: #050403; overflow: hidden; }
.cele-bg .ph { position: absolute; inset: 0; background: transparent; }
.cele-bg .ph img { filter: brightness(.3) saturate(.8) sepia(.25) blur(2px); transform: scale(1.04); }
.cele-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(255, 190, 110, .1), rgba(5, 4, 3, .85) 70%); }
.cele-prefs { position: fixed; top: 12px; right: 12px; z-index: 20; }
.cele-prefs .lang { background: var(--glass); border-color: var(--glass-line); }
.cele-skip { z-index: 30; }
.cele-stage { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.cele-stage > * { grid-area: 1 / 1; }
.cele-cert { width: min(80vw, 360px); }
.cele-glasses { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.cele-g { display: block; width: 74px; }
.cele-g svg { display: block; width: 100%; height: auto; overflow: visible; }
.cele-gl { transform-origin: 100% 100%; }
.cele-gr { transform-origin: 0 100%; }
.g-bowl { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 244, 220, .8); stroke-width: 1.2; }
.g-stem, .g-base { fill: rgba(255, 244, 220, .6); }
.g-shine { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1.4; stroke-linecap: round; }
.cele-flash { width: 70vmax; height: 70vmax; border-radius: 50%; background: radial-gradient(circle, rgba(255, 248, 228, .95) 0%, rgba(232, 211, 160, .45) 22%, rgba(232, 211, 160, 0) 55%); opacity: 0; }
.cele .leaves { z-index: 2; }
.cele-welcome { position: relative; z-index: 3; max-width: 640px; text-align: center; }
.cele-tier { margin: 0 0 6px; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .3em; font-size: 1rem; color: var(--leaf); }
.cele-h { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 8vw, 4.2rem); line-height: 1.05; color: var(--ink); }
.cele-h:focus { outline: none; }
.cele-since { margin: 12px 0 22px; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--ink-2); }
.cele-still { margin: 0 0 30px; }
.cele-enter { padding: 0 30px; }
.cele .c-fine { margin-top: 14px; }
.cd { position: absolute; top: 0; bottom: 0; width: 50.5%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .28) 0 2px, transparent 2px 72px), linear-gradient(90deg, #22150c, #3a2416 45%, #24160d); box-shadow: inset 0 0 0 1px rgba(227, 201, 143, .3), inset 0 0 90px rgba(0, 0, 0, .7); }
.cd-l { left: 0; border-right: 1px solid rgba(227, 201, 143, .55); }
.cd-r { right: 0; border-left: 1px solid rgba(227, 201, 143, .55); }
.cele-doors { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.cele-doors .cd-l { transform: translateX(-101%); }
.cele-doors .cd-r { transform: translateX(101%); }

/* play: before the run, nothing shows */
.cele.is-play:not(.is-run) .cele-cert, .cele.is-play:not(.is-run) .cele-g, .cele.is-play:not(.is-run) .cele-welcome { opacity: 0; }
/* play: the run */
.cele.is-run .cele-cert { animation: celeCert var(--T) both; }
.cele.is-run .cert-wax { animation: celeWax var(--T) both; }
.cele.is-run .cele-gl { animation: celeGL var(--T) both; }
.cele.is-run .cele-gr { animation: celeGR var(--T) both; }
.cele.is-run .cele-flash { animation: celeFlash var(--T) both; }
.cele.is-run .leaves i { animation: leafFall var(--dur) calc(2.2s + var(--dl)) ease-in both; }
.cele.is-run .cele-welcome { animation: celeWelcome var(--T) both; }
.cele.is-run .cele-doors .cd-l { animation: celeDoorL var(--T) both; }
.cele.is-run .cele-doors .cd-r { animation: celeDoorR var(--T) both; }

@keyframes celeCert {
  0% { opacity: 0; transform: translateY(40px) scale(.94); animation-timing-function: var(--ease-out); }
  12% { opacity: 1; transform: none; }
  36% { opacity: 1; transform: none; animation-timing-function: ease-in; }
  46%, 100% { opacity: 0; transform: translateY(-24px) scale(.86); }
}
@keyframes celeWax {
  0%, 13% { opacity: 0; transform: scale(1.9) rotate(-20deg); animation-timing-function: cubic-bezier(.5, 0, .75, 0); }
  24% { opacity: 1; transform: scale(.92) rotate(3deg); }
  29%, 100% { opacity: 1; transform: none; }
}
/* The glasses travel in from the sides and tilt toward each other just enough for the rims to touch. */
@keyframes celeGL {
  0%, 38% { opacity: 0; transform: translateX(-46vw) rotate(-10deg); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  42% { opacity: 1; }
  54% { opacity: 1; transform: translateX(2px) rotate(4deg); }
  57% { transform: translateX(-2px) rotate(2deg); }
  60% { transform: translateX(1px) rotate(4deg); }
  70% { opacity: 1; transform: translateX(1px) rotate(4deg); }
  77%, 100% { opacity: 0; transform: translateX(1px) rotate(4deg); }
}
@keyframes celeGR {
  0%, 38% { opacity: 0; transform: translateX(46vw) rotate(10deg); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  42% { opacity: 1; }
  54% { opacity: 1; transform: translateX(-2px) rotate(-4deg); }
  57% { transform: translateX(2px) rotate(-2deg); }
  60% { transform: translateX(-1px) rotate(-4deg); }
  70% { opacity: 1; transform: translateX(-1px) rotate(-4deg); }
  77%, 100% { opacity: 0; transform: translateX(-1px) rotate(-4deg); }
}
@keyframes celeFlash {
  0%, 53% { opacity: 0; transform: scale(.3); }
  56% { opacity: 1; transform: scale(.9); }
  72%, 100% { opacity: 0; transform: scale(1.6); }
}
@keyframes celeWelcome {
  0%, 60% { opacity: 0; transform: translateY(18px); animation-timing-function: var(--ease-out); }
  72%, 100% { opacity: 1; transform: none; }
}
@keyframes celeDoorL { 0%, 88% { transform: translateX(-101%); animation-timing-function: cubic-bezier(.6, 0, .3, 1); } 100% { transform: translateX(0); } }
@keyframes celeDoorR { 0%, 88% { transform: translateX(101%); animation-timing-function: cubic-bezier(.6, 0, .3, 1); } 100% { transform: translateX(0); } }

/* The doors opening onto the member home (an overlay added by finale.js; the home is untouched) */
.doors-open { position: fixed; inset: 0; z-index: 200; pointer-events: none; perspective: 1600px; }
.doors-open .cd-l { transform-origin: left center; animation: doorOpenL .9s cubic-bezier(.6, 0, .25, 1) both; }
.doors-open .cd-r { transform-origin: right center; animation: doorOpenR .9s cubic-bezier(.6, 0, .25, 1) both; }
.doors-open.is-quick .cd-l, .doors-open.is-quick .cd-r { animation-duration: .55s; }
@keyframes doorOpenL { 0% { transform: rotateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: rotateY(-88deg); opacity: 0; } }
@keyframes doorOpenR { 0% { transform: rotateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: rotateY(88deg); opacity: 0; } }

/* ======================================================================
   Desktop compositions
   ====================================================================== */
@media (min-width: 600px) {
  .tc-facts { grid-template-columns: repeat(4, 1fr); }
  .scenes-2 { grid-template-columns: repeat(2, 1fr); }
  .scenes-3 { grid-template-columns: repeat(3, 1fr); }
  .scenes-1 .scene { aspect-ratio: 16 / 9; }
  .rack-row { gap: 5px; }
  .c3-choose { flex-direction: row; gap: 6px; font-size: 15px; }
}
@media (min-width: 760px) {
  .selbar { padding: 6px 18px; }
  .selbar-back span { display: inline; }
  .selbar-nav li:not(:last-child) .sb-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .selbar-nav a { padding: 0 14px; }
  .c3-row { grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); column-gap: 10px; }
  .c3-label { grid-column: auto; text-align: left; padding: 14px 8px; display: flex; align-items: center; font-size: 14px; }
  .c3-corner { position: static; width: auto; height: auto; clip: auto; border: 0; }
  .c3-cell { padding: 14px 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; align-items: center; }
  .c3-headrow .c3-label, .c3-headrow .c3-col { border-top: 0; }
  .cmp-wrap { padding: 32px 24px 60px; }
}
@media (min-width: 1000px) {
  .selbar-where { display: inline; }
  .tc { padding-bottom: 0; }
  .tc-hero::after { background: var(--hero-veil-wide, var(--hero-veil)); }
  .tc-scoperta { --hero-veil-wide: linear-gradient(90deg, rgba(14,12,10,.9) 0%, rgba(14,12,10,.7) 34%, rgba(14,12,10,.15) 64%, rgba(14,12,10,.1) 100%), linear-gradient(180deg, transparent 70%, #0e0c0a 100%); }
  .tc-famiglia { --hero-veil-wide: linear-gradient(90deg, rgba(18,10,6,.92) 0%, rgba(18,10,6,.72) 36%, rgba(18,10,6,.2) 66%, rgba(18,10,6,.25) 100%), linear-gradient(180deg, transparent 70%, #120a06 100%); }
  .tc-hero { align-items: center; }
  .tc-hero-in { padding: 60px 48px; }
  .tc-scoperta .tc-hero-in > *, .tc-famiglia .tc-hero-in > * { max-width: 560px; }
  .tc-lede { font-size: 19px; }
  .tc-eredita .tc-hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-areas: "num vault" "name vault" "mean vault" "lede vault" "price vault"; column-gap: 64px; align-items: end; }
  .tc-eredita .tc-num { grid-area: num; }
  .tc-eredita .tc-name { grid-area: name; }
  .tc-eredita .tc-meaning { grid-area: mean; }
  .tc-eredita .tc-lede { grid-area: lede; }
  .tc-eredita .tc-hero-price { grid-area: price; }
  .tc-eredita .vault { grid-area: vault; align-self: center; margin: 0; justify-self: center; text-align: center; }
  .tc-eredita .niches3 { justify-content: center; gap: 26px; }
  .tc-eredita .niche3-in { width: 118px; }
  .tc-eredita .vault-line { margin: 0 auto; }
  .tc-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; padding: 40px 48px 60px; }
  .tc-side { position: sticky; top: 80px; left: auto; right: auto; bottom: auto; display: block; padding: 26px 24px 22px; border: 0; border-radius: 18px; background: rgba(14, 12, 10, .85); box-shadow: inset 0 0 0 1px var(--tier-line), 0 30px 60px -30px rgba(0, 0, 0, .8); }
  .tc-famiglia .tc-side { background: linear-gradient(180deg, rgba(170, 96, 40, .14), rgba(0, 0, 0, 0)), #140c07; box-shadow: inset 0 0 0 1px var(--tier-accent), inset 0 0 0 5px #140c07, inset 0 0 0 6px var(--tier-line), 0 30px 60px -30px rgba(0, 0, 0, .8); }
  .tc-eredita .tc-side { background: radial-gradient(ellipse at 50% 0%, rgba(255, 190, 110, .14), transparent 60%), #0a0806; box-shadow: inset 0 0 0 1px var(--tier-accent), inset 0 0 0 6px #0a0806, inset 0 0 0 7px var(--tier-line), 0 0 60px rgba(255, 190, 110, .1); }
  .tc-side-name { display: block; margin: 0 0 8px; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: 1.6rem; color: var(--tier-accent); }
  .tc-side-price .num { font-size: 2.6rem; }
  .tc-side-terms { margin: 6px 0 18px; font-size: 14px; }
  .tc-side .tc-mine { display: block; }
  .tc-choose { width: 100%; }
  .tc-side-cmp { display: block; margin-top: 14px; text-align: center; font-size: 14px; color: var(--ink-2); }
  body:has(.tc-side) #controls { bottom: 12px; }
  .tc-nextcard { min-height: 260px; padding: 32px; }
  .fin2-layout.has-aside { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; max-width: 1040px; padding-top: 32px; }
  .fin2-layout.has-aside .fin2-panel { margin: 0; max-width: none; }
  .fin2-aside { display: block; position: sticky; top: 90px; }
  .fin2-layout.has-aside .fin2-after { grid-column: 1; }
  .fin2-layout { padding-top: 32px; }
  .cele-g { width: 96px; }
}

/* ======================================================================
   Reduced motion: crossfades only
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  .tc[class*="is-enter"] .tc-hero-in, .tc[class*="is-enter"] .tc-hero-bg, .tc[class*="is-enter"] .tc-main { animation: dFade .35s ease-out both; }
  .tc[class*="is-leave"] .tc-hero, .tc[class*="is-leave"] .tc-body, .cmp-page[class*="is-leave"] .cmp-wrap { animation: dOut .16s ease-in both; }
  .tc-eredita[class*="is-enter"] .niche3 { animation: dFade .6s .3s ease-out both; }
  .cele-g, .cele-cert, .cert-wax { transform: none !important; }
  .cele.is-run .cele-cert { animation-name: rmCeleCert; }
  .cele.is-run .cert-wax { animation-name: rmCeleWax; }
  .cele.is-run .cele-gl, .cele.is-run .cele-gr { animation-name: rmCeleGlass; }
  .cele.is-run .cele-flash { animation: none; opacity: 0; }
  .cele.is-run .cele-welcome { animation-name: rmCeleWelcome; }
  .cele-doors .cd-l, .cele-doors .cd-r { transform: none; opacity: 0; }
  .doors-open .cd-l, .doors-open .cd-r { animation: dOut .5s ease-out both; }
}
@keyframes rmCeleCert { 0% { opacity: 0; } 10%, 36% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes rmCeleWax { 0%, 14% { opacity: 0; } 24%, 100% { opacity: 1; } }
@keyframes rmCeleGlass { 0%, 40% { opacity: 0; } 50%, 70% { opacity: 1; } 77%, 100% { opacity: 0; } }
@keyframes rmCeleWelcome { 0%, 62% { opacity: 0; } 72%, 100% { opacity: 1; } }
