/* Shared layout for the service pages (SAP BTP, S/4HANA Conversion, Development) */

/* ---------- Hero ---------- */

.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 32px) 0 72px;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50% 60% at 85% 10%, rgba(52, 89, 166, 0.1), transparent 70%),
    radial-gradient(40% 40% at 0% 90%, rgba(52, 89, 166, 0.06), transparent 70%);
}

.page-hero-grid {
  display: grid;
  gap: 56px;
  align-items: center;
}

.page-title {
  margin-top: 28px;
  font-size: clamp(40px, 5.8vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

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

.page-sub {
  max-width: 540px;
  margin-top: 28px;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* ---------- Tags ---------- */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.tag-list li {
  padding: 7px 14px;
  border: 1px solid rgba(52, 89, 166, 0.2);
  border-radius: 999px;
  background: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue);
}

/* ---------- Tabs ("the shift") ---------- */

.shift {
  display: grid;
  gap: 20px;
}

.shift-tabs {
  position: relative;
  display: flex;
  gap: 8px;
  margin: 0 -24px;
  padding: 0 24px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.shift-tabs::-webkit-scrollbar {
  display: none;
}

.shift-tab {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  scroll-snap-align: start;
  text-align: left;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.shift-num {
  font-size: 13px;
  font-weight: 600;
  color: rgba(11, 13, 18, 0.3);
  transition: color 0.3s ease;
}

.shift-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.shift-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

.shift-tab:hover .shift-label {
  color: var(--ink);
}

.shift-tab[aria-selected='true'] {
  border-color: rgba(52, 89, 166, 0.3);
  background: var(--blue-50);
}

.shift-tab[aria-selected='true'] .shift-num {
  color: var(--blue);
}

.shift-tab[aria-selected='true'] .shift-label {
  color: var(--ink);
}

.shift-panels {
  display: grid;
}

.shift-panel {
  grid-area: 1 / 1;
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.7s var(--ease), visibility 0s linear 0.5s;
}

.shift-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.shift-panel h3 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.shift-panel p {
  max-width: 680px;
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.check-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.check-list .why-icon {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: -1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
}

.check-list .why-icon svg {
  width: 13px;
  height: 13px;
}

/* ---------- Dark "root causes" panel ---------- */

.roots {
  position: relative;
  overflow: hidden;
  padding: 56px 24px;
  border-radius: 36px;
  color: var(--white);
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(52, 89, 166, 0.45), transparent 65%),
    radial-gradient(40% 60% at 0% 100%, rgba(52, 89, 166, 0.2), transparent 70%),
    var(--ink);
}

.roots .eyebrow {
  color: var(--blue-300);
}

.roots .section-title {
  max-width: 720px;
  margin-top: 8px;
}

.roots-grid {
  display: grid;
  gap: 14px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.root-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.4s ease, background-color 0.4s ease;
}

.root-card.spot-card::before {
  background: radial-gradient(360px circle at var(--x, 50%) var(--y, 50%), rgba(142, 168, 220, 0.18), transparent 45%);
}

.root-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.root-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.root-top .dropdown-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.root-num {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
}

.root-card p {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Feature rows (image + text) ---------- */

.features {
  display: grid;
  gap: 72px;
}

.feature {
  display: grid;
  gap: 32px;
  align-items: center;
}

.feature-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  will-change: transform;
}

.feature-num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--blue-50);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}

.feature-body h3 {
  margin-top: 24px;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.feature-body p {
  max-width: 500px;
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.statement {
  max-width: 980px;
  margin: 120px auto 0;
  text-align: center;
  font-size: clamp(30px, 4.4vw, 58px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

/* ---------- Image CTA card ---------- */

.cta-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 64px 24px;
  border-radius: 36px;
  color: var(--white);
  background: var(--ink);
}

.cta-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
}

.cta-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 13, 18, 0.55), rgba(11, 13, 18, 0.9)),
    linear-gradient(90deg, rgba(11, 13, 18, 0.6), rgba(37, 63, 122, 0.25));
}

.cta-content {
  max-width: 640px;
}

.cta-card .eyebrow {
  color: var(--blue-300);
}

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

.cta-card .section-title .accent {
  color: var(--blue-300);
}

.cta-text {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.cta-highlight {
  margin-top: 20px;
  font-size: 20px;
  font-weight: 600;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn-white {
  background: var(--white);
  color: var(--ink);
}

.btn-white .btn-cta-icon {
  background: rgba(11, 13, 18, 0.07);
}

.btn-white:hover {
  background: var(--blue);
  color: var(--white);
}

.btn-white:hover .btn-cta-icon {
  background: rgba(255, 255, 255, 0.16);
}

.btn-ghost-light {
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
}

.btn-ghost-light:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- BTP hero: centered headline + panoramic ERP ⇄ BTP data flow ---------- */

.hero-center {
  position: relative;
  padding: calc(var(--header-h) + 56px) 0 24px;
  overflow: hidden;
  text-align: center;
}

.hero-center::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 45% at 50% 0%, rgba(52, 89, 166, 0.12), transparent 70%);
}

.hero-center .page-title {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.hero-center .page-sub {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.hero-center .page-actions {
  justify-content: center;
}

.pano {
  position: relative;
  isolation: isolate;
  margin-top: 64px;
  padding: 40px 0 72px;
}

.pano-floor {
  position: absolute;
  z-index: -1;
  left: -20%;
  right: -20%;
  bottom: 0;
  height: 340px;
  background-image:
    linear-gradient(rgba(52, 89, 166, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 89, 166, 0.16) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 75%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 75%, transparent 100%);
  animation: floor 5s linear infinite;
}

@keyframes floor {
  to { background-position: 0 56px, 0 0; }
}

.pano-row {
  display: grid;
  justify-items: center;
}

.pano-slot {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  will-change: transform;
}

.pano-pop {
  width: 100%;
  display: flex;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease, transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}

.pano-pop.from-left { transform: translateX(-40px); }
.pano-pop.from-right { transform: translateX(40px); }
.pano-pop.from-center { transform: scale(0.8); }

.pano.is-in .pano-pop {
  opacity: 1;
  transform: none;
}

.pano-node {
  position: relative;
  width: 100%;
  max-width: 300px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 30px 60px -30px rgba(37, 63, 122, 0.45);
  text-align: left;
}

.pano-node-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pano-node strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.pano-node small {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
}

.pano-bars {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.pano-bars span {
  height: 8px;
  border-radius: 8px;
  background: rgba(11, 13, 18, 0.07);
}

.pano-bars span:nth-child(1) { width: 92%; }
.pano-bars span:nth-child(2) { width: 70%; }
.pano-bars span:nth-child(3) { width: 82%; }

.pano-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.pano-tiles span {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  animation: tile 4s ease-in-out infinite;
  animation-delay: calc(0.5s * var(--t));
}

@keyframes tile {
  0%, 70%, 100% { background: rgba(255, 255, 255, 0.08); }
  35% { background: rgba(142, 168, 220, 0.45); }
}

.pano-node-dark {
  border-color: transparent;
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(52, 89, 166, 0.55), transparent 70%),
    var(--ink);
  color: var(--white);
}

.pano-node-dark small {
  color: rgba(255, 255, 255, 0.65);
}

.pano-node-dark .dropdown-icon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.pano-chip {
  position: absolute;
  padding: 6px 12px;
  border: 1px solid rgba(52, 89, 166, 0.18);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 10px 24px -14px rgba(37, 63, 122, 0.5);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}

.pano-chip.muted {
  color: var(--ink-2);
}

.pano-chip.tl { top: -14px; left: 20px; }
.pano-chip.tr { top: -14px; right: 20px; }
.pano-chip.bl { bottom: -14px; left: 20px; }
.pano-chip.br { bottom: -14px; right: 20px; }

/* Connectors: three rails with travelling light pulses */

.pano-link {
  position: relative;
  width: 88px;
  height: 76px;
  overflow: hidden;
}

.rail {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(52, 89, 166, 0.1), rgba(52, 89, 166, 0.45), rgba(52, 89, 166, 0.1));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

.rail:nth-child(1) { left: 22%; }
.rail:nth-child(2) { left: 50%; }
.rail:nth-child(3) { left: 78%; }

.pano.is-in .rail {
  transform: none;
}

.pulse {
  position: absolute;
  left: -1px;
  top: -48px;
  width: 3px;
  height: 48px;
  border-radius: 3px;
  background: linear-gradient(180deg, transparent, var(--blue), transparent);
  opacity: 0;
  transition: opacity 0.6s ease 1.6s;
  animation: travel-y 2.4s linear infinite;
  animation-delay: var(--p, 0s);
}

.rail.reverse .pulse {
  animation-direction: reverse;
}

.pano.is-in .pulse {
  opacity: 1;
}

@keyframes travel-y {
  from { top: -48px; }
  to { top: 100%; }
}

@keyframes travel-x {
  from { left: -64px; }
  to { left: 100%; }
}

.pano-mark {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  margin: 22px 0;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: var(--white);
  box-shadow:
    0 0 0 10px rgba(52, 89, 166, 0.08),
    0 30px 60px -24px rgba(37, 63, 122, 0.55);
}

.pano-mark::before {
  content: '';
  position: absolute;
  inset: -24px;
  border: 1px dashed rgba(52, 89, 166, 0.35);
  border-radius: 40px;
  animation: spin 28s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pano-mark img {
  width: 48px;
  height: auto;
}

/* ---------- Code editor mockup (replaces a photo in a feature row) ---------- */

.code-media {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(70% 80% at 100% 0%, rgba(52, 89, 166, 0.45), transparent 65%),
    var(--ink);
  color: #c9d3e8;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-dots {
  display: flex;
  gap: 7px;
}

.code-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.code-tab {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.code-body {
  flex: 1;
  margin: 0;
  padding: 22px 20px;
  overflow: hidden;
  counter-reset: line;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: clamp(11px, 1.05vw, 14px);
  line-height: 1.75;
  white-space: pre;
}

.code-line {
  display: block;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
  transition-delay: calc(0.6s + 0.08s * var(--l));
}

.code-line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 2.2em;
  margin-right: 1em;
  text-align: right;
  color: rgba(255, 255, 255, 0.22);
}

.code-media.is-in .code-line {
  opacity: 1;
  transform: none;
}

.tok-k { color: #8ea8dc; font-weight: 600; }
.tok-t { color: #f2c88f; }
.tok-s { color: #9fd4bd; }
.tok-p { color: rgba(255, 255, 255, 0.45); }

.code-caret {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: #8ea8dc;
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.code-status {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease 1.9s, transform 0.8s var(--ease) 1.9s;
}

.code-media.is-in .code-status {
  opacity: 1;
  transform: none;
}

.code-status .why-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
}

.code-status .why-icon svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 639px) {
  .code-media {
    aspect-ratio: auto;
  }

  .code-body {
    padding-bottom: 76px;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
  }

  .code-status {
    right: 16px;
    bottom: 16px;
  }
}

/* Horizontal panorama on wide screens */

@media (min-width: 900px) {
  .pano-row {
    grid-template-columns: minmax(230px, 290px) 1fr auto 1fr minmax(230px, 290px);
    align-items: center;
  }

  .pano-link {
    width: 100%;
    height: 96px;
  }

  .rail {
    top: auto;
    bottom: auto;
    left: 0 !important;
    right: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(52, 89, 166, 0.1), rgba(52, 89, 166, 0.45), rgba(52, 89, 166, 0.1));
    transform: scaleX(0);
    transform-origin: left;
  }

  .rail:nth-child(1) { top: 22%; }
  .rail:nth-child(2) { top: 50%; }
  .rail:nth-child(3) { top: 78%; }

  .pulse {
    left: -64px;
    top: -1px;
    width: 64px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    animation-name: travel-x;
  }

  .pano-mark {
    margin: 0 28px;
  }
}

@media (min-width: 900px) and (max-width: 1139px) {
  .pano-row {
    grid-template-columns: minmax(210px, 250px) 1fr auto 1fr minmax(210px, 250px);
  }

  .pano-mark {
    margin: 0 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse,
  .pano-floor,
  .pano-tiles span,
  .pano-mark::before,
  .code-caret {
    animation: none;
  }
}

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

@media (max-width: 639px) {
  .page-actions .btn {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .page-actions .btn-light {
    justify-content: center;
  }

}

@media (min-width: 768px) {
  .shift-panel {
    padding: 48px;
  }

  .roots {
    padding: 80px 56px;
  }

  .roots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1024px) {
  .page-hero {
    display: flex;
    align-items: center;
    min-height: min(100svh, 940px);
    padding: calc(var(--header-h) + 40px) 0 72px;
  }

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

  .shift {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }

  .shift-tabs {
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .shift-tab {
    padding: 22px 22px;
    border-radius: 20px;
  }

  .shift-label {
    white-space: normal;
    font-size: 16.5px;
  }

  .roots-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .root-card {
    min-height: 260px;
    justify-content: space-between;
  }

  .feature {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 80px;
  }

  .feature-reverse .feature-media {
    order: 2;
  }

  .features {
    gap: 112px;
  }
}
