/*
 * Homepage · The problem and the fix, version 2 (live; /?split=v1 for the previous section)
 * template-parts/section-split-v2.php · assets/js/home-split.js
 *
 * Left, on the dark: our study's 480 AI answers as 480 dots, the 36 that
 * named a real local independent lit in gold. Right, on paper: four lines,
 * each with one real record, ticked and underlined by the red pencil.
 * Every "before" state is scoped to .sx.is-live, which the script adds.
 */

.sx {
  --sx-red: #c62828;
  --sx-navy: #0f172a;
  --sx-green: #1E3D2F;
  --sx-gold: #C9A44A;
  --sx-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  position: relative;
}
.sx-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.sx-eyebrow { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.1rem; font-family: 'Space Mono', monospace; font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sx-gold); }
.sx-eyebrow::before { content: ''; width: 2rem; height: 1px; background: currentColor; opacity: 0.6; }

/* ── The problem ── */
.sx-problem {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5.5rem clamp(2rem, 5vw, 4.5rem);
  color: #ffffff;
  background:
    radial-gradient(70% 55% at 0% 0%, rgba(201, 164, 74, 0.1) 0%, transparent 60%),
    radial-gradient(60% 60% at 100% 100%, rgba(30, 61, 47, 0.5) 0%, transparent 65%),
    #0b1222;
}
.sx-h { margin: 0 0 1rem; font-family: 'Outfit', sans-serif; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; color: #ffffff; text-wrap: balance; }
.sx-h span { display: block; color: #e6c77e; }
.sx-lede { max-width: 34rem; margin: 0; font-family: 'Inter', sans-serif; font-size: 1rem; line-height: 1.6; color: rgba(255, 255, 255, 0.72); }

.sx-chart { display: grid; grid-template-columns: minmax(0, 19.5rem) minmax(0, 1fr); gap: 1.6rem; align-items: center; margin: 1.9rem 0 1.7rem; }
.sx-dots { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 19.5rem; }
.sx-dots i { display: block; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.sx-dots i.is-indie { background: #e6c77e; box-shadow: 0 0 0 2px rgba(230, 199, 126, 0.18), 0 0 10px rgba(230, 199, 126, 0.55); }
.sx-key { min-width: 0; }
.sx-count { position: relative; display: inline-flex; flex-direction: column; gap: 0.85rem; margin: 0.4rem 0 0.9rem; }
.sx-count b { align-self: flex-start; font-family: 'Outfit', sans-serif; font-size: 3.4rem; font-weight: 800; line-height: 0.9; letter-spacing: -0.03em; color: #e6c77e; font-variant-numeric: tabular-nums; }
.sx-count span { font-family: 'Inter', sans-serif; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; color: rgba(255, 255, 255, 0.85); }
.sx-vs { margin: 0; font-family: 'Inter', sans-serif; font-size: 0.875rem; line-height: 1.45; color: rgba(255, 255, 255, 0.6); }
.sx-vs b { font-weight: 800; color: #ffffff; }
.sx-punch { margin: 0 0 0.7rem; font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 600; line-height: 1.35; color: #ffffff; }
.sx-src { margin: 0; font-family: 'Inter', sans-serif; font-size: 0.8125rem; line-height: 1.5; color: rgba(255, 255, 255, 0.55); }
.sx-src a { font-weight: 700; color: #e6c77e; text-decoration: none; }
.sx-src a:hover { color: #ffffff; text-decoration: underline; }

/* ── The fix ── */
.sx-fix {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5.5rem clamp(2rem, 5vw, 4.5rem);
  color: var(--sx-navy);
  background-color: #fffdf8;
  background-image:
    linear-gradient(rgba(30, 61, 47, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 61, 47, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}
.sx-fix .sx-eyebrow { color: #8a6d1f; }
.sx-fix-h { margin: 0 0 1.2rem; font-family: 'Outfit', sans-serif; font-size: clamp(1.45rem, 2.2vw, 1.75rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--sx-navy); }
.sx-lines { margin: 0; padding: 0; list-style: none; }
.sx-line { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0.25rem; padding: 1.15rem 0; border-top: 1px solid rgba(30, 61, 47, 0.12); }
.sx-line:last-child { border-bottom: 1px solid rgba(30, 61, 47, 0.12); }
.sx-num { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; margin-top: 0.1rem; font-family: 'Space Mono', monospace; font-size: 0.78rem; font-weight: 700; color: #8a6d1f; border: 1.5px solid rgba(201, 164, 74, 0.6); border-radius: 50%; transition: color 0.3s ease, border-color 0.3s ease; }
.sx-line.is-ticked .sx-num { color: rgba(138, 109, 31, 0.35); border-color: rgba(198, 40, 40, 0.35); }
.sx-k { margin: 0 0 0.25rem; font-family: 'Inter', sans-serif; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #8a93a2; }
.sx-t { margin: 0 0 0.35rem; font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; color: var(--sx-navy); }
.sx-p { margin: 0; font-family: 'Inter', sans-serif; font-size: 0.9375rem; line-height: 1.55; color: #4b5563; }
.sx-p .sx-mark { font-weight: 800; color: var(--sx-navy); white-space: nowrap; }
.sx-p a { font-weight: 700; color: #8a6d1f; text-decoration: none; white-space: nowrap; }
.sx-p a:hover { color: var(--sx-green); text-decoration: underline; }
.sx a:focus-visible { outline: 2px solid var(--sx-red); outline-offset: 3px; }

/* The button strip keeps its look; it no longer waits for the old section's reveal */
.sx .split-cta.sx-cta { opacity: 1; transform: none; }

/* ── The pencil and its marks (one of each per side) ── */
.sx-ink { position: absolute; left: 0; top: 0; z-index: 4; overflow: visible; pointer-events: none; }
.sx-ink path { fill: none; stroke: var(--sx-red); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.92; }
.sx-problem .sx-ink path { stroke: #ef5350; }
.sx-pencil { position: absolute; left: 0; top: 0; z-index: 5; display: none; width: 150px; height: 20px; margin-top: -10px; transform-origin: 0 50%; pointer-events: none; }
.sx-pencil svg { display: block; width: 100%; height: 100%; filter: drop-shadow(5px 9px 5px rgba(0, 0, 0, 0.3)); }
.sx.is-live .sx-pencil { display: block; opacity: 0; transition: opacity 0.3s ease; }
.sx.is-live .sx-pencil.is-shown { opacity: 1; }

/* ── Before it plays (only once the script is running) ── */
.sx.is-live .sx-dots i { opacity: 0; transform: scale(0.4); transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: calc(var(--r, 0) * 32ms); }
.sx.is-live .sx-dots.is-on i { opacity: 1; transform: none; }
.sx.is-live .sx-dots i.is-indie { background: rgba(255, 255, 255, 0.16); box-shadow: none; }
.sx.is-live .sx-dots i.is-indie.is-lit { background: #e6c77e; box-shadow: 0 0 0 2px rgba(230, 199, 126, 0.18), 0 0 10px rgba(230, 199, 126, 0.55); transition: background-color 0.25s ease, box-shadow 0.4s ease; transition-delay: 0s; }
.sx.is-live .sx-line { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.sx.is-live .sx-line.is-in { opacity: 1; transform: none; }
.sx.is-still .sx-dots i, .sx.is-still .sx-line { transition: none; }

/* No JavaScript: the proofs underlined in red ink */
.sx:not(.is-live) .sx-mark { text-decoration: underline; text-decoration-color: var(--sx-red); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ── Screen widths ── */
@media (max-width: 1100px) {
  .sx-chart { grid-template-columns: 1fr; gap: 1.2rem; }
}
@media (max-width: 900px) {
  .sx-grid { grid-template-columns: 1fr; }
  .sx-problem, .sx-fix { padding: 4.25rem 1.5rem; }
  .sx-chart { grid-template-columns: minmax(0, 19.5rem) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sx-problem, .sx-fix { padding: 3.75rem 1.25rem; }
  .sx-h { font-size: 1.85rem; }
  .sx-chart { grid-template-columns: 1fr; }
  .sx-dots { max-width: none; gap: 3.5px; }
  .sx-count b { font-size: 3rem; }
  .sx-line { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .sx-t { font-size: 1.15rem; }
  .sx-pencil { width: 120px; height: 16px; margin-top: -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sx *, .sx *::before, .sx *::after { animation: none !important; transition: none !important; }
}
