/* CSS Reset and Variables */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-canvas: #160f2e;
    --bg-surface: rgba(35, 25, 66, 0.92);
    --bg-surface-solid: #231942;
    --text-primary: #ffffff;
    --text-muted: #d1c9e8;
    --accent-primary: #e0409b;
    --accent-secondary: #f59e0b;
    --border-subtle: #3d2b63;

    --font-stack: Charter, "Bitstream Charter", Cambria, Georgia, serif;
    
    --radius-card: 20px;
    --ease-kinetic: cubic-bezier(0.22, 0.61, 0.36, 1);
    --duration: 400ms;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    hyphens: auto;
    padding: 16px; /* Space for the fixed frame */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Fixed Outer Border Margin */
.viewport-frame {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid var(--border-subtle);
    pointer-events: none;
    z-index: 9999;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.5rem; }

.small-caps, .meta-tag, .nav-link, .btn {
    font-variant: small-caps;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

p { margin-bottom: 1.5rem; color: var(--text-muted); }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header & Nav */
.site-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
    position: static;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.brand {
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand:hover { text-decoration: none; }

.brand-monogram {
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    color: var(--bg-canvas);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

.primary-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
    color: var(--accent-primary);
    text-decoration: none;
}

/* Mobile Nav */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Layout Core */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.article-container {
    max-width: 72ch;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Hero Overlapping Grid */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 5rem;
}

.hero-text .meta-tag {
    display: block;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.hero-overlap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
}

.hero-detail-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
}

.hero-detail-img:nth-child(1) { transform: translateY(30px); }
.hero-detail-img:nth-child(2) { transform: translateY(0); z-index: 2; }
.hero-detail-img:nth-child(3) { transform: translateY(50px); }

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 4rem;
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.bento-span-2 { grid-column: span 2; }
.bento-card .meta-tag {
    color: var(--accent-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

.bento-card h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.bento-card p { flex: 1; }

.bento-image-layer {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.15;
    background-size: cover;
    background-position: center;
}

/* Buttons */
.btn {
    background: var(--accent-primary);
    color: var(--bg-canvas);
    text-decoration: none;
    padding: 12px 24px;
    font-weight: bold;
    border: 1px solid var(--bg-canvas);
    box-shadow: 4px 4px 0 var(--text-primary);
    transition: transform 0.1s var(--ease-kinetic), box-shadow 0.1s var(--ease-kinetic);
    display: inline-block;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    text-decoration: none;
    color: var(--bg-canvas);
}

.btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--text-primary);
}

/* Imagery */
.macro-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-card);
    margin: 2rem 0;
    border: 1px solid var(--border-subtle);
}

/* Forms & Tables */
.contact-panel {
    background: var(--bg-surface-solid);
    padding: 2rem;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-primary); }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: inherit;
    border-radius: 4px;
}
.form-group input:focus, .form-group textarea:focus {
    outline: 2px solid var(--accent-primary);
    border-color: transparent;
}

.data-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface-solid);
    border-radius: var(--radius-card);
    overflow: hidden;
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
th { background: rgba(0,0,0,0.2); font-variant: small-caps; }

/* FAQ Accordion Base (JS free version) */
.faq-list { margin-top: 2rem; }
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.faq-question {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    margin-top: 5rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
    border-top: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    font-size: 0.875rem;
}
.footer-col h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--accent-primary); }

.legal-text { margin-top: 2rem; color: var(--text-muted); font-size: 0.75rem; }

/* Scroll Reveals */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--duration) var(--ease-kinetic), transform var(--duration) var(--ease-kinetic);
}
.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* Mobile Breakpoints */
@media (max-width: 768px) {
    .top-bar { align-items: flex-start; }
    .tagline { display: none; }
    .mobile-nav-toggle { display: block; }
    .primary-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        padding-top: 1rem;
    }
    .primary-nav.is-open { display: flex; }
    .hero-section { grid-template-columns: 1fr; }
    .hero-overlap { grid-template-columns: 1fr; }
    .hero-detail-img:nth-child(n) { transform: none; height: 180px; }
    .bento-span-2 { grid-column: span 1; }
    body { padding: 8px; }
}