/* * PROJECT: Demo Law Firm - Ultra Premium UI
 * DESIGN SYSTEM: 
 * - Fonts: System Serif (Headings) / System Sans (Body)
 * - Colors: Navy (#0f172a), Gold (#d4af37), White (#f8fafc)
 * - Feel: Luxurious, Spacious, Glassmorphism
 */

:root {
    /* Color Palette */
    --color-bg: #f8fafc;
    --color-bg-alt: #e2e8f0;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-primary: #0f172a; /* Deep Navy */
    --color-accent: #d4af37; /* Metallic Gold */
    --color-accent-hover: #b59226;
    --color-border: rgba(15, 23, 42, 0.1);
    --color-glass: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-heading: "Didot", "Bodoni MT", "Playfair Display", "Times New Roman", serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.3s ease;
}

[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-primary: #f8fafc;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-glass: rgba(15, 23, 42, 0.85);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: --font-body;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
}

/* Noise Overlay for Texture */
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }
p { margin-bottom: 1.5rem; max-width: 65ch; }
.gold-text { color: var(--color-accent); }
.text-center { text-align: center; }
.subtitle { 
    text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.85rem; 
    color: var(--color-accent); font-weight: 600; margin-bottom: 1rem; display: block;
}

/* --- UTILITIES --- */
.container { width: 90%; max-width: var(--container-width); margin: 0 auto; padding: 0 1rem; }
.section { padding: 6rem 0; position: relative; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* --- BUTTONS --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 2.5rem; font-size: 0.9rem; text-transform: uppercase;
    letter-spacing: 0.1em; font-weight: 600; cursor: pointer;
    transition: all var(--transition-fast); text-decoration: none;
    border: 1px solid transparent; position: relative; overflow: hidden;
    z-index: 1;
}
.btn-primary { background: var(--color-accent); color: #000; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3); }
.btn-outline { border-color: currentColor; color: currentColor; background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--color-accent); color: var(--color-accent); }

/* --- NAVIGATION --- */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height);
    z-index: 100; transition: all 0.4s ease;
    display: flex; align-items: center; border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    background: var(--color-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--color-border);
    height: 70px;
}
.nav-container {
    display: flex; justify-content: space-between; align-items: center;
    width: 90%; max-width: var(--container-width); margin: 0 auto;
}
.logo {
    font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
    color: var(--color-text); text-decoration: none; letter-spacing: -0.03em;
    display: flex; align-items: center; gap: 0.5rem;
}
.logo span { color: var(--color-accent); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-link {
    color: var(--color-text); text-decoration: none; font-size: 0.9rem;
    font-weight: 500; position: relative; opacity: 0.8; transition: opacity 0.3s;
}
.nav-link:hover, .nav-link.active { opacity: 1; color: var(--color-accent); }
.nav-link::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 1px;
    background: var(--color-accent); transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* Mobile Menu */
.hamburger { display: none; cursor: pointer; background: none; border: none; color: var(--color-text); font-size: 1.5rem; z-index: 102; }
.mobile-menu {
    position: fixed; top: 0; right: 0; width: 100%; height: 100vh;
    background: var(--color-bg); z-index: 101;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 2rem; transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu a { font-family: var(--font-heading); font-size: 2rem; color: var(--color-text); text-decoration: none; }

/* Theme Toggle */
.theme-toggle { background: none; border: none; cursor: pointer; color: var(--color-text); font-size: 1.2rem; margin-left: 2rem; transition: transform 0.3s; }
.theme-toggle:hover { transform: rotate(15deg); color: var(--color-accent); }

/* --- HERO SECTION --- */
.hero {
    height: 100vh; min-height: 700px; display: flex; align-items: center;
    position: relative; overflow: hidden; padding-top: var(--header-height);
}
/* Abstract CSS Background */
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(circle at 15% 50%, #1e293b 0%, #0f172a 100%);
}
[data-theme="light"] .hero-bg {
    background: radial-gradient(circle at 15% 50%, #f1f5f9 0%, #cbd5e1 100%);
}
.hero-shape {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.6;
    animation: drift 20s infinite alternate;
}
.shape-1 { top: -10%; right: -10%; width: 50vw; height: 50vw; background: var(--color-accent); opacity: 0.15; }
.shape-2 { bottom: -10%; left: -10%; width: 40vw; height: 40vw; background: #64748b; opacity: 0.1; }

.hero-content { position: relative; z-index: 2; max-width: 800px; }
.hero-cta-group { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* --- STATS COUNTERS --- */
.stats-section { background: var(--color-bg-alt); padding: 4rem 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.stat-item { text-align: center; }
.stat-number { font-family: var(--font-heading); font-size: 3.5rem; color: var(--color-accent); display: block; line-height: 1; margin-bottom: 0.5rem; }
.stat-label { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); }

/* --- CARDS (Practice & Team) --- */
.card {
    background: var(--color-bg); border: 1px solid var(--color-border);
    padding: 2.5rem; transition: all 0.4s ease; position: relative;
    overflow: hidden; height: 100%; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }
.card-icon { width: 50px; height: 50px; fill: var(--color-accent); margin-bottom: 1.5rem; }
.card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.card-link { margin-top: auto; color: var(--color-accent); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; }
.card-link::after { content: '→'; transition: transform 0.3s; }
.card-link:hover::after { transform: translateX(5px); }

/* --- ACCORDION (Practice Areas) --- */
.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-header {
    width: 100%; text-align: left; background: none; border: none;
    padding: 2rem 0; cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; font-size: 1.5rem; font-family: var(--font-heading);
    color: var(--color-text); transition: color 0.3s;
}
.accordion-header:hover { color: var(--color-accent); }
.accordion-content {
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out;
    padding-right: 2rem;
}
.accordion-content p { padding-bottom: 2rem; color: var(--color-text-muted); }
.accordion-icon { transition: transform 0.3s; color: var(--color-accent); }
.accordion-item.active .accordion-icon { transform: rotate(45deg); }
.accordion-item.active .accordion-content { max-height: 500px; }

/* --- CONTACT FORM --- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.form-group { position: relative; margin-bottom: 2rem; }
.form-input, .form-textarea {
    width: 100%; padding: 1rem 0; background: transparent; border: none;
    border-bottom: 1px solid var(--color-border); color: var(--color-text);
    font-size: 1rem; transition: border-color 0.3s; border-radius: 0;
}
.form-input:focus, .form-textarea:focus { outline: none; border-bottom-color: var(--color-accent); }
.form-label {
    position: absolute; top: 1rem; left: 0; color: var(--color-text-muted);
    pointer-events: none; transition: all 0.3s ease;
}
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label,
.form-textarea:focus + .form-label,
.form-textarea:not(:placeholder-shown) + .form-label {
    top: -10px; font-size: 0.75rem; color: var(--color-accent);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* --- FOOTER --- */
.footer { background: #050911; color: #fff; padding: 5rem 0 2rem; position: relative; }
[data-theme="light"] .footer { background: #0f172a; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 4rem; }
.footer h4 { color: var(--color-accent); margin-bottom: 1.5rem; font-size: 1.1rem; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 0.8rem; }
.footer a { color: #94a3b8; text-decoration: none; transition: color 0.3s; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; display: flex; justify-content: space-between; color: #64748b; font-size: 0.85rem; }

/* --- ANIMATIONS --- */
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(30px, -30px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Scroll Progress */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--color-accent); width: 0%; z-index: 1000; }

/* Scroll Top */
.scroll-top {
    position: fixed; bottom: 2rem; right: 2rem; width: 50px; height: 50px;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s;
    color: var(--color-accent); box-shadow: var(--shadow-sm); z-index: 90;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--color-accent); color: #000; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .hamburger { display: block; }
    .contact-layout { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* --- EXIT DEMO BUTTON --- */
.exit-demo-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #ff4b4b; /* Clean Red */
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-family: sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(255, 75, 75, 0.3);
    z-index: 9999; /* Higher than all other elements */
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exit-demo-btn:hover {
    background-color: #e03a3a;
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(255, 75, 75, 0.4);
    color: white; /* Keeps text white on hover */
}