/* 
  Lawya: The Immutable Law Office 
  Design System V3.5 (Monochrome Premium - "The $20M Refinement")
*/

:root {
    /* The Palette of Absolute Truth */
    --canvas-white: #FFFFFF;
    --vantablack: #000000;
    --off-white: #F8F8F8;
    --steel-gray: #E8E8E8;
    --carbon: #222222;
    --border-soft: rgba(0, 0, 0, 0.08);

    /* Semantic Mapping */
    --bg-body: var(--canvas-white);
    --text-primary: var(--vantablack);
    --text-secondary: var(--carbon);
    --border-primary: var(--vantablack);
    --border-subtle: var(--steel-gray);

    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter Tight', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Metrics */
    --width-max: 1320px;
    --space-2xs: 4px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 40px;
    --space-xl: 80px;
    --space-2xl: 160px;

    --transition-sharp: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Texture Layer: The Grain */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    font-size: 17px;
    overflow-x: hidden;
}

/* Typography Engineering */
h1,
h2,
h3,
h4,
.serif {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

h1.hero-title {
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: -0.06em;
    margin-bottom: var(--space-lg);
}

p {
    max-width: 55ch;
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 1.15rem;
}

a {
    color: inherit;
    text-decoration: none;
    position: relative;
    transition: color var(--transition-sharp);
}

a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transition: width var(--transition-sharp);
}

a:hover::after {
    width: 100%;
}

/* Layout System */
.container {
    max-width: var(--width-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    width: 100%;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: var(--space-xl);
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-xl);
}

@media (max-width: 768px) {

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-md {
    gap: var(--space-md);
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Nav: Glassmorphism refined */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-soft);
    height: 90px;
    display: flex;
    align-items: center;
    z-index: 2000;
}

/* Split Hero System */
.split-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 160px 0 80px 0;
}

.hero-left__content {
    max-width: 600px;
    margin-left: auto;
    padding-right: var(--space-xl);
}

.hero-right {
    background: var(--vantablack);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--canvas-white);
    padding: var(--space-xl);
    overflow: hidden;
}

@media (max-width: 1024px) {
    .split-hero {
        grid-template-columns: 1fr;
    }

    .hero-right {
        display: none;
    }

    .hero-left {
        padding: 120px 0 60px 0;
    }

    .hero-left__content {
        margin: 0 auto;
        padding: 0 var(--space-lg);
    }
}

.nav__logo {
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -0.07em;
    text-transform: uppercase;
    z-index: 2002;
    position: relative;
}

.nav__links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    z-index: 2001;
}

.nav__toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--vantablack);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s;
}

.nav__toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg) !important;
}

.nav__toggle.active span:nth-child(2) {
    opacity: 0 !important;
}

.nav__toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg) !important;
}

@media (max-width: 768px) {
    .nav {
        height: 70px;
    }

    .nav__toggle {
        display: flex;
    }

    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .nav__links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: #ffffff !important;
        flex-direction: column;
        justify-content: flex-start;
        padding: 140px var(--space-lg) var(--space-xl) var(--space-lg);
        gap: var(--space-lg);
        transition: left 0.5s cubic-bezier(0.19, 1, 0.22, 1);
        z-index: 2000;
        border: none;
        overflow-y: auto;
    }

    .nav__links.active {
        left: 0;
    }

    .nav__links li {
        width: 100%;
        text-align: left;
    }

    .nav__links li a {
        font-size: 2rem;
        font-family: var(--font-serif);
        text-transform: none;
        letter-spacing: -0.02em;
    }

    .nav__links .btn {
        font-size: 0.85rem;
        font-family: var(--font-sans);
    }
}

/* Buttons: Premium kinetic interaction */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px 48px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: transform var(--transition-sharp), background var(--transition-sharp), color var(--transition-sharp);
    border-radius: 0;
}

.btn:active {
    transform: scale(0.96);
}

.btn--primary {
    background: var(--vantablack);
    color: var(--canvas-white);
    border: 1px solid var(--vantablack);
}

.btn--primary:hover {
    background: transparent;
    color: var(--vantablack);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--vantablack);
    color: var(--vantablack);
}

.btn--outline:hover {
    background: var(--vantablack);
    color: var(--canvas-white);
}

/* Sections: Cinematic White Space */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2xl) 0;
}

.section-divider {
    border-top: 1px solid var(--border-soft);
    padding: var(--space-2xl) 0;
}

/* Cards: The Brutalist Minimalist */
.feature-card {
    padding: var(--space-lg) 0;
    transition: transform var(--transition-sharp);
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feature-card h3 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

/* Badge refined */
.badge-black {
    background: var(--vantablack);
    color: var(--canvas-white);
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
    border-radius: 100px;
}

/* Feature Diagram: Matrix feel */
.feature-diagram {
    background: #FAFAFA;
    border: 1px solid var(--steel-gray);
    padding: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.feature-diagram::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.02));
    pointer-events: none;
}

/* Table refinements */
.spec-table td {
    padding: 32px 0;
    font-size: 1.1rem;
}

/* Blog listings */
.blog-item {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-soft);
}

.blog-item:hover h2 {
    font-style: italic;
}

.blog-image-container {
    width: 100%;
    height: 400px;
    background: var(--off-white);
    margin-bottom: 32px;
    overflow: hidden;
}

.blog-featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.blog-item:hover .blog-featured-image {
    transform: scale(1.05);
}

.blog-single-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    max-height: 600px;
    object-fit: cover;
    margin-bottom: 60px;
}

/* Subscribe Section */
.subscribe-section {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-soft);
    background: var(--canvas-white);
}

.subscribe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.subscribe-form {
    display: flex;
    gap: 0;
    border: 1px solid var(--vantablack);
}

.subscribe-input {
    flex: 1;
    border: none;
    padding: 24px;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.subscribe-btn {
    background: var(--vantablack);
    color: var(--canvas-white);
    border: none;
    padding: 0 40px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: opacity 0.2s;
}

.subscribe-btn:hover {
    opacity: 0.9;
}

@media (max-width: 991px) {
    .subscribe-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .subscribe-form {
        flex-direction: column;
    }

    .subscribe-btn {
        padding: 20px;
    }
}

/* Animation utilities */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Page-Specific Responsive Utilities */
@media (max-width: 768px) {

    /* Blog Enhancements */
    .blog-item h2,
    article h3.serif {
        font-size: 1.8rem !important;
        line-height: 1.1;
    }

    /* Manifesto & Hero Enhancements */
    .hero-title-giant i {
        display: inline;
        margin: 0;
    }

    .hero-title-giant i {
        display: inline;
        margin: 0;
    }

    /* Pricing Table Enhancements */
    .spec-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .pricing-card {
        margin-bottom: var(--space-lg);
    }

    /* Platform Grid Refinements */
    .platform-grid,
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Utility to prevent horizontal overflow on elements with fixed widths */
    .premium-mock-ui {
        padding: 20px !important;
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 16px 32px;
        width: 100%;
        font-size: 0.75rem;
    }

    .nav__logo {
        font-size: 1.25rem;
    }
}

/* Breadcrumbs */
.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--vantablack);
}