/* ============================================================
   CHIRICA LAW TOOLS — Landing Page Design System
   Premium Legal Tools Portal v2.0
   ============================================================ */

/* --- Design Tokens --- */
:root {
    /* Color Palette */
    --primary-navy: #1d3242;
    --primary-navy-light: #2a4b6a;
    --primary-navy-dark: #102230;
    --primary-navy-darker: #0a1520;

    --accent-red: #dc2015;
    --accent-red-hover: #b01810;
    --accent-red-light: #ff4d5a;
    --accent-red-glow: rgba(220, 32, 21, 0.15);

    --success-green: #06d6a0;
    --warning-amber: #ffd60a;
    --info-blue: #0077b6;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Typography */
    --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;

    /* Fluid Type Scale */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);
    --text-5xl: clamp(3rem, 2.25rem + 3.75vw, 4rem);
    --text-6xl: clamp(3.75rem, 2.75rem + 5vw, 5.5rem);

    /* Weights */
    --weight-light: 300;
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    --weight-black: 900;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 24px 64px rgba(0, 0, 0, 0.14), 0 8px 16px rgba(0, 0, 0, 0.08);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index */
    --z-base: 0;
    --z-sticky: 1100;
    --z-fixed: 1200;

    /* Layout */
    --max-width: 1200px;
    --max-width-narrow: 800px;
}


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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 150ms ease-in;
}

body.loaded {
    opacity: 1;
}

::selection {
    background: rgba(220, 32, 21, 0.15);
    color: var(--primary-navy);
}

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

a:hover {
    color: var(--accent-red-hover);
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}


/* --- Focus & Accessibility --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--accent-red);
    color: var(--white);
    font-weight: var(--weight-semibold);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
    color: var(--white);
}

:focus-visible {
    outline: 3px solid var(--accent-red);
    outline-offset: 3px;
}

.keyboard-nav :focus:not(:focus-visible) {
    outline: none;
}


/* --- Top Bar --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    padding: var(--space-3) var(--space-6);
    background: transparent;
    transition: background-color 400ms ease, box-shadow 400ms ease, padding 400ms ease;
}

.top-bar.scrolled {
    background: rgba(10, 21, 32, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: var(--space-2) var(--space-6);
}

.top-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-brand {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
    transition: color var(--transition-fast);
}

.top-bar-brand:hover {
    color: #ffffff;
}

.top-bar-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.top-bar-link {
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.02em;
    transition: color var(--transition-fast);
}

.top-bar-link:hover {
    color: #ffffff;
}

.top-bar-portal {
    padding: var(--space-2) var(--space-5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 22.5px;
    transition: all var(--transition-fast);
}

.top-bar-portal:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
}


/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--primary-navy) url('books.webp') center / cover no-repeat;
    color: var(--white);
    text-align: center;
    padding: var(--space-8) var(--space-6);
}

/* Geometric pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            transparent 24%,
            rgba(255, 255, 255, 0.018) 25%,
            rgba(255, 255, 255, 0.018) 26%,
            transparent 27%,
            transparent 74%,
            rgba(255, 255, 255, 0.018) 75%,
            rgba(255, 255, 255, 0.018) 76%,
            transparent 77%),
        linear-gradient(45deg,
            transparent 24%,
            rgba(255, 255, 255, 0.018) 25%,
            rgba(255, 255, 255, 0.018) 26%,
            transparent 27%,
            transparent 74%,
            rgba(255, 255, 255, 0.018) 75%,
            rgba(255, 255, 255, 0.018) 76%,
            transparent 77%);
    background-size: 60px 60px;
    animation: patternDrift 120s linear infinite;
    z-index: 0;
    pointer-events: none;
}

/* Color + gradient overlay on top of background image */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(220, 32, 21, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(42, 75, 106, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, rgba(29, 50, 66, 0.82) 0%, rgba(10, 21, 32, 0.92) 100%);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 100%;
}

.hero-overline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.7rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: var(--space-4);
    opacity: 0;
    animation: heroReveal 600ms var(--ease-out-expo) 250ms forwards;
}

.hero-overline::before,
.hero-overline::after {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent-red);
    opacity: 0.7;
}

.hero-logo {
    width: 500px;
    height: auto;
    margin: 0 auto var(--space-12);
    opacity: 0;
    animation: logoReveal 800ms var(--ease-out-expo) 100ms forwards;
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.35)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.hero-heading {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: var(--weight-black);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-6);
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    opacity: 0;
    animation: heroReveal 700ms var(--ease-out-expo) 300ms forwards;
    position: relative;
    padding-bottom: var(--space-5);
}

.hero-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    width: 120px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
    animation: accentLineReveal 600ms var(--ease-out-expo) 800ms forwards;
}

.hero-subheading {
    font-size: var(--text-xl);
    font-weight: var(--weight-normal);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-width: 640px;
    margin: 0 auto var(--space-8);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: heroReveal 600ms var(--ease-out-expo) 500ms forwards;
}

.hero-tagline {
    font-size: var(--text-sm);
    font-weight: var(--weight-light);
    color: rgba(255, 255, 255, 0.5);
    max-width: 580px;
    margin: 0 auto;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: heroReveal 600ms var(--ease-out-expo) 650ms forwards;
}

.hero-disclaimer {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: #ffffff;
    background: var(--accent-red);
    width: fit-content;
    margin: var(--space-8) auto 0;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-md);
    line-height: 1.6;
    text-align: center;
    opacity: 0;
    animation: heroReveal 600ms var(--ease-out-expo) 800ms forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    opacity: 0;
    animation: heroReveal 500ms var(--ease-out-expo) 900ms forwards;
}

.scroll-indicator svg {
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.5);
    animation: scrollBob 2.4s ease-in-out infinite;
}


/* --- Tools Section --- */
.tools-section {
    padding: var(--space-32) var(--space-6);
    background: var(--primary-navy) url('tools-bg.webp') center / cover no-repeat;
    position: relative;
    overflow: hidden;
}

/* Geometric pattern overlay */
.tools-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.015) 40px,
            rgba(255, 255, 255, 0.015) 41px
        );
    pointer-events: none;
    z-index: 0;
}

/* Gradient overlay */
.tools-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(120, 20, 15, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(120, 20, 15, 0.08) 0%, transparent 60%),
        linear-gradient(135deg, rgba(70, 15, 10, 0.9) 0%, rgba(45, 10, 8, 0.94) 50%, rgba(10, 21, 32, 0.92) 100%);
    pointer-events: none;
    z-index: 0;
}

.tools-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tools-section .section-overline {
    color: var(--accent-red-light);
}

.tools-section .section-overline::before {
    background: var(--accent-red-light);
}

.tools-section .section-heading {
    color: var(--white);
}

.tools-section .section-description {
    color: rgba(255, 255, 255, 0.7);
}

.section-overline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: var(--space-3);
}

.section-overline::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--accent-red);
    border-radius: 1px;
}

.section-heading {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: var(--weight-extrabold);
    color: var(--primary-navy);
    line-height: 1.15;
    margin-bottom: var(--space-4);
}

.section-description {
    font-size: var(--text-lg);
    color: var(--gray-600);
    max-width: var(--max-width-narrow);
    line-height: 1.6;
    margin-bottom: var(--space-16);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
}


/* --- Tool Cards --- */
.tool-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-card);
    transition:
        transform 400ms var(--ease-out-expo),
        box-shadow 400ms var(--ease-out-expo),
        border-color 400ms var(--ease-out-expo);
    overflow: hidden;
    contain: content;
    /* Scroll reveal initial state */
    opacity: 0;
    transform: translateY(40px) scale(0.98);
}

/* Gradient accent bar at top — animated */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-red) 0%, var(--primary-navy) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 500ms var(--ease-out-expo);
}

/* Subtle corner glow on hover */
.tool-card::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(220, 32, 21, 0.06) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 500ms var(--ease-out-expo);
    pointer-events: none;
}

.tool-card:hover {
    transform: translateY(-10px) scale(1.005);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--gray-300);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-card.revealed {
    animation: cardReveal 700ms var(--ease-out-expo) forwards;
}

.tool-card.revealed:nth-child(2) {
    animation-delay: 150ms;
}

/* Card image with title overlay */
.card-image {
    position: relative;
    margin: calc(var(--space-10) * -1) calc(var(--space-10) * -1) var(--space-6) calc(var(--space-10) * -1);
    overflow: hidden;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    max-height: 220px;
}

.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(10, 21, 32, 0.85) 0%, rgba(10, 21, 32, 0.4) 50%, transparent 100%);
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 600ms var(--ease-out-expo);
}

.tool-card:hover .card-image img {
    transform: scale(1.05);
}

.card-title {
    position: absolute;
    bottom: var(--space-5);
    left: var(--space-6);
    right: var(--space-6);
    z-index: 1;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-extrabold);
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Card number watermark on image */
.tool-card[data-number] .card-image::before {
    content: attr(data-number);
    position: absolute;
    top: var(--space-4);
    right: var(--space-5);
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: var(--weight-normal);
    color: rgba(255, 255, 255, 0.12);
    line-height: 1;
    z-index: 1;
    pointer-events: none;
}

.card-description {
    font-size: var(--text-base);
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

.card-features {
    list-style: none;
    margin-bottom: var(--space-8);
}

.card-features li {
    position: relative;
    padding-left: var(--space-8);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-700);
    line-height: 1.5;
}

/* Checkmark-style bullets */
.card-features li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0.35em;
    width: 14px;
    height: 8px;
    border-left: 2px solid var(--accent-red);
    border-bottom: 2px solid var(--accent-red);
    transform: rotate(-45deg);
    opacity: 0.8;
}

/* CTA button with shine sweep */
.tool-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--accent-red) 0%, #c1121f 100%);
    color: var(--white);
    border-radius: 22.5px;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-md), 0 4px 14px rgba(220, 32, 21, 0.2);
    transition:
        transform 200ms var(--ease-in-out),
        box-shadow 200ms var(--ease-in-out);
    position: relative;
    overflow: hidden;
}

.tool-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 600ms var(--ease-out-expo);
    pointer-events: none;
}

.tool-cta:hover::before {
    left: 120%;
}

.tool-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 8px 24px rgba(220, 32, 21, 0.3);
    color: var(--white);
}

.tool-cta:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.tool-cta svg {
    width: 18px;
    height: 18px;
    transition: transform 200ms var(--ease-in-out);
}

.tool-cta:hover svg {
    transform: translateX(3px);
}


/* --- About Section --- */
.about-section {
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-navy-dark) 100%);
    padding: var(--space-32) var(--space-6);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

/* Subtle diagonal line texture */
.about-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 40px,
        rgba(255, 255, 255, 0.015) 40px,
        rgba(255, 255, 255, 0.015) 41px
    );
    pointer-events: none;
}

.about-inner {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    text-align: center;
    position: relative;
    /* Scroll reveal initial state */
    opacity: 0;
    transform: translateY(30px);
}

.about-inner.revealed {
    animation: sectionReveal 700ms var(--ease-out-expo) forwards;
}

.about-section .section-heading {
    color: var(--white);
}

.about-description {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: var(--space-10);
}

.practice-areas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-10);
}

.practice-badge {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(12px);
}

.practice-badge.revealed {
    animation: badgeReveal 400ms var(--ease-out-expo) forwards;
}

.practice-badge:nth-child(1).revealed { animation-delay: 0ms; }
.practice-badge:nth-child(2).revealed { animation-delay: 80ms; }
.practice-badge:nth-child(3).revealed { animation-delay: 160ms; }
.practice-badge:nth-child(4).revealed { animation-delay: 240ms; }

.about-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--white);
    padding: var(--space-3) var(--space-6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 22.5px;
    transition:
        background-color var(--transition-base),
        border-color var(--transition-base),
        transform var(--transition-base);
}

.about-cta:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
    transform: translateY(-2px);
}

.about-cta svg {
    width: 16px;
    height: 16px;
    transition: transform 200ms var(--ease-in-out);
}

.about-cta:hover svg {
    transform: translateX(3px);
}


/* --- Take My Card Section --- */
.card-section {
    padding: var(--space-32) var(--space-6);
    background: var(--gray-50);
    text-align: center;
    overflow: hidden;
}

.card-section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.card-section .section-overline {
    justify-content: center;
}

.card-section-heading {
    text-align: center;
}

.card-section-description {
    font-size: var(--text-lg);
    color: var(--gray-600);
    max-width: var(--max-width-narrow);
    margin: 0 auto var(--space-12);
    line-height: 1.6;
}

.vcard-animation-wrapper {
    width: 800px;
    height: 620px;
    position: relative;
    margin: 0 auto;
    perspective: 3000px;
    cursor: pointer;
}

/* Sticky note */
.vcard-sticky {
    position: absolute;
    font-family: 'Permanent Marker', cursive;
    font-size: 50px;
    top: 5%;
    right: 15%;
    background: #fff7a1;
    padding: 12px;
    font-weight: 600;
    color: #2b2b2b;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15), inset 0 -20px 20px -20px rgba(0, 0, 0, 0.1);
    z-index: 1;
    transform: rotate(6deg);
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.02) 10px, rgba(0, 0, 0, 0.02) 11px);
    opacity: 0;
    animation: vcardStickyAppear 0.5s ease forwards;
    animation-delay: 0.3s;
}

/* iPhone frame */
.vcard-phone {
    position: absolute;
    width: 320px;
    height: 640px;
    background: var(--primary-navy);
    border-radius: 48px;
    left: 40%;
    top: 40%;
    z-index: 10;
    transform: translate(-50%, -42%) rotateX(0deg) rotate(-8deg) scale(0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-out;
    opacity: 0;
    animation: vcardPhoneAppear 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.8s forwards;
}

.vcard-phone:hover {
    transform: translate(-50%, -42%) rotateX(0deg) rotate(-4deg) scale(0.97);
}

.vcard-animation-wrapper.clicked .vcard-phone {
    transform: translate(-50%, -42%) rotateX(0deg) rotate(-8deg) scale(0.93);
}

.vcard-phone-screen {
    position: absolute;
    background: #111;
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('card/add-contact.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    border-radius: 36px;
    overflow: hidden;
}

.vcard-animation-wrapper.clicked .vcard-phone-screen {
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('card/added.jpg');
}

.vcard-status-bar {
    height: 44px;
    padding: 12px 22px 0;
    margin-top: -10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: white;
    z-index: 2;
    position: relative;
}

.vcard-time {
    font-family: -apple-system, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    margin-top: 2px;
}

.vcard-status-icons {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 2px;
}

.vcard-status-icons svg {
    height: 11px;
    width: auto;
}

/* Business card */
.vcard-biz-card {
    position: absolute;
    width: 340px;
    height: 190px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.99), rgba(250, 250, 250, 0.98));
    border-radius: 2px;
    left: 40%;
    bottom: 30%;
    transform: translate(-50%, 0) rotate(18deg) translateX(80px);
    box-shadow: 8px 12px 24px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 10;
    cursor: pointer;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-navy);
    opacity: 0;
    animation: vcardCardAppear 1s cubic-bezier(0.23, 1, 0.32, 1) 2s forwards,
               vcardWiggle 0.4s ease-in-out infinite 3s;
}

.vcard-biz-card:hover {
    animation: vcardCardAppear 1s cubic-bezier(0.23, 1, 0.32, 1) forwards,
               vcardWiggle 0.8s ease-in-out infinite;
}

.vcard-animation-wrapper.clicked .vcard-biz-card {
    animation: none;
    transform: translate(-50%, 0) rotate(18deg) translateX(80px);
    transition: transform 0.3s ease-out;
}

.vcard-biz-logo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: auto;
}

.vcard-biz-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vcard-biz-name {
    font-size: 24px;
    font-weight: 700;
    margin-top: 65px;
    margin-bottom: -8px;
    letter-spacing: 0.25px;
    white-space: nowrap;
}

.vcard-biz-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.vcard-biz-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 0;
    color: var(--primary-navy);
    text-decoration: none;
}

.vcard-biz-address {
    font-size: 6px;
    text-align: left;
    line-height: 1.6;
    margin-right: 80px;
    width: 130px;
}

.vcard-biz-links {
    text-align: right;
    margin-top: 5px;
    margin-right: 0;
    font-size: 8px;
    line-height: 6px;
}

.vcard-biz-links a {
    color: var(--primary-navy);
    text-decoration: none;
}

/* Success message overlay */
.vcard-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 18px;
    font-weight: var(--weight-semibold);
    opacity: 0;
    z-index: 30;
    text-align: center;
    width: 200px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-lg);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.vcard-animation-wrapper.clicked .vcard-success {
    opacity: 1;
    transform: translate(-50%, -100%);
}

.vcard-animation-wrapper.clicked .vcard-success.fade-out {
    opacity: 0;
    transform: translate(-50%, -120%);
}

/* Card section keyframes */
@keyframes vcardPhoneAppear {
    0%   { transform: translate(-50%, 50vh) rotateX(20deg) rotate(-8deg) scale(0.95); opacity: 0; }
    60%  { transform: translate(-50%, -42%) rotateX(0deg) rotate(-8deg) scale(0.97); opacity: 1; }
    100% { transform: translate(-50%, -42%) rotateX(0deg) rotate(-8deg) scale(0.95); opacity: 1; }
}

@keyframes vcardCardAppear {
    0%   { transform: translate(-50%, 50vh) rotate(18deg) translateX(80px); opacity: 0; }
    60%  { transform: translate(-50%, -2%) rotate(18deg) translateX(80px); opacity: 1; }
    100% { transform: translate(-50%, 0) rotate(18deg) translateX(80px); opacity: 1; }
}

@keyframes vcardStickyAppear {
    0%   { opacity: 0; transform: rotate(6deg) translateY(-20px); }
    100% { opacity: 1; transform: rotate(6deg) translateY(0); }
}

@keyframes vcardWiggle {
    0%   { transform: translate(-50%, 0) rotate(16deg) translateX(76px); }
    50%  { transform: translate(-50%, 0) rotate(20deg) translateX(84px); }
    100% { transform: translate(-50%, 0) rotate(16deg) translateX(76px); }
}


/* --- Contact Bar --- */
.contact-section {
    padding: var(--space-12) var(--space-6);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.contact-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-700);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    transition: background-color var(--transition-fast);
}

.contact-item:hover {
    background: var(--gray-50);
}

.contact-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-navy);
    flex-shrink: 0;
}

.contact-item a {
    color: var(--primary-navy);
    font-weight: var(--weight-medium);
}

.contact-item a:hover {
    color: var(--accent-red);
}


/* --- Footer --- */
.main-footer {
    background: var(--primary-navy-darker);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-10) var(--space-6);
    position: relative;
}

/* Red gradient top accent line */
.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--primary-navy-light), var(--accent-red));
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.footer-copyright {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    margin: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    font-size: var(--text-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 200ms ease;
}

.footer-links a:hover {
    color: var(--white);
}


/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-red) 0%, #c1121f 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-xl), 0 4px 14px rgba(220, 32, 21, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
        opacity 300ms var(--ease-in-out),
        visibility 300ms var(--ease-in-out),
        transform 300ms var(--ease-in-out);
    z-index: var(--z-fixed);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl), 0 8px 20px rgba(220, 32, 21, 0.35);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}


/* ===========================
   KEYFRAMES
   =========================== */

@keyframes logoReveal {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

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

@keyframes accentLineReveal {
    from { transform: translateX(-50%) scaleX(0); }
    to   { transform: translateX(-50%) scaleX(1); }
}

@keyframes scrollBob {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50%      { transform: translateY(10px); opacity: 1; }
}

@keyframes patternDrift {
    from { background-position: 0% 0%; }
    to   { background-position: 100% 100%; }
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

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


/* ===========================
   RESPONSIVE
   =========================== */

/* Tablet */
@media (max-width: 1024px) {
    .tools-grid {
        gap: var(--space-6);
    }

    .tool-card {
        padding: var(--space-8);
    }

    .card-image {
        margin: calc(var(--space-8) * -1) calc(var(--space-8) * -1) var(--space-6) calc(var(--space-8) * -1);
    }

    .hero-logo {
        width: 500px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .top-bar {
        padding: var(--space-2) var(--space-4);
    }

    .top-bar-link:not(.top-bar-portal) {
        display: none;
    }

    .hero {
        min-height: 100vh;
        min-height: 100svh;
        padding: var(--space-16) var(--space-4);
    }

    .hero-logo {
        width: 300px;
        margin-bottom: var(--space-8);
    }

    .hero-heading {
        font-size: var(--text-4xl);
    }

    .hero-subheading {
        font-size: var(--text-lg);
    }

    .tools-section {
        padding: var(--space-16) var(--space-4);
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .tool-card {
        padding: var(--space-6);
    }

    .card-image {
        margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-5) calc(var(--space-6) * -1);
    }

    .card-title {
        left: var(--space-5);
        right: var(--space-5);
        bottom: var(--space-4);
    }

    .about-section {
        padding: var(--space-16) var(--space-4);
    }

    .contact-inner {
        flex-direction: column;
        align-items: center;
        gap: var(--space-4);
    }


    .footer-links {
        flex-direction: column;
        gap: var(--space-2);
    }

    .card-section {
        padding: var(--space-16) var(--space-4);
    }

    .vcard-animation-wrapper {
        height: 440px;
        width: 100%;
    }

    .vcard-sticky {
        height: 150px;
        width: 150px;
        right: auto;
        left: 57%;
        font-size: 25px;
    }

    .vcard-phone {
        width: 220px;
        height: 440px;
        border-radius: 36px;
        left: 35%;
    }

    .vcard-phone-screen {
        border-radius: 28px;
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .vcard-biz-card {
        width: 240px;
        height: 140px;
        padding: 12px;
        bottom: 25%;
    }

    .vcard-biz-name {
        font-size: 16px;
        margin-top: 18px;
        margin-bottom: -8px;
    }

    .vcard-biz-logo {
        width: 70px;
        top: 12px;
        right: 12px;
    }

    .vcard-biz-address {
        font-size: 6px;
        width: 130px;
        margin-right: 80px;
    }

    .vcard-biz-links {
        font-size: 8px;
        line-height: 6px;
    }

    .scroll-indicator {
        bottom: var(--space-6);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero {
        padding: var(--space-12) var(--space-3);
    }

    .hero-logo {
        width: 170px;
    }

    .hero-heading {
        font-size: 2rem;
    }

    .hero-subheading {
        font-size: var(--text-base);
    }

    .tools-section,
    .about-section {
        padding: var(--space-12) var(--space-3);
    }

    .tool-card {
        padding: var(--space-5);
    }

    .card-image {
        margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) var(--space-4) calc(var(--space-5) * -1);
        max-height: 180px;
    }

    .card-image img {
        height: 180px;
    }

    .card-title {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-3);
        font-size: var(--text-xl);
    }

    .contact-section {
        padding: var(--space-8) var(--space-3);
    }

    .practice-areas {
        gap: var(--space-2);
    }
}


/* ===========================
   DARK MODE
   =========================== */

@media (prefers-color-scheme: dark) {
    :root {
        --white: #0f1419;
        --gray-50: #1a2332;
        --gray-100: #1e2a3a;
        --gray-200: #283848;
        --gray-300: #3a4e62;
        --gray-400: #4a5b6e;
        --gray-500: #7a8a9a;
        --gray-600: #a0adb8;
        --gray-700: #c8d0d8;
        --gray-800: #e2e8f0;
        --gray-900: #f1f5f9;
        --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
        --shadow-card-hover: 0 24px 64px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.25);
    }

    ::selection {
        background: rgba(220, 32, 21, 0.25);
        color: var(--gray-900);
    }

    .tool-card {
        border-color: var(--gray-200);
    }

    .tool-card:hover {
        border-color: var(--gray-300);
    }

    .tool-card::after {
        background: radial-gradient(circle, rgba(220, 32, 21, 0.1) 0%, transparent 70%);
    }

    .contact-section {
        border-color: var(--gray-200);
    }

    .contact-item:hover {
        background: var(--gray-100);
    }

    .about-section {
        background: linear-gradient(135deg, #0f1a25 0%, #0a1118 100%);
    }
}


/* ===========================
   REDUCED MOTION
   =========================== */

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

    body {
        opacity: 1;
    }

    .hero-logo,
    .hero-overline,
    .hero-heading,
    .hero-subheading,
    .hero-tagline,
    .hero-disclaimer,
    .scroll-indicator {
        opacity: 1;
    }

    .tool-card {
        opacity: 1;
        transform: none;
    }

    .about-inner {
        opacity: 1;
        transform: none;
    }

    .practice-badge {
        opacity: 1;
        transform: none;
    }
}


/* ===========================
   PRINT
   =========================== */

@media print {
    .back-to-top,
    .scroll-indicator,
    .top-bar,
    .hero::before,
    .hero::after {
        display: none !important;
    }

    body {
        opacity: 1;
        background: white;
        color: black;
    }

    .hero {
        background: none;
        color: black;
        min-height: auto;
        padding: 2rem 0;
    }

    .hero-heading,
    .hero-subheading,
    .hero-tagline {
        color: black;
    }

    .hero-logo {
        filter: none;
    }

    .about-section {
        background: none;
        color: black;
    }

    .about-section .section-heading,
    .about-description {
        color: black;
    }

    .about-inner {
        opacity: 1;
        transform: none;
    }

    .practice-badge {
        color: black;
        border-color: #ccc;
        background: none;
        opacity: 1;
        transform: none;
    }

    .tool-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        opacity: 1;
        transform: none;
    }

    .tool-cta::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
        font-weight: normal;
    }

    a[href^="http"]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }

    .main-footer {
        background: none;
        color: black;
    }

    .main-footer::before {
        display: none;
    }

    .footer-copyright,
    .footer-links a {
        color: black;
    }

    * {
        animation: none !important;
        transition: none !important;
    }
}
