/* CSS Reset & Variables */
:root {
    /* Clinical Cyberpunk Palette */
    --bg-primary: #06080E;
    --bg-secondary: #0B0F15;
    --accent-cyan: #1FC9C8;
    --accent-green: #4ADE80;
    --accent-amber: #FBB724;
    --text-primary: #FFFFFF;
    --text-secondary: #A8B2C7;
    --text-muted: #6B778C;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    
    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CRITICAL iOS FIX: Force dark background everywhere */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: #06080E !important;
    -webkit-background-size: cover !important;
}

body {
    font-family: var(--font-body);
    background: #06080E !important;
    background-color: #06080E !important;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-text-fill-color: initial !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* iOS-specific background fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS only */
    html, body {
        background: #06080E !important;
        background-color: #06080E !important;
        -webkit-background-size: 100% 100% !important;
    }
    
    body::before {
        background-color: #06080E !important;
    }
    
    /* Ensure all sections have dark background */
    section, main, header, footer, div {
        background-color: transparent !important;
    }
    
    /* Force text color on iOS */
    * {
        -webkit-text-fill-color: initial !important;
    }
}

/* Background gradient with iOS fix */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, #0B0F15 0%, #06080E 100%) !important;
    z-index: -3;
    pointer-events: none;
}

/* Ambient starfield */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(2px 2px at 20% 30%, rgba(31, 201, 200, 0.03), transparent),
                      radial-gradient(2px 2px at 60% 70%, rgba(31, 201, 200, 0.03), transparent),
                      radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.03), transparent);
    background-size: 200px 200px;
    z-index: -2;
    pointer-events: none;
}

/* FIXED: Hero section layout per engineering brief */
#hero {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem; /* Adjusted gap for spacing */
    padding: 8vh 0 4vh;
    flex-wrap: wrap; 
    max-width: 1440px; /* Constrain the hero's max width */
    margin: 0 auto;    /* Center the hero section */
}

.hero-copy {
    max-width: 45rem; /* Give text more width */
    flex: 1 1 500px; /* Allow shrinking but prefer a wider base */
    text-align: left; /* Ensure text is left-aligned on desktop */
}

/* Hero phone specific */
.hero-phone-container {
    flex: 0 0 auto;
}

/* Mobile responsiveness for hero */
@media (max-width: 968px) {
    #hero {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 4vh 2rem;
    }
    
    #hero .hero-copy {
        max-width: 100%;
        text-align: center;
    }
    
    .hero-phone-container {
        margin-top: 2rem;
    }
    
    .hero-phone {
        width: 300px;
        height: 600px;
    }
}

/* iOS specific fixes */
@media (max-width: 480px) {
    #hero {
        padding: 2rem 1rem;
    }
    
    .hero-phone {
        width: 280px;
        height: 560px;
    }
    
    .hero-copy h1 {
        font-size: 2.5rem;
    }
    
    .hero-copy h2 {
        font-size: 1.5rem;
    }
    
    .hero-copy h3 {
        font-size: 1.2rem;
    }
}

/* Keep badge on one line */
.hero-copy .badge {
    white-space: nowrap;
    display: inline-block;  /* FIXED: Prevents orphan wrapping */
    margin-top: 0.75rem;
}

/* Wrapper - Centers everything */
.wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: clamp(16px, 3vw, 80px);
    width: 100%; /* Ensure full width on mobile */
}

.wrapper > section {
    width: 100%;
}

/* Mobile section centering */
@media (max-width: 768px) {
    .wrapper {
        padding-inline: 1rem;
    }
    
    /* Center all section headers on mobile */
    .section-header,
    .demo-title,
    .demo-subtitle,
    .demo-features {
        text-align: center !important;
    }
    
    /* Center feature items on mobile */
    .feature-visual {
        justify-content: center;
    }
    
    .feature-text h3,
    .feature-text p {
        text-align: center !important;
    }
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary) !important;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--spacing-sm);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

p {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
}

/* Navigation - Updated for Logo */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(6, 8, 14, 0.8) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 80px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(31, 201, 200, 0.5));
    animation: glow 6s ease-in-out infinite;
}

.footer-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    opacity: 0.8;
}

@keyframes glow {
    0% { filter: drop-shadow(0 0 5px rgba(31, 201, 200, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(31, 201, 200, 0.8)); }
    100% { filter: drop-shadow(0 0 5px rgba(31, 201, 200, 0.5)); }
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(31, 201, 200, 0.6)); }
    50% { filter: drop-shadow(0 0 12px rgba(31, 201, 200, 0.9)); }
}

.hero-shield {
    animation: floatGentle 8s ease-in-out infinite, pulseGlow 4s ease-in-out infinite;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary) !important;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

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

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    color: var(--text-primary) !important;
}

.btn-primary {
    background: var(--accent-cyan);
    color: var(--bg-primary) !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 18px rgba(31, 201, 200, 0.35);
}

.btn-glow {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    color: var(--bg-primary) !important;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(calc(var(--mx, 0) * 1px - 50%), calc(var(--my, 0) * 1px - 50%));
    transition: transform 0.2s;
    pointer-events: none;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(31, 201, 200, 0.4);
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary) !important;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
}

.btn-hero {
    margin-top: 2rem;
    font-size: 1.1rem;
    padding: 1.25rem 3rem;
}

/* Button variants for CTA section */
.btn.hollow {
    background: transparent;
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan) !important;
}

.btn.hollow:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary) !important;
    transform: translateY(-2px);
}

.btn.solid {
    background: var(--accent-cyan);
    color: var(--bg-primary) !important;
}

/* Florence Explain Button */
.florence-explain-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    margin: 2rem auto;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    border: none;
    border-radius: 50px;
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Hide duplicate buttons - failsafe */
.florence-explain-btn ~ .florence-explain-btn {
    display: none !important;
}

#florenceButtonContainer ~ div .florence-explain-btn {
    display: none !important;
}

.florence-explain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(31, 201, 200, 0.4);
}

/* FIX: Florence button speaker stays dark */
.florence-explain-btn .speaker-icon {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(0) !important; /* Keep dark on the bright button */
    display: inline-block;
    vertical-align: middle;
}

.florence-explain-btn.playing {
    animation: pulse 1.5s infinite;
}

/* Glass Card Component */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
}

.card-glass:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(31, 201, 200, 0.1);
    border-color: rgba(31, 201, 200, 0.3);
}

/* Hero Section Base */
.hero-cinematic {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 15px !important;
    padding-bottom: 2rem;
}

/* Fixed nav space */
body {
    padding-top: 70px;
}

/* Background animation */
.hero-bg-particles {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(31, 201, 200, 0.1) 0%, transparent 50%);
    animation: particleDrift 20s ease-in-out infinite;
}

@keyframes particleDrift {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1) rotate(180deg);
        opacity: 0.8;
    }
}

/* ----- HERO SECTION UPDATES ----- */
/* Update hero structure for new layout */
.hero-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.hero-copy {
    text-align: left;
}

.hero-copy h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    max-width: 20ch;
    color: var(--text-primary) !important;
}

.hero-copy h2.accent {
    font-size: clamp(1.5rem, 3vw, 2rem);
    background: linear-gradient(90deg, var(--accent-cyan) 0%, #65E6F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

/* Typewriter effect */
@keyframes typing {
    from { width: 0 }
    to { width: calc(var(--ch) * 1ch) }
}

@keyframes blink {
    50% { border-right-color: transparent; }
}

.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: .1em solid var(--accent-cyan);
    animation: typing 2s steps(30, end),
               blink 0.8s step-end infinite alternate;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin-bottom: 1rem;
}

.done-typing {
    border-right: none;
    animation: none;
}

.hero-copy .sub {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 90%;
}

/* Metrics grid */
.metrics {
    margin: 2.5rem 0 1.2rem;
    display: flex;
    justify-content: flex-start;
    gap: 3rem;
    text-align: center;
    list-style: none;
    padding: 0;
}

.metrics li {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.metrics li:nth-child(1) { animation-delay: 0.5s; }
.metrics li:nth-child(2) { animation-delay: 0.7s; }
.metrics li:nth-child(3) { animation-delay: 0.9s; }

.metrics .big {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-cyan);
    line-height: 1;
}

.metrics small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Tech footer */
.tech-footer {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    opacity: 0.7;
    letter-spacing: 0.03em;
    margin-top: 2rem;
}

/* Hero phone container */
.hero-phone-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero copy mobile fixes */
@media (max-width: 768px) {
    .hero-copy {
        text-align: center;
        padding: 0 1rem;
    }
    
    .hero-copy h1 {
        font-size: 2.5rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .hero-copy h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .hero-copy h3 {
        font-size: 1.25rem;
        text-align: center;
        margin: 0 auto 1rem;
    }
    
    .hero-copy .sub {
        text-align: center;
        max-width: 100%;
    }
    
    .hero-copy .badge {
        text-align: center;
        font-size: 0.75rem;
    }
}

.hero-eyebrow {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Hero copy h3 - Fixed typewriter */
.hero-copy h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
    font-style: italic;
    display: inline-block;  /* Prevent full width */
    max-width: max-content; /* Constrain to content width */
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary) !important;
}

.hero-copy h2 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-block: 1rem 0;
    background: linear-gradient(90deg, var(--accent-cyan) 0%, #65E6F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-copy p {
    font-size: 1.125rem;
    max-width: 38ch;
    opacity: 0.9;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Compact Stats Section */
.stats-compact {
    padding: 3rem 0;
    width: 100%;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

.stat-item.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.stat-item:nth-child(1) { animation-delay: 0s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.4s; }

.stat-item > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    min-height: 3.5rem;
}

.stat-number {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--accent-cyan);
    line-height: 1;
    display: inline-block;
}

.stat-suffix {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    line-height: 1;
    display: inline-block;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Visual Demo Section */
.demo-visual {
    padding: 4rem 0;
    width: 100%;
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.demo-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: var(--text-primary) !important;
}

.demo-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.demo-features {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feature-visual {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    opacity: 0;
    transform: translateX(-20px);
}

.feature-visual.animate-in {
    animation: slideInLeft 0.6s ease-out forwards;
}

.feature-visual:nth-child(1) { animation-delay: 0s; }
.feature-visual:nth-child(2) { animation-delay: 0.2s; }
.feature-visual:nth-child(3) { animation-delay: 0.4s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feature-icon-wrap {
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon {
    font-size: 1.8rem;
}

.feature-text h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
    text-align: left;
    color: var(--text-primary) !important;
}

.feature-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: left;
}

/* FIXED PHONE STYLING */
.phone {
    aspect-ratio: 9/19.5;
    border-radius: 2rem;
}

.phone .screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0A0B0F !important;
}

.phone .messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 80px !important;
}

/* Hero Phone Specific - iOS fixes */
.hero-phone {
    width: 360px;
    height: 720px;
    background: #0A0B0F !important;
    border-radius: 40px;
    box-shadow: 
        0 0 0 12px #1a1a1a,
        0 0 0 14px #2a2a2a,
        0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    margin: 0 auto; /* Center the phone */
}

.hero-phone .screen {
    position: absolute;
    top: 20px;
    left: 10px;
    right: 10px;
    bottom: 20px;
    background: var(--bg-primary) !important;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
}

.hero-phone .chat-window {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.hero-phone #heroChat {
    padding: 1rem;
    padding-bottom: 80px;
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Messages list styling */
.messages {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Hero Chat specific fixes for iOS */
#heroChat {
    padding: 1rem;
    padding-bottom: 80px;
    overflow-y: auto;
    height: 100%;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    /* Ensure visibility */
    visibility: visible !important;
    opacity: 1 !important;
    list-style: none !important;
    margin: 0 !important;
}

/* Hero Chat Messages - Let JavaScript handle animations */
#heroChat .message {
    margin-bottom: 1rem;
    display: flex;
    /* No animation in CSS - JavaScript handles it */
}

#heroChat .message.user {
    justify-content: flex-end;
}

#heroChat .message.ai {
    justify-content: flex-start;
}

#heroChat .message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

#heroChat .message.user .message-content {
    background: #4ADE80;
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

#heroChat .message.ai .message-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* FIXED: Chat bubble styling per engineering brief */
.msg {
    margin-bottom: 1rem;
    display: flex;
    animation: messageSlide 0.3s ease-out;
}

.msg.user,
.msg.patient {
    justify-content: flex-end;
}

.msg.ai,
.msg.florence {
    justify-content: flex-start;
}

.msg-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.msg.user .msg-bubble,
.msg.patient .msg-bubble {
    background: #4ADE80;
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

.msg.ai .msg-bubble,
.msg.florence .msg-bubble {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* QR Section - FIXED CENTERING */
.qr-section-modern,
#qr {
    padding: 4rem 0;
    width: 100%;
    text-align: center;
}

#qr h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.2;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary) !important;
}

#qr h2 span {
    display: block;
    color: var(--text-secondary);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.qr-copy .tagline {
    font-weight: 600;
    margin-bottom: 24px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.qr-copy .benefits {
    list-style: none;
    text-align: left;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.qr-copy .benefits li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.qr-copy .benefits li strong {
    color: var(--text-primary);
}

.qr-copy .benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 1.2rem;
}

.qr-copy .cta {
    display: inline-block;
    margin-top: 32px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
    border-radius: 999px;
    color: var(--bg-primary) !important;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.qr-card {
    display: grid;
    place-items: center;
    padding: 2rem 3rem;
    border-radius: 1.5rem;
    background: radial-gradient(circle at 50% 0%, #093748 0%, #04131a 90%);
    box-shadow: 0 0 1.5rem #05f2d5a0;
    margin: 0 auto;
    max-width: fit-content;
}

/* FIX: Enhanced QR Code visibility */
#qrCanvas {
    width: 280px;
    height: 280px;
    border-radius: 24px;
    background: #000 !important;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.4) inset,
        0 0 24px #0ff,
        0 0 60px rgba(0, 255, 255, 0.5);
}

.qr-card .badge {
    margin-top: 1rem;
    background: #ffd000;
    color: #000;
    padding: 4px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Chat Gallery - FIXED LABEL SPACING */
.chat-gallery {
    padding: 4rem 0;
    width: 100%;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.5rem;
    color: var(--text-primary) !important;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.iphone-gallery {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.chat-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* FIXED: Much more spacing between label and phone */
.chat-label {
    margin: 0 0 2rem 0 !important; /* Increased from 8px to 2rem */
    font-size: 0.875rem;
    color: #9CA3AF;
    font-weight: 600;
    text-align: center;
    height: 20px; /* Fixed height to ensure consistent spacing */
}

.iphone-mockup {
    width: 320px;
    height: 640px;
    background: #0A0B0F !important;
    border-radius: 40px;
    box-shadow: 
        0 0 0 12px #1a1a1a,
        0 0 0 14px #2a2a2a,
        0 10px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Add smooth transform for Safari */
.iphone-mockup:hover {
    transform: translateY(-10px);
    will-change: transform;
}

/* FIX: Proper phone container structure for scrolling */
.iphone-screen {
    position: absolute !important;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: calc(100% - 20px) !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #0A0B0F;
}

.chat-header {
    flex-shrink: 0;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 600;
    color: #fff;
}

.chat-status {
    font-size: 0.875rem;
    color: #4ADE80;
}

.chat-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-body .messages {
    height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch !important;
    padding: 1rem;
    padding-bottom: 80px;
    scroll-behavior: smooth;
    /* iOS fixes for message visibility */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    background: transparent;
}

/* Ensure messages are visible on iOS */
.messages .msg {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    opacity: 1 !important;
    visibility: visible !important;
}

/* Chat Messages */
.msg.nurse {
    justify-content: flex-start;
}

.msg.nurse .msg-bubble {
    background: #05f2d5 !important;
    color: #000 !important;
    border-bottom-left-radius: 4px;
}

/* FIX: Speaker Icons - Make white on dark backgrounds */
.speaker-icon {
    filter: brightness(0) invert(1) !important;
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}

/* Audio play button positioning */
.play-audio {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(31, 201, 200, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.play-audio:hover {
    transform: scale(1.1);
    background: #1FC9C8;
}

.play-audio.playing {
    animation: pulse 1.5s infinite;
}

/* Dashboard Section - FIXED CENTERING */
.dashboard-section {
    padding: 4rem 0;
    width: 100%;
    text-align: center;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 0.5rem;
    color: var(--text-primary) !important;
    text-align: center;
}

.section-sub {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* KPI Tiles - Centered and animated */
.kpi-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem auto 3rem;
    flex-wrap: wrap;
}

.tile {
    flex: 0 1 200px;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.tile.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.tile:nth-child(1) { animation-delay: 0s; }
.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.4s; }

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.tile span {
    font: 700 3rem/1 var(--font-display);
    color: #fff;
    display: block;
    margin-bottom: 0.5rem;
}

.tile small {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    opacity: 0.9;
    letter-spacing: 0.1em;
    color: #fff;
}

.critical {
    background: linear-gradient(135deg, #E85A4F, #D9534F);
    box-shadow: 0 8px 16px rgba(232, 90, 79, 0.3);
}

.warning {
    background: linear-gradient(135deg, #FFB800, #FFA000);
    box-shadow: 0 8px 16px rgba(255, 184, 0, 0.3);
}

.warning small {
    color: #111;
}

.neutral {
    background: linear-gradient(135deg, #1FC9C8, #4ADE80);
    box-shadow: 0 8px 16px rgba(31, 201, 200, 0.3);
}

/* Dashboard Grid - Centered */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
    align-items: start;
}

/* Chart Container */
.chart-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    min-height: 400px;
    opacity: 0;
    transform: translateX(-30px);
}

.chart-container.animate-in {
    animation: fadeInLeft 0.8s ease-out forwards;
}

#esrdTrend {
    max-width: 100%;
    height: 300px !important;
}

/* Table Styling */
.table-wrapper {
    overflow-x: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    opacity: 0;
    transform: translateX(30px);
}

.table-wrapper.animate-in {
    animation: fadeInRight 0.8s ease-out forwards;
}

.dashboard-section table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-section th,
.dashboard-section td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
}

.dashboard-section th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--glass-border);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

/* FIX: Dashboard table row animations */
.dashboard-section tbody tr {
    opacity: 0;
    animation: tableRowFadeIn 0.6s ease-out forwards;
}

.dashboard-section tbody tr:nth-child(1) { animation-delay: 0s; }
.dashboard-section tbody tr:nth-child(2) { animation-delay: 0.1s; }
.dashboard-section tbody tr:nth-child(3) { animation-delay: 0.2s; }
.dashboard-section tbody tr:nth-child(4) { animation-delay: 0.3s; }
.dashboard-section tbody tr:nth-child(5) { animation-delay: 0.4s; }

@keyframes tableRowFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Status badges styling */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.critical {
    background: rgba(232, 90, 79, 0.2);
    color: #E85A4F;
}

.status-badge.warning {
    background: rgba(255, 184, 0, 0.2);
    color: #FFB800;
}

.status-badge.normal {
    background: rgba(74, 222, 128, 0.2);
    color: #4ADE80;
}

/* Trend indicators */
.current-value {
    font-weight: 700;
    color: #fff;
}

.unit {
    color: #6B778C;
    font-size: 0.875rem;
}

.trend {
    margin-left: 0.5rem;
    font-weight: 700;
}

.trend.trending-up { color: #FFB800; }
.trend.trending-down { color: #E85A4F; }

.target-range {
    color: #A8B2C7;
}

/* Florence Summary - Fixed formatting */
.florence-summary {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin: 3rem auto 0;
    max-width: 800px;
    padding: 0 2rem;
    opacity: 0;
    transform: translateY(30px);
}

.florence-summary.animate-in {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.florence-summary blockquote {
    flex: 1;
    background: linear-gradient(135deg, rgba(31, 201, 200, 0.15), rgba(74, 222, 128, 0.1));
    border: 1px solid rgba(31, 201, 200, 0.4);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    position: relative;
    font-style: italic;
}

.florence-summary blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--accent-cyan);
    opacity: 0.3;
    font-family: Georgia, serif;
}

/* Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(31, 201, 200, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(31, 201, 200, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 201, 200, 0); }
}

/* Modern Escalation Flow */
.escalation-modern {
    padding: 4rem 0;
}

/* === Records Hub Section === */
.records-hub {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    width: 100%;
}

.records-animation-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 4rem auto;
    aspect-ratio: 1 / 1;
    contain: layout; /* CSS containment for performance */
    min-height: 400px; /* Ensure minimum height */
}

/* ---------- RECORD HUB LAYOUT ---------- */
.hub-wrapper{position:relative;}
.hub-icon{
    position:absolute;
    width:72px;height:72px;
    border-radius:12px;
    background:#0f131a;
    display:flex;align-items:center;justify-content:center;
    opacity:0;                 /* fade‑in later */
    z-index: 2;  /* Ensure icons appear above hub */
}

/* FIXED: Hub line animation with dash */
.hub-line{
    stroke:#19e0ff; 
    stroke-width:1.4; 
    stroke-dasharray:140;
    stroke-dashoffset:140;
    animation: dash 0.8s forwards;
}

@keyframes dash{
    to{stroke-dashoffset:0}
}

.pulse{
    position:absolute;width:10px;height:10px;
    border-radius:50%;background:#19e0ff;
    animation:pulse 1.2s infinite;
}

/* FIXED: Hub icon image constraints - first-paint safe */
.hub-icon img{width:72px;height:72px;object-fit:contain;}

/* Hub Copy Overlay */
#hubCopy {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    white-space: nowrap;
    z-index: 10;
    width: 100%;
}

#hubCopy.fade-in { 
    opacity: 1; 
}

#hubCopy.fade-out { 
    opacity: 0; 
}

/* Central Hub */
.records-hub .hub {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1; /* Ensure hub is visible */
    z-index: 5; /* Above other elements */
}

.records-hub .hub-img {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(31, 201, 200, 0.7));
    transition: all 0.3s ease;
}

.records-hub .hub-img.flash {
    animation: hubFlash 0.6s ease-out;
}

@keyframes hubFlash {
    0% { filter: drop-shadow(0 0 20px rgba(31, 201, 200, 0.7)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 40px rgba(31, 201, 200, 1)); transform: scale(1.1); }
    100% { filter: drop-shadow(0 0 20px rgba(31, 201, 200, 0.7)); transform: scale(1); }
}

.records-hub .counter {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin-top: 1rem;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.records-hub .counter.counting {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(31, 201, 200, 0.5);
}

.records-hub .hub-status {
    font-size: 0.875rem;
    color: var(--accent-cyan);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease;
}

.records-hub .hub-status.visible {
    opacity: 0.8;
    transform: translateY(0);
}

/* SVG Container for lines */
#hubLines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ===== ENHANCED RECORDS HUB ANIMATION STYLES ===== */

/* Copy overlay for synced text */
#syncCopy {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    white-space: nowrap;
    z-index: 10;
}

#syncCopy.fadeIn { 
    opacity: 1; 
}

#syncCopy.fadeOut { 
    opacity: 0; 
    transition: opacity 0.2s ease; 
}

/* Enhanced hub animations */
.records-hub .hub-img.flare {
    animation: hubFlare 0.6s ease-out;
}

/* Pulse line styles */
.pulse-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* Pulse line styles */
.pulse-line {
    stroke: #20e0d9;
    stroke-width: 2;
    fill: none;
    opacity: 0.3;
}

.pulse-blob {
    fill: #20e0d9;
    filter: drop-shadow(0 0 6px rgba(32, 224, 217, 0.8));
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .records-animation-wrapper {
        max-width: 400px;
        aspect-ratio: 1 / 1.2;
    }
    
    .records-hub .sources li {
        width: 60px;
        height: 60px;
        margin: -30px;
    }
    
    .records-hub .hub-img {
        width: 120px;
    }
    
    #syncCopy {
        font-size: 1rem;
        white-space: normal;
        max-width: 280px;
        line-height: 1.4;
    }
}

/* Records Hub Animation Keyframes */
@keyframes fadeInRing {
    from {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(1.3);
    }
    to {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
}

@keyframes converge {
    from {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(0, 0) scale(0.3);
    }
}

/* Compliance Badges */
.compliance-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.compliance-badges .badge {
    padding: 0.5rem 1rem;
    background: rgba(31, 201, 200, 0.1);
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--accent-cyan);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* FIX: Escalation Flow Animation */
.escalation-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.escalation-item {
    text-align: center;
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

.escalation-item:nth-child(1) { animation-delay: 0.2s; }
.escalation-item:nth-child(3) { animation-delay: 0.4s; }
.escalation-item:nth-child(5) { animation-delay: 0.6s; }

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.escalation-icon-wrap {
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

.escalation-connector {
    position: relative;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connector-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    overflow: hidden;
}

.connector-line::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: flowLine 2s ease-in-out infinite;
}

@keyframes flowLine {
    to { left: 100%; }
}

.connector-time {
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--accent-cyan);
    font-weight: 600;
    z-index: 1;
}

/* Single Testimonial */
.testimonial-single {
    padding: 4rem 0;
}

.testimonial-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* CTA Section */
#cta { 
    text-align: center; 
    margin: 120px 0 80px;
}

#cta .btn { 
    margin: 0 12px; 
}

/* Footer */
.footer {
    background: var(--bg-primary) !important;
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 80px);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-primary) !important;
    border-left: 1px solid var(--glass-border);
    padding: 80px 2rem 2rem;
    transition: right 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-menu.open {
    right: 0;
}

/* FIX: Background Canvas Visibility */
#bgStars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8; /* Increased opacity for visibility */
}

#sparks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4; /* Increased opacity for visibility */
}

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

@media (max-width: 1024px) {
    .demo-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .hero-content-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-copy {
        text-align: center;
    }
    
    .hero-copy .sub {
        max-width: 100%;
    }
    
    .metrics {
        justify-content: center;
        gap: 2rem;
    }
    
    .hero-phone-container {
        margin-top: 2rem;
    }
    
    .demo-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .demo-right {
        display: flex;
        justify-content: center;
    }
    
    .qr-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .qr-copy .benefits {
        text-align: left;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-cinematic {
        padding: 2rem 0 2rem !important;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
    }
    
    .iphone-mockup {
        width: 280px;
        height: 560px;
    }
    
    .hero-phone {
        width: 300px;
        height: 600px;
    }
    
    .kpi-row {
        gap: 16px;
    }
    
    .tile {
        min-width: 140px;
        padding: 24px;
    }
    
    .florence-explain-btn {
        width: 90%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-shield {
        width: 180px;
    }
    
    .kpi-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .tile {
        width: 100%;
        max-width: 280px;
    }
    
    .metrics {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .metrics .big {
        font-size: 2.5rem;
    }
}

/* Demo Visual Section - iOS centering */
.demo-visual {
    padding: 4rem 0;
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* iOS-specific viewport fixes */
@supports (-webkit-touch-callout: none) {
    .wrapper {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    main {
        overflow-x: hidden;
        width: 100%;
    }
}

/* Fade utility class */
.fade-out { animation: fade 4s forwards }
@keyframes fade { 0%{opacity:1} 100%{opacity:0} }

/* Hub flash and fade animations */
.hub-img.flash {
    filter: drop-shadow(0 0 8px #19e0ff);
    transition: filter 0.3s;
}

.fade-in {
    animation: fadeIn 0.4s both;
}

.fade-out {
    animation: fadeOut 0.6s 0.3s both;
}

@keyframes fadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
}

@keyframes fadeOut {
    from { opacity: 1 }
    to { opacity: 0 }
}

/* iOS Message Visibility Fixes */
.messages li,
.messages .msg,
#heroChat li,
#heroChat .msg {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Ensure bubble visibility on iOS */
.msg-bubble {
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* ===== NEW SECTIONS CSS ===== */

/* Content Sections Base */
.content-section {
    padding: var(--spacing-xl) 0;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 80px);
}

/* How Florence Helps You Stay Healthy Section */
.health-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.health-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.health-card.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.health-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 20px 40px rgba(31, 201, 200, 0.1);
}

.health-card svg {
    margin-bottom: 1.5rem;
}

.health-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0;
}

.health-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Your Personal Health Advocate Section */
.advocate-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.feature-item.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.feature-item:nth-child(1) { animation-delay: 0s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.4s; }

.feature-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 201, 200, 0.1);
    border-radius: 12px;
}

.feature-item h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0;
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Florence in Your Pocket Section */
.app-banner {
    background: linear-gradient(135deg,
        rgba(31, 201, 200, .08) 0%,
        rgba(74, 222, 128, .08) 100%);
    border: 1px solid rgba(31, 201, 200, .25);
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 3rem);
    margin: var(--spacing-lg) 0;
    overflow: hidden;
    position: relative;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* By adding the section ID, this rule becomes more specific and is guaranteed to apply. */
#instant-ios .app-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.app-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.app-layout {
    display: grid;
    gap: 2rem;
    align-items: center;
}

/* Desktop Layout: GIF left, text right */
@media (min-width: 768px) {
    .app-layout {
        grid-template-columns: auto auto; /* Prevents the text column from over-expanding */
        justify-content: center;       /* Centers the phone and text block together */
        gap: 4rem;                     /* Increases the space between the phone and text */
        text-align: left;
    }
}

/* Mobile Layout: Heading → Text → GIF */
@media (max-width: 767px) {
    .app-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .app-visual {
        order: 2;  /* GIF comes after text on mobile */
    }
    
    .app-text {
        order: 1;  /* Text comes first on mobile */
    }
}

.app-visual img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.app-text p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.app-benefits {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
}

.app-benefits li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.app-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

.app-benefits .alt-channel {
    color: var(--accent-amber);
    font-style: italic;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.store-badges {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.store-badges img {
    height: 50px;
    transition: transform 0.3s ease;
}

.store-badges img:hover {
    transform: scale(1.05);
}

/* From Episodic Care to Continuous Advocacy Section */
.continuous-care-section {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, 
        rgba(31, 201, 200, 0.03) 0%, 
        rgba(74, 222, 128, 0.03) 100%);
}

.continuous-care-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.continuous-advocate-wrapper {
    position: relative;
    margin: 3rem 0;
}

.continuous-care-svg {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
}

/* Orbital pulses - these orbit around the SVG */
.outer-pulse {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent-amber);
    border-radius: 50%;
    opacity: 0.8;
    animation: orbitPulse 8s linear infinite;
    pointer-events: none;
}

.outer-pulse:nth-child(2) { animation-delay: -2s; }
.outer-pulse:nth-child(3) { animation-delay: -4s; }
.outer-pulse:nth-child(4) { animation-delay: -6s; }

@keyframes orbitPulse {
    0% {
        transform: rotate(0deg) translateX(350px) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: rotate(-360deg) translateX(350px) rotate(360deg);
        opacity: 0.8;
    }
}

.care-footer-text {
    margin-top: 2rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mini Records Hub for Visual Demo Section */
/* === PASTE THIS ENTIRE UPDATED BLOCK === */

/* Mini Records Hub for Visual Demo Section */
.mini-records-hub {
    position: relative;
    width: 455px;  /* UPDATED */
    height: 455px; /* UPDATED */
    margin: 0 auto;
}

.mini-hub-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* SVG Container for connection lines */
.hub-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Connection lines styling */
.connection-line {
    stroke: rgba(31, 201, 200, 0.2);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

.connection-line.active {
    stroke: rgba(31, 201, 200, 0.5);
}

/* Central Hub */
.mini-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 156px;  /* UPDATED */
    height: 156px; /* UPDATED */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Breathing glow effect layer */
.hub-glow-layer {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31, 201, 200, 0.4) 0%, transparent 70%);
    animation: breathingGlow 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes breathingGlow {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Hub receives pulse glow */
.hub-glow-layer.pulse-received {
    animation: hubPulseGlow 0.6s ease-out;
}

@keyframes hubPulseGlow {
    0% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.3);
        box-shadow: 0 0 30px rgba(31, 201, 200, 0.8);
    }
    100% { 
        opacity: 0.3;
        transform: scale(1);
    }
}

.mini-hub-img {
    width: 117px;  /* UPDATED */
    height: 117px; /* UPDATED */
    border-radius: 50%;
    object-fit: contain;
    z-index: 2;
}

.mini-hub-img.sphere-logo {
    filter: drop-shadow(0 0 15px rgba(31, 201, 200, 0.5));
}

/* Surrounding Icons - No rotation, just positioned */
/* Find and replace this rule in styles.css */

.mini-hub-icon {
    position: absolute;
    width: 88px;
    height: 88px;
    top: 50%;
    left: 50%;
    /* This translateX value has been increased to move the icons outward */
    transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(198px) rotate(calc(var(--angle) * -1deg)); /* UPDATED from 169px */
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.3s ease;
}

/* Staggered wake-up animation */
.mini-hub-icon.wake-up {
    opacity: 1;
    animation: iconWakeUp 0.6s ease-out;
}

@keyframes iconWakeUp {
    0% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(169px) rotate(calc(var(--angle) * -1deg)) scale(0); /* UPDATED */
    }
    50% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(169px) rotate(calc(var(--angle) * -1deg)) scale(1.2); /* UPDATED */
    }
    100% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(169px) rotate(calc(var(--angle) * -1deg)) scale(1); /* UPDATED */
    }
}

.mini-hub-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(31, 201, 200, 0.3));
    transition: all 0.3s ease;
}

/* Icon pulse animation when sending data */
.mini-hub-icon.sending-pulse img {
    animation: iconPulse 0.6s ease-out;
}

@keyframes iconPulse {
    0% { 
        filter: drop-shadow(0 0 8px rgba(31, 201, 200, 0.3));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(31, 201, 200, 0.9));
        transform: scale(1.1);
    }
    100% { 
        filter: drop-shadow(0 0 8px rgba(31, 201, 200, 0.3));
        transform: scale(1);
    }
}

/* Data pulse that travels along the line */
.data-pulse {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1FC9C8;
    box-shadow: 0 0 10px rgba(31, 201, 200, 0.8);
    z-index: 15;
    pointer-events: none;
}

/* Different pulse colors for variety */
.data-pulse.type-1 {
    background: #1FC9C8;
    box-shadow: 0 0 10px rgba(31, 201, 200, 0.8);
}

.data-pulse.type-2 {
    background: #4ADE80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
}

.data-pulse.type-3 {
    background: #3B82F6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

/* Mobile Responsive Adjustments for New Sections */
@media (max-width: 768px) {
    .health-cards {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .store-badges {
        justify-content: center;
    }
    
    .continuous-care-svg {
        max-width: 100%;
    }
    
    .outer-pulse {
        display: none; /* Hide orbital pulses on mobile for performance */
    }
    
    .mini-records-hub {
        width: 280px;
        height: 280px;
    }
    
    .mini-hub {
        width: 105px;
        height: 105px;
    }
    
    .mini-hub-img {
        width: 75px;
        height: 75px;
    }
    
    .mini-hub-icon {
        width: 60px;
        height: 60px;
        transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(110px) rotate(calc(var(--angle) * -1deg));
    }
}

@media (max-width: 480px) {
    .health-card {
        padding: 1.5rem;
    }
    
    .feature-item {
        padding: 1.5rem;
    }
    
    .app-benefits {
        text-align: left;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .mini-records-hub {
        width: 220px;
        height: 220px;
    }
    
    .mini-hub {
        width: 90px;
        height: 90px;
    }
    
    .mini-hub-img {
        width: 60px;
        height: 60px;
    }
    
    .mini-hub-icon {
        width: 52.5px;
        height: 52.5px;
        transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(90px) rotate(calc(var(--angle) * -1deg));
    }
    
    .hub-glow-layer {
        inset: -22.5px;
    }
}

/* Animation for scroll reveal on new sections */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* FIX 1: Force mini hub UNDER bullets on mobile */
@media (max-width: 968px) {
    .demo-container {
        grid-template-columns: 1fr !important;
    }
    
    .demo-visual .demo-left,
    .demo-visual .demo-right {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .demo-visual .demo-right {
        margin-top: 2rem;
        display: flex;
        justify-content: center;
    }
    
    .mini-records-hub {
        margin: 0 auto;
    }
}

/* FIX 2: Kill ALL rotation on desktop too */
.mini-hub-wrapper {
    animation: none !important;
}

.mini-hub-icon {
    animation: none !important;
}

/* Override any rotation with more specific selectors */
#miniRecordsHub .mini-hub-wrapper {
    animation: none !important;
    transform: none !important;
}

#miniRecordsHub .mini-hub-icon {
    animation: none !important;
    /* Keep icons in their static positions */
    transform: translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(130px) rotate(calc(var(--angle) * -1deg)) !important;
}
/* FIX 1: Force mini hub UNDER bullets on mobile */
@media (max-width: 968px) {
    .demo-container {
        grid-template-columns: 1fr !important;
    }
    
    .demo-visual .demo-left,
    .demo-visual .demo-right {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .demo-visual .demo-right {
        margin-top: 2rem;
        display: flex;
        justify-content: center;
    }
    
    .mini-records-hub {
        margin: 0 auto;
    }
}
/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 8, 14, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #0B0F15;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(31, 201, 200, 0.3);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.video-modal video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
}

.video-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.video-modal-close::before,
.video-modal-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #fff;
}

.video-modal-close::before {
    transform: rotate(45deg);
}

.video-modal-close::after {
    transform: rotate(-45deg);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .video-modal-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
}
/* iOS Chat Fix - Force all messages visible */
@supports (-webkit-touch-callout: none) {
  /* iOS only styles */

  .messages li,
  .messages .msg,
  .msg-bubble {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .typing-indicator,
  .cursor {
    display: none !important;
  }

  .msg.user,
  .msg.patient { /* This is the more specific rule */
    justify-content: flex-end !important;
    display: flex !important;
  }

  .msg.ai,
  .msg.florence { /* This is the more specific rule */
    justify-content: flex-start !important;
    display: flex !important;
  }
}
/* === FINAL STYLES FOR CMS UPDATE (AUG 2025) === */

/* Modifier class for the new text-based CMS badge */
.badge.badge--cms {
    color: #A8B2C7;
    background: rgba(107, 119, 140, 0.1);
    border-color: rgba(107, 119, 140, 0.2);
}

/* Styles for the press release on news.html */
.press-release {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}
.press-release h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}
.press-release h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
}
.press-release p, .press-release li {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.press-release .release-meta {
    color: #A8B2C7;
    margin-bottom: 2rem;
}
.press-release blockquote {
    margin: 3rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid #1FC9C8;
    background: #0B0F15;
    font-size: 1.2rem;
    font-style: italic;
}

/* Styles for the embedded video wrapper */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  margin: 2rem 0;
  overflow: hidden;
  border-radius: 8px;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Styles for the CMS Certificate figure */
.cms-certificate {
  margin: 4rem auto 2rem;
  text-align: center;
  max-width: 455px;
  scroll-margin-top: 120px; /* Prevents nav bar from covering it */
}
.cms-certificate img {
  max-width: 100%;
  height: auto;
  border: 4px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
}
.cms-certificate figcaption {
  font-size: .85rem;
  margin-top: 1rem;
  color: rgba(255, 255, 255, .75);
  line-height: 1.5;
}

/* Style for the QR footnote, moved from inline */
.qr-footnote {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #A8B2C7;
    text-align: left;
}
/* === FINAL POLISH & LAYOUT REFINEMENTS (AUG 2025) === */

/* 1. Hero Section Refinements */
.hero-copy {
    max-width: 42rem; /* Wider to prevent line wrapping */
    flex-basis: 550px; /* Give text more space */
}

.hero-copy h1.h1--subdued {
    font-size: clamp(1.5rem, 3vw, 2rem); /* Smaller font size */
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* 2. New CTA Bar below Hero */
.cta-bar {
    padding: 3rem 0 2rem;
    text-align: center;
    width: 100%;
}

/* 3. Certificate Resizing */
.cms-certificate {
    max-width: 455px; /* 30% smaller than 650px */
}

/* 4. New Security Info Section */
.security-info {
    text-align: center;
    padding: 4rem 0;
    max-width: 600px;
    margin: 0 auto;
    border-top: 1px solid var(--glass-border);
}

.security-info h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

/* 5. QR Code Security Visual */
.qr-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}
.qr-security img {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* 6. "Florence in your Pocket" Section Refinements */
.app-text {
    max-width: 55ch; /* Constrains line length to force wrapping */
}

.store-badges img {
    height: 80px; /* Significantly larger */
    width: auto;
}
.pathways-section { padding: 6rem 2rem; background: radial-gradient(circle at 50% 100%, rgba(0,229,255,.03), transparent); }
.pathways-explainer {
  max-width: 880px; margin: 2rem auto 0; padding: 2rem;
  background: linear-gradient(180deg, rgba(12,18,28,.7), rgba(12,18,28,.4));
  border: 1px solid var(--medical-cyan); border-radius: 12px;
}
.pathways-explainer h3 { color: var(--medical-cyan); margin: 0 0 1rem; font-size: 1.25rem; }
.pathways-explainer p { color: var(--text-secondary); line-height: 1.8; margin: 0 0 1rem; }

.pathways-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 1rem; margin-top: 2.5rem; }
.pathway-card {
  display: grid; place-items: center; gap: .5rem; padding: 1.25rem;
  background: rgba(15,20,32,.6); border: 1px solid var(--glass-border); border-radius: 14px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  will-change: transform;
}
.pathway-card .pathway-icon { font-size: 1.6rem; filter: drop-shadow(0 0 6px rgba(31,201,200,.4)); }
.pathway-card .pathway-name { font-weight: 600; color: var(--text-primary); }

.pathway-card:hover { transform: translateY(-4px) scale(1.02); border-color: var(--medical-cyan); box-shadow: 0 10px 30px rgba(0,229,255,.08); }
.pathway-card.featured { border-color: var(--medical-cyan); animation: glowPulse 3s ease-in-out infinite; }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 rgba(0,229,255,0); } 50% { box-shadow: 0 0 16px rgba(0,229,255,.15); } }