/* Flip The Switch homepage: split stage (scroll-craft grammar 2.7).
   The divider is the chrome. home.js writes --x (share of the frame the
   "off" side holds), --c (collapse 0..1) and --k (switch knob 0..1). */

:root {
  --sc-canvas: #111110; --sc-surface: #1b1b19;
  --sc-ink: #f2f0eb;    --sc-ink-soft: #b3afa6;
  --sc-accent: #daff3e; --sc-accent-ink: #111110;
  --sc-font-display: "Archivo", system-ui, sans-serif;
  --sc-font-text: "Geist", system-ui, sans-serif;
  --off-ground: #d8d5cc;
  --off-ink: #2c2b27;
  --off-soft: #55534d;
  --g: clamp(20px, 4vw, 56px);
}
body.home { background: var(--ink); color: var(--stone); }

.stage { position: relative; }
.split { --x: .5; --c: 0; --k: .1; height: 100vh; height: 100svh; overflow: clip; }
.side { position: absolute; inset: 0; }
.side--on { background: var(--ink); color: var(--stone); }
.side--off {
  z-index: 2; background: var(--off-ground); color: var(--off-ink);
  clip-path: inset(0 calc((1 - var(--x)) * 100%) 0 0);
}
.track { position: absolute; inset: 0; }
.ch { position: absolute; }

/* ---- off side: the business today, anchored low-left ---- */
.home-logo { position: absolute; top: 26px; left: var(--g); width: 104px; z-index: 3; }
.home-logo img { width: 100%; height: auto; }
.track--off .ch { left: var(--g); bottom: clamp(56px, 13vh, 132px); width: calc(35vw - var(--g) - 40px); }
.off-state { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 3.4vw, 54px); letter-spacing: -.035em; line-height: 1; margin: 0 0 16px; color: var(--off-ink); }
.off-state--quiet { color: var(--off-soft); font-weight: 700; }
.off-state--hero { font-size: clamp(48px, 5.6vw, 92px); letter-spacing: -.05em; line-height: .9; margin-bottom: 22px; }
.off-line { margin: 0; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; color: var(--off-soft); max-width: 34ch; }

/* ---- on side: rides with the divider ---- */
.track--on { transform: translate3d(calc((var(--x) - .5) * 100vw), 0, 0); }
.track--on .ch { left: calc(50vw + var(--g) + 40px); top: clamp(88px, 17vh, 170px); width: calc(50vw - var(--g) * 2 - 48px); max-width: 44rem; }
.kick { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--sc-ink-soft); margin: 0 0 18px; }
.kick a { color: var(--stone); text-decoration: none; border-bottom: 1px solid rgba(242, 240, 235, .35); padding-bottom: 1px; }
.kick a:hover { color: var(--volt); border-color: var(--volt); }
.on-h1 { font-size: clamp(56px, 6.4vw, 104px); letter-spacing: -.05em; line-height: .9; margin: 0 0 24px; }
.on-h1 .kick { display: block; font-family: var(--sans); letter-spacing: .04em; font-size: 14px; line-height: 1.4; margin-bottom: 20px; }
.on-h { font-size: clamp(38px, 4.6vw, 72px); letter-spacing: -.045em; line-height: .95; margin: 0 0 20px; }
.on-h--sm { font-size: clamp(30px, 3.2vw, 48px); margin-bottom: 32px; }
.on-p { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: #cfccc4; max-width: 40ch; margin: 0 0 28px; }
.on-p--sm { font-size: 16px; margin-top: 32px; }
.on-p a, .on-link a { color: var(--stone); font-weight: 700; text-underline-offset: 4px; }
.on-link { margin: 0; }
.on-link a:hover, .on-p a:hover { color: var(--volt); }
.on-fig { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(44px, 5vw, 76px); letter-spacing: -.05em; line-height: 1; color: var(--volt); font-variant-numeric: tabular-nums; }
.on-fig small { display: block; font-family: var(--sans); font-weight: 500; font-size: 16px; letter-spacing: 0; color: var(--sc-ink-soft); margin-top: 8px; }
.split .btn-ghost { color: var(--stone); }
.logos--stage { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 26px 28px; }
.logos--stage img { opacity: .9; max-height: 40px; }

/* ---- the close: lands after the collapse ---- */
.track--on .ch--close { left: calc(50vw + var(--g)); top: clamp(96px, 20vh, 200px); width: min(62rem, calc(100vw - var(--g) * 2)); max-width: none; }
.close-h { font-size: clamp(64px, 11vw, 176px); letter-spacing: -.055em; line-height: .88; color: var(--volt); margin: 0 0 28px; }
.close-p { font-size: clamp(18px, 1.6vw, 23px); color: #cfccc4; max-width: 44ch; margin: 0 0 32px; }
.close-small { margin: 26px 0 0; font-size: 15px; color: var(--sc-ink-soft); }
.close-small a { color: var(--stone); }

/* ---- the divider: chrome, progress and the signature switch ---- */
.divider { position: absolute; top: 0; bottom: 0; left: 0; width: 0; z-index: 5; transform: translate3d(calc(var(--x) * 100vw), 0, 0); }
.divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--ink); opacity: calc(1 - var(--c)); }
.d-menu {
  position: absolute; top: 22px; left: 16px; white-space: nowrap;
  background: var(--ink-3); color: var(--stone); border: 0; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: background .16s, color .16s;
}
.d-menu:hover { background: var(--volt); color: var(--ink); }
.d-lbl { position: absolute; top: 96px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: calc(1 - var(--c)); }
.d-lbl--off { right: 14px; color: var(--off-soft); }
.d-lbl--on { left: 14px; color: var(--grey); }

.lightswitch {
  position: absolute; top: 50%; left: 0; width: 40px; height: 76px; margin: -38px 0 0 -20px;
  border-radius: 999px; background: #3a3933; cursor: grab; touch-action: none;
  box-shadow: 0 2px 4px rgba(10, 10, 8, .25), 0 10px 24px -6px rgba(10, 10, 8, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: background .3s;
  outline-offset: 5px;
  /* After the collapse the switch comes to rest, flipped on, bottom-left under the CTA. */
  transform: translate3d(calc(var(--c) * (var(--g) + 20px)), calc(var(--c) * 34vh), 0);
}
.lightswitch:active { cursor: grabbing; }
.ls-knob {
  position: absolute; left: 5px; top: 5px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--stone); box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
  transform: translate3d(0, calc((1 - var(--k)) * 36px), 0);
}
.split.is-on .lightswitch { background: var(--volt); }
.split.is-on .ls-knob { background: var(--ink); }
.lightswitch::after { content: "Drag me"; position: absolute; left: 54px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--grey); white-space: nowrap; opacity: calc(1 - var(--c) * 3); pointer-events: none; }
.split.was-dragged .lightswitch::after { content: none; }

.d-nav { position: absolute; top: calc(50% + 70px); left: 14px; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; opacity: calc(1 - var(--c) * 2); }
.d-nav a { font-size: 13px; font-weight: 600; color: #7d7a72; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.d-nav a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.d-nav a.is-now { color: var(--stone); }
.d-nav a.is-now::before { background: var(--volt); border-color: var(--volt); }
.d-nav a:hover { color: var(--volt); }
.d-now { display: none; }

/* ---- after the stage: a compact services index ---- */
.home-after { background: var(--ink); color: var(--stone); padding: clamp(56px, 8vw, 112px) 0; border-top: 1px solid var(--line-dark); }
.after-grid { display: grid; gap: 40px; }
@media (min-width: 1000px) { .after-grid { grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 48px; } }
.after-h { font-size: clamp(30px, 3.2vw, 44px); letter-spacing: -.04em; line-height: 1; margin-bottom: 12px; }
.after-col h3 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 8px; }
.after-col p { color: #a9a69e; font-size: 15px; }
.after-col ul { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line-dark); }
.after-col a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line-dark); text-decoration: none; font-weight: 600; }
.after-col a:hover { color: var(--volt); }
.home .muted { color: var(--grey); }

/* ---- phones: the split turns horizontal, off on top ---- */
@media (max-width: 760px) {
  .side--off { clip-path: inset(0 0 calc((1 - var(--x)) * 100%) 0); }
  .home-logo { top: 18px; width: 84px; }
  .track--off .ch { left: var(--g); right: var(--g); bottom: auto; top: 86px; width: auto; }
  .off-state { font-size: 28px; margin-bottom: 8px; }
  .off-state--hero { font-size: 40px; }
  .off-line { font-size: 15px; }

  .track--on { transform: translate3d(0, calc((var(--x) - .42) * 100svh), 0); }
  .track--on .ch { left: var(--g); right: var(--g); width: auto; top: calc(42svh + 30px); }
  .kick { margin-bottom: 10px; font-size: 12px; }
  .on-h1 { font-size: 48px; margin-bottom: 14px; }
  .on-h1 .kick { font-size: 12px; margin-bottom: 10px; }
  .on-h { font-size: 34px; margin-bottom: 12px; }
  .on-h--sm { font-size: 26px; margin-bottom: 18px; }
  .on-p { font-size: 16px; margin-bottom: 18px; }
  .on-fig { font-size: 42px; }
  .logos--stage { gap: 16px 18px; }
  .logos--stage img { max-height: 30px; }
  .split .btn { padding: 13px 16px 13px 20px; font-size: 15px; }
  .track--on .ch--close { left: var(--g); top: calc(42svh + 12svh); width: auto; }
  .close-h { font-size: 64px; }

  .divider { top: 0; left: 0; right: 0; bottom: auto; width: auto; height: 0; transform: translate3d(0, calc(var(--x) * 100svh), 0); }
  .divider::before { top: -1px; bottom: auto; left: 0; right: 0; width: auto; height: 2px; }
  .d-menu { top: auto; bottom: 12px; left: auto; right: var(--g); padding: 8px 14px; font-size: 13px; }
  .split.is-on .d-menu { bottom: auto; top: 14px; }
  .d-lbl, .d-nav { display: none; }
  .lightswitch { top: 0; left: var(--g); width: 64px; height: 36px; margin: -18px 0 0 0; transform: translate3d(0, calc(var(--c) * 88svh), 0); }
  .ls-knob { width: 26px; height: 26px; top: 5px; left: 5px; transform: translate3d(calc(var(--k) * 28px), 0, 0); }
  .lightswitch::after { left: 76px; top: 28px; transform: none; content: attr(data-now); color: var(--stone); letter-spacing: .06em; opacity: calc(1 - var(--c)); }
  .split.was-dragged .lightswitch::after { content: attr(data-now); }
}
@media (max-width: 760px) and (max-height: 700px) {
  .on-h1 { font-size: 40px; }
  .on-p { font-size: 15px; }
  .off-line { display: none; }
}

/* ---- no JavaScript: a readable stacked page, nothing hidden ---- */
.no-js .split { height: auto; position: static; overflow: visible; }
.no-js .side, .no-js .track, .no-js .ch { position: static; clip-path: none; transform: none; opacity: 1; width: auto; }
.no-js .side { padding: 96px var(--g) 48px; }
.no-js .ch { margin-bottom: 56px; }
.no-js .divider { display: none; }
.no-js .home-logo { position: static; margin-bottom: 40px; }

@media (prefers-reduced-motion: reduce) {
  .ls-knob, .track--on, .divider { transition: none; }
}

/* ---- Flagship AI + SEO copy after the stage ---- */
.flagship { border: 1px solid var(--line-dark); border-radius: 28px; padding: clamp(28px, 4vw, 56px); margin-bottom: clamp(56px, 7vw, 96px); background: var(--ink-2); }
.flagship .kick { color: var(--volt); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.flag-h { font-size: clamp(36px, 5vw, 72px); letter-spacing: -.045em; line-height: .95; margin: 0 0 18px; max-width: 16ch; }
.flag-p { font-size: clamp(17px, 1.4vw, 21px); color: #cfccc4; max-width: 56ch; margin: 0 0 28px; }
.flagship .btn-ghost { color: var(--stone); }
@media (min-width: 1000px) { .after-grid { grid-template-columns: 1fr 1fr 1fr; } }
.home-seo { background: var(--ink); color: var(--stone); padding: 0 0 clamp(56px, 8vw, 112px); }
.home-seo p { color: #b8b5ad; max-width: 62ch; }
.home-faq summary { color: var(--stone); }
.home-faq details { border-color: var(--line-dark); }
.home-faq .ans { color: #b8b5ad; }
.home-faq { border-top-color: var(--line-dark); }
.home-faq summary::after { background: var(--ink-3); }
