/* S/4HANA Conversion page */

:root {
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.14);
}

/* ---------- Dark hero card with system scanner ---------- */

.s4-hero {
  padding: calc(var(--header-h) + 4px) 12px 0;
}

.s4-hero-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 56px 0 64px;
  border-radius: 32px;
  color: var(--white);
  background:
    radial-gradient(55% 70% at 100% 0%, rgba(52, 89, 166, 0.5), transparent 65%),
    radial-gradient(45% 60% at 0% 100%, rgba(52, 89, 166, 0.22), transparent 70%),
    var(--ink);
}

.s4-hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(80% 70% at 70% 40%, #000, transparent);
  mask-image: radial-gradient(80% 70% at 70% 40%, #000, transparent);
}

.s4-hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(142, 168, 220, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 168, 220, 0.22) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
  mask-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.s4-hero-card.is-lit::after {
  opacity: 1;
}

.s4-hero .page-title {
  font-size: clamp(38px, 5vw, 66px);
}

.s4-hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.eyebrow-pill.on-dark {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
}

.eyebrow-pill.on-dark .dot,
.eyebrow-pill.on-dark .dot::after {
  background: var(--amber);
}

.s4-hero .page-title .accent {
  color: var(--blue-300);
}

.s4-hero .page-sub {
  color: rgba(255, 255, 255, 0.7);
}

.scanner {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}

.scanner-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scanner-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.scanner-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.scanner-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-300);
  animation: blink 1s ease-in-out infinite;
}

.scanner.is-done .scanner-status .dot {
  background: var(--amber);
  animation: none;
}

@keyframes blink {
  50% { opacity: 0.25; }
}

.scanner-body {
  position: relative;
  padding: 12px;
}

.scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-300), transparent);
  box-shadow: 0 0 18px 4px rgba(142, 168, 220, 0.45);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.scan-beam::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 56px;
  background: linear-gradient(0deg, rgba(142, 168, 220, 0.14), transparent);
}

.scanner.is-done .scan-beam {
  opacity: 0;
}

.scan-list {
  display: grid;
  gap: 6px;
}

.scan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.scan-obj {
  min-width: 0;
}

.scan-obj code {
  display: block;
  overflow: hidden;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-obj small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.scan-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.5s var(--ease);
}

.scan-row[data-flag='ok'] .scan-badge {
  background: rgba(142, 168, 220, 0.14);
  color: var(--blue-300);
}

.scan-row:not([data-flag='ok']) .scan-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.scan-row.is-scanned .scan-badge {
  opacity: 1;
  transform: none;
}

.scan-row.is-scanned:not([data-flag='ok']) {
  border-color: rgba(245, 165, 36, 0.3);
  background: rgba(245, 165, 36, 0.06);
}

.scanner-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.scanner-foot strong {
  font-size: 15px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.scan-progress {
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.scan-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-300));
  transform: scaleX(0);
  transform-origin: left;
}

/* No-JS / reduced motion: show the finished scan */
html:not(.js) .scan-badge {
  opacity: 1;
  transform: none;
}

/* ---------- Split sections ---------- */

.split {
  display: grid;
  gap: 48px;
  align-items: center;
}

.split .section-title {
  margin-top: 8px;
}

.split-text p {
  max-width: 540px;
  margin-top: 24px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.warning-note {
  display: flex;
  gap: 16px;
  max-width: 540px;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid rgba(245, 165, 36, 0.35);
  border-radius: 20px;
  background: #fff9ef;
}

.warning-note .dropdown-icon {
  flex: none;
  background: var(--amber-soft);
  color: #c47d0c;
}

.warning-note p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- Iceberg ---------- */

.berg {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 400 / 440;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
}

.berg svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.berg-wave {
  animation: wave 5s linear infinite;
}

@keyframes wave {
  to { transform: translateX(-100px); }
}

.berg-ice {
  animation: bob 6s ease-in-out infinite alternate;
}

@keyframes bob {
  to { transform: translateY(5px); }
}

.berg-bubble {
  fill: rgba(255, 255, 255, 0.55);
  animation: rise 6s ease-in infinite;
  animation-delay: var(--b, 0s);
}

@keyframes rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-190px); opacity: 0; }
}

.berg-caption {
  position: absolute;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.berg-caption.below {
  color: rgba(255, 255, 255, 0.85);
}

.berg-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 12px 28px -14px rgba(11, 13, 18, 0.45);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
}

.berg.is-in .berg-pill {
  opacity: 1;
  transform: none;
}

.berg-pill .ping {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.berg-pill .ping::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--amber);
  animation: ping 2.2s var(--ease) infinite;
  animation-delay: var(--d, 0s);
}

.berg-pill.safe .ping,
.berg-pill.safe .ping::after {
  background: var(--blue);
}

/* ---------- Before / after compare ---------- */

.compare {
  --pos: 50%;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.compare-pane {
  padding: 72px 20px 24px;
}

.compare-after {
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(52, 89, 166, 0.1), transparent 70%),
    var(--white);
}

.compare-before {
  position: absolute;
  inset: 0;
  color: var(--white);
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(245, 165, 36, 0.12), transparent 70%),
    var(--ink);
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.compare-after .compare-head {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.compare-head strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.compare-head small {
  font-size: 13.5px;
  color: var(--ink-2);
}

.compare-before .compare-head small {
  color: rgba(255, 255, 255, 0.5);
}

.compare-rows {
  display: grid;
  gap: 10px;
}

.cmp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 14px;
}

.cmp-row > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-after .cmp-row {
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 15px;
  font-weight: 600;
}

.compare-before .cmp-row {
  border: 1px dashed rgba(245, 165, 36, 0.35);
  background: rgba(255, 255, 255, 0.04);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}


.cmp-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.cmp-badge svg {
  width: 13px;
  height: 13px;
}

.compare-before .cmp-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.compare-after .cmp-badge {
  background: var(--blue-50);
  color: var(--blue);
}

.compare-label {
  position: absolute;
  top: 20px;
  z-index: 3;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.compare-label.before {
  left: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.compare-label.after {
  right: 20px;
  background: var(--blue-50);
  color: var(--blue);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 4;
  width: 2px;
  margin-left: -1px;
  background: var(--white);
  box-shadow: 0 0 0 1px rgba(11, 13, 18, 0.08), 0 0 24px rgba(52, 89, 166, 0.5);
}

.compare-handle:focus-visible {
  outline: none;
}

/* At either end the knob sits on the card edge, clipped to a half circle showing only the usable arrow */
.compare-knob {
  position: absolute;
  top: 50%;
  left: var(--pos);
  z-index: 5;
  pointer-events: none;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 12px 30px -8px rgba(11, 13, 18, 0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.compare-knob svg {
  width: 22px;
  height: 22px;
  transition: transform 0.35s var(--ease);
}

.compare-knob path {
  transition: opacity 0.25s ease;
}

.compare.at-end .compare-knob svg {
  transform: translateX(-6px);
}

.compare.at-start .compare-knob svg {
  transform: translateX(6px);
}

.compare.at-end .chev-r,
.compare.at-start .chev-l {
  opacity: 0;
}

.compare:hover .compare-knob,
.compare.is-dragging .compare-knob {
  transform: scale(1.08);
}

.compare-handle:focus-visible + .compare-knob {
  box-shadow: 0 0 0 3px var(--blue), 0 12px 30px -8px rgba(11, 13, 18, 0.35);
}

.compare-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* ---------- Steps ---------- */

.steps-intro {
  max-width: 640px;
  margin: 72px auto 0;
  text-align: center;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
}

.steps {
  position: relative;
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

.step {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.step-num {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  box-shadow: 0 0 0 6px var(--surface);
}

.step h3 {
  margin-top: 20px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step p {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---------- Unknown unknowns ---------- */

.unknowns-text {
  max-width: 1040px;
  margin-top: 40px;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.promises {
  display: grid;
  gap: 16px;
  margin-top: 56px;
}

.promise {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  transition: border-color 0.3s ease, box-shadow 0.4s ease, transform 0.4s var(--ease);
}

.promise:hover {
  border-color: rgba(52, 89, 166, 0.25);
  box-shadow: 0 24px 50px -30px rgba(37, 63, 122, 0.35);
  transform: translateY(-3px);
}

.promise strong {
  font-size: 17px;
  font-weight: 600;
}

/* ---------- Blue CTA ---------- */

.cta-blue {
  position: relative;
  overflow: hidden;
  padding: 64px 24px;
  border-radius: 36px;
  text-align: center;
  color: var(--white);
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(135deg, var(--blue) 0%, var(--blue-600) 100%);
}

.cta-blue::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}

.cta-blue > * {
  position: relative;
}

.cta-blue .section-title {
  max-width: 900px;
  margin: 0 auto;
}

.cta-blue .section-title .accent {
  color: rgba(255, 255, 255, 0.7);
}

.cta-blue .cta-actions {
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.cta-mail {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 4px;
}

.cta-mail:hover {
  color: var(--white);
  text-decoration-color: var(--white);
}

/* ---------- Breakpoints ---------- */

@media (max-width: 639px) {
  .s4-hero {
    padding-left: 8px;
    padding-right: 8px;
  }

  .s4-hero-card {
    padding: 40px 0 32px;
    border-radius: 28px;
  }

  .scan-row {
    padding: 10px 12px;
  }

  .scan-obj code {
    font-size: 12.5px;
  }

  .scan-row:nth-child(n + 6) {
    display: none;
  }

  .scanner-head .code-dots {
    display: none;
  }

  .scanner-title {
    min-width: 0;
    overflow: hidden;
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .compare-head small {
    display: none;
  }

  .compare-knob {
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
  }

  .berg-pill {
    padding: 5px 10px 5px 8px;
    font-size: 11.5px;
  }

  .berg-caption {
    font-size: 10.5px;
  }

  .compare-pane {
    padding: 64px 14px 18px;
  }

  .cmp-row {
    min-height: 52px;
    padding: 10px 12px;
  }

  .compare-after .cmp-row {
    font-size: 13.5px;
  }

  .compare-before .cmp-row {
    font-size: 12.5px;
  }

  .cmp-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .cmp-badge .cmp-badge-text {
    display: none;
  }
}

@media (min-width: 768px) {
  .compare-pane {
    padding: 80px 40px 36px;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps::before {
    content: '';
    position: absolute;
    left: 50px;
    right: 50px;
    top: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--blue-300));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.4s var(--ease) 0.3s;
  }

  .steps.is-in::before {
    transform: none;
  }

  .step {
    background: transparent;
    border-color: transparent;
    padding: 28px 22px;
  }

  .step-num {
    box-shadow: 0 0 0 8px var(--white);
  }

  .promises {
    grid-template-columns: repeat(3, 1fr);
  }

  .cta-blue {
    padding: 96px 64px;
  }
}

@media (min-width: 1024px) {
  .s4-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .s4-hero-card {
    display: flex;
    align-items: center;
    min-height: min(calc(100svh - var(--header-h) - 20px), 820px);
    padding: 72px 0;
    border-radius: 40px;
  }

  .s4-hero-grid {
    width: 100%;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .berg-wave,
  .berg-ice,
  .berg-bubble,
  .berg-pill .ping::after,
  .scanner-status .dot {
    animation: none;
  }
}
