/* ==========================================================================
   Interactive demo: industry switcher + before/after slider + device toggle.
   The mock sites use their OWN palette (per industry), not the brand tokens.
   ========================================================================== */
.demo { display: grid; gap: 1.4rem; }
.demo-controls { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.demo-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.demo-tab { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); padding: .6rem 1rem; border-radius: 999px; font: 600 .95rem/1 var(--font-body); cursor: pointer; transition: .2s; }
.demo-tab:hover { border-color: var(--color-text); }
.demo-tab[aria-selected="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.device-toggle { display: inline-flex; background: var(--color-surface-alt); border-radius: 999px; padding: 4px; }
.device-toggle button { border: 0; background: none; padding: .5rem .9rem; border-radius: 999px; font: 600 .88rem/1 var(--font-body); color: var(--color-muted); cursor: pointer; }
.device-toggle button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }

.demo-stage { display: flex; justify-content: center; }
.browser {
  width: 100%; max-width: 1040px; border-radius: 14px; overflow: hidden; background: var(--color-surface);
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  transition: max-width .6s var(--ease), border-radius .6s var(--ease);
}
.browser.is-phone { max-width: 380px; border-radius: 34px; border: 10px solid #2A2420; }
.browser.is-phone .browser-bar { display: none; }
.browser-bar { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: #EFE6DB; border-bottom: 1px solid var(--color-border); }
.dots { display: flex; gap: 6px; } .dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.url { flex: 1; background: var(--color-surface); border-radius: 7px; padding: .35rem .8rem; font: 500 .8rem/1.2 ui-monospace, monospace; color: var(--color-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.viewport { position: relative; height: 520px; overflow: hidden; container-type: inline-size; --split: 50%; }
.browser.is-phone .viewport { height: 620px; }
.layer { position: absolute; inset: 0; overflow: hidden; }
.layer-after { clip-path: inset(0 0 0 var(--split)); }
.split-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 0; z-index: 5; pointer-events: none; }
.split-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 0 12px rgba(0,0,0,.25); }
.split-handle::after { content: "⟷"; position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 1.1rem; color: var(--color-text); box-shadow: var(--shadow); }
.split-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 6; }
.split-range:focus-visible + .split-handle::after { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.split-label { position: absolute; top: 12px; z-index: 4; font: 700 .72rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; padding: .4rem .65rem; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; pointer-events: none; }
.split-label.before { left: 12px; } .split-label.after { right: 12px; }
.demo-caption { text-align: center; font-size: var(--fs-small); color: var(--color-muted); }

/* ---------- "AFTER": modern mock site ---------- */
.m { --p: #333; --bg: #fff; --a: #999; --ink: #1a1a1a; --soft: #666; --card: #fff;
  height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--mfont, system-ui, sans-serif);
  transition: background .5s, color .5s; }
.m * { transition: background .5s, color .5s, border-color .5s; }
.m-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; }
.m-hero > div:first-child { min-width: 0; }
.m-brand { font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.m-brand b { width: 26px; height: 26px; border-radius: 8px; background: var(--p); display: grid; place-items: center; font-size: .85rem; }
.m-links { display: flex; gap: 22px; font-size: .88rem; color: var(--soft); align-items: center; }
.m-links .m-btn { padding: 8px 14px; font-size: .82rem; }
.m-btn { display: inline-block; background: var(--p); color: var(--pc, #fff); border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: .92rem; }
.m-hero { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: center; padding: 26px 28px 30px; }
.m-kicker { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--p); background: color-mix(in srgb, var(--p) 12%, transparent); padding: 5px 10px; border-radius: 999px; margin-bottom: 12px; }
.m-h1 { font-family: var(--mhead, inherit); font-size: clamp(1.6rem, 5cqi, 2.9rem); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; }
.m-sub { color: var(--soft); font-size: .98rem; margin: 0 0 18px; max-width: 420px; }
.m-art { order: -1; position: relative; overflow: hidden; aspect-ratio: 4 / 3.4; max-height: 300px; width: 100%; border-radius: 28px; background: radial-gradient(circle at 30% 30%, var(--a), var(--p)); display: grid; place-items: center; font-size: clamp(3rem, 11cqi, 6.5rem); box-shadow: 0 24px 50px -20px var(--p); animation: m-float 6s ease-in-out infinite; }
.m-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@keyframes m-float { 50% { transform: translateY(-8px) rotate(-2deg); } }
.m-stars { margin-top: 14px; font-size: .8rem; color: var(--soft); } .m-stars span { color: #f5a524; letter-spacing: 2px; }
.m-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 28px 28px; }
.m-card { background: var(--card); border-radius: 16px; padding: 16px; border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }
.m-card i { font-style: normal; font-size: 1.4rem; } .m-card h4 { margin: 6px 0 4px; font-size: .95rem; } .m-card p { margin: 0; font-size: .8rem; color: var(--soft); }
.m-enter > * { animation: m-in .6s var(--ease) both; } .m-enter > *:nth-child(2) { animation-delay: .08s; } .m-enter > *:nth-child(3) { animation-delay: .16s; }
@keyframes m-in { from { opacity: 0; transform: translateY(14px); } }
@container (max-width: 560px) {
  .m-links span { display: none; }
  .m-nav { padding: 16px 18px; }
  .m-hero { grid-template-columns: 1fr; padding: 10px 18px 20px; }
  .m-art { aspect-ratio: 16 / 9; max-height: 180px; font-size: 4rem; border-radius: 20px; }
  .m-cards { grid-template-columns: 1fr; padding: 0 18px 18px; }
}

/* ---------- "BEFORE": dated mock site ---------- */
.old { height: 100%; overflow: hidden; background: #d4d0c8 repeating-linear-gradient(45deg, #ccc8c0 0 2px, transparent 2px 8px); font-family: "Times New Roman", Times, serif; color: #000; padding: 10px; }
.old-box { background: #fff; border: 3px outset #aaa; max-width: 700px; margin: 0 auto; padding: 10px; }
.old h1 { font-family: "Comic Sans MS", "Comic Sans", cursive; color: #c00; text-align: center; font-size: 1.7rem; margin: 6px 0; text-shadow: 2px 2px #ff0; letter-spacing: 0; }
.old marquee, .old .marq { display: block; background: #000080; color: #ff0; font-weight: bold; padding: 3px; font-size: .85rem; white-space: nowrap; overflow: hidden; }
.old .marq span { display: inline-block; padding-left: 100%; animation: marq 12s linear infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
.old table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.old td { border: 1px solid #999; padding: 6px; vertical-align: top; }
.old .side a { display: block; color: #00e; text-decoration: underline; margin-bottom: 4px; }
.old .uc { text-align: center; font-weight: bold; color: #f60; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.old .counter { font-family: monospace; background: #000; color: #0f0; padding: 1px 4px; }
.old .tiny { font-size: .72rem; color: #555; text-align: center; margin-top: 6px; }
@container (max-width: 560px) { .old table, .old tbody, .old tr, .old td { display: block; width: auto; } .old h1 { font-size: 1.3rem; } }

/* The stacked parody is taller than the 520px frame used on a narrow page.
   Scale that frame only; the phone toggle is 620px and already fits. */
@media (max-width: 700px) {
  .browser:not(.is-phone) .old-box { zoom: 0.8; }
}

@media (prefers-reduced-motion: reduce) { .m-art, .old .marq span, .old .uc { animation: none !important; } }

/* Full-frame preview images. Wide and narrow art is swapped by the
   existing viewport container so desktop and phone stay the same size. */
.shot { position: absolute; inset: 0; background: #F6F1E9; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.shot-narrow { display: none; }
@container (max-width: 960px) {
  .shot .shot-wide { object-fit: contain; object-position: center; background: #F6F1E9; }
}
@container (max-width: 560px) {
  .shot-wide { display: none; }
  .shot-narrow { display: block; }
}

/* Mockups whose headline sits on the left: the after image starts at the slider
   line (at full-frame scale), so the headline stays in view instead of hiding
   behind "before". Phone-size mockups are all left-aligned, so all use it there. */
.layer-after.focus-left .shot { left: var(--split); }
.layer-after.focus-left .shot img { width: 100cqi; object-fit: cover; object-position: left top; }
@container (max-width: 560px) {
  .layer-after .shot { left: var(--split); }
  .layer-after .shot img { width: 100cqi; object-position: left top; }
}
