/* 
  Design System - Anthropic Replica 
  Theme: Warm Institutional
*/

:root {
    /* Colors */
    --bg-cream: #FAF9F5;
    --bg-charcoal: #141413;
    --bg-sand: #F0EFEA;

    --text-primary: #141413;
    --text-secondary: #585855;
    --text-inverse: #FAF9F5;

    --accent-rust: #C6613F;

    --border-grid: #E1DFD6;
    --border-strong: #141413;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
}

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

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

body {
    background-color: var(--bg-cream);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5 {
    font-weight: 450;
    /* Slightly lighter than bold */
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

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

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

.serif-italic {
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-weight: 300;
}

.section-divider {
    width: 100%;
    height: 1px;
    background-color: var(--border-grid);
}

/* Navigation */
.site-nav {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-grid);
    position: sticky;
    top: 0;
    background-color: rgba(250, 249, 245, 0.9);
    /* Cream with opacity */
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Left align children */
    line-height: 1.1;
}

.brand-main {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    /* Slightly smaller to accommodate longer text */
    letter-spacing: -0.01em;
    text-transform: uppercase;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.brand-cursive {
    font-family: 'Caveat', cursive;
    text-transform: none;
    font-size: 1.4rem;
    font-weight: 500;
}

.brand-sub {
    font-family: 'Caveat', cursive;
    /* Handwritten Style */
    font-size: 1.3rem;
    /* Larger */
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    /* Black */
    margin-top: -2px;
    /* Pull it up slightly for visual balance */
}

.nav-logo-img {
    height: 28px;
    /* Size constraint */
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding-bottom: 2px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    /* Slightly thicker for pencil feel */
    bottom: 0;
    left: 0;
    background-color: var(--bg-charcoal);
    /* Black/Charcoal Pencil */
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-links a:hover {
    color: var(--text-primary);
    /* Keep text black */
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hamburger Button */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Buttons */
.btn-primary {
    background-color: var(--bg-charcoal);
    color: var(--text-inverse);
    padding: 0.8rem 1.4rem;
    border-radius: 6px;
    /* Soft square */
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: inline-block;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Hero Section */
.hero-section {
    padding: var(--spacing-xl) 0;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5.5rem);
    /* Massive responsive type */
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.hero-subtitle {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    max-width: 600px;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.link-arrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

.link-arrow:hover {
    border-bottom-color: var(--accent-rust);
    color: var(--accent-rust);
}

/* Feature Section */
.feature-section {
    padding: var(--spacing-xl) 0;
}

.section-header {
    margin-bottom: var(--spacing-lg);
    border-left: 1px solid var(--border-grid);
    padding-left: var(--spacing-md);
}

.eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    background-color: var(--bg-sand);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: var(--spacing-md);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.2s;
}

.card:hover {
    border-color: var(--border-grid);
    transform: translateY(-4px);
}

.card-large {
    grid-column: span 2;
    background-color: #E8E6DF;
    /* Slightly darker sand for emphasis */
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    /* Mixing sans body in cards for readability */
}

/* Manifesto */
.manifesto-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-cream);
}

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

.manifesto-text {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    line-height: 1.4;
    color: var(--text-primary);
    max-width: 900px;
    margin: 0 auto;
}

.highlight-serif {
    color: var(--accent-rust);
    font-style: italic;
}

/* Footer */
.site-footer {
    background-color: var(--bg-charcoal);
    color: var(--text-inverse);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
}

.site-footer p,
.site-footer a {
    color: #999;
    /* Dimmed footer text */
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-brand h4 {
    color: var(--text-inverse);
    margin-bottom: 1rem;
}

.footer-col h5 {
    color: var(--text-inverse);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.footer-col a:hover {
    color: var(--text-inverse);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
}

@media (max-width: 768px) {

    /* --- Mobile Navigation --- */
    .nav-hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--bg-cream);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 1.5rem;
        border-left: 1px solid var(--border-grid);
        transition: right 0.3s ease;
        z-index: 1050;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .nav-container .btn-primary {
        display: none;
    }

    /* --- Hero --- */
    .hero-section {
        padding: var(--spacing-lg) 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

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

    /* --- Manifesto --- */
    .manifesto-text {
        font-size: 1.5rem;
    }

    /* --- Bento Grid --- */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .card-large {
        grid-column: span 1;
    }

    /* --- Section Header --- */
    .section-header {
        padding-left: 1rem;
    }

    /* --- Footer --- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .footer-col h5[style*="visibility: hidden"] {
        display: none;
    }

    /* --- Modal --- */
    .modal-content {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    /* --- Article --- */
    .article-container {
        padding: 3rem 1.2rem;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .article-subtitle {
        font-size: 1.05rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.35rem;
    }

    .article-body h3 {
        font-size: 1.15rem;
    }

    .article-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    /* --- Service page sector blocks --- */
    .sector-title {
        font-size: 1.5rem;
    }

    /* --- Announcement research list --- */
    .research-content h3 {
        font-size: 1.2rem;
    }
}

/* --- Modal Styles --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 3, 5, 0.6);
    /* Void with opacity */
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-cream);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-header {
    margin-bottom: 2rem;
    text-align: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--bg-charcoal);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background-color: #FFFFFF;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-rust);
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.required {
    color: var(--accent-rust);
}

/* --- Animations (Anthropic Style) --- */

/* Base Fade Up */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Logic for Bento Grid */
.bento-grid .card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bento-grid .card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Children Delays */
.bento-grid .card:nth-child(1) {
    transition-delay: 0ms;
}

.bento-grid .card:nth-child(2) {
    transition-delay: 100ms;
}

.bento-grid .card:nth-child(3) {
    transition-delay: 200ms;
}

.bento-grid .card:nth-child(4) {
    transition-delay: 300ms;
}

.bento-grid .card:nth-child(5) {
    transition-delay: 400ms;
}

.bento-grid .card:nth-child(6) {
    transition-delay: 500ms;
}

/* --- A.I.M Page Specifics (Value Grid) --- */
.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

.value-card {
    background: transparent;
    border-top: 1px solid var(--border-strong);
    padding: 2rem 0 0 0;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.value-card:hover {
    border-color: var(--accent-rust);
    transform: translateY(-5px);
}

.value-number {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-rust);
    margin-bottom: 1rem;
    display: block;
}

.value-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-family: 'Merriweather', serif;
}

.value-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 90%;
}

@media (max-width: 768px) {
    .values-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* --- Card Background Image Styles --- */
.card {
    position: relative;
    overflow: hidden;
    /* Ensure image stays inside rounded corners */
    /* ... existing styles ... */
}

/* Specific adjustment for the pharma card to allow image */
.pharma-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Push text to bottom if needed, or keeping it as is */
}

.pharma-card .card-content .eyebrow {
    color: #FFD0B0;
    /* Light peach/orange for contrast */
}

.pharma-card .card-content h3,
.pharma-card .card-content p {
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    /* Stronger shadow for readability */
}

/* Specific adjustment for the entertainment card */
.entertainment-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.entertainment-card .card-content .eyebrow {
    color: #FFD0B0;
}

.entertainment-card .card-content h3,
.entertainment-card .card-content p {
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Specific adjustment for the accounting card */
.accounting-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.accounting-card .card-content .eyebrow {
    color: #FFD0B0;
}

.accounting-card .card-content h3,
.accounting-card .card-content p {
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Specific adjustment for the real estate card */
.real-estate-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.real-estate-card .card-content .eyebrow {
    color: #FFD0B0;
}

.real-estate-card .card-content h3,
.real-estate-card .card-content p {
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Specific adjustment for the b2c card */
.b2c-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.b2c-card .card-content .eyebrow {
    color: #FFD0B0;
}

.b2c-card .card-content h3,
.b2c-card .card-content p {
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.card-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.card-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card:hover .card-bg-image img {
    transform: scale(1.05);
    /* Subtle zoom on hover */
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0));
    z-index: 2;
    pointer-events: none;
}

/* Ensure content is above image */
.card-content {
    position: relative;
    z-index: 3;
}

/* Ensure handwritten note is also above image if it exists */
.handwritten-note {
    z-index: 4;
}

/* --- Article/Blog Detail Page Styles --- */
.article-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 6rem 1.5rem;
}

.article-header {
    margin-bottom: 3rem;
    text-align: center;
}

.article-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

.article-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.article-body {
    font-family: 'Merriweather', serif;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.article-body h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-grid);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-rust);
}