/* 
 * Birchview Capital Website Styles
 * Following the June 2025 deck style guide specifications:
 * - Responsive design with WCAG 2.1 AA accessibility
 * - Top-right hamburger navigation with right-side drawer
 * - Modern sans (Inter) for UI + refined serif (Crimson Text) for headings
 * - Typography: 16-20px body text, 36-48px H1 headings
 * - Ample whitespace for clean, minimalist aesthetic
 */

/* CSS Custom Properties for Brand Colors - June 2025 Deck Style */
:root {
    --brand-bg: #ffffff;        /* clean white background from presentation deck */
    --brand-fg: #1a1a1a;        /* dark text on white background for readability */
    --brand-head: #111827;      /* dark heading text for strong hierarchy */
    --brand-muted: #6b7280;     /* muted copy - matching logo "CAPITAL" gray */
    --brand-accent: #3b82f6;    /* accent - bright blue from "BIRCHVIEW" in logo */
    --surface: #f8fafc;         /* light surface */
    --border: #e5e7eb;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Crimson Text', Georgia, serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Layout */
    --max-width: 1200px;
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--brand-fg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Homepage with video background */
.home-page {
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
    height: 100vh;
}

/* Video Container */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Video Background for Homepage */
.video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    background-size: cover;
}

/* When video fails to load, show the molecular background */
.home-page.video-failed {
    background: url('../images/molecular-bg.jpg') center/cover no-repeat fixed;
}

/* Static background for other pages */
body:not(.home-page) {
    background: white;
    color: #212529;
}

.main-container {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Only lock height and disable scrolling on homepage */
.home-page .main-container {
    height: 100vh;
    overflow: hidden;
}

/* Responsive body font sizing: 16-20px */
@media (min-width: 768px) {
    body {
        font-size: 1.125rem; /* 18px */
    }
}

@media (min-width: 1024px) {
    body {
        font-size: 1.25rem; /* 20px */
    }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--brand-head);
    margin-bottom: var(--space-md);
}

/* Override heading colors for non-homepage pages */
body:not(.home-page) h1,
body:not(.home-page) h2,
body:not(.home-page) h3,
body:not(.home-page) h4,
body:not(.home-page) h5,
body:not(.home-page) h6 {
    color: #212529;
}

h1 {
    font-size: clamp(2.25rem, 4vw, 3rem); /* 36-48px range as specified */
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

h3 {
    font-size: clamp(1.5rem, 2.5vw, 1.875rem);
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--brand-accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover,
a:focus {
    text-decoration: underline;
    outline: none;
}

a:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

/* Layout */
.container {
    width: 100%;
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

.main {
    min-height: 100vh;
    padding-top: 80px;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 2px 20px rgba(59, 130, 246, 0.1);
    z-index: 1000;
}

/* Transparent navigation for homepage */
.home-page .nav {
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
}

/* Remove shadow for non-homepage pages */
body:not(.home-page) .nav {
    box-shadow: none;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    width: 100%;
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .nav-container {
        padding: 0 var(--space-lg);
    }
}

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

.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-xs);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-toggle:hover {
    background-color: var(--surface);
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

.hamburger {
    width: 24px;
    height: 2px;
    background-color: var(--brand-head);
    transition: var(--transition);
}

/* White hamburger menu on homepage */
.home-page .hamburger {
    background-color: #ffffff;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Navigation Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition);
}

.nav-drawer[aria-hidden="false"] {
    pointer-events: all;
    opacity: 1;
}

.nav-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.nav-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 80vw;
    background: white;
    transform: translateX(100%);
    transition: var(--transition);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
}

.nav-drawer[aria-hidden="false"] .nav-drawer-content {
    transform: translateX(0);
}

.nav-drawer-close {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--brand-head);
}

.nav-drawer-close:hover {
    background-color: var(--surface);
}

.nav-drawer-close:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

.nav-drawer-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.nav-drawer-menu a {
    display: block;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--brand-head);
    padding: var(--space-sm);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-family: Futura, 'Futura PT', 'Century Gothic', 'Apple Gothic', 'Avenir Next', Avenir, -apple-system, sans-serif;
}

.nav-drawer-menu a:hover,
.nav-drawer-menu a[aria-current="page"] {
    background-color: var(--surface);
    color: var(--brand-accent);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: color-mix(in srgb, var(--brand-accent) 80%, black);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

/* Hero Section */
.hero {
    padding: var(--space-3xl) var(--space-lg);
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
}

/* Homepage hero locked to exact height */
.home-page .hero {
    height: calc(100vh - 80px);
    overflow: hidden;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: Futura, 'Futura PT', 'Century Gothic', 'Apple Gothic', 'Avenir Next', Avenir, -apple-system, sans-serif;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.hero-subhead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: white;
    margin-bottom: var(--space-xl);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-cta {
    display: flex;
    justify-content: flex-start;
}

/* Features Section */
.features {
    padding: var(--space-3xl) 0;
    background: rgba(200, 200, 200, 0.35);
    backdrop-filter: blur(8px);
}

.features-grid {
    display: grid;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2xl);
    }
}

.feature-card {
    padding: var(--space-lg);
    background: rgba(200, 200, 200, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.feature-card h3 {
    margin-bottom: var(--space-sm);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.feature-card p {
    margin: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Context Section */
.context {
    background-color: var(--surface);
    padding: var(--space-2xl) 0;
}

.context-content {
    text-align: center;
    width: 100%;
}

.context-text {
    font-size: 1.125rem;
    color: var(--brand-muted);
    margin-bottom: var(--space-md);
}

.context-note {
    margin: 0;
    font-size: 0.9rem;
}

/* Page Header */
.page-header {
    padding: var(--space-2xl) 0 var(--space-xl);
    text-align: center;
}

.page-title {
    margin-bottom: 0;
}

/* Homepage page title */
.home-page .page-title {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Other pages page title */
body:not(.home-page) .page-title {
    color: #2475f8;
    text-shadow: none;
    font-family: Futura, 'Futura PT', 'Century Gothic', 'Apple Gothic', 'Avenir Next', Avenir, -apple-system, sans-serif;
    font-weight: 700;
}

/* Content Sections */
.content-section {
    padding: var(--space-2xl) 0;
}

.home-page .content-section p,
.home-page .content-section li {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body:not(.home-page) .content-section p,
body:not(.home-page) .content-section li {
    color: #212529;
    text-shadow: none;
}

/* Remove alternating backgrounds - clean design */

.content-grid {
    width: 100%;
}

.intro-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.section-title {
    margin-bottom: var(--space-lg);
}

.home-page .section-title {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body:not(.home-page) .section-title {
    color: #212529;
    text-shadow: none;
}

.principles-list,
.ai-list {
    list-style: none;
    margin-bottom: var(--space-lg);
}

.principles-list li,
.ai-list li {
    margin-bottom: var(--space-md);
    padding-left: var(--space-md);
    position: relative;
}

.principles-list li::before,
.ai-list li::before {
    content: '•';
    color: var(--brand-accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.ai-grid {
    display: grid;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .ai-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }
}

.market-context {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #212529;
    text-shadow: none;
}

/* Team Section */
.team-section {
    padding: var(--space-2xl) 0;
}

.team-category {
    margin-bottom: var(--space-3xl);
}

.team-category:last-child {
    margin-bottom: 0;
}

.team-category-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: var(--space-md);
}

.team-divider {
    border: none;
    border-top: 2px solid #212529;
    margin-bottom: var(--space-xl);
}

.team-grid {
    display: grid;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl);
    }
}

@media (min-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.team-card {
    background: #4a4a4a;
    border-radius: var(--border-radius);
    padding: var(--space-2xl);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.team-card:hover {
    background: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.team-card-content {
    text-align: center;
}

.team-name {
    color: white !important;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.team-title {
    color: white !important;
    font-weight: 400;
    font-size: 1.1rem;
    margin: 0;
}

/* Bio Modal */
.bio-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
}

.bio-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.bio-modal-content {
    background: white;
    padding: var(--space-2xl);
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.bio-modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--brand-muted);
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.bio-modal-close:hover {
    color: var(--brand-primary);
}

.bio-modal-content h2 {
    margin-top: 0;
    color: var(--brand-primary);
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.bio-modal-title {
    color: var(--brand-accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
}

.bio-modal-text {
    color: var(--brand-muted);
    line-height: 1.7;
    font-size: 1rem;
}

/* Contact Section */
.contact-section {
    padding: var(--space-2xl) 0;
}

.contact-info {
    margin-bottom: var(--space-3xl);
    text-align: center;
}

.contact-message {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #212529;
    text-shadow: none;
    margin: 0;
}

.contact-message a {
    color: #2475f8;
    text-decoration: underline;
    font-weight: 700;
}

.contact-cards {
    display: grid;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .contact-cards {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }
}

.contact-card {
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.contact-card h3 {
    margin-bottom: var(--space-sm);
    color: var(--brand-head);
}

.contact-title {
    color: #212529;
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
    text-shadow: none;
}

.locations-section {
    margin-bottom: var(--space-3xl);
}

.locations-grid {
    display: grid;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .locations-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }
}

.location-item h4 {
    margin-bottom: var(--space-md);
    color: #212529;
    text-shadow: none;
}

.map-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-container iframe {
    display: block;
    filter: grayscale(20%);
    transition: var(--transition);
}

.map-container:hover iframe {
    filter: grayscale(0%);
}

/* Contact Form */
.contact-form-section {
    width: 100%;
}

.contact-form {
    display: grid;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-weight: 500;
    color: var(--brand-head);
}

.form-input,
.form-textarea {
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    min-height: 44px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 2px rgba(14, 165, 163, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background-color: var(--brand-bg);
    color: var(--brand-fg);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: auto;
}

.footer-content {
    display: grid;
    gap: var(--space-lg);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr auto;
        text-align: left;
        align-items: center;
        gap: var(--space-2xl);
    }
}

.footer-legal p {
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
    color: var(--brand-muted);
}

.footer-legal p:last-child {
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
}

@media (min-width: 768px) {
    .footer-links {
        justify-content: flex-end;
    }
}

.footer-links a {
    color: var(--brand-fg);
    font-size: 0.9rem;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.feature-card,
.team-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --brand-muted: #333;
    }
}

/* Focus styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .nav,
    .nav-drawer,
    .footer {
        display: none;
    }
    
    .main {
        padding-top: 0;
    }
    
    .hero {
        background: white;
        color: black;
    }
}
