:root {
    /* Palette: Sophisticated Warm Neutrals & Deep Navy */
    --color-primary: #121212;
    --color-text: #2A2A2A;
    --color-text-muted: #4A4A4A;
    /* WCAG AA compliant */
    --color-accent: #D4845F;
    /* Warm Terracotta */
    --color-accent-soft: rgba(212, 132, 95, 0.1);
    --color-bg: #FFFFFF;
    --color-bg-alt: #F8F6F3;
    --color-bg-dark: #121B28;
    /* Deep Navy for Testimonials */
    --color-border: #E8E4DF;

    /* Typography Scales */
    --font-serif: 'Tenor Sans', serif;
    --font-sans: 'Outfit', sans-serif;

    /* Spacing - Intentional Editorial Gaps */
    --space-unit: clamp(1.5rem, 3vw, 3rem);
    --section-gap: clamp(10rem, 15vw, 15rem);
    /* Forces 160px-240px padding to stop 'Wall of Noise' */
    --container-max: 1320px;

    /* Elevation & Depth */
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 30px 60px -12px rgba(0, 0, 0, 0.12);

    --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    /* Improved readability */
    -webkit-font-smoothing: antialiased;
    font-size: 17px;
    /* Increased base size */
}

/* --- Typography Hierarchy --- */
h1,
h2,
h3,
.serif {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--color-primary);
}

.huge-title {
    font-size: clamp(2.5rem, 4.5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 600;
    color: var(--color-accent);
    display: block;
    margin-bottom: 1rem;
}

/* --- Layout Foundations --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: var(--section-gap) 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

/* --- Unified Button Components (Fixing Button Frankenstein) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.125rem 2.5rem;
    /* Strict unified padding */
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--color-primary);
    /* Consistent border weight */
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    /* Prevent awkward wraps */
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(212, 132, 95, 0.3);
}

.btn-primary:hover {
    background: #c27250;
    border-color: #c27250;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(212, 132, 95, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-3px);
}

/* Header CTA now matches the unified .btn component exactly */

/* --- Specific UI Elements (As requested by design) --- */
.layer-gallery {
    position: relative;
}

/* The Blue Shelf Shape - Custom SVG Shape for Editorial Vibe */
.blue-shelf-decor {
    position: absolute;
    width: 280px;
    height: 280px;
    background: var(--color-bg-dark);
    border-radius: 50%;
    top: -40px;
    left: -60px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-float);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blue-shelf-decor svg {
    width: 80%;
    height: auto;
    color: white;
    opacity: 0.8;
}

/* --- Header Styles --- */
header {
    padding: 2.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    transition: var(--transition-smooth);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 28px;
    height: auto;
}

.logo-text {
    height: 18px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 3.5rem;
    list-style: none;
}

.nav-link {
    font-size: 0.8125rem;
    font-weight: 600;
    /* Increased from 500 */
    letter-spacing: 0.15em;
    color: var(--color-primary);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--color-accent);
    transition: var(--transition-smooth);
}

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

/* --- Hero Section --- */
.hero {
    padding-top: 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: center;
    /* Center text block vertically against the image column on desktop */
}

.hero-content {
    z-index: 5;
}

.hero-content .btn {
    min-width: 270px;
    /* Balance the footprint of hero buttons exactly */
}

.hero-visual {
    position: relative;
}

.hero-main-img {
    aspect-ratio: 4/5;
    width: 100%;
    max-height: 65vh;
    /* Clamp height so it never breaks the viewport */
    object-fit: cover;
    box-shadow: var(--shadow-float);
}

.hero-thumbs {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: none;
}

.hero-thumbs::-webkit-scrollbar {
    display: none;
}

.hero-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    object-fit: cover;
    transition: var(--transition-smooth);
    cursor: pointer;
    opacity: 0.7;
}

.hero-thumb:hover {
    opacity: 1;
    transform: translateY(-5px);
}

/* --- Gallery Section (The "Layered" Grid) --- */
.gallery-block {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6rem;
    align-items: flex-end;
    /* Ground the floating text relative to the massive image */
}

.gallery-content {
    max-width: 480px;
}

.gallery-text {
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
    font-size: 1.125rem;
    /* Slightly larger */
    line-height: 1.8;
    max-width: 65ch;
    /* Optimal reading width */
}

.image-stack {
    position: relative;
}

.image-stack-main {
    width: 90%;
    margin-left: 10%;
    box-shadow: var(--shadow-float);
}

/* --- Service Explanation Section (Redesigned) --- */
.service-explanation {
    background: white;
    text-align: left;
}

.service-explanation__header {
    max-width: 600px;
    margin-bottom: 4rem;
}

.service-explanation__copy {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    font-weight: 300;
    line-height: 1.8;
}

.service-explanation__visuals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.visual-proof {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.visual-proof__img {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.visual-proof__img:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-float);
}

.visual-proof__caption {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    font-weight: 500;
}

.service-explanation__footer {
    margin-top: 2rem;
}

/* --- Testimonial Block (Dramatic Luxury) --- */
.testimonial-block {
    padding: 0;
    background: var(--color-bg-dark);
    color: white;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    align-items: stretch;
    overflow: hidden;
}

.testimonial-img-wrapper {
    position: relative;
    min-height: 600px;
}

.testimonial-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.testimonial-content {
    padding: clamp(4rem, 10vw, 8rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    /* Anchor for absolute elements */
}

.quote-mark {
    font-family: var(--font-serif);
    font-size: 10rem;
    line-height: 1;
    color: var(--color-accent);
    opacity: 0.1;
    /* More subtle */
    position: absolute;
    top: 0;
    /* Align with top padding */
    left: 2rem;
    pointer-events: none;
    z-index: 1;
    transform: translateY(-50%);
    /* Shift up by half its height to clear text */
}

.quote-text {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 3rem;
    color: white;
}

.author-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.author-name {
    font-size: 1.25rem;
    font-weight: 500;
    display: block;
}

.author-role {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
}

.pagination {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    opacity: 0.5;
}

/* --- Problem Statement Section --- */
.problem-statement {
    background: linear-gradient(135deg, #F8F6F3 0%, #FFFFFF 100%);
    text-align: center;
    padding: clamp(5rem, 10vw, 8rem) 0;
}

/* --- Editorial Vertical Marginalia --- */
.marginalia-wrapper {
    position: absolute;
    left: 2rem;
    /* Move closer to edge */
    top: 0;
    bottom: 0;
    width: 2rem;
    /* Fixed thin track */
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marginalia-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
    transform: rotate(-90deg);
    /* Anchor to the exact center of the track */
    transform-origin: center center;
    opacity: 0.6;
}

/* Ensure sections that use marginalia have position: relative */
.has-marginalia {
    position: relative;
}

@media (max-width: 1200px) {
    .marginalia-wrapper {
        display: none;
        /* Hide on smaller screens where there's no margin space */
    }
}

/* --- Interactive Style Cards --- */
.style-card-interactive {
    background: white;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.style-card-interactive:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}

.style-card-interactive__img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.style-card-interactive__content {
    padding: 2.5rem;
}

.style-card-interactive__title {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.style-card-interactive__desc {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.style-card-interactive__cta {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.style-card-interactive__cta::after {
    content: '→';
    transition: transform 0.3s ease;
}

.style-card-interactive:hover .style-card-interactive__cta::after {
    transform: translateX(5px);
}

/* --- Final CTA Section --- */
.final-cta {
    background: var(--color-bg-dark);
    color: white;
    text-align: center;
    padding: clamp(6rem, 12vw, 10rem) 0;
}

.btn-light {
    background: white;
    color: var(--color-primary);
    border-color: white;
}

.btn-light:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* Header CTA now maps to unified .btn component above */

/* --- Improved Testimonial Highlight --- */
.quote-highlight {
    color: var(--color-accent);
    font-weight: 500;
}

/* --- Portfolio Page --- */
.portfolio-hero {
    background: var(--color-bg-alt);
    padding: 8rem 0 4rem;
    text-align: center;
}

.filter-nav {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 4rem 0;
    list-style: none;
}

.filter-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    background: none;
    text-transform: uppercase;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.filter-btn.active {
    color: var(--color-primary);
    border-color: var(--color-accent);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: var(--section-gap);
}

.project-card {
    position: relative;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.project-card__img-wrapper {
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: 1.5rem;
    background: var(--color-bg-alt);
}

.project-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-card__img {
    transform: scale(1.05);
}

.project-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.project-card__title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.project-card__category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    font-weight: 600;
}

/* --- Project Detail Page --- */
.project-hero {
    height: 80vh;
    position: relative;
    overflow: hidden;
}

.project-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 6rem 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    color: white;
}

.project-info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 6rem;
    align-items: start;
}

.project-spec-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.project-spec-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    display: block;
    margin-bottom: 0.5rem;
}

.project-spec-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.project-gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3rem;
}

.project-gallery-item--full {
    grid-column: span 12;
}

.project-gallery-item--half {
    grid-column: span 6;
}

.project-gallery-item--staggered {
    grid-column: span 8;
}

.project-gallery-item img {
    width: 100%;
    height: auto;
    box-shadow: var(--shadow-soft);
}

/* --- About Page --- */
.process-timeline {
    position: relative;
    padding: 4rem 0;
}

.process-step {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6rem;
    margin-bottom: 6rem;
    position: relative;
}

.process-number {
    font-family: var(--font-serif);
    font-size: 5rem;
    line-height: 1;
    color: var(--color-accent);
    opacity: 0.2;
    position: absolute;
    top: -1.5rem;
    left: -2rem;
    z-index: -1;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
}

.team-member__img-wrapper {
    aspect-ratio: 4/5;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--color-bg-alt);
}

.team-member__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: var(--transition-smooth);
}

.team-member:hover .team-member__img {
    filter: grayscale(0);
    transform: scale(1.05);
}

/* --- Services Page --- */
.services-detailed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

.service-detail-card {
    padding: 4rem;
    background: white;
    border: 1px solid var(--color-border);
    transition: var(--transition-smooth);
}

.service-detail-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-soft);
}

.service-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 2rem 0;
}

.faq-question {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--color-accent);
}

.faq-answer {
    margin-top: 1.5rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 800px;
    line-height: 1.8;
}

/* --- Style Guide Page --- */
.moodboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

.color-swatches {
    display: flex;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    position: relative;
}

.color-swatch::after {
    content: attr(data-label);
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    white-space: nowrap;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
}

.material-card {
    padding: 2.5rem;
    background: white;
    border: 1px solid var(--color-border);
    text-align: center;
    transition: var(--transition-smooth);
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}

.material-card__img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
}

/* --- Contact Page --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8rem;
    align-items: start;
}

.form-group {
    margin-bottom: 3.5rem;
    position: relative;
}

.form-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    font-weight: 600;
    display: block;
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-border);
    font-family: var(--font-sans);
    font-size: 1.15rem;
    color: var(--color-primary);
    transition: var(--transition-smooth);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-accent);
}

.form-input::placeholder {
    color: rgba(0, 0, 0, 0.15);
}

textarea.form-input {
    min-height: 150px;
    resize: none;
}

/* --- Journal Page --- */
.article-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 6rem;
}

.article-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.article-card__img-wrapper {
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: 1.5rem;
}

.article-card--featured .article-card__img-wrapper {
    aspect-ratio: 16/8;
}

.article-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.article-card:hover .article-card__img {
    transform: scale(1.05);
}

.category-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.article-card__title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin: 0.5rem 0 1rem;
}

/* --- Footer --- */
footer {
    padding: 6rem 0 3rem;
    background: #0D0D0D;
    color: rgba(255, 255, 255, 0.6);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4rem;
    margin-bottom: 3rem;
}

.footer-logo {
    filter: brightness(0) invert(1);
    margin-bottom: 2rem;
}

.footer-title {
    color: white;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.footer-links {
    list-style: none;
}

.footer-link {
    display: block;
    margin-bottom: 1rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: white;
    transform: translateX(5px);
}

/* --- Responsive Tweaks --- */
@media (max-width: 1024px) {

    .hero-grid,
    .gallery-block,
    .split-section,
    .styles-grid,
    .testimonial-block,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .testimonial-img-wrapper {
        min-height: 400px;
    }

    .blue-shelf-decor {
        display: none;
    }

    /* Hide on small screens for cleaner mobile layout */
}