/* 
   SafeHaven Design System 
   Aesthetic: Warm Modernism / Accessible Luxury
*/

:root {
    /* Color Palette */
    --color-bg: #F9F7F2;
    /* Warm cream background - simpler on eyes than white */
    --color-surface: #FFFFFF;
    --color-primary: #0F4C5C;
    /* Deep Teal - Trust, calm */
    --color-primary-dark: #09333E;
    --color-accent: #E36414;
    /* Warm Amber - Attention, action */
    --color-accent-hover: #C2500B;
    --color-text-main: #2D3142;
    /* Soft Black - High contrast but not harsh */
    --color-text-muted: #6B7086;
    --color-border: #E8E6DF;

    /* Feature specific colors */
    --color-voice: #9B5DE5;
    --color-fall: #F15BB5;
    --color-meds: #00BBF9;
    --color-lock: #00F5D4;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Public Sans', sans-serif;

    /* Spacing & Layout */
    --container-width: 1200px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Shadows - Soft and diffused */
    --shadow-soft: 0 10px 40px -10px rgba(45, 49, 66, 0.08);
    --shadow-hover: 0 20px 60px -15px rgba(45, 49, 66, 0.15);

    /* Measurements */
    --nav-height: 80px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 18px;
    /* Increased base size for seniors */
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    font-weight: 800;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), #2a9d8f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    /* Larger touch targets */
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
    box-shadow: 0 4px 15px rgba(227, 100, 20, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
}

.btn-secondary {
    background-color: rgba(15, 76, 92, 0.1);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: rgba(15, 76, 92, 0.2);
}

.dot {
    color: var(--color-accent);
}

/* Navbar */
.navbar {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(249, 247, 242, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--color-text-main);
    font-size: 1.1rem;
}

.nav-links a:hover {
    color: var(--color-primary);
}

/* Hero Section */
.hero {
    padding-top: calc(var(--nav-height) + 4rem);
    padding-bottom: 6rem;
    position: relative;
    overflow: hidden;
}

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

.badge {
    display: inline-block;
    background: rgba(15, 76, 92, 0.1);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero h1 {
    font-size: 4.5rem;
    /* Massive heading for impact and readability */
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--color-text-main);
}

.hero p {
    font-size: 1.35rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-image-wrapper {
    position: relative;
    height: 600px;
}

/* Abstract stylized background for the "image" side */
.hero-image-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-image: url('hero-senior.png');
    background-size: cover;
    background-position: center;
    border-radius: 40px;
    z-index: -1;
    overflow: hidden;
}

.hero-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    position: absolute;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-card strong {
    display: block;
    color: var(--color-text-main);
    font-size: 1.1rem;
}

.hero-card span {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.icon-box.success {
    background: #2a9d8f;
}

.icon-box.alert {
    background: #E76F51;
}

/* Positioning cards floating */
.hero-card:nth-child(2) {
    /* System Active */
    top: 20%;
    right: -20px;
    z-index: 2;
}

.hero-card:nth-child(3) {
    /* Heart Rate */
    bottom: 20%;
    left: -20px;
    z-index: 3;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.float-animation-delayed {
    animation: float 7s ease-in-out infinite;
    animation-delay: 1s;
}

/* Features Section */
.features {
    padding: 8rem 0;
    background-color: #FFFFFF;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 5rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-main);
}

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

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    /* slightly wider cards */
    gap: 2.5rem;
}

.feature-card {
    background: var(--color-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    background: white;
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-border);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.feature-icon i {
    width: 32px;
    height: 32px;
}

.icon-voice {
    color: var(--color-voice);
}

.icon-fall {
    color: var(--color-fall);
}

.icon-meds {
    color: var(--color-meds);
}

.icon-lock {
    color: var(--color-lock);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    /* Space for link */
    flex-grow: 1;
    /* Push link to bottom */
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: auto;
}

.card-link i {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.card-link:hover i {
    transform: translateX(4px);
}

/* Highlight Section (Why It Matters) */
.highlight-section {
    padding: 8rem 0;
}

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

.highlight-content h2 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: var(--color-text-main);
}

.highlight-content p {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
}

.checklist {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
}

.check-item i {
    color: var(--color-accent);
}

.highlight-card {
    background: white;
    /* Contrast against the bg */
    border: 1px solid var(--color-border);
}

/* Trust Section */
.trust-section {
    background: #09333E;
    /* Dark elegant background */
    padding: 6rem 0;
    color: white;
}

.trust-content {
    text-align: center;
}

.trust-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.trust-item i {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
}


/* Footer (Simple but clean) */
.footer {
    background: var(--color-text-main);
    color: white;
    padding: 5rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-col h4 {
    color: #8D99AE;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.footer-col p {
    color: #8D99AE;
    max-width: 300px;
}

.footer-col a {
    display: block;
    color: white;
    margin-bottom: 0.8rem;
    opacity: 0.8;
}

.footer-col a:hover {
    opacity: 1;
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    color: #8D99AE;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

/* Media Queries */
@media (max-width: 968px) {

    .hero-container,
    .highlight-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-image-wrapper {
        height: 400px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .trust-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .nav-links.desktop-only {
        display: none;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .trust-grid {
        grid-template-columns: 1fr;
    }

    .hamburger-btn {
        display: block;
    }
}

/* NEW Header Styles */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.hamburger-btn {
    display: none;
    /* hidden on desktop default, shown in media query */
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-btn i {
    width: 32px;
    height: 32px;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    /* flex but hidden via transform */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-main);
}

@media (max-width: 968px) {
    .nav-links.desktop-only {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }
}