/* ============================================
   Services page: one methodology, three applications
   ============================================ */

.sv-lead-unused {
    max-width: 760px;
    font-size: 1.125rem !important;
    line-height: 1.7;
}

.sv-lead strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text);
}

.sv-section { padding: 70px 0 20px; }

/* ---------- expandable service cards ---------- */
.sx-list { display: flex; flex-direction: column; gap: 16px; }

.sx-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    text-align: left;
}

.sx-card:hover, .sx-card.open {
    border-color: rgba(0, 212, 255, 0.5);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 102, 255, 0.08) 100%), var(--color-bg-card);
    box-shadow: var(--shadow-glow);
}

.sx-head {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 26px 30px;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sx-head:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; border-radius: var(--border-radius-lg); }

.sx-icon { flex: none; width: 48px; height: 48px; }
.sx-icon svg { width: 100%; height: 100%; }

.sx-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sx-title { font-size: 1.5rem; line-height: 1.25; color: var(--color-text); }
.sx-tag { font-size: 1rem; color: var(--color-primary); }

.sx-stage {
    align-self: flex-start;
    padding: 3px 12px;
    font-size: 0.6875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 100px;
}

.sx-arrow { flex: none; margin-left: auto; font-size: 2rem; line-height: 1; color: var(--color-primary); transform: rotate(90deg); transition: var(--transition); }
.sx-card.open .sx-arrow { transform: rotate(-90deg); }

.sx-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s ease; }
.sx-card.open .sx-body { grid-template-rows: 1fr; }
.sx-inner { min-height: 0; overflow: hidden; padding: 0 30px; }
.sx-card.open .sx-inner { padding-bottom: 30px; }

.sx-label {
    margin: 4px 0 14px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* process: steps ending in the output */
.sx-process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 26px; }

.sx-step {
    position: relative;
    padding: 18px 18px 16px;
    background: rgba(10, 10, 15, 0.45);
    border: 1px solid rgba(0, 212, 255, 0.18);
    border-right-width: 0;
}

.sx-step:first-child { border-radius: var(--border-radius) 0 0 var(--border-radius); }
.sx-step:last-child { border-right-width: 1px; border-radius: 0 var(--border-radius) var(--border-radius) 0; }

.sx-step::after {
    content: '';
    position: absolute;
    right: -9px;
    top: 50%;
    z-index: 2;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    background: var(--color-bg-card);
    border-top: 1px solid rgba(0, 212, 255, 0.45);
    border-right: 1px solid rgba(0, 212, 255, 0.45);
    transform: rotate(45deg);
}

.sx-step:last-child::after { display: none; }

.sx-step i { display: block; margin-bottom: 8px; font-style: normal; font-size: 0.6875rem; letter-spacing: 1px; color: var(--color-primary); }
.sx-step b { display: block; margin-bottom: 4px; font-weight: 500; font-size: 0.9375rem; color: var(--color-text); }
.sx-step span { font-size: 0.8125rem; line-height: 1.55; color: var(--color-text-muted); }

.sx-step.out {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(0, 102, 255, 0.18));
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.15);
}

.sx-step.out i { color: #fff; }

.sx-cols { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; }
.sx-cols ul { margin: 0; columns: 2; column-gap: 34px; }
.sx-cols li { text-align: left; break-inside: avoid; }

.sx-more { color: var(--color-primary); font-weight: 500; text-decoration: none; white-space: nowrap; }
.sx-more:hover { text-decoration: underline; }

/* investment card: builds on the outputs of the others */
.sx-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 -2px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.sx-divider::before, .sx-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(0,212,255,0.35), transparent); }
.sx-divider::before { background: linear-gradient(270deg, rgba(0,212,255,0.35), transparent); }

.sx-card.builds { border-style: dashed; border-color: rgba(0, 212, 255, 0.3); }
.sx-uses { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; font-size: 0.8125rem; color: var(--color-text-muted); }
.sx-uses a { padding: 5px 12px; color: var(--color-text); text-decoration: none; background: rgba(0, 102, 255, 0.12); border: 1px solid rgba(127, 178, 255, 0.4); border-radius: 100px; }
.sx-uses a:hover { border-color: rgba(0, 212, 255, 0.7); background: rgba(0, 212, 255, 0.15); }

/* ---------- diagram ---------- */
.sv-diagram {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 6px;
    padding: 30px 26px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
}

.dg-node {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 8px;
    text-align: center;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: var(--border-radius);
}

.dg-node b { font-size: 0.8125rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--color-text); }
.dg-node span { font-size: 0.6875rem; color: var(--color-text-muted); }
.dg-node.accent { background: linear-gradient(135deg, rgba(0,212,255,0.18), rgba(0,102,255,0.18)); border-color: rgba(0, 212, 255, 0.6); box-shadow: var(--shadow-glow); }

.dg-arrow { align-self: center; flex: none; color: var(--color-primary); opacity: 0.75; font-size: 1.25rem; }

.dg-fan { flex: none; width: 46px; }
.dg-fan svg { display: block; width: 100%; height: 100%; }
.dg-fan path { fill: none; stroke: rgba(0, 212, 255, 0.55); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-dasharray: 5 4; animation: svDash 2.4s linear infinite; }
@keyframes svDash { to { stroke-dashoffset: -18; } }

.dg-services { flex: 1.5 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.dg-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text);
    text-decoration: none;
    background: rgba(0, 102, 255, 0.12);
    border: 1px solid rgba(127, 178, 255, 0.4);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.dg-chip:hover { background: rgba(0, 212, 255, 0.18); border-color: rgba(0, 212, 255, 0.7); }

/* ---------- engineering first ---------- */
.sv-first { max-width: 820px; margin: 0 auto; padding: 70px 0 30px; text-align: center; }
.sv-first h2 { margin-bottom: 14px; font-size: clamp(1.6rem, 3.4vw, 2.25rem); font-weight: 300; }
.sv-first p { color: var(--color-text-muted); line-height: 1.8; font-size: 1.0625rem; }
.sv-first a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
.sv-first a:hover { text-decoration: underline; }

/* ---------- CTA ---------- */
.sv-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin: 50px 0 40px;
    padding: 36px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 102, 255, 0.08) 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--border-radius-lg);
    text-align: left;
}

.sv-cta h2 { margin-bottom: 6px; font-size: 1.75rem; }
.sv-cta p { color: var(--color-text-muted); }

.sv-ind { margin: 10px 0 90px; }
.sv-ind h3 { margin-bottom: 14px; font-size: 0.75rem; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--color-text-muted); }
.sv-ind .industries-grid { grid-template-columns: repeat(4, 1fr); }

/* reveal */
.sv-rv { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
.sv-rv.in { opacity: 1; transform: none; }


@media (prefers-reduced-motion: reduce) {
    .sv-step, .dg-fan path { animation: none; }
    .sv-rv { opacity: 1; transform: none; }
}

@media (max-width: 1000px) {
    .sx-process { grid-template-columns: 1fr 1fr; gap: 10px; }
    .sx-step, .sx-step:first-child, .sx-step:last-child { border-radius: var(--border-radius); border-right-width: 1px; }
    .sx-step::after { display: none; }
    .sx-cols { grid-template-columns: 1fr; gap: 16px; align-items: start; }
    .sx-cols ul { columns: 1; }
    .sv-diagram { flex-direction: column; align-items: stretch; padding: 22px; }
    .dg-arrow { transform: rotate(90deg); }
    .dg-fan { display: none; }
    .dg-services { flex-direction: column; }
    .dg-chip { padding: 12px; }
    .sv-ind .industries-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .sx-head { padding: 20px; gap: 14px; }
    .sx-icon { width: 38px; height: 38px; }
    .sx-title { font-size: 1.1875rem; }
    .sx-inner { padding: 0 20px; }
    .sx-card.open .sx-inner { padding-bottom: 22px; }
    .sx-process { grid-template-columns: 1fr; }
    .sv-section { padding-top: 48px; }
    .sv-cta { flex-direction: column; align-items: stretch; padding: 24px; }
    .sv-ind { margin-bottom: 60px; }
    .sv-first { padding-top: 50px; }
}

/* steps appear one after the other when a card opens */
.sx-step { opacity: 0; transform: translateY(14px); }

.sx-card.open .sx-step {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.sx-card.open .sx-step:nth-child(1) { transition-delay: 0.25s; }
.sx-card.open .sx-step:nth-child(2) { transition-delay: 0.65s; }
.sx-card.open .sx-step:nth-child(3) { transition-delay: 1.05s; }
.sx-card.open .sx-step:nth-child(4) { transition-delay: 1.5s; }

.sx-card.open .sx-step.out { animation: sxOut 1.2s ease-out 1.5s both; }
@keyframes sxOut { 0% { box-shadow: 0 0 0 rgba(0,212,255,0); } 50% { box-shadow: 0 0 36px rgba(0,212,255,0.55); } 100% { box-shadow: 0 0 24px rgba(0,212,255,0.15); } }

.sx-step::after { transition: opacity 0.4s ease-out; }
.sx-card:not(.open) .sx-step::after { opacity: 0; }
.sx-card.open .sx-step::after { opacity: 1; transition-delay: inherit; }

.sv-first p { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
    .sx-step, .sx-card.open .sx-step { opacity: 1; transform: none; transition: none; animation: none; }
}

/* ---------- three service tiles in one row + detail panel below ---------- */
.sx-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }

.sx-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 210px;
    padding: 22px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.sx-tile:hover, .sx-tile.active {
    border-color: rgba(0, 212, 255, 0.55);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12) 0%, rgba(0, 102, 255, 0.12) 100%), var(--color-bg-card);
    box-shadow: var(--shadow-glow);
}

.sx-tile.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    background: #12151f;
    border-right: 1px solid rgba(0, 212, 255, 0.55);
    border-bottom: 1px solid rgba(0, 212, 255, 0.55);
    transform: rotate(45deg);
    z-index: 3;
}

.sx-tile:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.sx-tile .sx-icon { width: 44px; height: 44px; margin-bottom: 4px; }
.sx-tile .sx-title { font-size: 1.1875rem; line-height: 1.25; color: var(--color-text); }
.sx-tile .sx-tag { font-size: 0.875rem; line-height: 1.45; color: var(--color-primary); }
.sx-tile .sx-stage { margin-top: auto; }

.sx-panels { margin-bottom: 8px; }

.sx-panel {
    display: none;
    padding: 30px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 102, 255, 0.08) 100%), var(--color-bg-card);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-glow);
    text-align: left;
}

.sx-panel.open { display: block; animation: sxPanel 0.4s ease-out; }
@keyframes sxPanel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sx-panel-title { margin-bottom: 14px; font-size: 1.375rem; font-weight: 400; }

/* steps in a panel appear in sequence every time the panel is shown */
.sx-panel .sx-step { opacity: 1; transform: none; }
.sx-panel.open .sx-step { animation: sxIn 0.5s ease-out both; }
.sx-panel.open .sx-step:nth-child(1) { animation-delay: 0.2s; }
.sx-panel.open .sx-step:nth-child(2) { animation-delay: 0.6s; }
.sx-panel.open .sx-step:nth-child(3) { animation-delay: 1s; }
.sx-panel.open .sx-step:nth-child(4) { animation-delay: 1.45s; }
.sx-panel.open .sx-step.out { animation: sxIn 0.5s ease-out 1.45s both, sxOut 1.2s ease-out 1.45s both; }
@keyframes sxIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.sx-list-2 { margin-top: 0; }

@media (max-width: 1000px) {
    .sx-tile { min-height: 190px; padding: 18px; }
    .sx-panel { padding: 22px; }
}

@media (max-width: 640px) {
    .sx-tiles { gap: 8px; }
    .sx-tile { min-height: 0; padding: 14px 8px; align-items: center; text-align: center; gap: 6px; border-radius: var(--border-radius); }
    .sx-tile .sx-icon { width: 34px; height: 34px; margin: 0; }
    .sx-tile .sx-title { font-size: 0.8125rem; }
    .sx-tile .sx-tag, .sx-tile .sx-stage { display: none; }
    .sx-tile.active::after { bottom: -8px; width: 12px; height: 12px; margin-left: -6px; }
    .sx-panel { padding: 18px; }
    .sx-panel-title { font-size: 1.125rem; }
}

@media (prefers-reduced-motion: reduce) {
    .sx-panel.open, .sx-panel.open .sx-step, .sx-panel.open .sx-step.out { animation: none; }
}

/* more compact tiles: the open service stays in view without scrolling */
.sx-tile { min-height: 168px; padding: 18px 20px; gap: 6px; }
.sx-tile .sx-icon { width: 36px; height: 36px; margin-bottom: 2px; }
.sx-tile .sx-title { font-size: 1.125rem; }
.sx-tile .sx-tag { font-size: 0.8125rem; }
.sx-section:first-of-type { padding-top: 44px; }
.sx-section:first-of-type .section-header { margin-bottom: 34px; }
.sv-section .section-header { margin-bottom: 34px; }
.sv-section:first-of-type { padding-top: 46px; }
.sx-panel { padding: 24px 28px; }
.sx-panel-title { margin-bottom: 8px; font-size: 1.25rem; }
.sx-panel .sx-process { margin-bottom: 18px; }
@media (max-width: 640px) {
    .sx-tile { min-height: 0; padding: 14px 8px; }
    .sx-panel { padding: 18px; }
}

@media (max-width: 640px) {
    .sx-tile .sx-title { font-size: 0.75rem; line-height: 1.3; overflow-wrap: normal; word-break: normal; }
}

/* ---------- hero with the photo fading in from the right ---------- */
.page-hero--photo {
    position: relative;
    min-height: 400px;
    padding-bottom: 110px;
    overflow: hidden;
}

.page-hero--photo::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 68%;
    z-index: 0;
    background: url('../imgs/services-banner.jpg') center 40% / cover no-repeat;
    opacity: 0.85;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.55) 35%, #000 75%), linear-gradient(180deg, transparent 0, transparent 70px, #000 150px, #000 72%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.55) 35%, #000 75%), linear-gradient(180deg, transparent 0, transparent 70px, #000 150px, #000 72%, transparent 100%);
    mask-composite: intersect;
    pointer-events: none;
}

.page-hero--photo::before { z-index: 1; }
.page-hero--photo .container { z-index: 2; }

@media (max-width: 1000px) {
    .page-hero--photo { min-height: 0; padding-bottom: 80px; }
    .page-hero--photo::after { width: 100%; opacity: 0.4; -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 60px, #000 140px, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, transparent 60px, #000 140px, transparent 100%); }
}
