/* =========================================================
   ADMITH LEGACY — SHARED PREMIUM POLISH
   Non-destructive refinements for every public page.
========================================================= */

:root {
    --section-space: clamp(4.5rem, 8vw, 7rem);
    --section-space-compact: clamp(3.5rem, 6vw, 5.5rem);
    --content-measure: 72rem;
    --reading-measure: 68ch;
}

html {
    scroll-behavior: smooth;
}

main {
    isolation: isolate;
}

/* A persistent navigation bar keeps primary routes accessible on long pages. */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

body {
    padding-top: 90px;
    overflow-x: hidden;
}

@media (max-width: 760px) {
    body {
        padding-top: 76px;
    }
}


/* =========================================================
   SHARED RETURN-TO-TOP CONTROL
========================================================= */

.return-to-top {
    position: fixed;
    right: clamp(1rem, 2vw, 1.5rem);
    bottom: clamp(5.75rem, 9vw, 6.75rem);
    z-index: 990;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 3rem;
    height: 3rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(33, 102, 63, 0.34);
    border-radius: 999px;
    color: #1f7146;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 32px rgba(20, 35, 27, 0.14);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem) scale(0.94);
    transition: width 0.25s ease, gap 0.25s ease, color 0.25s ease, background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.return-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.return-to-top svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.return-to-top span {
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.03em;
    opacity: 0;
    transition: width 0.25s ease, opacity 0.18s ease;
}

.return-to-top:hover,
.return-to-top:focus-visible {
    width: 8.8rem;
    gap: 0.45rem;
    border-color: #3d9865;
    color: #ffffff;
    background: #3d9865;
}

.return-to-top:hover span,
.return-to-top:focus-visible span {
    width: 4.4rem;
    opacity: 1;
}

.return-to-top:focus-visible {
    outline: 3px solid rgba(91, 183, 128, 0.38);
    outline-offset: 4px;
}

@media (max-width: 760px) {
    .return-to-top {
        right: 1rem;
        bottom: 5.25rem;
    }

    .return-to-top:hover,
    .return-to-top:focus-visible {
        width: 3rem;
        gap: 0;
    }

    .return-to-top:hover span,
    .return-to-top:focus-visible span {
        width: 0;
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .return-to-top,
    .return-to-top span {
        transition: none;
    }
}

/* =========================================================
   Cross-page title system
   Controls the named page-title patterns that otherwise carry their own
   oversized local rules. It deliberately preserves hierarchy while keeping
   titles readable in fewer vertical lines.
========================================================= */

main :is(
    .africartmall-hero-title,
    .gallery-hero-title,
    .insights-hero-title,
    .legal-hero-title,
    .nnobae-hero-title
) {
    max-width: 15ch !important;
    margin-block: 0.7rem 1.1rem !important;
    font-size: clamp(2.5rem, 5.15vw, 5.15rem) !important;
    font-weight: 750 !important;
    line-height: 0.98 !important;
    letter-spacing: -0.058em !important;
    text-wrap: balance;
}

/* Consistent section eyebrows: these previously inherited many page-specific
   text styles and could read as unconnected plain copy. */
main .section-label,
main .service-page-label {
    display: inline-flex !important;
    align-items: center;
    width: fit-content;
    min-height: 1.95rem;
    box-sizing: border-box;
    gap: 0.48rem;
    margin: 0 0 0.85rem !important;
    padding: 0.38rem 0.68rem !important;
    border: 1px solid rgba(39, 132, 86, 0.32) !important;
    border-radius: 999px;
    color: #1d754a !important;
    background: rgba(91, 183, 128, 0.08) !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.105em !important;
    line-height: 1.1 !important;
    text-transform: uppercase;
}

main .section-label::before,
main .service-page-label::before {
    width: 0.42rem !important;
    height: 0.42rem !important;
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 50%;
    background: #43a96c !important;
    box-shadow: 0 0 0 0.2rem rgba(91, 183, 128, 0.14) !important;
}

/* Keep dark and image-led sections legible without requiring unique label CSS. */
main :is(.design-cta, .hero, .nnobae-hero, .africartmall-hero) .section-label {
    border-color: rgba(183, 245, 203, 0.34) !important;
    color: #cbf7d8 !important;
    background: rgba(10, 30, 18, 0.38) !important;
}

main :is(.section-heading, .design-philosophy-heading, .about-story-heading, .about-values-heading) > .section-label {
    margin-bottom: 0.85rem !important;
}

main :is(
    .section-title,
    .about-approach-heading h2,
    .about-story-heading h2,
    .about-values-heading h2,
    .africartmall-journey-heading h2,
    .brand-audience-heading h2,
    .brand-intro-heading h2,
    .deliverables-heading h2,
    .design-philosophy-heading h2,
    .design-showcase-heading h2,
    .documentation-audience-heading h2,
    .documentation-intro-heading h2,
    .documentation-section-heading h2,
    .future-products-heading h2,
    .growth-intro-heading h2,
    .growth-outcomes-heading h2,
    .growth-section-heading h2,
    .how-we-think-heading h2,
    .innovation-approach-heading h2,
    .nnobae-journey-heading h2,
    .portfolio-capabilities-heading h2,
    .portfolio-intro-heading h2,
    .portfolio-projects-heading h2,
    .product-deliverables-heading h2,
    .product-philosophy-heading h2,
    .product-section-heading h2,
    .projects-intro-heading h2,
    .services-intro-heading h2,
    .strategy-section-heading h2,
    .who-we-work-heading h2
) {
    max-width: 18ch !important;
    margin-block: 0.75rem 1rem !important;
    font-size: clamp(1.9rem, 3.65vw, 3.45rem) !important;
    font-weight: 750 !important;
    line-height: 1.04 !important;
    letter-spacing: -0.045em !important;
    text-wrap: balance;
}

main :is(
    .capability-card h3,
    .project-title,
    .workflow-title,
    .service-visual-title,
    .card-title
) {
    margin-block: 0.55rem !important;
    font-size: clamp(1.1rem, 1.75vw, 1.45rem) !important;
    font-weight: 750 !important;
    line-height: 1.18 !important;
    letter-spacing: -0.025em !important;
    text-wrap: balance;
}

@media (max-width: 760px) {
    main :is(
        .africartmall-hero-title,
        .gallery-hero-title,
        .insights-hero-title,
        .legal-hero-title,
        .nnobae-hero-title
    ) {
        max-width: 13ch !important;
        font-size: clamp(2.25rem, 10vw, 3.55rem) !important;
    }

    main :is(
        .section-title,
        .about-approach-heading h2,
        .about-story-heading h2,
        .about-values-heading h2,
        .africartmall-journey-heading h2,
        .brand-audience-heading h2,
        .brand-intro-heading h2,
        .deliverables-heading h2,
        .design-philosophy-heading h2,
        .design-showcase-heading h2,
        .documentation-audience-heading h2,
        .documentation-intro-heading h2,
        .documentation-section-heading h2,
        .future-products-heading h2,
        .growth-intro-heading h2,
        .growth-outcomes-heading h2,
        .growth-section-heading h2,
        .how-we-think-heading h2,
        .innovation-approach-heading h2,
        .nnobae-journey-heading h2,
        .portfolio-capabilities-heading h2,
        .portfolio-intro-heading h2,
        .portfolio-projects-heading h2,
        .product-deliverables-heading h2,
        .product-philosophy-heading h2,
        .product-section-heading h2,
        .projects-intro-heading h2,
        .services-intro-heading h2,
        .strategy-section-heading h2,
        .who-we-work-heading h2
    ) {
        max-width: 16ch !important;
        font-size: clamp(1.65rem, 7.5vw, 2.4rem) !important;
    }
}

/* Shared editorial scale: firm hierarchy without oversized, vertically
   inefficient headings on wide screens. Individual pages retain their
   composition, but no heading can exceed a readable production scale. */
main h1 {
    max-width: 18ch;
    font-size: clamp(2.35rem, 4.9vw, 4.9rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

main h2 {
    max-width: 22ch;
    font-size: clamp(1.8rem, 3.4vw, 3.25rem) !important;
    line-height: 1.04 !important;
    letter-spacing: -0.04em !important;
    text-wrap: balance;
}

main h3 {
    font-size: clamp(1.1rem, 1.8vw, 1.55rem) !important;
    line-height: 1.18 !important;
    text-wrap: balance;
}

main p {
    max-width: var(--reading-measure);
    line-height: 1.65;
}

main section > .container {
    position: relative;
}

/* Prevent decorative content from covering primary copy at compact widths. */
@media (max-width: 760px) {
    main h1 {
        max-width: 15ch;
        font-size: clamp(2.2rem, 11vw, 3.45rem) !important;
        line-height: 1 !important;
    }

    main h2 {
        max-width: 17ch;
        font-size: clamp(1.65rem, 8vw, 2.35rem) !important;
    }

    .hero .floating-card.card-two,
    .hero .floating-card.card-three,
    .insights-hero-visual,
    .orbit-two,
    .orbit-three {
        display: none !important;
    }

    .hero .floating-card.card-one {
        position: static !important;
        width: min(100%, 20rem) !important;
        margin: 1rem auto 0 !important;
        transform: none !important;
    }
}

main section[id] {
    scroll-margin-top: 7rem;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: #111111;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(91, 183, 128, 0.72);
    outline-offset: 4px;
}

.btn,
.footer-social-link,
.nav-item a,
.dropdown-toggle {
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 760px) {
    main section[id] {
        scroll-margin-top: 6rem;
    }
}

/* Homepage transition-to-capabilities handoff. The wave no longer stacks a
   large empty reserve with the next section's heading space. */
#home + .innovation-transition {
    min-height: clamp(21rem, 31vw, 25rem) !important;
    padding: clamp(3.75rem, 5vw, 4.75rem) 1.5rem clamp(4rem, 5.5vw, 5rem) !important;
}

#home + .innovation-transition .transition-content {
    transform: translateY(clamp(-1.5rem, -1.8vw, -0.85rem));
}

#home + .innovation-transition .transition-wave {
    height: clamp(4.5rem, 7vw, 6.5rem);
}

#home ~ .capabilities {
    padding-top: clamp(2.75rem, 3.7vw, 4.25rem) !important;
}

@media (max-width: 760px) {
    #home + .innovation-transition {
        min-height: 0 !important;
        padding: 3.5rem 1.25rem 4.25rem !important;
    }

    #home + .innovation-transition .transition-content {
        transform: translateY(-0.5rem);
    }

    #home ~ .capabilities {
        padding-top: 2.75rem !important;
    }
}

/* =========================================================
   SITE-WIDE CONTENT RHYTHM
   Loaded last on every page to neutralize oversized legacy spacing while
   preserving dedicated hero compositions and component layouts.
========================================================= */

:root {
    --content-section-block: clamp(3.75rem, 5.4vw, 6.25rem);
    --content-heading-gap: clamp(1.25rem, 2vw, 2rem);
    --display-heading-max: 22ch;
}

main section:not(.hero):not([class*="hero"]) {
    min-height: auto !important;
    padding-block: var(--content-section-block) !important;
}

main :is(
    .section-title,
    .section-heading h2,
    [class*="-heading"] > h2,
    [class*="-heading"] h2,
    [class*="-intro"] > h2,
    [class*="-intro"] h2,
    [class*="-cta"] h2,
    [class*="-content"] > h2
) {
    max-width: var(--display-heading-max) !important;
    margin-bottom: var(--content-heading-gap) !important;
    font-size: clamp(2.25rem, 4vw, 4.85rem) !important;
    font-weight: 800;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

main :is(
    .section-heading,
    [class*="-heading"]:not(.form-heading),
    [class*="-intro"]:not(.hero-intro)
) {
    margin-bottom: clamp(1.5rem, 3vw, 3.25rem) !important;
}

main :is(
    .section-heading p,
    [class*="-heading"] > p,
    [class*="-intro"] > p
) {
    max-width: 62ch;
    line-height: 1.65;
}

/* Retain compact, utilitarian UI headings inside cards, forms, and legal copy. */
main :is(
    .card h2,
    .card h3,
    .form-heading h2,
    .form-heading h3,
    .legal-section h2,
    .vision-mission-card h2,
    .support-widget h2,
    .support-widget h3
) {
    max-width: none !important;
    margin-bottom: initial !important;
    font-size: revert !important;
    line-height: revert !important;
    letter-spacing: revert !important;
}

@media (max-width: 760px) {
    :root {
        --content-section-block: clamp(3.25rem, 12vw, 4.5rem);
        --display-heading-max: 17ch;
    }

    main :is(
        .section-title,
        .section-heading h2,
        [class*="-heading"] > h2,
        [class*="-heading"] h2,
        [class*="-intro"] > h2,
        [class*="-intro"] h2,
        [class*="-cta"] h2,
        [class*="-content"] > h2
    ) {
        font-size: clamp(2rem, 8.5vw, 3.35rem) !important;
        line-height: 1 !important;
    }
}
