/* ==========================================================================
   Homepage
   ========================================================================== */

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

.hero-actions {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-top: var(--sp-6);
    justify-content: center;
}

.hero-badge { text-align: center; }

/* --------------------------------------------------------------------------
   Hero scene — "five services converge into one system"

   Rings, connectors, flow dots and the core are SVG (so paths can be measured
   and drawn); satellites and stat chips are HTML, so they get real
   box-shadows, real text and real hover states. Replaces the three.js scene.

   Animations are authored so the FINAL state is the base state and the
   keyframes animate *from* an offset. Without JS, or with reduced motion, the
   scene is therefore fully composed rather than invisible.
   -------------------------------------------------------------------------- */

.hero-scene {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    aspect-ratio: 1 / 1;
    perspective: 1400px;
    /* Container units let the orbit radius scale with the scene. A percentage
       inside translate() would resolve against the 92px chip instead. */
    container-type: size;
    --mx: 0;
    --my: 0;
    --r: 34cqmin;
}

.hero-scene > * {
    position: absolute;
    inset: 0;
    transition: transform 600ms var(--ease-out);
}

/* Depth planes — each consumes the pointer position at a different rate. */
.scene-glow      { transform: translate3d(calc(var(--mx) * -4px),  calc(var(--my) * -4px),  0); }
.scene-mandala   { transform: translate3d(calc(var(--mx) * -8px),  calc(var(--my) * -8px),  0); }
.scene-svg       { transform: translate3d(calc(var(--mx) * 12px),  calc(var(--my) * 12px),  0); }
.scene-particles { transform: translate3d(calc(var(--mx) * 18px),  calc(var(--my) * 18px),  0); }
/* Adds a card-like lean toward the cursor on top of the existing plane parallax —
   the ring of satellites tilts in 3D rather than only sliding. */
.scene-sats      { transform: translate3d(calc(var(--mx) * 28px),  calc(var(--my) * 28px),  0)
                               rotateY(calc(var(--mx) * 6deg)) rotateX(calc(var(--my) * -6deg)); }
.scene-chips     { transform: translate3d(calc(var(--mx) * 44px),  calc(var(--my) * 44px),  0); }

/* L1 — slowly rotating ornament ghost, tying the hero to the texture system */
.scene-mandala {
    background-image: var(--tex-mandala);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.22;
    animation: mandalaSpin 140s linear infinite;
}

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

/* L0 — backmost aurora bloom. A blurred brand-gradient disc breathing behind
   the whole scene; ambient, so it plays unconditionally like the mandala spin
   rather than waiting on the is-ready reveal. */
.scene-glow {
    background: var(--grad-brand-soft);
    filter: blur(48px);
    border-radius: 50%;
    opacity: 0.5;
    animation: glowBreathe 9s var(--ease-in-out) infinite;
}

@keyframes glowBreathe {
    0%, 100% { opacity: 0.35; transform: scale(0.94); }
    50%      { opacity: 0.6;  transform: scale(1.05); }
}

/* L2 — ambient drifting particles, positioned per-dot via inline custom
   properties set in PHP (see index.php). Each dot fades in/out while it
   drifts so the field never looks static or mechanically uniform. */
.scene-particles { pointer-events: none; }

.particle {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sky);
    opacity: 0;
    animation: particleDrift var(--dur, 8s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes particleDrift {
    0%, 100% { opacity: 0;   transform: translate3d(0, 0, 0) scale(0.8); }
    50%      { opacity: 0.5; transform: translate3d(6px, -10px, 0) scale(1.1); }
}

.scene-svg svg { width: 100%; height: 100%; overflow: visible; }

/* L5 — satellites. Positioned with rotate/translate/rotate so the chip stays
   upright while sitting on the orbit; tilted icons look amateur. */
.scene-sats { pointer-events: none; }

.sat {
    position: absolute;
    top: 50%; left: 50%;
    width: 92px;
    margin: -46px 0 0 -46px;
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 18px;
    background: var(--plane-2);
    border: 1px solid var(--hair-1);
    box-shadow: var(--el-2), var(--el-lip);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-2);
    text-align: center;
    line-height: 1.25;
    text-decoration: none;
    pointer-events: auto;
    transform: rotate(var(--a)) translate(var(--r)) rotate(calc(var(--a) * -1));
    transition: box-shadow 320ms var(--ease-out), border-color 240ms var(--ease-out);
}
.sat .icon { color: var(--primary-color); }
.sat:hover { box-shadow: var(--el-3), var(--el-lip); border-color: var(--hair-2); }

/* L7 — glass stat chips, the frontmost plane */
.scene-chips { pointer-events: none; }

.scene-chip {
    position: absolute;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), var(--el-1);
    font-size: var(--fs-xs);
    color: var(--ink-2);
    white-space: nowrap;
}
.scene-chip strong {
    font-family: var(--font-head);
    font-size: var(--fs-base);
    color: var(--primary-color);
}
.scene-chip.c1 { left: -2%;  top: 6%; }
.scene-chip.c2 { right: -4%; bottom: 26%; }
.scene-chip.c3 { left: 4%;   bottom: 2%; }

/* --- Core glow, flow glow, connector highlight, arrival flash -----------
   Base states are always visible (a resting glow / a dim core-spark), same
   discipline as .pulse's static ring — no-JS or reduced-motion never leaves
   anything invisible, only the extra motion on top is enhanced. --- */
.core-fill { filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.35)); }

.flow {
    filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.75));
    transform-box: fill-box;
    transform-origin: center;
}

.conn-glow {
    stroke: #7dd3fc;
    stroke-width: 2.5;
    stroke-dasharray: 24 999;
    opacity: 0.9;
    filter: drop-shadow(0 0 4px rgba(125, 211, 252, 0.8));
}

.core-spark {
    opacity: 0.15;
    transform-box: fill-box;
    transform-origin: center;
}

/* --- Load-in. Parts arrive, then connect, then the core forms last. --- */
.hero-scene.is-ready .scene-mandala { animation: mandalaSpin 140s linear infinite, sceneFadeScale 1100ms var(--ease-out) 120ms backwards; }
.hero-scene.is-ready .ring          { animation: drawRing 700ms var(--ease-out) backwards; }
.hero-scene.is-ready .ring-2        { animation-delay: 350ms; }
.hero-scene.is-ready .ring-3        { animation-delay: 440ms; }
.hero-scene.is-ready .sat           { animation: satIn 620ms var(--ease-spring) backwards,
                                                 satDrift 8s ease-in-out 2.2s infinite alternate; }
.hero-scene.is-ready .conn          { animation: drawConn 640ms var(--ease-out) backwards; }
.hero-scene.is-ready .core          { animation: coreIn 700ms var(--ease-spring) 1420ms backwards; }
.hero-scene.is-ready .core-fill     { animation: coreGlowPulse 3400ms var(--ease-out) infinite; }
.hero-scene.is-ready .core-shadow   { animation: shadowIn 600ms var(--ease-out) 1560ms backwards; }
.hero-scene.is-ready .scene-chip    { animation: chipIn 520ms var(--ease-out) backwards; }
.hero-scene.is-ready .flow          { animation: flowMove 2600ms linear infinite, flowGlow 2600ms linear infinite; }
.hero-scene.is-ready .conn-glow     { animation: connTravel 2600ms linear infinite; }
.hero-scene.is-ready .core-spark    { animation: coreFlash 2600ms ease-out infinite; }
.hero-scene.is-ready .pulse         { animation: corePulse 3400ms var(--ease-out) infinite; }

.hero-scene.is-ready .sat:nth-of-type(1) { animation-delay: 480ms, 2.2s; }
.hero-scene.is-ready .sat:nth-of-type(2) { animation-delay: 590ms, 3.1s; }
.hero-scene.is-ready .sat:nth-of-type(3) { animation-delay: 700ms, 2.6s; }
.hero-scene.is-ready .sat:nth-of-type(4) { animation-delay: 810ms, 3.7s; }
.hero-scene.is-ready .sat:nth-of-type(5) { animation-delay: 920ms, 2.9s; }

.hero-scene.is-ready .conn:nth-of-type(1) { animation-delay: 1040ms; }
.hero-scene.is-ready .conn:nth-of-type(2) { animation-delay: 1120ms; }
.hero-scene.is-ready .conn:nth-of-type(3) { animation-delay: 1200ms; }
.hero-scene.is-ready .conn:nth-of-type(4) { animation-delay: 1280ms; }
.hero-scene.is-ready .conn:nth-of-type(5) { animation-delay: 1360ms; }

.hero-scene.is-ready .scene-chip.c1 { animation-delay: 1820ms; }
.hero-scene.is-ready .scene-chip.c2 { animation-delay: 1950ms; }
.hero-scene.is-ready .scene-chip.c3 { animation-delay: 2080ms; }

.flow:nth-of-type(2) { animation-delay: 500ms; }
.flow:nth-of-type(3) { animation-delay: 1000ms; }
.flow:nth-of-type(4) { animation-delay: 1500ms; }
.flow:nth-of-type(5) { animation-delay: 2000ms; }

/* Same stagger as the flow dots above, so the connector highlight and the
   core's arrival flash both track their own satellite's dot. */
.conn-glow:nth-of-type(2), .core-spark:nth-of-type(2) { animation-delay: 500ms; }
.conn-glow:nth-of-type(3), .core-spark:nth-of-type(3) { animation-delay: 1000ms; }
.conn-glow:nth-of-type(4), .core-spark:nth-of-type(4) { animation-delay: 1500ms; }
.conn-glow:nth-of-type(5), .core-spark:nth-of-type(5) { animation-delay: 2000ms; }

@keyframes sceneFadeScale { from { opacity: 0; transform: scale(0.88); } }
@keyframes drawRing  { from { stroke-dashoffset: var(--len, 2000); opacity: 0; } }
@keyframes drawConn  { from { stroke-dashoffset: var(--len, 400); } }
@keyframes satIn     { from { opacity: 0; transform: rotate(var(--a)) translate(calc(var(--r) + 40px)) rotate(calc(var(--a) * -1)) scale(0.4); } }
@keyframes coreIn    { from { opacity: 0; transform: scale(0) rotate(-30deg); } }
@keyframes coreGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.35)); }
    50%      { filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.65)); }
}
@keyframes shadowIn  { from { opacity: 0; transform: scaleX(0.3); } }
@keyframes chipIn    { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
@keyframes flowMove  { from { offset-distance: 0%; } to { offset-distance: 100%; } }
/* A slight size ramp as the dot nears the core, so arrival reads as energy
   gathering rather than a dot simply stopping. */
@keyframes flowGlow {
    0%, 80% { transform: scale(1); }
    92%     { transform: scale(1.9); }
    100%    { transform: scale(1); }
}
/* A short dash sweeps the connector's full length once per cycle, fading in
   near the satellite and out as it reaches the core. */
@keyframes connTravel {
    0%   { stroke-dashoffset: 0; opacity: 0; }
    8%   { opacity: 1; }
    88%  { opacity: 1; }
    100% { stroke-dashoffset: calc(-1 * (var(--len, 400) + 24)); opacity: 0; }
}
/* The core's brief flash as each dot arrives. */
@keyframes coreFlash {
    0%, 82% { opacity: 0.15; transform: scale(1); }
    90%     { opacity: 1;    transform: scale(2.2); }
    100%    { opacity: 0.15; transform: scale(1); }
}
@keyframes corePulse { from { transform: scale(1); opacity: 0.5; } to { transform: scale(1.55); opacity: 0; } }

/* Idle drift — 3px of slow wander so the scene never fully freezes. Uses the
   same transform-box discipline as .float-el. */
@keyframes satDrift {
    from { translate: 0 0; }
    to   { translate: 2px -3px; }
}

/* --------------------------------------------------------------------------
   Hero visual — two designs, not one design with parts removed.

   >=1025px  the full orbit scene: ~11 concurrent infinite animations plus a
             pointermove parallax across six depth planes.
   <=1024px  the SAME five .sat anchors, unwound out of the orbit into a static
             chip rail. Every decorative plane is dropped, so nothing animates
             and no SVG is rasterised.

   Previously .hero-visual was display:none for the whole range below 1025px,
   so a phone got headline + paragraph + two buttons on a bare gradient and
   nothing else.
   -------------------------------------------------------------------------- */

.hero-visual { display: block; }

@media (min-width: 1025px) {
    .hero-actions { justify-content: flex-start; }
    .hero-badge { text-align: left; }
}

@media (max-width: 1024px) {
    /* The SVG is the expensive one: 3 rings, 5 connectors, 5 travelling
       dashes, 5 flow dots and 5 arrival flashes, all on infinite loops. */
    .scene-glow,
    .scene-mandala,
    .scene-particles,
    .scene-chips,
    .scene-svg { display: none; }

    /* container-type:size implies contain:size — with aspect-ratio removed and
       size containment left in place the box collapses to zero height. This
       line is load-bearing, not tidying. */
    .hero-scene {
        max-width: 32rem;
        aspect-ratio: auto;
        perspective: none;
        container-type: normal;
        margin-top: var(--sp-7);
    }

    /* Undo "absolutely positioned depth plane" for the one surviving child. */
    .hero-scene > * {
        position: static;
        inset: auto;
        transform: none;
        transition: none;
    }

    .scene-sats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
        gap: var(--sp-3);
    }

    /* Undo the orbit maths: rotate(--a) translate(--r) rotate(calc(--a * -1)). */
    .sat {
        position: static;
        width: auto;
        margin: 0;
        transform: none;
        padding: var(--sp-4) var(--sp-2);
    }

    /* motion.js adds .is-ready unconditionally, which would otherwise start
       satIn plus an infinite satDrift on chips that no longer orbit. */
    .hero-scene.is-ready .sat { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-scene .scene-mandala,
    .hero-scene .scene-glow,
    .hero-scene .particle,
    .hero-scene .flow,
    .hero-scene .core-fill,
    .hero-scene .core-spark,
    .hero-scene .conn-glow,
    .hero-scene .pulse { animation: none !important; }
    .hero-scene > * { transition: none !important; }
    .scene-sats { transform: none !important; }
}

/* --------------------------------------------------------------------------
   Grid that never leaves an orphan cell

   The original put 5 cards into a 3-column grid, stranding an empty 6th cell
   and, in the process section, a single card alone on its own row. A 6-column
   track with each card spanning 2 gives 3 per row; when exactly 5 children are
   present the trailing pair is offset by one column so it centres instead of
   hanging left.
   -------------------------------------------------------------------------- */

.grid-even {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--sp-5);
}
.grid-even > * { grid-column: span 2; }

/* Exactly 5 children: centre the trailing pair.
   Must be the `2 / span 2` longhand — `grid-column: span 2` puts "span 2" in
   grid-column-START, so overriding start alone silently drops the span and
   the card collapses to one column. */
.grid-even > :nth-child(4):nth-last-child(2) { grid-column: 2 / span 2; }

/* Exactly 4 children: two rows of two. */
.grid-even > :nth-child(1):nth-last-child(4),
.grid-even > :nth-child(2):nth-last-child(3),
.grid-even > :nth-child(3):nth-last-child(2),
.grid-even > :nth-child(4):nth-last-child(1) { grid-column: span 3; }

@media (max-width: 1024px) {
    .grid-even { grid-template-columns: repeat(2, 1fr); }
    .grid-even > *,
    .grid-even > :nth-child(n) { grid-column: span 1 !important; }
}
@media (max-width: 640px) {
    .grid-even { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Challenge cards — real illustrated scenes, not grey placeholder boxes
   -------------------------------------------------------------------------- */

.challenge-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.challenge-visual {
    position: relative;
    height: 190px;
    background: linear-gradient(150deg, #eaf3ff 0%, #dbeafe 60%, #e0f2fe 100%);
    display: grid;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
}
.challenge-visual svg { width: 100%; height: 100%; }

/* Not a flex container: the body holds a sentence with inline <strong>, and
   making it flex turns each text run into a separate flex item, which breaks
   the sentence into columns. */
.challenge-card .card-body { flex: 1; text-align: left; }

/* Stat strip that fills what used to be dead space under "Who We Are" */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
    margin-top: var(--sp-6);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border-light);
}
.mini-stat strong {
    display: block;
    font-family: var(--font-head);
    font-size: var(--fs-2xl);
    color: var(--primary-color);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.mini-stat span { font-size: var(--fs-xs); color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.4px; }

/* --------------------------------------------------------------------------
   Feature panel — replaces the near-empty dark box
   -------------------------------------------------------------------------- */

.feature-panel {
    background: linear-gradient(150deg, #0f172a, #16233f 55%, #0b1220);
    border-radius: var(--radius-xl);
    padding: var(--sp-7);
    color: var(--slate-300);
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    min-height: 100%;
}
.feature-panel h3 { color: var(--white); font-size: var(--fs-xl); }
.feature-panel .fp-visual { display: grid; place-items: center; }

.fp-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.fp-metric {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
}
.fp-metric strong {
    display: block;
    font-family: var(--font-head);
    font-size: var(--fs-xl);
    color: var(--sky);
    font-variant-numeric: tabular-nums;
}
.fp-metric span { font-size: var(--fs-xs); color: var(--slate-400); }

/* --------------------------------------------------------------------------
   P.E.A.C.E. — first card featured so five items fill the grid
   -------------------------------------------------------------------------- */

.peace-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    position: relative;
    overflow: hidden;
}
.peace-card .peace-step {
    font-family: var(--font-head);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    color: var(--secondary-color);
    text-transform: uppercase;
}
.peace-card h3 {
    font-size: var(--fs-lg);
    letter-spacing: 0.02em;
}
.peace-card::after {
    content: attr(data-letter);
    position: absolute;
    right: -6px; bottom: -28px;
    font-family: var(--font-head);
    font-size: 120px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-color);
    opacity: 0.06;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Process timeline — 5 steps across one row on desktop with a connecting
   line whose fill is driven by scroll; horizontal scroll-snap on small screens
   -------------------------------------------------------------------------- */

.process-track { position: relative; margin-top: var(--sp-7); }

.process-line {
    position: absolute;
    top: 21px; left: 0; right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.process-line span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--sky));
    transform: scaleX(var(--p, 0));
    transform-origin: 0 50%;
    transition: transform 120ms linear;
}

/* Homepage-only override of the shared .process-grid in 03-components.css,
   which stays as-is for service.php (4 cards). home.css loads last and only on
   this page, so the two never collide — keep both. */
.process-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--sp-4);
    margin-top: 0;
}
.process-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}
.process-card p { margin-bottom: 0; }

/* Five across cannot survive below ~1100px, but a nested left-right scroller
   inside a dark full-bleed panel is worse than the problem it solved: on a
   390px screen you see one 240px card and nothing indicating four more exist,
   which reads as "the page is cut off". It wraps instead. .process-line still
   goes — it only ever connected a single row. */
@media (max-width: 1100px) {
    .process-grid { grid-template-columns: repeat(3, 1fr); }
    .process-line { display: none; }
}

@media (max-width: 900px) {
    .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .process-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
}

/* --------------------------------------------------------------------------
   Services — bento layout so five cards fill their space
   -------------------------------------------------------------------------- */

.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--sp-5);
}
.bento > * { grid-column: span 2; }
.bento > .is-feature { grid-column: span 3; }

.service-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    min-height: 100%;
}

/* Diagonal sheen that sweeps across on hover — sits above the card fill but
   below the copy (z-index 1), so it reads as light catching the surface
   rather than a filter over the text. The shared gradient edge-frame already
   owns ::before (03-components.css), so this uses ::after instead. */
.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 35%, rgba(56, 189, 248, 0.16) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: transform 650ms var(--ease-out);
    pointer-events: none;
    z-index: 1;
}
.service-card:hover::after { transform: translateX(120%); }
.service-card > * { position: relative; z-index: 2; }

.service-card .svc-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: var(--badge-bg);
    color: var(--primary-color);
    font-size: 22px;
    transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
                transform 320ms var(--ease-spring);
}
.service-card:hover .svc-icon { background: var(--primary-color); color: var(--white); transform: scale(1.08) rotate(-4deg); }
.service-card h3 { font-size: var(--fs-lg); margin-bottom: 0; }
.service-card p { font-size: var(--fs-sm); }
.service-card .svc-more {
    margin-top: auto;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}
.service-card:hover .svc-more .icon { transform: translateX(3px); }
.service-card .svc-more .icon { transition: transform var(--dur-2) var(--ease-out); }

@media (max-width: 1024px) {
    .bento { grid-template-columns: repeat(2, 1fr); }
    .bento > *, .bento > .is-feature { grid-column: span 1; }
}
@media (max-width: 640px) {
    .bento { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Result panel — replaces the fake video block, which showed a play button
   over an empty black box with no video behind it
   -------------------------------------------------------------------------- */

.result-panel {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--sp-7);
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--sp-7);
    box-shadow: var(--shadow-md);
}
.result-quote {
    font-family: var(--font-head);
    font-size: var(--fs-xl);
    line-height: var(--lh-snug);
    color: var(--dark-bg);
}
.result-attrib { margin-top: var(--sp-4); display: flex; align-items: center; gap: var(--sp-3); }

@media (max-width: 900px) { .result-panel { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Dashboard mockup — charts draw and numbers tick on scroll
   -------------------------------------------------------------------------- */

.mockup {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.mockup-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--sp-3) var(--sp-4);
    background: var(--slate-100);
    border-bottom: 1px solid var(--border-light);
}
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slate-300); }
.mockup-body { padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.mockup-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.mockup-kpi { background: var(--light-bg); border-radius: var(--radius-md); padding: var(--sp-3); }
.mockup-kpi strong {
    display: block;
    font-family: var(--font-head);
    font-size: var(--fs-lg);
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}
.mockup-kpi span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--slate-500); }

/* --------------------------------------------------------------------------
   Logo marquee
   -------------------------------------------------------------------------- */

.logo-strip { padding: var(--sp-6) 0; }
.logo-strip .marquee-track { gap: var(--sp-9); align-items: center; }
.logo-chip {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--slate-400);
    letter-spacing: -0.01em;
    white-space: nowrap;
    filter: grayscale(1);
    opacity: 0.75;
    transition: opacity var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.logo-chip:hover { opacity: 1; color: var(--primary-color); }

/* --------------------------------------------------------------------------
   Work / case studies
   -------------------------------------------------------------------------- */

.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--sp-5); }

.work-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.work-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.work-cover { height: 190px; position: relative; overflow: hidden; }
.work-cover svg {
    width: 100%;
    height: 100%;
    transition: transform 500ms var(--ease-out);
}
.work-card:hover .work-cover svg { transform: scale(1.06); }

/* Gradient wash that rises on hover — reads as depth, not a filter over the
   illustration, since it only appears at the moment of interaction. */
.work-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(13, 71, 161, 0.28), transparent 65%);
    opacity: 0;
    transition: opacity 320ms var(--ease-out);
    pointer-events: none;
}
.work-card:hover .work-cover::after { opacity: 1; }

.work-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.work-metric {
    font-family: var(--font-head);
    font-size: var(--fs-2xl);
    color: var(--primary-color);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
/* The metric pops in a beat after its card fades up — same --i/stagger the
   grid already sets, no extra JS. Skips a literal count-up since values here
   are free-text ("3.2x", "$50K"), not always plain integers. */
.js-motion .work-grid[data-animate="stagger"] .work-metric {
    opacity: 0;
    transform: scale(0.7) translateY(6px);
    transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-spring);
    transition-delay: calc(var(--i, 0) * var(--_stagger, var(--stagger)) + 160ms);
}
.work-grid[data-animate="stagger"].is-in .work-metric { opacity: 1; transform: none; }

.work-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.work-tags span {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--slate-100);
    color: var(--slate-600);
    transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.work-card:hover .work-tags span { background: var(--badge-bg); color: var(--primary-color); }

/* --------------------------------------------------------------------------
   Pricing — promoted out of the nav hover-dropdown, where most visitors
   would never have found it
   -------------------------------------------------------------------------- */

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); align-items: stretch; }

.price-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--sp-7);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    position: relative;
    transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.price-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-color); }
.price-card.is-featured {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}
.price-card.is-featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px; left: 50%;
    /* The shared card ::before (the hover edge-glow frame in 03-components)
       matches this element too and sets inset/opacity/mask for the frame
       effect. Every one of those must be neutralised here or the tag renders
       invisible: right/bottom auto (inset:0 would stretch it), opacity 1
       (frame rests at 0), mask none (the frame mask hollows out the fill). */
    right: auto; bottom: auto;
    opacity: 1;
    -webkit-mask: none;
    mask: none;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
}
.price-name { font-family: var(--font-head); font-size: var(--fs-xl); color: var(--dark-bg); }
.price-sub { font-size: var(--fs-sm); color: var(--slate-500); }
.price-value { font-size: var(--fs-lg); font-weight: 700; color: var(--primary-color); margin-top: var(--sp-2); }
.price-list { display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.price-list li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); }
.price-list .icon { color: var(--primary-color); margin-top: 3px; flex-shrink: 0; }

/* Checkmarks pop in a beat after their row fades up — same --i/stagger the
   shared primitive already sets on the <li>, so no extra JS is needed. */
.js-motion .price-list[data-animate="stagger"] .icon {
    transform: scale(0.5);
    transition: transform var(--dur-3) var(--ease-spring);
    transition-delay: calc(var(--i, 0) * var(--_stagger, var(--stagger)));
}
.price-list[data-animate="stagger"].is-in .icon { transform: scale(1); }

@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Contact — details beside the form rather than stacked above it. Stacked,
   this section ran 1279px; side by side it converts better and costs a third
   of the scroll.
   -------------------------------------------------------------------------- */

.contact-split {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--sp-7);
    align-items: start;
}
.contact-split .contact-details-bar {
    grid-template-columns: 1fr;
    margin-bottom: 0;
    gap: var(--sp-4);
}
.contact-split .detail-box { text-align: left; display: grid; gap: 4px; }
.contact-split .form-wrapper { margin: 0; max-width: none; }

@media (max-width: 900px) {
    .contact-split { grid-template-columns: 1fr; gap: var(--sp-6); }
}

/* --------------------------------------------------------------------------
   Tighter vertical rhythm — the original padded every section identically
   regardless of how much content it held
   -------------------------------------------------------------------------- */

.page-home .section-container { padding-block: clamp(3rem, 5.5vw, 4.5rem); }
.page-home .section-subtitle { margin-bottom: var(--sp-7); }
.page-home .services-overview { padding: clamp(3rem, 5.5vw, 4.5rem) var(--sp-5); }

/* --------------------------------------------------------------------------
   Gradient keyword. split-text rebuilds the h1 into .split-word spans, so the
   last word ("Smarter.") is targeted positionally — inner markup would be
   destroyed by the splitter (motion.js setupSplitText). Fallback path: before
   JS runs there are no spans, and browsers without background-clip get the
   solid heading color from .hero h1. */
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .hero h1 .split-word:last-child {
        background: var(--grad-brand);
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: heroGradientShift 6s ease-in-out infinite;
    }
    @keyframes heroGradientShift {
        0%, 100% { background-position: 0% 50%; }
        50%      { background-position: 100% 50%; }
    }
    @media (prefers-reduced-motion: reduce) {
        .hero h1 .split-word:last-child { animation: none !important; }
    }
}

/* Featured tier gets a permanent soft aurora halo — hierarchy visible before
   any copy is read. Blur on a pseudo-element, behind the card. Breathing is
   ambient (unconditional), matching the hero glow's convention — the base
   frame is always visible, the breathing is the enhancement. */
.price-card.is-featured { z-index: 1; }
.price-card.is-featured::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: inherit;
    background: var(--grad-brand-soft);
    background-size: 200% 200%;
    filter: blur(22px);
    z-index: -1;
    pointer-events: none;
    animation: featuredHaloBreathe 6s ease-in-out infinite;
}
@keyframes featuredHaloBreathe {
    0%, 100% { opacity: 0.85; background-position: 0% 50%; transform: scale(1); }
    50%      { opacity: 1;    background-position: 100% 50%; transform: scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
    .price-card.is-featured::after { animation: none !important; }
}

/* ==========================================================================
   Phone tier — added with the mobile pass. See the breakpoint scale in
   css/00-tokens.css before adding anything here.
   ========================================================================== */

/* --fs-display's fluid term is tuned for desktop and still returns ~55px at
   390px, spending most of the first screen on four lines of headline. This is
   a steeper curve over the phone range ONLY: at 768px it evaluates to 70.6px,
   which is exactly what the desktop clamp returns there, so the two curves meet
   with no visible step and nothing above 768px changes. */
@media (max-width: 768px) {
    .hero h1 { font-size: clamp(2.5rem, 1.05rem + 7vw, 4.42rem); }
}

/* service.css already does this on its own hero; the homepage never did. Two
   half-width pills on a 360px screen are below a comfortable tap target. */
@media (max-width: 560px) {
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions > .btn-primary,
    .hero-actions > .btn-dark-pill { width: 100%; }
}

/* A 22px blur on a scaling pseudo-element in a 6s infinite loop is one of the
   most expensive things a mid-range Android GPU can be asked to do. The static
   halo is the design; the breathing is the enhancement. */
@media (max-width: 900px) {
    .price-card.is-featured::after { animation: none; filter: blur(16px); }
    .hero h1 .split-word:last-child { animation: none; }
}

/* --------------------------------------------------------------------------
   Case studies detail page (case-studies.php) — reuses .card, .work-metric,
   .work-tags and .badge-warn from elsewhere rather than redefining them.
   -------------------------------------------------------------------------- */
.case-study-list { display: flex; flex-direction: column; gap: var(--sp-6); }
.case-study-detail h2 { margin-top: var(--sp-2); }
.case-study-detail h3 { margin-top: var(--sp-5); margin-bottom: var(--sp-2); font-size: var(--fs-md); }
.case-study-metric { display: flex; align-items: baseline; gap: var(--sp-3); margin: var(--sp-3) 0; }
