/* Page parts shared by more than one page (2026-11-28 restructure): calculators, the home hero's three cards,
   before/after slider, audit panel, price lists. Loaded on every page from Site.astro, after fx.css. */

/* a section as tall as its content, not a forced full screen */
main > .section.section--fit { height: auto; min-height: 0; }
/* the audit form keeps at least a full screen, so the footer does not show under it */
main > .section.section--fit#audit { min-height: 100svh; }

/* drawn pictures (ServiceVisuals, AudienceVisuals): a padded box that centres its drawing */
.svc { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: clamp(20px, 4vw, 48px);
  background: radial-gradient(90% 70% at 85% 10%, rgba(183, 243, 74, .10), transparent 60%), var(--surface, #1a1d23); color: var(--ink); }
.svc[hidden] { display: none; }
.tile__media > .svc { position: absolute; inset: 0; }
@media (min-width: 640px) and (max-width: 1023px) { .hero__media > .svc--ads { padding: 16px; gap: 14px; } .hero__media > .svc--ads .ad__art.ad__art { aspect-ratio: 2.2; } }
/* stacked columns (tablet, phone): clear space between the words and the panel or picture under them */
@media (max-width: 1023px) { main > .section > .wrap.grid--top, main > .section > .wrap > .grid--top { row-gap: var(--s-6); } }
/* small laptops: half-width frames are narrow, so they need more height to hold their drawing */
@media (min-width: 1024px) and (max-width: 1279px) { main > .section > .wrap .frame--photo:has(> .rv, > .svc):not(:has(> .svc--growth)) { --ratio: 114% !important; } }
/* "How it works" pictures, when the steps are not pinned: as tall as the drawing (the kit's fixed 4:3 cut them off) */
[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual.mo-pc__visual--lit.stepv { aspect-ratio: auto; }

/* audit form panel */
.audit-panel { background: var(--g-alt, var(--surface)); padding: var(--s-8); border-radius: var(--r-lg); }
@media (max-width: 639px) { .audit-panel { padding: var(--s-5); } #audit .rows small { display: none; } }
@media (min-width: 640px) and (max-width: 1023px) { .audit-panel { padding: var(--s-7); } }

/* ---------- heroes that hold a calculator or the three cards ---------- */
.hero__calc, .hero__who { background: none; overflow: visible; display: flex; align-items: center; }
/* short laptops: the hero keeps enough height for what it holds */
@media (min-width: 1024px) { .hero.hero--split:has(.hero__who) { height: max(100svh, 780px); } .hero.hero--split:has(.hero__calc) { height: max(100svh, 890px); } }
@media (min-width: 1024px) and (max-width: 1279px) { .hero.hero--split:has(.hero__calc) { height: max(100svh, 940px); } }
@media (max-width: 1023px) {
  .hero.hero--split .hero__calc, .hero.hero--split .hero__who { height: auto; flex: none; }
  .hero.hero--split:has(.hero__calc, .hero__who) { height: auto; min-height: 100svh; padding-bottom: var(--s-8); }
}

/* ---------- calculators ---------- */
.calc { background: var(--g-alt, var(--surface)); border-radius: var(--r-lg); padding: var(--s-7); display: grid; gap: var(--s-5);
  box-shadow: 0 28px 70px -28px rgba(183, 243, 74, .45), 0 0 0 1px rgba(183, 243, 74, .14); }
.calc--hero { width: 100%; }
.calc__title { margin: 0; font-family: var(--font-display); font-size: 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.calc__title span { font-family: var(--font-text); font-size: 13px; color: var(--muted); }
.calc__note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.calc label { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; margin-bottom: var(--s-2); }
.calc label output { color: var(--accent, #b7f34a); font-variant-numeric: tabular-nums; }
.calc input[type="range"] { width: 100%; accent-color: #b7f34a; height: 28px; }
.calc input[type="number"] { width: 100%; height: 48px; font: inherit; font-size: 16px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.calc__result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); border-top: 1px solid var(--line); padding-top: var(--s-5); }
.calc__result p { margin: 0; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; justify-content: space-between; }
.calc__result strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 2.6vw, 38px); color: var(--ink); font-variant-numeric: tabular-nums; }
.calc__result .is-big strong { color: var(--accent, #b7f34a); }
@media (max-width: 639px) {
  .calc { padding: var(--s-5); }
  .calc__title { flex-direction: column; gap: 4px; }
  .calc input[type="range"] { height: 44px; }
}

/* ---------- home hero: three cards ---------- */
.who { width: 100%; height: 100%; scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.who__list { list-style: none; margin: 0; padding: 0; height: 100%; display: grid; grid-auto-rows: minmax(0, 1fr); gap: var(--s-4); }
.who__slot { display: grid; min-width: 0; }
.who__card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-5);
  padding: var(--s-5) var(--s-6); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent; transition: scale 160ms cubic-bezier(.23, 1, .32, 1);
}
.who__card:focus-visible { outline: 2px solid var(--accent, #b7f34a); outline-offset: 4px; border-radius: var(--r-lg); }
/* GSAP writes `scale: none` inline once it owns the tilt, so the press needs !important */
.who__card:active { scale: .985 !important; }
.who .who__panel.glass.glass.glass, .who__glow { position: absolute; inset: 0; border-radius: inherit; }
/* the glow is its own layer and only its opacity changes: no shadow repaint while the card tilts */
.who__glow { opacity: 0; pointer-events: none; box-shadow: 0 0 0 1px rgba(183, 243, 74, .55), 0 0 56px -6px rgba(183, 243, 74, .5), 0 30px 80px -30px rgba(183, 243, 74, .7); transition: opacity 200ms ease; }
.who__icon, .who__text, .who__go { position: relative; transition: transform 260ms cubic-bezier(.23, 1, .32, 1), background-color 200ms ease, color 200ms ease; }
.who__icon, .who__go { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.who__icon { width: 64px; height: 64px; padding: 16px; border-radius: 18px; stroke-width: 1.5; color: var(--accent, #b7f34a); background: rgba(10, 11, 14, .55); border: 1px solid rgba(183, 243, 74, .28); }
.who__text { display: grid; gap: var(--s-1); }
.who__name { font-family: var(--font-display); font-size: clamp(22px, 2vw, 30px); line-height: 1.15; letter-spacing: -.02em; }
.who__line { font-size: 16px; line-height: 1.45; }
.who__eg { font-size: 14px; line-height: 1.45; color: var(--muted); }
.who__go { width: 44px; height: 44px; padding: 11px; border-radius: 50%; stroke-width: 1.8; color: var(--accent, #b7f34a); border: 1px solid rgba(183, 243, 74, .35); }
.who__card:focus-visible .who__glow { opacity: 1; }
.who__card:focus-visible .who__go { background: var(--accent, #b7f34a); color: #111318; }
@media (hover: hover) and (pointer: fine) {
  .who__card:hover .who__glow { opacity: 1; }
  .who__card:hover .who__go { background: var(--accent, #b7f34a); color: #111318; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .who__card:hover .who__icon { transform: translateZ(44px); }
  .who__card:hover .who__text { transform: translateZ(26px); }
  .who__card:hover .who__go { transform: translateZ(44px) translateX(3px); }
}
/* entrance: one after another, on the slot around each card so it never mixes with the tilt */
@media (prefers-reduced-motion: no-preference) {
  .who__slot { animation: who-in 620ms cubic-bezier(.23, 1, .32, 1) backwards; animation-delay: calc(160ms + var(--i) * 75ms); }
  @keyframes who-in { from { opacity: 0; translate: 0 28px; } }
}
@media (prefers-reduced-motion: reduce) { .who__icon, .who__text, .who__go, .who__card { transition-property: background-color, color; } .who__card:active { scale: none !important; } }
@media (max-width: 1023px) { .who, .who__list { height: auto; } .who__list { grid-auto-rows: auto; } .who__card { min-height: 128px; } }
@media (max-width: 639px) {
  .who__list { gap: var(--s-3); }
  .who__card { gap: var(--s-4); padding: var(--s-4); min-height: 112px; }
  .who__icon { width: 48px; height: 48px; padding: 11px; border-radius: 14px; }
  .who__line { font-size: 15px; }
  .who__go { width: 36px; height: 36px; padding: 8px; }
}

/* ---------- before/after slider ---------- */
.compare { position: relative; overflow: hidden; border-radius: var(--r-lg); aspect-ratio: 4 / 3; --pos: 50%; touch-action: pan-y; cursor: col-resize; user-select: none;
  box-shadow: 0 28px 70px -28px rgba(183, 243, 74, .45), 0 0 0 1px rgba(183, 243, 74, .14); }
.compare .compare__after, .compare__line { transition: clip-path 90ms linear, left 90ms linear; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .compare__after { clip-path: inset(0 0 0 var(--pos)); }
.compare__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent, #b7f34a); pointer-events: none; }
.compare__line::after { content: "\2039 \203A"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: var(--accent, #b7f34a); color: #111318; display: grid; place-items: center; font-size: 18px; }
.compare__tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(17, 19, 24, .8); font-size: 13px; pointer-events: none; }
.compare__tag--l { left: 12px; } .compare__tag--r { right: 12px; }
.compare input[type="range"] { position: absolute; inset: auto 0 0 0; width: 100%; height: 44px; opacity: 0; cursor: ew-resize; margin: 0; }
.compare:focus-within { outline: 2px solid var(--accent, #b7f34a); outline-offset: 3px; }

/* ---------- price cards and price lists ---------- */
.card--plan { display: flex; flex-direction: column; }
.card--plan .plan__price { font-family: var(--font-display); font-weight: 400; font-size: var(--t-stat); line-height: 1.1; color: var(--ink); margin: 0; }
.card--plan .plan__price small { font-family: var(--font-text); font-size: var(--t-body); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.card--plan .btn { margin-top: auto; }
.spec { margin: 0; display: grid; }
.spec > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-4); padding-block: var(--s-3); border-top: 1px solid var(--line); }
.spec dt { color: var(--muted); font-size: var(--t-small); line-height: 1.5; }
.spec dd { margin: 0; font-size: var(--t-small); line-height: 1.5; }
.price-lg { font-family: var(--font-display); font-size: var(--t-stat); line-height: 1.1; }
.price-lg small { font-family: var(--font-text); font-size: var(--t-body); color: var(--muted); margin-left: 6px; letter-spacing: 0; }

/* a worked example set out like a receipt */
.receipt { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.4; }
.receipt caption { text-align: left; font-family: var(--font-display); font-size: 22px; line-height: 1.25; padding-bottom: var(--s-4); }
.receipt th, .receipt td { padding: var(--s-3) 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: baseline; }
.receipt td { padding-left: var(--s-4); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt th small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.receipt .is-total th, .receipt .is-total td { font-weight: 500; }
.receipt .is-net td { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--accent, #b7f34a); }
