/* Subpage flow (subpage-flow.js) — toss.im/service style sections + rail. */
.sp-flow { --sp-ease: cubic-bezier(.22, 1, .36, 1); --sp-lav: #f6f2fd; --sp-lav-2: #ebe1fc; }
.sp-flow main.page-content { max-width: 1248px; }

/* Hero: eyebrow + title left, lead right, then a large rounded visual. */
.sp-flow .page-content .subpage-hero.sp-hero {
  min-height: 0; padding: 168px 0 0;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: 64px; align-items: end;
}
.sp-flow .sp-hero-head { grid-column: 1; }
.sp-flow .page-content .sp-eyebrow { margin: 0 0 20px; font-size: 18px; font-weight: 500; color: #6b7684; letter-spacing: -.03em; }
.sp-flow .sp-hero h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.32; letter-spacing: -.03em; }
.sp-flow .page-content .subpage-hero > p.sp-hero-lead {
  grid-column: 2; margin: 0 0 10px; max-width: 420px; font-size: 18px; line-height: 1.7; color: #4e5968; font-weight: 300;
}
.sp-flow .sp-hero > .sp-visual { grid-column: 1 / -1; margin-top: 72px; }

/* Visual panels: lavender field, screen bleeding off the bottom-right. */
.sp-visual {
  position: relative; margin: 0; overflow: hidden; border-radius: 32px;
  background: radial-gradient(120% 90% at 85% 100%, #e4d6fb 0%, transparent 60%), linear-gradient(160deg, #faf8fe 0%, var(--sp-lav) 55%, var(--sp-lav-2) 100%);
  aspect-ratio: 16 / 9; opacity: 0; transform: translateY(56px);
  transition: opacity .9s var(--sp-ease), transform 1.1s var(--sp-ease);
}
.sp-visual.is-in { opacity: 1; transform: none; }
.sp-visual.is-item { aspect-ratio: 3 / 2; border-radius: 24px; margin-top: 28px; }
.sp-visual.is-section { margin: 72px 0 0; aspect-ratio: 21 / 10; }
.sp-screen {
  position: absolute; left: 9%; top: 12%; right: -2%; bottom: -6%;
  border-radius: 18px 0 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 30px 80px rgba(73, 38, 140, .14), 0 0 0 1px rgba(25, 31, 40, .05);
  transform: translateY(40px) scale(1.02); transform-origin: 0 0;
  transition: transform 1.4s var(--sp-ease) .1s;
}
.sp-visual.is-in .sp-screen { transform: none; }
.sp-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.sp-screen.is-contain { left: 10%; right: 10%; top: 12%; bottom: 0; border-radius: 18px 18px 0 0; }
.sp-screen.is-contain img { object-fit: contain; object-position: center top; padding: 6% 6% 0; }
.sp-visual.is-hero .sp-screen, .sp-visual.is-section .sp-screen { left: 7%; top: 10%; }

/* Floating quote cards (fan) */
.sp-card {
  position: absolute; left: 50%; top: 50%; width: min(30%, 340px); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(73, 38, 140, .14); opacity: 0;
  transform: translate(calc(-50% + (var(--i) - 1) * 112%), calc(-50% + 80px));
  transition: transform 1.1s var(--sp-ease), opacity .8s var(--sp-ease); transition-delay: calc(.15s + var(--i) * .12s);
}
.sp-visual.is-in .sp-card { opacity: 1; transform: translate(calc(-50% + (var(--i) - 1) * 112%), -50%); }
.sp-visual.is-in .sp-card:nth-child(2) { transform: translate(-50%, calc(-50% - 28px)); }
.sp-card img { width: 100%; display: block; }

/* Buyers hero: the request screen, with quotes arriving in its right column */
.sp-stack-base {
  position: absolute; left: 7%; right: 7%; top: 9%; aspect-ratio: 1722 / 1246; border-radius: 20px; overflow: hidden;
  background: #fff; box-shadow: 0 30px 80px rgba(73, 38, 140, .14), 0 0 0 1px rgba(25, 31, 40, .05);
  transform: translateY(48px); transition: transform 1.3s var(--sp-ease) .05s;
}
.sp-stack-base > img { width: 100%; display: block; }
.sp-visual.is-in .sp-stack-base { transform: none; }
.sp-stack-cards { position: absolute; left: 63.5%; width: 31%; top: 26%; display: flex; flex-direction: column; gap: 14px; }
.sp-stack-card {
  border-radius: 14px; overflow: hidden; box-shadow: 0 16px 40px rgba(73, 38, 140, .14); opacity: 0;
  transform: translateY(36px) scale(.96);
  transition: transform .9s var(--sp-ease), opacity .6s var(--sp-ease); transition-delay: calc(.7s + var(--i) * .22s);
}
.sp-visual.is-in .sp-stack-card { opacity: 1; transform: none; }
.sp-stack-card img { width: 100%; display: block; }

/* Section number chip */
.sp-num {
  display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; margin-bottom: 24px;
  border: 1px solid #e5e8eb; border-radius: 8px; font-size: 13px; font-weight: 500; color: #8b95a1; letter-spacing: 0;
  opacity: 0; transform: translateY(12px); transition: opacity .6s var(--sp-ease), transform .8s var(--sp-ease);
}
.sp-num.is-in { opacity: 1; transform: none; }

/* Feature sections */
.sp-flow .page-content > section > section.sp-feature,
.sp-flow .page-content > section > section.sp-steps,
.sp-flow .page-content > section > section.sp-pricing { padding-block: 200px 40px; margin: 0; }
.sp-flow .page-content .sp-head h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.38; margin: 0 0 20px; }
.sp-flow .page-content .sp-head > p { font-size: 18px; line-height: 1.75; color: #6b7684; margin: 0; }

.sp-feature--center .sp-head { text-align: center; display: flex; flex-direction: column; align-items: center; }
.sp-feature--center .sp-head > p { max-width: 560px; }
.sp-items--grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 40px; margin-top: 64px; }
.sp-items--grid .sp-item { padding-top: 28px; border-top: 1px solid #e5e8eb; }

.sp-feature--split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); column-gap: 72px; align-items: start; }
.sp-feature--split .sp-head { position: sticky; top: calc(var(--site-header-height, 88px) + 48px); }
.sp-feature--split .sp-items { display: flex; flex-direction: column; }
.sp-feature--split .sp-item { padding: 40px 0 56px; border-top: 1px solid #e5e8eb; }
.sp-feature--split .sp-item:first-child { border-top: 0; padding-top: 0; }
.sp-flow .page-content .sp-item h3 { margin: 0 0 12px; font-size: 22px; line-height: 1.5; letter-spacing: -.03em; }
.sp-flow .page-content .sp-item p { margin: 0; font-size: 17px; line-height: 1.75; }
.sp-item { opacity: 0; transform: translateY(40px); transition: opacity .8s var(--sp-ease), transform 1s var(--sp-ease); }
.sp-item.is-in { opacity: 1; transform: none; }
.sp-items--grid .sp-item:nth-child(2) { transition-delay: .08s; }
.sp-items--grid .sp-item:nth-child(3) { transition-delay: .16s; }
.sp-item .sp-visual { opacity: 1; transform: none; }

/* FAQ in the split */
.sp-faq .sp-items h3 { margin: 40px 0 8px !important; font-size: 15px !important; color: #8b95a1; font-weight: 500; }
.sp-faq .sp-items h3:first-child { margin-top: 0 !important; }

/* Steps: four cards in a row */
.sp-steps .sp-head { text-align: center; }
.sp-flow .page-content .sp-steps ol { list-style: none; padding: 0; margin: 64px 0 0; max-width: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sp-flow .page-content .sp-steps ol > li { margin: 0; padding: 32px 28px 36px; border-radius: 24px; background: #f8f6fc;
  opacity: 0; transform: translateY(40px); transition: opacity .8s var(--sp-ease), transform 1s var(--sp-ease); }
.sp-flow .page-content .sp-steps ol > li.is-in { opacity: 1; transform: none; }
.sp-steps ol > li:nth-child(2) { transition-delay: .08s; }
.sp-steps ol > li:nth-child(3) { transition-delay: .16s; }
.sp-steps ol > li:nth-child(4) { transition-delay: .24s; }
.sp-step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 40px; border-radius: 50%; background: #fff; color: #7938d6; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.sp-flow .page-content .sp-steps li h3 { font-size: 20px; margin: 0 0 10px; }
.sp-flow .page-content .sp-steps li p { font-size: 16px; line-height: 1.7; }

/* Pricing: centered head, full table */
.sp-pricing .sp-head { text-align: center; display: flex; flex-direction: column; align-items: center; }
.sp-flow .page-content .sp-pricing > h3 { margin-top: 64px; }

/* Closing CTA */
.sp-flow .page-content .sp-cta {
  margin: 200px 0 0; padding: 120px 32px; border-radius: 40px; text-align: center;
  background: radial-gradient(80% 120% at 72% 112%, #d9c6fb 0%, transparent 62%), radial-gradient(60% 90% at 9% 100%, #eef2ff 0%, transparent 70%), linear-gradient(180deg, #ebe1fc 0%, #f8f6fc 100%);
}
.sp-flow .page-content .sp-cta h2 { margin: 0 0 36px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.38; }
.sp-cta-button {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 10px 0 24px; border-radius: 26px;
  background: #191f28; color: #fff !important; text-decoration: none; font-size: 16px; font-weight: 500;
}
.sp-cta-button svg { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: rgba(255, 255, 255, .14); }

/* ---- Section rail (toss.im style): bare dashes, dock-like hover. */
.sp-rail {
  position: fixed; left: 24px; top: 50%; z-index: 40; width: 72px; transform: translateY(-50%);
  --rail-ink: 28, 31, 37; opacity: 0; pointer-events: none; transition: opacity .4s ease;
  font-family: 'Pretendard', sans-serif; letter-spacing: -.03em;
}
.sp-rail[data-theme="dark"] { --rail-ink: 255, 255, 255; }
.sp-rail[data-visible] { opacity: 1; pointer-events: auto; }
.sp-rail a { position: relative; display: block; width: 72px; height: 12px; }
.sp-rail-dash {
  position: absolute; left: 0; top: 5px; width: 40px; height: 2px; border-radius: 1px;
  background: rgba(var(--rail-ink), .18); transform: scaleX(var(--s, .35)); transform-origin: 0 50%;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), background .3s ease;
}
.sp-rail a[aria-current] .sp-rail-dash { background: rgb(var(--rail-ink)); }
.sp-rail-label {
  position: absolute; left: 56px; top: 0; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  font-size: 15px; font-weight: 600; line-height: 1; color: rgb(var(--rail-ink)); opacity: 0;
  transition: opacity .18s ease, top .18s ease-out, color .3s ease;
}
.sp-rail[data-hover] .sp-rail-label { opacity: 1; }
.sp-rail a:focus-visible { outline: none; }
.sp-rail a:focus-visible .sp-rail-dash { background: #7938d6; }

@media (max-width: 700px) { .sp-rail { display: none; } }
@media (max-width: 960px) {
  .sp-flow .page-content .subpage-hero.sp-hero { grid-template-columns: 1fr; padding-top: 128px; }
  .sp-flow .page-content .subpage-hero > p.sp-hero-lead { grid-column: 1; margin-top: 24px; }
  .sp-feature--split { grid-template-columns: 1fr; }
  .sp-feature--split .sp-head { position: static; margin-bottom: 48px; }
  .sp-items--grid { grid-template-columns: 1fr; }
  .sp-flow .page-content .sp-steps ol { grid-template-columns: 1fr 1fr; }
  .sp-visual.is-section, .sp-visual { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) { .sp-flow .page-content .sp-steps ol { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .sp-visual, .sp-item, .sp-num, .sp-steps li, .sp-screen, .sp-card, .sp-stack-card, .sp-stack-base { transition: none !important; }
}


/* CTA button: a softer, frosted dark instead of solid black. */
.sp-cta-button {
  background: rgba(25, 31, 40, .68);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: background 180ms, transform 180ms;
}
.sp-cta-button:hover { background: rgba(25, 31, 40, .8); }
.sp-cta-button svg { background: rgba(255, 255, 255, .18); }
