@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

:root {
    --color-cream: #FFF8F0;
    --color-terracotta: #D4745E;
    --color-navy: #1A2332;
    --color-sage: #8B9D83;
    --color-gold: #E8B86D;
    --color-charcoal: #2D3748;
    
    --font-brand: 'Varela Round', 'Arial Rounded MT Bold', sans-serif;
    --font-display: 'Archivo', sans-serif;
    --font-body: 'Crimson Pro', serif;
    
    --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Always reserve the vertical scrollbar gutter so switching between short and
   tall views (e.g. clinic tabs) doesn't change page width and shift the
   centered header content left/right. */
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    font-family: var(--font-body);
    background: var(--color-cream);
    color: var(--color-navy);
    overflow-x: hidden;
    position: relative;
}

/* Grain Texture Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 248, 240, 0.82);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    box-shadow: 0 2px 20px rgba(26, 35, 50, 0.05);
    animation: slideDown 0.6s var(--ease-smooth);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-brand);
    font-weight: 400;
    font-size: 1.7rem;
    letter-spacing: -0.065em;
    text-decoration: none;
}

.logo-text {
    display: inline-block;
    color: #45515B;
    line-height: 0.9;
    text-rendering: geometricPrecision;
}

.logo-text::first-letter {
    color: var(--color-terracotta);
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 7px rgba(26, 35, 50, 0.1));
}

.logo { cursor: pointer; }

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

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--color-navy);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    transition: color 0.3s var(--ease-smooth);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-terracotta);
    transition: width 0.3s var(--ease-smooth);
}

.nav-link:hover {
    color: var(--color-terracotta);
}

.nav-link:hover::after {
    width: 100%;
}

/* Main */
.main {
    padding-top: 80px;
}

/* Hero Section */
.hero {
    min-height: 42vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--color-terracotta) 0%, transparent 70%);
    opacity: 0.05;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-logo-stage {
    position: relative;
    width: clamp(180px, 40vw, 300px);
    aspect-ratio: 1 / 1;
    margin: 0 auto 1.5rem;
    overflow: visible;
}

/* The animated SVG owns its internal timing and reduced-motion fallback. */
.hero-logo-fallback {
    position: absolute;
    inset: 0;
    display: block;
    width: 68%;
    height: 68%;
    margin: auto;
    object-fit: contain;
    filter: drop-shadow(0 14px 26px rgba(26, 35, 50, 0.14)) drop-shadow(0 4px 10px rgba(212, 116, 94, 0.1));
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.hero-title-line {
    display: block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideUp 0.8s var(--ease-smooth) forwards;
}

.hero-title-line:nth-child(1) {
    animation-delay: 0.68s;
}

.hero-title-line:nth-child(2) {
    animation-delay: 0.82s;
    color: var(--color-terracotta);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--color-charcoal);
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-smooth) 1.12s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Categories Section */
.categories {
    padding: 6rem 2rem 6rem;
    max-width: 1240px;
    margin: 0 auto;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
    align-items: stretch;
}

.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 340px;
    padding: 2rem;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(26, 35, 50, 0.08);
    transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
    opacity: 0;
    animation: cardAppear 0.6s var(--ease-smooth) forwards;
    /* fallback background */
    background: linear-gradient(135deg, #F1F5F9 0%, rgba(226, 232, 240, 0.5) 100%);
}

/* Gradient variants (ported from gradient-card.tsx) */
.category-card[data-gradient="orange"] {
    background: linear-gradient(135deg, #FFEDD5 0%, rgba(253, 230, 138, 0.5) 100%);
}

.category-card[data-gradient="gray"] {
    background: linear-gradient(135deg, #F1F5F9 0%, rgba(226, 232, 240, 0.5) 100%);
}

.category-card[data-gradient="purple"] {
    background: linear-gradient(135deg, #F3E8FF 0%, rgba(199, 210, 254, 0.5) 100%);
}

.category-card[data-gradient="green"] {
    background: linear-gradient(135deg, #D1FAE5 0%, rgba(153, 246, 228, 0.5) 100%);
}

.category-card:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
}

.category-card:nth-child(1) { animation-delay: 0.2s; }
.category-card:nth-child(2) { animation-delay: 0.4s; }
.category-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(26, 35, 50, 0.16);
}

/* Decorative background graphic (bottom-right, faded) */
.card-graphic {
    position: absolute;
    right: -12%;
    bottom: -14%;
    width: 62%;
    max-width: 220px;
    color: var(--color-navy);
    opacity: 0.12;
    pointer-events: none;
    transition: transform 0.4s var(--ease-smooth);
    z-index: 0;
}

.card-graphic svg {
    width: 100%;
    height: 100%;
}

.category-card:hover .card-graphic {
    transform: scale(1.1) rotate(3deg);
}

/* Card content column */
.card-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-body-text {
    flex-grow: 1;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    color: var(--color-navy);
}

.card-description {
    font-size: 1.0625rem;
    line-height: 1.55;
    max-width: 22rem;
    color: rgba(26, 35, 50, 0.72);
}

/* Call-to-action link with sliding arrow */
.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-navy);
}

.card-cta-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s var(--ease-smooth);
}

.category-card:hover .card-cta-arrow {
    transform: translateX(4px);
}

/* Features Section — editorial bridge between roles and footer */
.features {
    position: relative;
    overflow: hidden;
    padding: clamp(6rem, 10vw, 9rem) 2rem;
    border-top: 1px solid rgba(26, 35, 50, 0.08);
    background:
        radial-gradient(circle at 12% 18%, rgba(212, 116, 94, 0.09), transparent 24rem),
        linear-gradient(180deg, var(--color-cream) 0%, #F6EEE5 100%);
    color: var(--color-navy);
}

.features::after {
    content: "";
    position: absolute;
    right: -8rem;
    bottom: -11rem;
    width: 26rem;
    height: 26rem;
    border: 1px solid rgba(26, 35, 50, 0.07);
    border-radius: 50%;
    box-shadow: 0 0 0 4rem rgba(26, 35, 50, 0.025),
                0 0 0 8rem rgba(26, 35, 50, 0.018);
    pointer-events: none;
}

.features-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(260px, 0.78fr) minmax(520px, 1.22fr);
    gap: clamp(4rem, 10vw, 9rem);
    max-width: 1240px;
    margin: 0 auto;
}

.features-heading {
    align-self: start;
    position: sticky;
    top: 8rem;
}

.features-title {
    margin: 0;
    color: var(--color-navy);
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 6vw, 6rem);
    font-weight: 600;
    line-height: 0.9;
    letter-spacing: -0.075em;
    text-align: left;
}

.features-title span {
    display: block;
    margin-top: 0.12em;
    color: #45515B;
    font-family: var(--font-brand);
    font-weight: 400;
    letter-spacing: -0.075em;
}

.features-title span::first-letter {
    color: var(--color-terracotta);
}

.features-grid {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(26, 35, 50, 0.18);
}

.feature-item {
    position: relative;
    display: grid;
    grid-template-columns: 2.25rem 3.5rem minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    min-height: 7.25rem;
    padding: 1.35rem 0;
    border-bottom: 1px solid rgba(26, 35, 50, 0.14);
    text-align: left;
    transition: border-color 0.25s var(--ease-smooth);
}

.feature-item:hover {
    border-color: rgba(212, 116, 94, 0.62);
}

.feature-number {
    align-self: center;
    padding-top: 0;
    color: rgba(26, 35, 50, 0.38);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.feature-icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0;
    place-items: center;
    border: 1px solid rgba(212, 116, 94, 0.2);
    border-radius: 50%;
    background: rgba(212, 116, 94, 0.08);
    color: var(--color-terracotta);
    transition: color 0.25s var(--ease-smooth), background 0.25s var(--ease-smooth), transform 0.25s var(--ease-smooth);
}

.feature-icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.feature-item:hover .feature-icon {
    background: var(--color-terracotta);
    color: var(--color-cream);
    transform: rotate(-5deg);
}

.feature-copy {
    transition: transform 0.25s var(--ease-smooth);
}

.feature-item:hover .feature-copy {
    transform: translateX(5px);
}

.feature-item h4 {
    margin: 0 0 0.35rem;
    color: var(--color-navy);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.feature-item p {
    margin: 0;
    color: rgba(26, 35, 50, 0.58);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.4;
}

/* Footer */
.footer {
    position: relative;
    overflow: hidden;
    background: #131D2A;
    color: var(--color-cream);
    padding: 3rem 2rem;
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.footer-links a {
    color: rgba(255, 248, 240, 0.78);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.25s var(--ease-smooth);
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--color-terracotta);
}

/* Homepage editorial footer */
.footer-home {
    isolation: isolate;
    padding: 0 2rem;
    background:
        radial-gradient(circle at 86% 18%, rgba(212, 116, 94, 0.16), transparent 26rem),
        linear-gradient(145deg, #111A26 0%, #172435 58%, #121C29 100%);
}

.footer-home::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.32;
    background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.footer-home .footer-content {
    display: block;
    max-width: 1240px;
    padding: 5.5rem 0 2rem;
}

.footer-orbit {
    position: absolute;
    z-index: 0;
    border: 1px solid rgba(232, 184, 109, 0.13);
    border-radius: 50%;
    pointer-events: none;
}

.footer-orbit::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-terracotta);
    box-shadow: 0 0 0 6px rgba(212, 116, 94, 0.1);
}

.footer-orbit-one {
    width: 520px;
    height: 520px;
    right: -260px;
    top: -275px;
}

.footer-orbit-one::after {
    left: 44px;
    bottom: 88px;
}

.footer-orbit-two {
    width: 280px;
    height: 280px;
    right: -100px;
    top: -118px;
}

.footer-orbit-two::after {
    left: 12px;
    bottom: 74px;
    width: 6px;
    height: 6px;
}

.footer-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 3rem;
    padding-bottom: 4.75rem;
}

.footer-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    color: rgba(255, 248, 240, 0.62);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.footer-eyebrow span,
.footer-trust span {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--color-terracotta);
    box-shadow: 0 0 0 5px rgba(212, 116, 94, 0.12);
}

.footer-cta h2 {
    max-width: 760px;
    margin: 0;
    color: var(--color-cream);
    font-family: var(--font-display);
    font-size: clamp(3rem, 6.8vw, 6.25rem);
    font-weight: 600;
    line-height: 0.88;
    letter-spacing: -0.075em;
}

.footer-cta h2 em {
    color: var(--color-terracotta);
    font-family: var(--font-body);
    font-weight: 400;
}

.footer-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    min-height: 3.75rem;
    padding: 0.9rem 1.4rem 0.9rem 1.65rem;
    border: 1px solid rgba(255, 248, 240, 0.2);
    border-radius: 999px;
    background: var(--color-cream);
    color: var(--color-navy);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.25s var(--ease-smooth), background 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
}

.footer-cta-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s var(--ease-smooth);
}

.footer-cta-button:hover {
    transform: translateY(-3px);
    background: #FFFFFF;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.footer-cta-button:hover svg {
    transform: translateX(4px);
}

.footer-cta-button:focus-visible,
.footer-link-group a:focus-visible,
.footer-bottom a:focus-visible,
.footer-brand-lockup:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 5px;
}

.footer-rule {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 248, 240, 0.25), rgba(255, 248, 240, 0.06));
}

.footer-main {
    display: grid;
    grid-template-columns: minmax(280px, 1.35fr) minmax(360px, 1fr);
    gap: clamp(4rem, 10vw, 9rem);
    padding: 4rem 0 4.5rem;
}

.footer-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-cream);
    text-decoration: none;
}

.footer-logo-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid rgba(255, 248, 240, 0.15);
    border-radius: 15px;
    background: rgba(255, 248, 240, 0.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.footer-logo-mark img {
    width: 2rem;
    height: 2rem;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18));
}

.footer-brand-name {
    font-family: var(--font-brand);
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.065em;
}

.footer-brand-name b {
    color: var(--color-terracotta);
    font-weight: 400;
}

.footer-brand > p {
    max-width: 430px;
    margin: 1.5rem 0 1.75rem;
    color: rgba(255, 248, 240, 0.62);
    font-family: var(--font-body);
    font-size: 1.08rem;
    line-height: 1.55;
}

.footer-trust {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 248, 240, 0.78);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.035em;
}

.footer-trust span {
    width: 6px;
    height: 6px;
    background: var(--color-sage);
    box-shadow: 0 0 0 5px rgba(139, 157, 131, 0.1);
}

.footer-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 3rem;
}

.footer-link-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
}

.footer-link-group h3 {
    margin: 0 0 0.65rem;
    color: var(--color-gold);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-link-group a {
    position: relative;
    color: rgba(255, 248, 240, 0.72);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.93rem;
    transition: color 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}

.footer-link-group a:hover {
    color: var(--color-cream);
    transform: translateX(4px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid rgba(255, 248, 240, 0.09);
    color: rgba(255, 248, 240, 0.42);
    font-family: var(--font-display);
    font-size: 0.74rem;
    letter-spacing: 0.025em;
}

.footer-bottom a {
    color: rgba(255, 248, 240, 0.56);
    text-decoration: none;
    transition: color 0.2s var(--ease-smooth);
}

.footer-bottom a:hover {
    color: var(--color-terracotta);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.65rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav {
        width: 100%;
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .hero {
        min-height: 40vh;
        padding: 3rem 1rem;
    }
    
    .hero-title {
        font-size: clamp(3rem, 15vw, 5rem);
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .categories {
        padding: 3.5rem 1rem 3.5rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .category-card {
        min-height: 300px;
        padding: 1.75rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .features {
        padding: 5rem 1.25rem;
    }

    .features-content {
        grid-template-columns: 1fr;
        gap: 3.25rem;
    }

    .features-heading {
        position: static;
    }
    
    .features-title {
        font-size: clamp(3.25rem, 16vw, 4.75rem);
    }
    
    .features-grid {
        gap: 0;
    }

    .feature-item {
        grid-template-columns: 1.75rem 3rem minmax(0, 1fr);
        gap: 0.85rem;
        min-height: 6.5rem;
        padding: 1.15rem 0;
    }

    .feature-icon {
        width: 2.75rem;
        height: 2.75rem;
    }

    .feature-icon svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .feature-item h4 {
        font-size: 1.05rem;
    }

    .feature-item p {
        font-size: 0.94rem;
    }
    
    .footer:not(.footer-home) .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-home {
        padding: 0 1.25rem;
    }

    .footer-home .footer-content {
        padding: 4.25rem 0 1.5rem;
        text-align: left;
    }

    .footer-cta {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 2.25rem;
        padding-bottom: 3.5rem;
    }

    .footer-cta h2 {
        font-size: clamp(2.75rem, 14vw, 4.5rem);
        line-height: 0.92;
    }

    .footer-cta-button {
        width: fit-content;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 3.5rem;
        padding: 3.25rem 0;
    }

    .footer-navigation {
        gap: 2rem;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }

    .footer-orbit-one {
        right: -380px;
    }

    .footer-orbit-two {
        right: -190px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

/* Print Styles */
@media print {
    .grain-overlay,
    .header,
    .footer {
        display: none;
    }
}

/* Paint-synchronized homepage entrance.
   Waiting for .page-ready guarantees desktop browsers paint the initial state
   before transitioning, instead of completing animations during page parsing. */
.header,
.hero-logo-stage,
.hero-title-line,
.hero-subtitle,
.category-card {
    animation: none;
}

.header {
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.45s var(--ease-smooth), transform 0.45s var(--ease-smooth);
}

.hero-logo-stage {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.6s var(--ease-smooth) 0.1s, transform 0.6s var(--ease-smooth) 0.1s;
}

.hero-title-line {
    transition: opacity 0.65s var(--ease-smooth), transform 0.65s var(--ease-smooth);
}

.hero-title-line:nth-child(1) {
    transition-delay: 0.3s;
}

.hero-title-line:nth-child(2) {
    transition-delay: 0.42s;
}

.hero-subtitle {
    transform: translateY(10px);
    transition: opacity 0.55s var(--ease-smooth) 0.62s, transform 0.55s var(--ease-smooth) 0.62s;
}

.category-card {
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease-smooth), transform 0.5s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.category-card:nth-child(1) { transition-delay: 0.72s; }
.category-card:nth-child(2) { transition-delay: 0.82s; }
.category-card:nth-child(3) { transition-delay: 0.92s; }

body.page-ready .header,
body.page-ready .hero-logo-stage,
body.page-ready .hero-title-line,
body.page-ready .hero-subtitle,
body.page-ready .category-card {
    opacity: 1;
    transform: none;
}

/* Remove entrance delays after the reveal so hover feedback stays immediate. */
body.page-ready.page-entered .category-card {
    transition-delay: 0s;
}

body.page-ready.page-entered .category-card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* Below-the-fold rows reveal only when they actually enter the viewport. */
.feature-item {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s var(--ease-smooth) var(--reveal-delay, 0ms),
                transform 0.5s var(--ease-smooth) var(--reveal-delay, 0ms),
                border-color 0.25s var(--ease-smooth);
}

.feature-item.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    /* Keep the homepage reveal visible when desktop OS animations are disabled.
       Most elements fade; the hero copy retains its requested upward entrance. */
    .header,
    .hero-logo-stage,
    .hero-title-line,
    .hero-subtitle,
    .category-card,
    .feature-item {
        transform: none !important;
        animation: none !important;
    }

    .header {
        transition: opacity 0.25s ease !important;
    }

    .hero-logo-stage {
        transition: opacity 0.3s ease 0.08s !important;
    }

    .hero-title-line {
        transform: translateY(100%) !important;
        transition: opacity 0.42s var(--ease-smooth),
                    transform 0.42s var(--ease-smooth) !important;
    }

    .hero-title-line:nth-child(1) { transition-delay: 0.18s !important; }
    .hero-title-line:nth-child(2) { transition-delay: 0.3s !important; }

    .hero-subtitle {
        transform: translateY(14px) !important;
        transition: opacity 0.36s var(--ease-smooth) 0.42s,
                    transform 0.36s var(--ease-smooth) 0.42s !important;
    }

    body.page-ready .hero-title-line,
    body.page-ready .hero-subtitle {
        opacity: 1 !important;
        transform: none !important;
    }

    .category-card {
        transition: opacity 0.3s ease, box-shadow 0.2s ease !important;
    }

    .category-card:nth-child(1) { transition-delay: 0.5s !important; }
    .category-card:nth-child(2) { transition-delay: 0.58s !important; }
    .category-card:nth-child(3) { transition-delay: 0.66s !important; }

    body.page-ready.page-entered .category-card {
        transition-delay: 0s !important;
    }

    .feature-item {
        transition: opacity 0.25s ease var(--reveal-delay, 0ms),
                    border-color 0.2s ease !important;
    }
}

/* The hero subtitle fades in without vertical movement on every device. */
.hero-subtitle {
    transform: none !important;
    transition: opacity 0.5s var(--ease-smooth) 0.48s !important;
}
