/* Start in the gallery's closing teal. The page carries the colour through
   the section boundaries without an overlay or another fixed background. */
.home-rest {
    --story-ink: #f1f6f5;
    --story-muted: #bfd1d4;
    --story-edge: rgb(159 207 213 / 24%);
    --story-surface: #173942;
    font-family: RuuyaSora, sans-serif;
    background: linear-gradient(#102e37, #122b35 60rem, #132e39);
    color: var(--story-ink);
}

.home-rest > section:not(#contact) {
    display: flex;
    flex-direction: column;
    padding-bottom: clamp(1.25rem, 3vw, 2.75rem);
}
.home-rest #intro { min-height: auto; }
#intro > .container {
    max-width: 72rem;
    padding-block: clamp(4rem, 8vw, 7rem) clamp(2.5rem, 5vw, 4.5rem);
    align-items: stretch;
}
#intro .intro-lead { text-align: start; }
#intro .intro-lead h1,
.home-rest #industries h2,
#services .services-intro-heading {
    font-family: RuuyaSora, sans-serif;
    line-height: 1.08;
    letter-spacing: -.045em;
    text-wrap: balance;
}
#intro .intro-lead h1 { font-size: clamp(3.1rem, 7vw, 6rem); margin-bottom: .35em; }
.home-rest #industries h2 { font-size: clamp(2.1rem, 4.3vw, 3.6rem); }
#intro .intro-lead p { margin-inline: 0; color: var(--story-muted); }
#intro .intro-lead > div { align-items: flex-start; justify-content: start; }
#intro .intro-lead a {
    box-shadow: none;
    border-radius: 3rem;
    padding: .8rem 1.45rem;
    font-size: .96rem;
}
#intro .btn-outline { background: transparent; border: 1px solid var(--story-edge); color: var(--story-ink); }
#intro .hero-stats-grid {
    width: 100%;
    max-width: none;
    gap: clamp(.85rem, 2vw, 1.5rem);
    margin-top: clamp(2rem, 5vw, 4rem);
}
#intro .hero-stat-card,
#industries .industry-card {
    background: var(--story-surface);
    color: var(--story-ink);
    text-align: start;
    border: 1px solid var(--story-edge);
    border-radius: .9rem;
    box-shadow: 0 .5rem 1.25rem rgb(2 15 22 / 15%);
}
#intro .hero-stat-card-body > :first-child { color: var(--story-ink); font-size: clamp(1.5rem, 2.5vw, 2.2rem); }
#intro .hero-stat-card-body > :last-child, #industries .industry-card-sub { color: var(--story-muted); }
#industries .industry-card { min-height: 0; }
#industries .industry-card-media { aspect-ratio: 16 / 9; flex: none; min-height: 0; }
#industries .industry-card-body { padding: 1.1rem 1.3rem; }
#industries .industry-card-title { color: var(--story-ink); font-size: 1.2rem; }
#industries .industry-card-cta { color: #94d8e5; }
#industries .industry-card:is(:hover, :focus-visible) { border-color: #77bcc9; }
#services .service-offering-frame { background: #102934; border-color: var(--story-edge); }
#services .services-rail-btn.is-active { background: #244951; }

@media (min-width: 768px) {
    #intro .intro-lead {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-content: center;
        column-gap: 2rem;
    }
    #intro .intro-lead h1 { grid-row: span 3; align-self: center; margin: 0; }
    #intro .intro-lead p { margin-bottom: .65rem; }
    #intro .intro-lead > div { margin-top: .75rem; }
}
@media (max-width: 639px) {
    #intro .intro-lead > div { flex-flow: row wrap; }
}
/* Continue the same typographic scale through the client wall, the
   four-step process, the practice profile and the contact invitation. */
.home-rest :is(.clients-intro-heading, .methodology-heading h2, .about-intro-heading, #contact h2) {
    margin: 0;
    padding: 0;
    color: var(--story-ink);
    background: none;
    box-shadow: none;
    font: 600 clamp(2.1rem, 4.3vw, 3.6rem)/1.1 RuuyaSora, sans-serif;
    letter-spacing: -.045em;
    text-wrap: balance;
}
#clients .clients-intro, #about .about-intro { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
#clients .clients-intro { gap: clamp(.65rem, 1.2vw, .9rem); }
#clients .clients-title-type { display: block; }
#clients .client-logo-card { background: #dce5e7; border-radius: .65rem; box-shadow: none; }
.methodology-heading-line { background: var(--story-edge); }
#methodology .methodology-title-type { display: block; }
#methodology .methodology-panel {
    padding: clamp(1rem, 4vw, 3rem);
    background: var(--story-surface);
    border: 1px solid var(--story-edge);
    box-shadow: none;
}
#methodology .methodology-timeline { isolation: isolate; }
#methodology .methodology-phase {
    --methodology-aperture: 100%;
    --methodology-focus: 0;
    --methodology-lift: -4px;
    --methodology-depth: 16px;
    z-index: auto;
}
#methodology .phase-1 { --methodology-accent: #2f5b6b; }
#methodology .phase-2 { --methodology-accent: #2b96af; }
#methodology .phase-3 { --methodology-accent: #ea5c3f; }
#methodology .phase-4 { --methodology-accent: #f7b759; }

#methodology .methodology-phase::before,
#methodology .methodology-phase.is-revealed::after {
    content: '';
    position: absolute;
    inset: -.35rem .35rem;
    z-index: 0;
    pointer-events: none;
    border: 1px solid var(--story-edge);
    border-radius: .7rem;
    background: #122f3a;
}

/* The timer exposes the phase. Its panel lighting follows scroll separately. */
#methodology .methodology-phase.is-revealed::after {
    border-color: color-mix(in srgb, var(--methodology-accent) 62%, var(--story-edge));
    background: linear-gradient(155deg, color-mix(in srgb, var(--methodology-accent) 24%, #122f3a), #122f3a 86%);
    clip-path: inset(var(--methodology-aperture) 0 0 0 round .7rem);
    transform: perspective(720px) translate3d(
        0, calc(var(--methodology-lift) * var(--methodology-focus)),
        calc(var(--methodology-depth) * var(--methodology-focus))
    );
}

#methodology .timeline-track { z-index: 1; }
#methodology :is(.phase-label, .phase-tag, .phase-node) { position: relative; z-index: 2; }
#methodology .phase-label { color: var(--story-ink); }
#methodology .phase-tag { color: var(--story-muted); }
#methodology .phase-node {
    width: 2.85rem;
    height: 2.85rem;
    border: 2px solid var(--story-surface);
    box-shadow: 0 0 0 1px var(--story-edge);
    font-variant-numeric: tabular-nums;
}
#methodology :is(.phase-2, .phase-3, .phase-4) .phase-node { color: #0b2432; }
@media (min-width: 769px) {
    #methodology .methodology-timeline { padding: 0; }
    #methodology .methodology-phase { display: grid; grid-template-rows: 2.8rem 2.85rem auto; gap: .65rem; justify-items: center; }
    #methodology :is(.phase-tag, .phase-label) { margin: 0; min-height: 0; }
    #methodology .timeline-track {
        left: 12.5%; right: 12.5%; top: calc(2.8rem + .65rem + 1.425rem - 2px);
        height: 4px; background: #294c56; box-shadow: none;
    }
}
@media (max-width: 768px) {
    #methodology .methodology-timeline { gap: 0; }
    #methodology .methodology-phase {
        --methodology-lift: -2px;
        --methodology-depth: 7px;
        display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem;
        align-items: center; text-align: start; padding: 1rem .4rem;
    }
    #methodology .methodology-phase::before,
    #methodology .methodology-phase.is-revealed::after { inset: .25rem -.25rem; }
    #methodology .methodology-phase + .methodology-phase { border-top: 1px solid var(--story-edge); }
    #methodology .phase-node { grid-column: 1; grid-row: 1 / 3; }
    #methodology :is(.phase-tag, .phase-label) { grid-column: 2; margin: 0; }
    #methodology .phase-label { justify-content: flex-start; }
}

#about .about-intro {
    align-items: start; text-align: start; gap: .6rem;
    margin-bottom: clamp(1.65rem, 3.4vw, 3rem);
}
#about .about-title-type { display: block; }
#about .about-intro-copy { max-width: 46rem; }
#about .about-layout { gap: clamp(1.5rem, 5vw, 4.5rem); }
#about .about-aside { gap: 1rem; }
#about .about-aside-brand {
    flex-direction: row; align-items: center; gap: .95rem;
    perspective: 940px; perspective-origin: left center;
}
#about .about-aside-logo { width: clamp(4.5rem, 7.5vw, 6rem); }
#about .about-story { gap: clamp(1rem, 1.8vw, 1.35rem); max-width: 64ch; }
#about .about-story > p { color: var(--story-muted); }
#about .about-story > p:first-child {
    color: var(--story-ink); font-size: clamp(1.2rem, 1.9vw, 1.6rem); line-height: 1.5;
}
#about .about-expertise li {
    color: var(--story-muted); border: 1px solid var(--story-edge);
    background: rgb(159 207 213 / 5%); box-shadow: none; text-align: start;
    padding: .48rem .8rem; border-radius: .45rem;
}
#about .about-objective {
    --about-objective-rule: 1;
    position: relative; padding: .6rem 0 .6rem 1.25rem;
    border: 0; background: transparent; box-shadow: none;
}
#about .about-objective::before {
    content: ''; position: absolute; inset: 0 auto 0 0;
    width: 2px; background: var(--coral);
    transform: scaleY(var(--about-objective-rule)); transform-origin: top;
}
#about .about-objective-title { color: var(--story-ink); }
#about .about-objective p { color: var(--story-muted); }
@media (max-width: 1023px) {
    #about .about-layout { grid-template-columns: minmax(0, 1fr); }
    #about .about-expertise { flex-flow: row wrap; align-items: start; }
}

#contact { padding-block: clamp(3.5rem, 7vw, 6.5rem) clamp(2rem, 4.5vw, 4rem); }
#contact > .container { max-width: 72rem; }
#contact .contact-intro { text-align: start; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
#contact .contact-title-type { display: block; }
#contact .contact-summary {
    margin: .95rem 0 1.35rem; max-width: 32ch;
    color: var(--story-muted); font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.6;
}
#contact .contact-channel {
    display: inline-flex; align-items: center; gap: .75rem;
    min-height: 48px; max-width: 100%; padding: .7rem 1rem;
    color: var(--story-ink); border: 1px solid var(--story-edge); border-radius: .7rem;
    background: #15343e; text-decoration: none;
}
#contact .contact-channel:hover { background: #1a404a; }
#contact .contact-channel i { color: #91d5e2; font-size: 1.25rem; }
#contact .contact-channel-copy { display: grid; gap: .12rem; }
#contact .contact-channel-copy > span { color: var(--story-muted); font-size: .875rem; }
#contact .contact-form-panel {
    min-width: 0; padding: clamp(1rem, 3.5vw, 2.65rem); border: 1px solid var(--story-edge);
    background: linear-gradient(150deg, #1c414b, #142f39);
    border-radius: 1rem; box-shadow: none;
}
#contact label { color: var(--story-ink); }
#contact .neu-input {
    min-height: 44px; background: #102b34; border: 1px solid #52737c; color: var(--story-ink);
    box-shadow: none;
}
#contact .neu-input::placeholder { color: #aac1c7; }
#contact .contact-submit {
    min-height: 48px; color: #0b2432; background: #ea5c3f; border: 1px solid #ea5c3f; box-shadow: none;
}
#contact .contact-submit:hover { background: #f27b64; }
#contact :is(.contact-channel, .neu-input, .contact-submit) { scroll-margin-top: 6rem; }
#contact :is(.contact-channel, .neu-input, .contact-submit):focus-visible {
    outline: 2px solid #94d8e5; outline-offset: 3px;
}
/* The scroll pose yields to native focus and validation immediately. */
#contact .contact-form-panel:not(:focus-within),
#contact .contact-form-panel:not(:focus-within) .contact-submit,
#contact .contact-channel:not(:focus) {
    clip-path: var(--contact-mask, none);
    transform: var(--contact-pose, none);
}
@media (min-width: 900px) {
    #contact > .container {
        display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
        align-items: start; gap: clamp(2rem, 5vw, 5rem);
    }
    #contact .contact-intro { margin-bottom: 0; }
}
body:has(.home-rest) footer {
    font-family: RuuyaSora, sans-serif;
    background: linear-gradient(#132e39, #0b202a);
    border-color: rgb(159 207 213 / 20%);
}

/* The departure shade sits on the gallery's edge while its cards and
   controls remain interactive. The default is the stationary presentation. */
.intro-gallery-shade {
    position: absolute;
    z-index: 3;
    inset: auto 0 100%;
    height: min(36vh, 19rem);
    background: linear-gradient(0deg, rgb(9 29 38 / 36%) 4%, rgb(9 29 38 / 22%) 42%, transparent 100%);
    opacity: 0;
    pointer-events: none;
}
.intro-title-type, .intro-copy-type { display: block; }
.intro-card-frame { min-width: 0; }
.intro-card-frame .hero-stat-card { height: 100%; }

/* Independent of the Introduction entrance's transform. */
#intro .intro-card-frame { translate: var(--industries-exit-offset, none); }
.industries-title-type { display: block; }

/* Native anchor positions and the pin length share one layout measurement. */
.services-scroll-track[data-services-scroll] {
    position: relative;
    --service-step: clamp(18rem, 52svh, 34rem);
    padding-bottom: calc(var(--service-step) * 5.64);
    overflow-anchor: none;
}
.service-scroll-stop {
    position: absolute;
    inset-inline-start: 0;
    width: 1px;
    height: 1px;
    scroll-margin-top: var(--services-nav-offset);
    pointer-events: none;
}
[data-services-scroll] .services-stage {
    display: grid;
    isolation: isolate;
    overflow: clip;
    border-radius: 1.15rem;
    background: #102934;
}
#services [data-services-scroll] .service-offering {
    display: grid;
    grid-area: 1 / 1;
    visibility: hidden;
    min-width: 0;
}
#services [data-services-scroll] .service-offering.is-active { visibility: visible; }
#services [data-services-scroll] .service-offering-media { perspective: 1100px; }

@media (max-width: 1023px) {
    #services [data-services-scroll] .services-scroll-scene {
        max-height: max(0px, calc(100svh - var(--services-nav-offset) - 12px));
    }
}

@media (max-width: 959px) {
    #services [data-services-scroll] .services-rail {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .25rem;
        overflow: visible;
        margin: 0;
    }
    #services [data-services-scroll] .services-rail-btn {
        min-height: 40px;
        padding: .35rem .45rem;
        gap: .3rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    #services [data-services-scroll] .services-rail-label { font-size: .82rem; }
    #services [data-services-scroll] .services-rail-arrow { display: none; }
}

/* Keep the native detail sources out of layout in older scripted browsers
   that do not implement popovers. The noscript presentation opens them. */
.industry-source { display: none; }
