:root {
    /* Design Tokens from Stitch MCP */
    --primary: #ffb77b;
    --primary-container: #c8803f;
    --on-primary: #4d2700;

    --secondary: #d5c5a7;

    --surface-dim: #131313;
    --surface: #131313;
    --surface-container-lowest: #0e0e0e;
    --surface-container-low: #1c1b1b;
    --surface-container: #20201f;
    --surface-container-high: #2a2a2a;

    --on-surface: #e5e2e1;
    --outline: #a08d80;
    --outline-variant: #524439;

    /* Isoform Added Colors */
    --obsidian: #1a1a1a;
    --aged-parchment: #e8dcc4;
    --copper: #b87333;
    --verdigris: #5e9c8f;

    --font-heading: 'IM Fell Double Pica', serif;
    --font-body: 'Goudy Bookletter 1911', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--surface-dim);
    color: var(--on-surface);
    font-family: var(--font-body);
    overflow: hidden;
    /* Single page app, no global scroll */
    -webkit-font-smoothing: antialiased;
}

/* Typography */
.display-lg {
    font-family: var(--font-heading);
    font-size: 4rem;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 2rem;
}

.display-md {
    font-family: var(--font-heading);
    font-size: 3rem;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 2rem;
}

.body-md {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--on-surface);
}

.label-sm {
    font-size: 0.875rem;
    color: var(--outline);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Layout */
.split-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Forge Core (Left) */
.forge-core {
    position: fixed;
    top: 0;
    left: 0;
    width: 50vw;
    height: 100vh;
    background-color: var(--surface-container-lowest);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

/* Blueprint pattern */
.blueprint-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--outline-variant) 1px, transparent 1px),
        linear-gradient(90deg, var(--outline-variant) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.15;
    z-index: 2;
}

/* Parallax Layer */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300vh;
    z-index: 3;
    pointer-events: none;
}

.parallax-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 1px solid var(--outline-variant);
    opacity: 0.3;
    transform: rotate(45deg);
}

/* Central Logo */
.logo-container {
    position: relative;
    z-index: 10;
    width: 45vmin;
    height: 45vmin;
    max-width: 600px;
    max-height: 600px;
}

#revolving-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(255, 183, 123, 0.15));
}

/* Codex Shadow */
.codex-shadow {
    position: fixed;
    top: 0;
    left: 50vw;
    width: 50vw;
    height: 100vh;
    box-shadow: -15px 0 30px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 15;
}

/* Raised Codex (Right) */
.raised-codex {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    background-color: transparent;
    z-index: 20;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.raised-codex::-webkit-scrollbar {
    display: none;
}

/* Segments */
.segment {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    padding-left: calc(50vw + 4rem);
    position: relative;
    box-sizing: border-box;
}

/* Surface Depth Variations */
.segment-1 {
    background: linear-gradient(to right, transparent 50%, var(--surface-dim) 50%);
}

.segment-2 {
    background: linear-gradient(to right, transparent 50%, var(--surface-container-low) 50%);
}

.segment-2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50vw;
    right: 0;
    height: 1px;
    background-color: rgba(82, 68, 57, 0.15);
    /* Ghost Border */
}

.segment-3 {
    background: linear-gradient(to right, transparent 50%, var(--surface-container) 50%);
}

.segment-3::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50vw;
    right: 0;
    height: 1px;
    background-color: rgba(82, 68, 57, 0.15);
    /* Ghost Border */
}

.content-wrapper {
    max-width: 600px;
    width: 100%;
    position: relative;
}

/* Components */
.ledger-nav {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 0px solid transparent;
    padding-left: 0;
}

.nav-link-small {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 0px solid transparent;
    padding-left: 0;
}

.nav-link:hover {
    color: var(--primary);
    padding-left: 1.5rem;
    border-left: 2px solid var(--primary);
}

.nav-link-small:hover {
    color: var(--primary);
    padding-left: 1.5rem;
    border-left: 2px solid var(--primary);
}

.ledger-form {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.etched-input {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--outline);
    color: var(--on-surface);
    padding: 1rem 0;
    font-family: var(--font-body);
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.etched-input:focus {
    outline: none;
    border-bottom: 2px solid var(--primary);
    background-color: var(--surface-container-lowest);
    background-image: linear-gradient(var(--outline-variant) 1px, transparent 1px),
        linear-gradient(90deg, var(--outline-variant) 1px, transparent 1px);
    background-size: 10px 10px;
    padding-left: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    color: var(--on-primary);
    border: none;
    border-radius: 0;
    /* 0px roundedness */
    padding: 1.25rem 2rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(255, 183, 123, 0.4);
    transform: translateY(-2px);
}

/* =========================================
   High-Depth Overlay Panels
   ========================================= */

.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--obsidian);
    color: var(--aged-parchment);
    z-index: 50;
    visibility: hidden;
    /* Heavy mechanical shutter feel with a 3deg rotation */
    /* Handled dynamically via JavaScript, but base transition here */
    transition: transform 0.8s cubic-bezier(0.8, 0, 0.2, 1), visibility 0s 0.8s;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.95), 0 0 0 100vw rgba(0, 0, 0, 0.5);
    /* Deep shadow */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.panel-overlay.active {
    visibility: visible;
    transition: transform 0.8s cubic-bezier(0.8, 0, 0.2, 1), visibility 0s 0s;
}

/* Close Button */
.close-panel-btn {
    position: absolute;
    top: 2rem;
    right: 3rem;
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--copper);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 60;
}

.close-panel-btn:hover {
    color: var(--verdigris);
    text-shadow: 0 0 10px rgba(94, 156, 143, 0.5);
}

/* Center Panel Box (#about-panel) */
#about-panel .panel-content-box {
    width: 80%;
    max-width: 800px;
    background-color: transparent;
    padding: 3rem;
    position: relative;
    z-index: 10;
}

#about-panel h2 {
    font-family: var(--font-heading);
    color: var(--copper);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
}

.personnel-row {
    font-family: var(--font-body);
    font-size: 1.25rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--copper);
    color: var(--aged-parchment);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.personnel-row:first-of-type {
    border-top: 1px solid var(--copper);
}

.personnel-row strong {
    color: var(--copper);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: normal;
}

/* Projects Panel */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    width: 80%;
    max-width: 1000px;
    z-index: 10;
}

.project-tile {
    border: 2px solid var(--copper);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
}

.project-tile h3 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--copper);
    margin-bottom: 1rem;
    transition: color 0.4s ease;
}

.project-tile p {
    font-family: var(--font-body);
    color: var(--aged-parchment);
    font-size: 1.1rem;
    opacity: 0.8;
}

.project-tile:hover {
    border-color: var(--verdigris);
    box-shadow: inset 0 0 20px rgba(94, 156, 143, 0.1), 0 0 20px rgba(94, 156, 143, 0.3);
}

.project-tile:hover h3 {
    color: var(--verdigris);
}

/* Shutter Animation Overlay */
.shutter-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.shutter-blade {
    height: 50vh;
    background-color: var(--obsidian);
    border-top: 2px solid var(--copper);
    border-bottom: 2px solid var(--copper);
    transform: scaleY(0);
    transition: transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
}

.shutter-blade-top {
    transform-origin: top;
}

.shutter-blade-bottom {
    transform-origin: bottom;
}

.shutter-overlay.closing .shutter-blade {
    transform: scaleY(1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
}