/* KorExBridge — scroll-scene pages.
   Loaded by index.html, how-it-works.html and pricing.html. Everything here
   assumes the snap container is the viewport, so it must never be linked from a
   normally-scrolling page such as contact.html. */

/* ── SNAP CONTAINER ────────────────────────────────────────────────── */
html {
  scroll-snap-type: y mandatory;
}

/* The shared header is sticky, which would push scene 1 down by its own
   height and leave every scene 64px too tall. Take it out of flow instead. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* ── SCENE ─────────────────────────────────────────────────────────── */
.scene {
  /* One scene must equal one screen. svh is the *smallest* viewport height, so
     when the phone hides its URL bar the real viewport grows past the scene and
     two of them show at once; dvh tracks what is actually visible. */
  --scene-top: 80px;                 /* 64px fixed header + breathing room */
  --scene-bottom: 24px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--scene-top) var(--pad-x) var(--scene-bottom);
}
/* Stated separately rather than as a second min-height declaration, so the
   older unit is not left competing with the newer one. */
@supports (min-height: 100dvh) {
  .scene { min-height: 100dvh; }
}

.scene-inner {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}
.scene-alt { background: var(--tint); }

.scene-line {
  font-size: clamp(2.2rem, 8.6vw, 4.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.045em;
  max-width: 15ch;
  text-wrap: balance;
}

.scene-sub {
  margin-top: 20px;
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34ch;
}

/* ── LITTLE UI ─────────────────────────────────────────────────────── */
.ui-card {
  margin-top: 44px;
  max-width: 400px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04),
              0 12px 32px rgba(11, 18, 32, 0.06);
}
.scene-alt .ui-card { border-color: transparent; }

.ui-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  font-size: 15px;
}
.ui-row + .ui-row { border-top: 1px solid var(--line); }
.ui-label { color: var(--ink-soft); }
.ui-value { font-weight: 700; text-align: right; }

.ui-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
}

.ui-input {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 13px;
  background: var(--tint);
  font-size: 15px;
  color: var(--ink-mid);
  overflow: hidden;
  white-space: nowrap;
}
.ui-caret {
  display: inline-block;
  width: 2px;
  height: 20px;
  margin-left: 3px;
  background: var(--primary);
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.ui-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  font-size: 15px;
  color: var(--ink-mid);
}
.ui-check + .ui-check { border-top: 1px solid var(--line); }
.ui-tick {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SCENE 5: QUOTE FORM ───────────────────────────────────────────── */
.quote-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
  margin-top: 40px;
}
.quote-form input {
  width: 100%;
  height: 60px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--tint);
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
.scene-alt .quote-form input { background: white; }
.quote-form input::placeholder { color: #9aa3af; }
.quote-form input:focus { border-color: var(--primary); background: white; }
.quote-form button {
  height: 60px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background .15s;
}
.quote-form button:hover { background: var(--primary-dark); }
.quote-form button:disabled { background: #9aa3af; cursor: default; }

.hp-field { position: absolute; left: -9999px; }

.quote-success {
  display: none;
  max-width: 460px;
  margin-top: 40px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 18px;
  padding: 32px 26px;
  text-align: center;
}
.quote-success-check {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}
.quote-success-msg { font-size: 18px; font-weight: 800; color: #15803d; margin-bottom: 5px; }
.quote-success-sub { font-size: 15px; color: var(--ink-soft); }

.quote-error {
  display: none;
  max-width: 460px;
  margin-top: 12px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  font-size: 14px;
  color: #b91c1c;
}
.quote-error a { font-weight: 700; text-decoration: underline; }

.scene-cta { margin-top: 40px; }

.scene-note {
  max-width: 460px;
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.scene-note a { color: var(--primary); font-weight: 600; }

/* ── Q & A ─────────────────────────────────────────────── */
/* A reference block, so it steps down from the scene display sizes. Three pairs
   per scene: six would overflow the viewport, and mandatory snapping would then
   put the last answers out of reach. */
.scene-line-sm {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  max-width: 20ch;
}

.qa {
  margin-top: 36px;
  max-width: 620px;
  display: grid;
  gap: 26px;
}
.qa-item {
  display: grid;
  gap: 8px;
}
.qa-q {
  font-size: clamp(1rem, 4.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
}
.qa-a {
  font-size: clamp(0.9rem, 3.7vw, 1rem);
  line-height: 1.6;
  color: var(--ink-soft);
}
/* At 320px the answers wrap to five lines each and a three-question slide ran
   35px past the screen. Tighten the spacing, not the type. */
@media (max-width: 359px) {
  .qa { margin-top: 24px; gap: 18px; }
  .qa-item { gap: 6px; }
  .qa-a { line-height: 1.5; }
}

/* ── SCENE RAIL ────────────────────────────────────────────────────── */
.rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rail a {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfd6e0;
  transition: background .2s, transform .2s;
}
.rail a:hover { background: #9aa3af; }
.rail a.on { background: var(--primary); transform: scale(1.4); }

/* ── FOOTER STOP ───────────────────────────────────────────────────── */
.scene-footer { scroll-snap-align: end; }

/* ── REVEAL (only once JS has marked the document) ─────────────────── */
.js .scene-inner > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s cubic-bezier(.22,.61,.36,1),
              transform .65s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--d, 0ms);
}
.js .scene.seen .scene-inner > * {
  opacity: 1;
  transform: none;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .rail { display: none; }
}

@media (min-width: 900px) {
  .scene { --scene-bottom: 32px; }
}

/* Snapping stays on for phones. It is dropped only for a landscape window too
   short to hold a scene at all, where mandatory snapping would strand content
   below the fold. */
@media (max-height: 480px) {
  html { scroll-snap-type: none; }
  .scene { min-height: 0; --scene-top: 96px; --scene-bottom: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .scene-inner > * { opacity: 1; transform: none; transition: none; }
  .ui-caret { animation: none; }
}
