/* Vibetrans homepage refresh - scoped to body.page-home
   Rollback: ./scripts/rollback-home.sh */

body.page-home {
  --home-glow-a: rgba(124, 92, 255, 0.22);
  --home-glow-b: rgba(34, 211, 238, 0.18);
  --home-surface: rgba(10, 12, 20, 0.62);
  --home-line: linear-gradient(90deg, var(--accent), var(--accent-2));
}

html[data-theme="light"] body.page-home {
  --home-glow-a: rgba(124, 92, 255, 0.12);
  --home-glow-b: rgba(34, 211, 238, 0.14);
  --home-surface: rgba(255, 255, 255, 0.78);
}

/* Hero layout */
body.page-home .portal {
  max-width: 1360px;
  padding: 104px 32px 88px;
  gap: clamp(32px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 440px);
}

body.page-home .intro {
  position: relative;
  isolation: isolate;
}

body.page-home .home-hero__glow {
  position: absolute;
  inset: -12% -8% auto -10%;
  height: 420px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 18% 42%, var(--home-glow-a), transparent 68%),
    radial-gradient(ellipse 45% 55% at 72% 18%, var(--home-glow-b), transparent 72%);
  filter: blur(2px);
}

body.page-home .intro h1 {
  max-width: 11ch;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

body.page-home .intro__lead {
  max-width: 54ch;
  font-size: 17px;
  line-height: 1.68;
  margin-bottom: 24px;
}

body.page-home .intro__metrics {
  margin-bottom: 22px;
}

body.page-home .intro__metrics div {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  border-radius: 14px;
  border-color: var(--border-strong);
  background: var(--home-surface);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

body.page-home .intro__metrics div::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: var(--home-line);
  opacity: 0.65;
}

body.page-home .intro__metrics div:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 18px 40px -24px rgba(34, 211, 238, 0.55);
}

body.page-home .intro__metrics strong {
  font-size: 24px;
  letter-spacing: -0.02em;
}

/* Quick links */
body.page-home .home-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  max-width: 640px;
}

body.page-home .home-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

body.page-home .home-chip:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: var(--glass-strong);
  transform: translateY(-1px);
}

body.page-home .home-chip svg {
  flex: none;
  color: var(--accent-2);
}

/* Calculator */
body.page-home .calc {
  max-width: none;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.1), rgba(34, 211, 238, 0.06)),
    var(--home-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 28px 70px -36px rgba(0, 0, 0, 0.75);
}

body.page-home .calc::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 22px 22px 0 0;
  background: var(--home-line);
  opacity: 0.85;
}

body.page-home .calc__title {
  font-size: 16px;
}

body.page-home .calc__field {
  border-radius: 12px;
  padding: 11px 13px;
}

body.page-home .calc__btn {
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--btn-primary-fg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  box-shadow: 0 12px 32px -14px var(--accent);
}

body.page-home .calc__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px var(--accent);
}

/* Auth panel */
body.page-home .auth {
  border-radius: 24px;
  padding: 30px;
  background:
    linear-gradient(160deg, rgba(124, 92, 255, 0.06), transparent 42%),
    var(--home-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 36px 90px -40px rgba(0, 0, 0, 0.8);
}

body.page-home .auth__tabs {
  border-radius: 14px;
  padding: 5px;
}

body.page-home .auth__tab.is-active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.14));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* Section shell */
body.page-home .home-section {
  position: relative;
  width: min(1280px, calc(100% - 48px));
}

body.page-home .home-section::before {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: var(--home-line);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.45);
}

body.page-home .services {
  width: min(1280px, calc(100% - 48px));
  padding: 72px 0 96px;
}

body.page-home .services__head h2 {
  font-size: clamp(30px, 3.6vw, 48px);
  letter-spacing: -0.03em;
}

body.page-home .service-row {
  min-height: auto;
  padding: 36px 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--home-surface);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

body.page-home .service-row:hover {
  border-color: rgba(34, 211, 238, 0.28);
  transform: translateY(-3px);
  box-shadow: 0 24px 60px -40px rgba(34, 211, 238, 0.35);
}

body.page-home .service-row:first-child { border-top: 1px solid var(--border); }
body.page-home .service-row:last-child { border-bottom: 1px solid var(--border); }

body.page-home .service-row__copy h3 {
  margin-top: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

body.page-home .service-points li {
  border-radius: 12px;
  background: var(--glass);
}

body.page-home .puzzle-line::before {
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(124, 92, 255, 0.1), transparent 50%),
    var(--glass);
}

/* Ops */
body.page-home .ops {
  width: min(1280px, calc(100% - 48px));
  padding-bottom: 96px;
}

body.page-home .ops-grid article {
  border-radius: 18px;
  padding: 28px 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 38%),
    var(--home-surface);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

body.page-home .ops-grid article:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.35);
}

body.page-home .ops-grid span {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

/* Workflow */
body.page-home .workflow {
  width: min(1280px, calc(100% - 48px));
  padding: clamp(48px, 6vw, 72px) clamp(24px, 4vw, 48px);
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--home-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 24px;
}

body.page-home .workflow-list div {
  border-radius: 14px;
  padding: 20px 22px;
  background: var(--glass);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

body.page-home .workflow-list div:hover {
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateX(4px);
}

/* CTA band */
body.page-home .support-band {
  width: min(1280px, calc(100% - 48px));
  padding: 36px clamp(24px, 4vw, 40px);
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.14), rgba(34, 211, 238, 0.1)),
    var(--home-surface);
  box-shadow: 0 28px 80px -48px rgba(124, 92, 255, 0.55);
  margin-bottom: 88px;
}

body.page-home .support-band .btn--primary {
  flex: none;
  padding: 14px 28px;
  font-size: 14.5px;
  white-space: nowrap;
}

/* Ordering blur - new hero elements */
body.page-home .portal.is-ordering .home-hero__chips,
body.page-home .portal.is-ordering .home-hero__glow {
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 1100px) {
  body.page-home .portal {
    grid-template-columns: 1fr;
    padding-top: 92px;
  }

  body.page-home .auth {
    max-width: 560px;
  }

  body.page-home .intro h1 {
    max-width: none;
  }
}

@media (max-width: 900px) {
  body.page-home .service-row {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 22px;
  }

  body.page-home .puzzle-line {
    min-height: 520px;
  }

  body.page-home .workflow {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  body.page-home .support-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  body.page-home .support-band .btn--primary {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.page-home .portal {
    padding: 88px 18px 64px;
  }

  body.page-home .intro__metrics {
    grid-template-columns: 1fr;
  }

  body.page-home .services,
  body.page-home .ops,
  body.page-home .workflow,
  body.page-home .support-band {
    width: calc(100% - 32px);
  }

  body.page-home .ops-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .intro__metrics div,
  body.page-home .service-row,
  body.page-home .ops-grid article,
  body.page-home .workflow-list div,
  body.page-home .home-chip,
  body.page-home .calc__btn {
    transition: none;
  }
}