:root {
    --bg-color: #0d0d0f;
    /* Deep charcoal */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a2;
    --accent-color: #3b82f6;
    /* Subtle functional blue/indigo */
    --accent-glow: rgba(59, 130, 246, 0.4);
    --surface-dark: #161618;
    --border-color: rgba(255, 255, 255, 0.1);
    --focus-ring: rgba(96, 165, 250, 0.9);
    --font-main: 'Inter', sans-serif;
    --container-width: 1280px;
    --header-height: 80px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Texture (Animated Noise) */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 100;
    /* Overlay on top of everything except header/tooltips */
    opacity: 0.35;
    /* Visual opacity of the layer */
    animation: grain 8s steps(10) infinite;
    mix-blend-mode: overlay;
}

/* Vignette */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Subtle cinematic vignette */
    background: radial-gradient(circle at center, transparent 40%, rgba(13, 13, 15, 0.6) 100%);
    pointer-events: none;
    z-index: 101;
    /* Overlay on top of noise */
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -10%);
    }

    20% {
        transform: translate(-15%, 5%);
    }

    30% {
        transform: translate(7%, -25%);
    }

    40% {
        transform: translate(-5%, 25%);
    }

    50% {
        transform: translate(-15%, 10%);
    }

    60% {
        transform: translate(15%, 0%);
    }

    70% {
        transform: translate(0%, 15%);
    }

    80% {
        transform: translate(3%, 35%);
    }

    90% {
        transform: translate(-10%, 10%);
    }
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.1;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

button,
input,
select {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 10000;
    transform: translateY(-150%);
    background: #fff;
    color: #111;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 100;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;

    /* HUD Effect */
    background: rgba(13, 13, 15, 0.6);
    /* Semi-transparent dark */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header.scrolled {
    /* Enhanced glass on scroll if needed, or keeping same */
    background: rgba(13, 13, 15, 0.85);
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* Left, Center, Right */
    align-items: center;
    padding: 0 3rem;
    /* More breathing room */
}

/* 1. Left: Logo Mark */
.site-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    z-index: 10;
}

.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-primary);
    /* Mono style */
}

.logo-icon {
    width: 32px;
    height: 32px;
    transition: filter 0.3s ease;
}

.site-logo:hover .logo-icon {
    filter: brightness(1.2);
    /* Subtle hover lift */
}

.logo-text {
    font-weight: 600;
    /* Slightly lighter than bold */
    letter-spacing: 0.08em;
    font-size: 1rem;
    /* Restrained */
    text-transform: uppercase;
    color: #e0e0e0;
}

/* 2. Center: Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 3rem;
    /* Increased spacing */
    height: 100%;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Active Indicator (Dot) */
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
}

/* 3. Right: Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    /* Enterprise slightly clearcut */
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Connect Button (Matches Nav Baseline) */
.btn-header {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
    overflow: visible;
}

.btn-header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-header:hover {
    border-color: rgba(96, 165, 250, 0.25);
    background: rgba(96, 165, 250, 0.04);
}

.btn-header:hover::after {
    opacity: 1;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

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

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

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

.btn-secondary:hover {
    border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    isolation: isolate;
    overflow: hidden;
}

/* Aurora wash — same palette as the footer's footer-aurora,
   tuned softer so it never competes with the globe. */
.hero-section::before {
    content: "";
    position: absolute;
    inset: -8% -4%;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(38% 32% at 22% 28%, rgba(59, 130, 246, 0.16), transparent 70%),
        radial-gradient(34% 30% at 82% 62%, rgba(120, 90, 255, 0.10), transparent 72%),
        radial-gradient(28% 26% at 50% 96%, rgba(0, 220, 255, 0.08), transparent 70%);
    filter: blur(36px);
    opacity: 0.85;
    animation: heroAuroraDrift 26s ease-in-out infinite alternate;
}

/* Bottom kernel seam — twin of the footer's top seam.
   Together they bracket the page in matching glowing thresholds. */
.hero-section::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(96, 165, 250, 0.55) 30%,
            rgba(255, 255, 255, 0.85) 50%,
            rgba(96, 165, 250, 0.55) 70%,
            transparent 100%);
    box-shadow:
        0 0 12px rgba(96, 165, 250, 0.45),
        0 0 32px rgba(59, 130, 246, 0.22);
    z-index: 5;
    pointer-events: none;
    animation: kernelSeam 6s ease-in-out infinite;
}

@keyframes heroAuroraDrift {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1.03); }
    50%  { transform: translate3d(2%, 1%, 0) scale(1.08); }
    100% { transform: translate3d(-1%, 2%, 0) scale(1.05); }
}

@keyframes kernelSeam {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1; }
}

.hero-container {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Left Column */
.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 3;
}

.headline {
    font-size: 4.2rem;
    margin-top: 1rem;
    margin-bottom: 1.75rem;
    letter-spacing: 0;
    line-height: 1.05;
    text-shadow: 0 24px 80px rgba(96, 165, 250, 0.14);
}

/* Continuous multi-color shimmer — same gradient as the footer's
   signoff-thanks-accent so the hero and footer "rhyme" across the page. */
.shimmer-text {
    background: linear-gradient(120deg,
            #6ef3ff 0%,
            #60a5fa 35%,
            #a78bfa 70%,
            #6ef3ff 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    animation: heroAccentShimmer 6s ease-in-out infinite;
}

@keyframes heroAccentShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}


.subhead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    max-width: 92%;
}

.disclaimer {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.01em;
    margin-bottom: 2rem;
}

/* Globe Instruction */
.globe-instruction {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.25rem;
    color: var(--accent-color);
    font-size: 0.9rem;
    opacity: 0.9;
}

.globe-instruction .icon {
    font-size: 1.2rem;
    animation: spin-slow 4s linear infinite;
    display: inline-block;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Micro-links */
/* Micro-links Container */
.micro-links-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.24);
}

.micro-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ml-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.ml-status {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.micro-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.micro-link {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    font-family: inherit;
    opacity: 0.86;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.micro-link:hover,
.micro-link.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.55);
    color: var(--text-primary);
}

.micro-link:hover {
    transform: translateY(-1px);
}

/* Right Column */
.hero-visual {
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    isolation: isolate;
}

/* Aura cradling the globe — sits behind the canvas (z-index: -1)
   so the globe itself stays untouched. Echoes the footer orb-aura. */
.hero-visual::before {
    content: "";
    position: absolute;
    inset: -8% -4%;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 50%,
            rgba(96, 165, 250, 0.22) 0%,
            rgba(120, 90, 255, 0.10) 38%,
            transparent 65%);
    filter: blur(42px);
    animation: heroGlobeAura 11s ease-in-out infinite alternate;
}

@keyframes heroGlobeAura {
    0%   { transform: scale(1);    opacity: 0.7; }
    100% { transform: scale(1.08); opacity: 1;   }
}

.globe-card {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    /* Optional: Card Styling
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    */
}

#globe-container {
    width: 100%;
    height: 100%;
    cursor: grab;
    opacity: 0.82;
    filter: saturate(0.92) brightness(0.96);
    transform: scale(1.04);
    transform-origin: center;
}

#globe-container:active {
    cursor: grabbing;
}

.globe-caption {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    z-index: 4;
}

.globe-context {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    max-width: 260px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(13, 13, 15, 0.58);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    pointer-events: none;
    z-index: 4;
}

.globe-context-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--accent-color);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.globe-context p {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
    line-height: 1.45;
}

.hero-orbital-field {
    position: absolute;
    inset: -6% -5% -2%;
    pointer-events: none;
    z-index: 1;
}

.orbital-ring {
    position: absolute;
    inset: 8% 3%;
    border: 1px solid rgba(147, 197, 253, 0.13);
    border-radius: 50%;
    transform: rotate(-12deg);
}

.orbital-ring-two {
    inset: 18% 14%;
    border-color: rgba(110, 243, 255, 0.11);
    transform: rotate(16deg);
}

.orbital-axis {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.2), transparent);
}

.orbital-axis-y {
    left: 50%;
    right: auto;
    top: 8%;
    bottom: 8%;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent, rgba(147, 197, 253, 0.18), transparent);
}

.orbital-signal {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(147, 197, 253, 0.9);
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.72);
}

.orbital-signal-one {
    top: 22%;
    left: 25%;
}

.orbital-signal-two {
    right: 18%;
    bottom: 28%;
}

/* Scroll Cue */
.scroll-cue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
}

.scroll-line {
    width: 100%;
    height: 0%;
    background-color: var(--text-primary);
    animation: scroll-fill 2s infinite ease-in-out;
}

@keyframes scroll-fill {
    0% {
        height: 0%;
        top: 0;
    }

    50% {
        height: 100%;
        top: 0;
    }

    51% {
        height: 100%;
        bottom: 0;
        top: auto;
    }

    100% {
        height: 0%;
        bottom: 0;
        top: auto;
    }
}

/* Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -400px;
    width: 400px;
    background: var(--surface-dark);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    padding: 3rem;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.drawer.active {
    right: 0;
}

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

.drawer-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.drawer-summary {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.drawer-bullets {
    margin-bottom: 2rem;
    padding-left: 1.2rem;
    color: var(--text-primary);
}

.drawer-bullets li {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .header-container {
        padding: 0 1rem;
        grid-template-columns: auto 1fr auto;
        gap: 0.9rem;
    }

    .main-nav {
        display: flex;
        justify-content: flex-end;
        gap: 1.15rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .btn-header {
        padding: 0.55rem 0.9rem;
        font-size: 0.82rem;
    }

    .hero-section {
        min-height: auto;
        padding-bottom: 4rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 2rem;
        gap: 2rem;
    }

    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .subhead {
        max-width: 100%;
    }

    .micro-links {
        justify-content: center;
    }

    .hero-visual {
        height: 400px;
        order: 1;
    }

    .hero-orbital-field {
        inset: -10% 0 -4%;
    }

    .headline {
        font-size: 3rem;
    }

    .drawer {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 640px) {
    :root {
        --header-height: 68px;
    }

    .logo-text {
        display: none;
    }

    .header-container {
        gap: 0.65rem;
    }

    .main-nav {
        gap: 0.85rem;
    }

    .header-actions {
        display: none;
    }

    .hero-container {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
        overflow: hidden;
    }

    .headline {
        width: 100%;
        max-width: 22rem;
        font-size: 2.25rem;
    }

    .subhead {
        font-size: 1rem;
        width: 22rem;
        max-width: 22rem;
    }

    .disclaimer {
        margin-bottom: 1rem;
        width: 22rem;
        max-width: 22rem;
    }

    .globe-instruction {
        margin-bottom: 1.5rem;
    }

    .micro-links-container {
        width: 22rem;
        max-width: calc(100vw - 2rem);
        padding: 1rem;
        overflow: hidden;
    }

    .micro-links-header {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .ml-status {
        display: none;
    }

    .micro-links {
        gap: 0.6rem;
    }

    .micro-link {
        font-size: 0.78rem;
        padding: 0.42rem 0.66rem;
    }

    .hero-visual {
        height: 360px;
    }

    #globe-container {
        transform: scale(1);
    }

    .globe-context {
        position: absolute;
        left: 50%;
        bottom: 0.75rem;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: min(100%, 340px);
        text-align: left;
    }

    .globe-caption {
        right: 50%;
        bottom: 6.2rem;
        transform: translateX(50%);
    }
}

@media (max-width: 420px) {
    .header-actions {
        display: none;
    }

    .header-container {
        grid-template-columns: auto 1fr;
    }

    .headline {
        font-size: 2.08rem;
    }
}


/* Globe Tooltip */
.globe-tooltip {
    position: absolute;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
    pointer-events: none;
    /* Let mouse pass through */
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 99999 !important;
    /* Force Top */
    max-width: 280px;
    line-height: 1.4;
    font-family: var(--font-main);
}

.globe-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.globe-tooltip strong {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

/* --- Operating Leverage (Bento Grid) --- */
.bento-section {
    padding: 8rem 0;
    position: relative;
    z-index: 10;
}

.bento-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.bento-header {
    margin-bottom: 4rem;
    max-width: 600px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.bento-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    /* Spring-like easing */
    opacity: 0.7;
    /* Dim by default */
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Hover Interaction: Glow & Expand */
.bento-card:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
    /* Soft accent glow */
    transform: translateY(-4px);
}

.card-icon {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    /* Icon default state */
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.bento-card:hover .card-icon {
    opacity: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Bento Responsive adjustments */
@media (max-width: 768px) {
    .bento-section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* --- Kernel Section --- */
.kernel-section {
    padding: 8rem 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.kernel-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    /* Split Asymmetry: 2/3 Content, 1/3 Visual */
    gap: 5rem;
    align-items: start;
}

/* Header & Status */
.kernel-header {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.kernel-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: monospace;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* 1. Manifesto */
.manifesto-module {
    margin-bottom: 6rem;
}

.manifesto-headline {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
}

.manifesto-body p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: #d1d5db;
    /* slightly softer white */
    max-width: 90%;
}

.philosophy-quote {
    font-family: 'Merriweather', serif;
    font-style: italic;
    border-left: 2px solid var(--accent-color);
    padding-left: 1.5rem;
    margin-top: 3rem;
    font-size: 1.25rem;
    color: #e5e7eb;
}

.signature-container {
    margin-top: 3rem;
    opacity: 0.8;
}

.sig-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    /* transition handled via JS scroll observer or simple animation */
    /* animation: sign 3s ease forwards; -- Moved to JS class toggle */
    transition: stroke-dashoffset 3s ease;
}

.signature-svg.signed .sig-path {
    stroke-dashoffset: 0;
}


/* 2. Operational Log (Timeline) */
.operational-log {
    margin-bottom: 6rem;
}

.kernel-label {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 1px solid var(--border-color);
}

.timeline:hover .timeline-node {
    opacity: 0.4;
    /* Dim all */
}

.timeline:hover .timeline-node:hover {
    opacity: 1;
    /* Focus hovered */
}


.timeline-node {
    position: relative;
    margin-bottom: 3rem;
    transition: opacity 0.3s ease;
}

.node-marker {
    position: absolute;
    left: -2.35rem;
    /* Adjust to align with border */
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--bg-color);
    /* Cutout look */
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.timeline-node.current .node-marker {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-node:hover .node-marker {
    background: var(--text-primary);
    border-color: var(--text-primary);
}


.node-meta {
    display: block;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.node-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.node-desc {
    font-size: 0.95rem;
    color: #d1d5db;
    line-height: 1.5;
}

.highlight {
    color: var(--accent-color);
    font-family: monospace;
    font-size: 0.9em;
}

/* 3. The Stack */
.stack-module {
    margin-bottom: 6rem;
}

.stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stack-tag {
    font-family: monospace;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.stack-tag:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* 4. Input / Output */
/* .io-module { } removed empty rule */

.io-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Continuing to io-item below... */
.io-item {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.io-item:hover {
    border-left-color: var(--accent-color);
}


.io-type {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.io-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.io-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}


/* Right Visual */
.kernel-visual {
    position: sticky;
    top: 20%;
    height: fit-content;
}

.visual-wrapper {
    position: relative;
    border: 1px solid var(--border-color);
    padding: 1rem;
    /* frame */
}

.halftone-image {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%) contrast(120%) brightness(0.9);
    mix-blend-mode: screen;
    /* Blend into dark bg */
    opacity: 0.8;
}

.visual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='0' width='1' height='1' fill='rgba(255,255,255,0.1)'/%3E%3C/svg%3E");
    /* Dither pattern */
    pointer-events: none;
    mix-blend-mode: overlay;
}

.node-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.node-tag {
    font-family: monospace;
    font-size: 0.7rem;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
    line-height: 1.4;
}

.node-tag:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (max-width: 900px) {
    .kernel-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .kernel-visual {
        order: -1;
        /* visual top or bottom? user said 2/3 text, 1/3 visual. stacked visual might be good at top or absent on mobile */
        position: relative;
        top: 0;
    }
}

/* --- OS End-to-End Section (Blueprint) --- */
.os-section {
    position: relative;
    /* Use local variables for this section's specific palette */
    --os-bg: #070A0F;
    --os-surface: rgba(255, 255, 255, 0.035);
    --os-stroke: rgba(255, 255, 255, 0.10);
    --os-text: rgba(255, 255, 255, 0.92);
    --os-muted: rgba(255, 255, 255, 0.66);
    --os-faint: rgba(255, 255, 255, 0.40);
    --os-accent: #6EF3FF;
    --os-accent2: #9C7BFF;

    background: radial-gradient(1200px 700px at 70% 25%, rgba(110, 243, 255, 0.10), transparent 60%),
        radial-gradient(900px 500px at 35% 75%, rgba(156, 123, 255, 0.10), transparent 65%),
        linear-gradient(180deg, #0B1020, #0B1020);
    /* Blend from site bg */
    color: var(--os-text);
    overflow: hidden;
    padding: 96px 0;
}

.os-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.os-copy {
    max-width: 680px;
    margin-bottom: 28px;
}

.os-kicker {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--os-faint);
    margin: 0 0 14px;
}

.os-title {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
    margin: 0 0 14px;
    font-weight: 600;
}

.os-sub {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.5;
    color: var(--os-muted);
    max-width: 60ch;
}

.os-note {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

.os-stage {
    position: relative;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    min-height: 720px;
    /* SVG viewport height approx */
}

.os-noise {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    opacity: 0.22;
}

.os-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Animation Initial States (handled by GSAP mostly but good defaults) */
.bg-grid {
    opacity: 0;
}

.core,
.spine,
.into-core,
.chips,
.orbit,
.beams,
.outcomes {
    opacity: 0;
}

.node-dot {
    fill: rgba(255, 255, 255, 0.04);
    stroke: rgba(255, 255, 255, 0.20);
    stroke-width: 1.2;
}

.chips .chip {
    fill: rgba(255, 255, 255, 0.04);
    stroke: rgba(255, 255, 255, 0.10);
    stroke-width: 1;
    opacity: 0;
}

.beams .beam {
    stroke: url(#accentGrad);
    stroke-width: 1.6;
    stroke-linecap: round;
    fill: none;
    opacity: 0;
    filter: url(#softGlow);
}

.orbit .token circle {
    filter: none;
}

.os-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.chipText {
    position: absolute;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.02em;
    opacity: 0;
    /* GSAP reveals */
    transform: translateY(6px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Chip positioning percentages relative to SVG 1200x720 */
/* Chip positioning percentages relative to SVG 1200x720 */
.chipText--c3a {
    left: 34%;
    top: 56%;
    width: fit-content;
}

.chipText--c3b {
    left: 34%;
    top: 60%;
    width: fit-content;
}

.chipText--c6a {
    left: 66%;
    top: 62%;
    width: fit-content;
}

.chipText--c6b {
    left: 66%;
    top: 66%;
    width: fit-content;
}

.chipText--c5a {
    left: 55%;
    top: 88%;
    width: fit-content;
}

/* Left-Side System Telemetry */
.sys-status {
    position: absolute;
    left: 20px;
    top: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    /* GSAP reveal */
    transform: translateX(-10px);
}

.sys-row {
    font-family: monospace;
    font-size: 11px;
    display: flex;
    gap: 12px;
    color: var(--os-faint);
    letter-spacing: 0.05em;
}

.sys-label {
    width: 80px;
    text-align: right;
    color: var(--os-muted);
}

.sys-val {
    color: var(--os-accent);
}

.sys-val.highlight {
    color: #10b981;
    /* Success green */
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.cred-rail {
    position: absolute;
    right: 18px;
    top: 60px;
    /* Moved down to avoid crowding */
    width: min(360px, 38%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(10px);
}

.cred {
    pointer-events: auto;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 12px 12px;
    color: rgba(255, 255, 255, 0.82);
    cursor: default;
}

.cred-ic {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--os-accent), var(--os-accent2));
    margin-top: 4px;
    box-shadow: 0 0 18px rgba(110, 243, 255, 0.35);
    flex: 0 0 auto;
}

.cred-txt {
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.cred-miniNote {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    padding: 6px 4px 0;
}

@media (max-width: 820px) {
    .os-wrap {
        padding: 70px 16px;
    }

    .cred-rail {
        position: static;
        width: 100%;
        margin: 14px 14px 0;
    }

    .chipText {
        display: none;
    }

    /* mobile: keep it clean */
    .os-stage {
        min-height: 660px;
    }
}


/* --- Kernel Section --- */
.kernel-section {
    padding: 8rem 0;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.kernel-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 6rem;
    align-items: start;
}

.kernel-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

@media (max-width: 1024px) {
    .kernel-container {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

/* --- Kernel Actions (Portfolio/Library) --- */
.kernel-actions {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.action-item {
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-item:hover {
    border-left-color: var(--accent-color);
}

.action-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.action-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.action-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--os-accent);
    letter-spacing: 0.05em;
    padding: 2px 6px;
    background: rgba(110, 243, 255, 0.1);
    border-radius: 4px;
}

.action-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.action-item:hover .action-arrow {
    transform: translateX(4px);
    color: var(--accent-color);
}

.action-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Interaction Overlay in Visual Column */
.interaction-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.int-arrow {
    opacity: 0;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: opacity 0.3s, stroke-dashoffset 0.8s ease-out;
}

.int-arrow.active {
    opacity: 1;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 8px rgba(110, 243, 255, 0.6));
}

/* Globe Poster (Instant Load) */
#globe-container {
    position: relative;
    /* Ensure canvas and poster stack correctly */
}

.globe-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 52%, rgba(59, 130, 246, 0.16), transparent 36%),
        radial-gradient(circle at 52% 50%, rgba(255, 255, 255, 0.08), transparent 22%);
    transition: opacity 0.4s ease-out;
    pointer-events: none;
}

.poster-globe {
    position: relative;
    width: min(430px, 78%);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.24), transparent 9%),
        radial-gradient(circle at 68% 72%, rgba(59, 130, 246, 0.25), transparent 24%),
        radial-gradient(circle at 50% 50%, #1a1a1c 0%, #111827 58%, #09090b 100%);
    border: 1px solid rgba(147, 197, 253, 0.28);
    box-shadow:
        inset -34px -26px 80px rgba(0, 0, 0, 0.72),
        inset 16px 12px 40px rgba(255, 255, 255, 0.06),
        0 0 72px rgba(59, 130, 246, 0.2);
    overflow: hidden;
}

.poster-ring,
.poster-grid {
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    pointer-events: none;
}

.poster-ring {
    border: 1px solid rgba(147, 197, 253, 0.22);
}

.ring-one {
    transform: rotateX(68deg) rotateZ(-18deg);
}

.ring-two {
    transform: rotateY(64deg) rotateZ(22deg);
}

.poster-grid {
    inset: 0;
    opacity: 0.55;
    background:
        linear-gradient(90deg, transparent 48%, rgba(147, 197, 253, 0.16) 49%, rgba(147, 197, 253, 0.16) 51%, transparent 52%),
        linear-gradient(0deg, transparent 48%, rgba(147, 197, 253, 0.12) 49%, rgba(147, 197, 253, 0.12) 51%, transparent 52%);
    background-size: 64px 64px;
    mix-blend-mode: screen;
}

.globe-poster.fade-out {
    opacity: 0;
}

.globe-caption.loading {
    opacity: 0.7;
    color: var(--text-secondary);
}

.status-dot.sm {
    width: 6px;
    height: 6px;
    margin-right: 6px;
}

/* Library Page Styles */
.library-container {
    max-width: 1200px;
    margin: 8rem auto 4rem;
    /* Top margin accounts for fixed header */
    padding: 0 1.5rem;
}

.library-header {
    margin-bottom: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-end;
}

.lib-title {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.lib-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.lib-input,
.lib-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.lib-select option {
    background-color: #111;
    color: #e0e0e0;
    /* var(--text-primary) might be transparent in some contexts, safer to be explicit or use var if opaque */
}

.lib-input:focus,
.lib-select:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
}

.lib-input {
    min-width: 250px;
}

/* Shelf Grid */
.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    content-visibility: auto;
    /* Skip rendering off-screen content */
    contain-intrinsic-size: 1000px;
    /* Approximate height estimate to prevent scrollbar jump */
}



/* Premium Text-Only Book Card Styles */
.shelf-item {
    background: transparent;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    /* Enable 3D space */
    border: none;
    box-shadow: none;
}

/* The visual card itself */
.shelf-item.book-card {
    border-radius: 0 4px 4px 0;
    /* Spine on left */
    background: #111;
    /* Fallback */
    transform-style: preserve-3d;
    transition: transform 0.1s linear, box-shadow 0.2s ease;
    /* Fast for tilt */
    /* Base shadow */
    box-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Accessibility Focus */
.shelf-item:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    transform: translateY(-4px);
}

.shelf-item:focus-visible .book-sheen {
    opacity: 0.1;
}

.book-spine {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--accent-color);
    box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    border-radius: 2px 0 0 2px;
}

.book-face {
    height: 100%;
    background: linear-gradient(145deg, #1c1c1e, #141415);
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    /* Left padding for spine */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: none;
    border-radius: 0 4px 4px 0;
}

/* Sheen Layer */
.book-sheen {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    background-size: 200% 200%;
    background-position: 50% 50%;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    transition: opacity 0.2s ease;
    z-index: 5;
}

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

.book-rating {
    color: var(--accent-color);
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.book-tags {
    display: flex;
    gap: 0.5rem;
}

.book-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 100px;
}

.book-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-title {
    font-family: var(--font-primary, sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    text-wrap: balance;
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.book-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #555;
    text-align: right;
    font-family: monospace;
}


@media (max-width: 768px) {
    .library-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls-bar {
        width: 100%;
    }

    .lib-input,
    .lib-select {
        flex: 1;
    }
}

/* Library Detail Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    /* Glass blur for backdrop */
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.book-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    /* Fixed width desktop */
    max-width: 90vw;
    background: #111;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.book-drawer.active {
    transform: translateX(0);
}

.drawer-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.drawer-close:hover {
    color: #fff;
}

.drawer-content {
    padding: 3rem 2rem;
}

/* Header Area */
.drawer-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}

.drawer-header .drawer-cover-stub {
    display: none;
    /* Hide stub in header usually, unless needed */
}

.drawer-title {
    font-family: var(--font-primary, sans-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.drawer-author {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.drawer-meta-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
}

.drawer-rating {
    color: var(--accent-color);
    letter-spacing: 2px;
}

/* Body Area */
.drawer-body {
    line-height: 1.6;
    color: #ccc;
    font-size: 1rem;
}

.drawer-review {
    margin-bottom: 2rem;
    white-space: pre-wrap;
    /* Preserve formatting if JSON has breaks */
}

.drawer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.drawer-tags .book-tag {
    /* Reuse tag style but slight tweaks */
    padding: 4px 12px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
}

/* Mobile Bottom Sheet */
@media (max-width: 768px) {
    .book-drawer {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        /* Partial height */
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px 12px 0 0;
    }

    .book-drawer.active {
        transform: translateY(0);
    }

    .drawer-content {
        padding: 4rem 1.5rem 2rem;
        /* More top padding for close btn */
    }
}

/* Utility to prevent body scroll when drawer open */
body.drawer-open {
    overflow: hidden;
}

/* Library Controls & Filtering */
.controls-bar {
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 280px 1fr auto;
    gap: 2rem;
    align-items: start;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-wrapper {
    display: flex;
    flex-direction: column;
}

.search-wrapper .lib-input {
    width: 100%;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.tag-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-and-count {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
    min-width: 160px;
}

.result-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0.7;
}

/* Clear Filters Buttons */
.btn-text.hidden {
    display: none;
}

/* Shelf Visuals */
.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
    /* Subtle shelf lines: repeating gradient */
    background-image: linear-gradient(to bottom,
            transparent 0%,
            transparent calc(100% - 1px),
            rgba(255, 255, 255, 0.06) calc(100% - 1px),
            rgba(255, 255, 255, 0.06) 100%);
    background-size: 100% 440px;
    /* Adjust to match approx row height */
    /* Note: Row height is variable so this is imperfect but adds the "plank" vibe */
}

.filter-chip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-chip:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #111;
    /* Dark text on bright accent */
    font-weight: 600;
}

.sort-wrapper .lib-select {
    min-width: 140px;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: right;
    padding-right: 0;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.btn-text:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .controls-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .filter-section {
        min-width: 0;
        width: 100%;
    }

    .filter-header {
        width: 100%;
    }

    .lib-input {
        min-width: 0;
    }

    .tag-filters {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        /* Scrollbar space */
        flex-wrap: nowrap;
        max-width: 100%;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar for cleaner look if desired, but keep functionality */
        scrollbar-width: none;
    }

    .tag-filters::-webkit-scrollbar {
        display: none;
    }

    .search-wrapper,
    .sort-wrapper {
        width: 100%;
    }

    .sort-and-count {
        align-items: flex-start;
        width: 100%;
    }

    .sort-wrapper .lib-select {
        text-align: left;
        padding-right: 1.2rem;
    }
}

/* Page Transition Overlay */
.transition-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

.transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
    /* optional blur effect during transition */
    backdrop-filter: blur(4px);
}

/* --- Footer --- */
.site-footer {
    padding: 6rem 0 4rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    margin-top: auto;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.footer-main {
    display: flex;
    justify-content: center;
    padding-bottom: 2rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
}

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

.footer-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
    line-height: 1.5;
}

.back-to-top {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.back-to-top:hover {
    opacity: 1;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
    }
}

/* Category Tag Distinction */
.category-tag {
    border-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .globe-instruction .icon,
    .scroll-line,
    .status-dot,
    .hero-section::before,
    .hero-section::after,
    .hero-visual::before,
    .shimmer-text {
        animation: none !important;
    }

    .shimmer-text {
        background-position: 50% 50%;
    }
}
