/* ==========================================================================
   BRIEFLIES LIBRARIES CO. - NEW DESIGN SYSTEM & GLOBAL STYLES
   ========================================================================== */

/* Typography Imports */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* New Ultra-Premium Deep Purple, Gold-Yellow, and Walnut Brown Palette */
    --color-bg: #120914;          /* Imperial Velvet Midnight Purple */
    --color-surface: #1E1224;     /* Deep Royal Grape / Dark Damson */
    --color-surface-hover: #2B1B33;
    --color-text-primary: #FAF6FC; /* Creamy Parchment / White Amber */
    --color-text-muted: #A898AC;   /* Dusty Lavender-Grey */
    --color-accent: #E5B842;       /* Aged Polished Brass Gold / Mustard Yellow */
    --color-accent-hover: #F2CC61;
    --color-brown: #5A3C28;        /* Rich Walnut Wood Finish / Tobacco Brown */
    --color-border: #2D1B36;       /* Clean Joinery Dark Shadow Line */
    --color-border-hover: #482C56;
    
    /* Fonts */
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    /* Shadows & Effects */
    --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.75);
    --shadow-brass: 0 4px 24px rgba(229, 184, 66, 0.25);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    line-height: 1.7;
}

body {
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header & Dynamic Navigation - Clean Layout & Space */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: rgba(18, 9, 20, 0.92);
    border-bottom: 1px solid var(--color-border);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 85px; /* Clean heights for spacious feel */
    gap: 24px;
}

.logo {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-primary);
}

.logo span {
    color: var(--color-accent);
}

.desktop-nav {
    display: flex;
    gap: 36px; /* Expanded spacing for single-word buttons */
    margin-right: 48px; /* Fixed spacing: ensures Contact link and Inquire button are never too close */
}

.nav-link {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
    position: relative;
    padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-accent);
}

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

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

.header-cta {
    display: flex;
    align-items: center;
}

/* Elegant Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 3px;
    transition: var(--transition-smooth);
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
}

.btn-primary {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    box-shadow: var(--shadow-brass);
}

.btn-solid {
    background: var(--color-accent);
    color: var(--color-bg);
    border: 1px solid var(--color-accent);
}

.btn-solid:hover {
    background: transparent;
    color: var(--color-accent);
}

/* Mobile Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1010;
}

.mobile-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-primary);
    margin: 5px 0;
    transition: var(--transition-smooth);
}

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

.mobile-nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

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

/* Mobile Nav Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    z-index: 1005;
    padding: 100px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.mobile-drawer.open {
    right: 0;
}

.mobile-drawer .nav-link {
    font-size: 15px;
}

/* Hero Template with Spacious Gradients */
.page-hero {
    padding: 120px 0 90px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    background: radial-gradient(circle at top, #261430 0%, var(--color-bg) 75%);
}

.page-hero-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--color-accent);
    display: block;
    margin-bottom: 20px;
    font-weight: 600;
}

.page-hero h1 {
    font-size: 52px;
    line-height: 1.15;
    max-width: 900px;
    margin: 0 auto 24px;
    font-weight: 300;
}

@media(max-width: 768px) {
    .page-hero h1 {
        font-size: 38px;
    }
}

.page-hero p {
    font-size: 18px;
    color: var(--color-text-muted);
    max-width: 720px;
    margin: 0 auto;
    font-weight: 300;
}

/* Landing Page Hero with Atmospheric Background Image */
.hero {
    padding: 180px 0 140px;
    background: linear-gradient(180deg, rgba(18, 9, 20, 0.88) 0%, var(--color-bg) 100%),
                url('images/bespoke_heritage_library_hero_background_dark.jpg') no-repeat center center / cover;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.hero-content h1 {
    font-size: 60px;
    font-weight: 300;
    line-height: 1.15;
    max-width: 960px;
    margin: 0 auto 28px;
}

@media(max-width: 768px) {
    .hero-content h1 {
        font-size: 40px;
    }
}

.hero-content p {
    font-size: 19px;
    color: var(--color-text-muted);
    max-width: 760px;
    margin: 0 auto 48px;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

@media(max-width: 576px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Section Spacing Improvements */
section {
    padding: 120px 0; /* Breathable spacing instead of compact paddings */
}

/* Card Showcase Grid with Elegant Borders & Centered Content */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 50px;
    justify-content: center;
}

.showcase-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 4px;
    overflow: hidden;
}

.showcase-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-8px);
    box-shadow: var(--shadow-soft);
}

.card-img-container {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--color-border);
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.showcase-card:hover .card-img-container img {
    transform: scale(1.05);
}

.card-content {
    padding: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

.card-content h3, .card-content h4 {
    font-size: 24px;
    margin-bottom: 14px;
    font-weight: 400;
    text-align: center;
}

.card-content p {
    font-size: 14.5px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
    flex-grow: 1;
    text-align: center;
}

/* Centered Features Block */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
    justify-content: center;
}

.feature-item {
    padding: 24px;
    border-top: 2px solid var(--color-accent);
    text-align: center;
}

.feature-item h4 {
    font-size: 21px;
    margin-bottom: 12px;
    font-weight: 500;
}

.feature-item p {
    color: var(--color-text-muted);
    font-size: 15px;
}

/* Legal & Informational Layout */
.legal-container {
    padding: 100px 0;
    max-width: 900px;
    margin: 0 auto;
}

.legal-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 64px;
    line-height: 1.85;
    border-radius: 4px;
    text-align: center;
}

.legal-card h2 {
    font-size: 26px;
    color: var(--color-accent);
    margin-top: 48px;
    margin-bottom: 18px;
    font-weight: 400;
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 10px;
    text-align: center;
}

.legal-card h2:first-of-type {
    margin-top: 0;
}

.legal-card p {
    color: var(--color-text-muted);
    font-size: 15.5px;
    margin-bottom: 26px;
    text-align: center;
}

.legal-card ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 26px;
    display: inline-block;
    text-align: left;
}

.legal-card ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 14px;
    font-size: 15px;
    color: var(--color-text-muted);
}

.legal-card ul li::before {
    content: "■";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-size: 9px;
    top: 3px;
}

@media(max-width: 768px) {
    .legal-card {
        padding: 40px 24px;
    }
}

/* Centered Planner / Configurator Split Layout */
.planner-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
    margin: 80px auto;
    max-width: 700px;
}

.planner-preview-panel {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 48px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 4px;
    width: 100%;
}

.preview-svg-render {
    width: 100%;
    max-width: 420px;
    height: auto;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    background-color: var(--color-bg);
}

.configurator-controls {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 48px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.configurator-controls form {
    width: 100%;
}

.configurator-controls label {
    text-align: center;
    width: 100%;
}

.select-button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
    width: 100%;
}

.selector-btn {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 14px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-radius: 2px;
}

.selector-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-text-primary);
}

.selector-btn.selected {
    border-color: var(--color-accent);
    background-color: var(--color-surface-hover);
    color: var(--color-accent);
    box-shadow: var(--shadow-brass);
}

.form-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    margin-top: 24px;
    width: 100%;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: var(--color-border);
    height: 4px;
    outline: none;
    margin-bottom: 24px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-accent);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--color-accent-hover);
    transform: scale(1.15);
}

/* Centered Dual Column Layout (Split Display) */
.split-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
    padding: 100px 0;
    max-width: 800px;
    margin: 0 auto;
}

.split-display div {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.split-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    border-radius: 4px;
}

/* Custom Fine Grain Finishes Grid */
.finishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    justify-content: center;
}

.finish-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 32px;
    text-align: center;
    transition: var(--transition-smooth);
    border-radius: 4px;
}

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

.finish-swatch {
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.4);
}

/* Tech Specs Table and Image */
.spec-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
    padding: 100px 0;
    max-width: 800px;
    margin: 0 auto;
}

.spec-grid div {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hardware-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    border-radius: 4px;
}

.tech-specs-table {
    width: 100%;
    max-width: 650px;
    margin: 40px auto 0;
    border-collapse: collapse;
}

.tech-specs-table th {
    border-bottom: 2px solid var(--color-accent);
    padding: 16px;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 20px;
}

.tech-specs-table td {
    border-bottom: 1px solid var(--color-border);
    padding: 18px 16px;
    font-size: 15px;
    text-align: center;
    color: var(--color-text-muted);
}

/* Study Section Specific Grid */
.study-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
    padding: 100px 0;
    max-width: 800px;
    margin: 0 auto;
}

.study-grid div {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.study-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    border-radius: 4px;
}

/* Contact Page Layout split */
.contact-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
    padding: 100px 0;
    max-width: 800px;
    margin: 0 auto;
}

.contact-layout > div {
    width: 100%;
}

.contact-layout form {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.studio-details-card {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 56px;
    border-radius: 4px;
}

.contact-method-item {
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 28px;
    margin-bottom: 28px;
    text-align: center;
}

.contact-method-item h4 {
    font-size: 18px;
    color: var(--color-accent);
    margin-bottom: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-align: center;
}

.form-control {
    width: 100%;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 16px;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 14.5px;
    transition: var(--transition-smooth);
    border-radius: 3px;
    text-align: center;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: var(--color-surface-hover);
}

/* Double-column Form Row helper */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

@media(max-width: 576px) {
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Testimonials */
.testimonials {
    padding: 120px 0;
    text-align: center;
    background: radial-gradient(circle at bottom, #231229 0%, var(--color-bg) 70%);
    border-top: 1px solid var(--color-border);
}

.testimonial-quote {
    font-family: var(--font-serif);
    font-size: 28px;
    line-height: 1.5;
    max-width: 940px;
    margin: 0 auto 28px;
    font-style: italic;
    color: var(--color-text-primary);
}

.testimonial-author {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-accent);
}

/* Split layout for About Page details */
.split-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
    padding: 100px 0;
    max-width: 800px;
    margin: 0 auto;
}

.split-content > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.craft-badge {
    background-color: var(--color-surface);
    border: 1px solid var(--color-accent);
    padding: 48px;
    text-align: center;
    border-radius: 4px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Global Footer styling - Centered */
footer {
    background-color: #08040A;
    border-top: 1px solid var(--color-border);
    padding: 100px 0 50px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 48px;
    margin-bottom: 80px;
    text-align: center;
}

@media(max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-col h5 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-accent);
    margin-bottom: 28px;
}

.footer-col p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.85;
}

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

.footer-links li {
    margin-bottom: 14px;
}

.footer-links a {
    font-size: 14px;
    color: var(--color-text-muted);
}

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

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Floating Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 30px;
    right: 30px;
    max-width: 400px;
    background: rgba(30, 18, 36, 0.98);
    border: 1px solid var(--color-accent);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    z-index: 10000;
    transform: translateY(150px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    border-radius: 4px;
}

.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}

@media(max-width: 576px) {
    .cookie-banner {
        bottom: 15px;
        left: 15px;
        right: 15px;
        max-width: none;
    }
}

.cookie-title {
    font-family: var(--font-serif);
    font-size: 19px;
    margin-bottom: 12px;
    color: var(--color-accent);
}

.cookie-text {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.cookie-buttons {
    display: flex;
    gap: 14px;
}

.cookie-btn {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 2px;
}

.cookie-btn-accept {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

.cookie-btn-accept:hover {
    background-color: var(--color-accent-hover);
}

.cookie-btn-deny {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.cookie-btn-deny:hover {
    border-color: var(--color-accent);
    color: var(--color-text-primary);
}

/* Tablet / Desktop Responsive Rules */
@media(max-width: 991px) {
    .desktop-nav, .header-cta {
        display: none;
    }
    .mobile-nav-toggle {
        display: block;
    }
}