/* Design Tokens */
:root {
    --bg-ivory-light: #faf8f2;     /* Warm ivory card color */
    --bg-ivory-dark: #f3f0e6;      /* Slightly deeper warm ivory margin */
    --text-primary: #242424;       /* Elegant dark graphite/charcoal */
    --text-secondary: #75726b;     /* Muted taupe/gray for submarks */
    --text-body: #4a4844;          /* Soft graphite for body text */
    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-active: rgba(0, 0, 0, 0.12);
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-ivory-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 300;
    line-height: 1.65;
    overflow-x: hidden;
}

/* Tactile Matte Paper Background Texture */
.texture-filter {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.card-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.18; /* Tactile grain strength (softer on light background) */
    mix-blend-mode: multiply; /* Multiplies noise to create darker paper fibers */
    filter: url(#noise);
}

/* Warm Ivory paper card gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 35%, var(--bg-ivory-light) 0%, var(--bg-ivory-dark) 100%);
    z-index: -1;
}

/* Main Container Layout (Centered card-like flow) */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6rem;
}

/* Hero Branding Section (Compact & elegant) */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 2rem;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-title {
    font-family: var(--font-serif);
    font-size: 2.6rem; 
    font-weight: 400; 
    letter-spacing: 0.18em; 
    color: var(--text-primary);
    margin-right: -0.18em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    
    /* Embossed / Raised dark lettering shadow (Top white highlight, bottom-right soft shadow) */
    text-shadow: 
        0 -0.75px 0.5px rgba(255, 255, 255, 0.95),
        0 1px 0.5px rgba(0, 0, 0, 0.15), 
        0 2px 4px rgba(0, 0, 0, 0.06);
}

.logo-submark {
    font-family: var(--font-sans);
    font-size: 0.65rem; 
    font-weight: 300;
    letter-spacing: 0.38em; 
    color: var(--text-secondary);
    margin-right: -0.38em;
    text-transform: uppercase;
    
    /* Subtle raised shadow matching main title */
    text-shadow: 
        0 -0.5px 0.5px rgba(255, 255, 255, 0.8),
        0 0.75px 0.5px rgba(0, 0, 0, 0.1), 
        0 1.5px 3px rgba(0, 0, 0, 0.04);
}

/* Thesis Section */
.thesis {
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    padding: 5rem 0;
    display: flex;
    justify-content: center;
}

.thesis-content {
    max-width: 620px;
    text-align: center;
}

.lead-text {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1.45;
    color: var(--text-primary);
    margin-bottom: 2rem;
    
    /* Subtle raised text shadow */
    text-shadow: 
        0 -0.5px 0.5px rgba(255, 255, 255, 0.9),
        0 1px 0.5px rgba(0, 0, 0, 0.1), 
        0 1.5px 3px rgba(0, 0, 0, 0.04);
}

.body-text {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-body);
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 3rem;
}

/* Inquire Button below description */
.btn-inquire {
    background: transparent;
    border: 1px solid var(--border-active);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 0.75rem 2.2rem;
    border-radius: 1px;
    cursor: pointer;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-inquire:hover {
    border-color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* Portfolio Section */
.portfolio {
    padding: 2rem 0;
    text-align: center;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    text-transform: uppercase;
    text-shadow: 0 -0.5px 0.5px rgba(255, 255, 255, 0.8), 0 1px 0.5px rgba(0, 0, 0, 0.08);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
    align-items: center;
    justify-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.portfolio-card {
    width: 100%;
    height: 160px; 
    padding: 2.2rem 1.5rem 1.8rem 1.5rem;
    background-color: rgba(0, 0, 0, 0.001);
    border: 1px solid var(--border-subtle);
    border-radius: 1px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-logo-wrapper {
    height: 60px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.portfolio-logo {
    width: 100%;
    height: 100%;
    max-height: 40px; 
    max-width: 110px;  
    color: var(--text-primary);
    opacity: 0.22; /* High-contrast matte look */
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-name {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card:hover {
    border-color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.005); /* Soft dark fiber integration */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.02);
}

.portfolio-card:hover .portfolio-logo {
    opacity: 0.75;
    color: var(--text-primary);
}

.portfolio-card:hover .portfolio-name {
    color: var(--text-primary);
}

/* Footer styles */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.footer-status {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-secondary);
}

/* Modal Inquire Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(243, 240, 230, 0.85); /* Ivory blur overlay */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-card {
    background-color: #faf8f2; /* Pure ivory modal */
    border: 1px solid var(--border-active);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
    padding: 3.5rem 4rem;
    width: 90%;
    max-width: 450px;
    border-radius: 1px;
    text-align: center;
    position: relative;
    transform: scale(0.97) translateY(5px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

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

.modal-header h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    text-shadow: 0 -0.5px 0.5px rgba(255, 255, 255, 0.9), 0 1px 0.5px rgba(0, 0, 0, 0.1);
}

.modal-sub {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.38em;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.modal-body p {
    font-size: 0.88rem;
    color: var(--text-body);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.email-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-active);
    padding: 0.75rem 1.2rem;
    border-radius: 1px;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.001);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.email-box:hover {
    border-color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.005);
}

.email-text {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.copy-status {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

/* Scroll Animation Base */
.scroll-reveal {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsiveness adjustments */
@media (max-width: 768px) {
    .container {
        padding: 3rem 1.2rem;
        gap: 4rem;
    }
    
    .logo-title {
        font-size: 2.0rem;
        letter-spacing: 0.18em;
        margin-right: -0.18em;
    }
    
    .logo-submark {
        font-size: 0.58rem;
        letter-spacing: 0.3em;
        margin-right: -0.3em;
    }
    
    .lead-text {
        font-size: 1.35rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }

    .modal-card {
        padding: 2.5rem 1.5rem;
    }

    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
    
    .portfolio-card {
        padding: 1.2rem 0.8rem 1rem 0.8rem;
        height: 120px;
        min-width: 0;
    }

    .portfolio-logo-wrapper {
        height: 45px;
    }

    .portfolio-logo {
        max-height: 30px;
        max-width: 90px;
    }
}
