        html {
            scroll-behavior: smooth;
        }

        body {
            background-color: #000;
            color: #fff;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
            transition: opacity 0.5s ease;
        }

        /* 3D Book Styles */
        .book-scene {
            perspective: 1000px;
            width: 240px;
            height: 360px;
            position: relative;
            will-change: transform;
        }

        .book-aura {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 150%;
            height: 150%;
            transform: translate(-50%, -50%);
            filter: blur(60px);
            opacity: 0;
            transition: opacity 0.5s ease;
            z-index: 0;
            pointer-events: none;
            /* Performance: force GPU layer for blur */
            transform: translate3d(-50%, -50%, 0);
        }

        .group:hover .book-aura {
            opacity: 0.4;
        }

        .book {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transform: rotateY(-25deg) rotateX(5deg);
            transition: transform 0.5s ease;
            will-change: transform;
        }

        .group:hover .book {
            transform: rotateY(-10deg) rotateX(5deg) translateZ(20px);
        }

        .book-face {
            position: absolute;
            backface-visibility: hidden;
        }

        .book-front {
            width: 100%;
            height: 100%;
            transform: translateZ(20px);
            box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.5);
        }

        .book-spine {
            width: 40px;
            height: 100%;
            background: #111;
            transform: rotateY(-90deg) translateZ(20px);
            left: -20px;
        }

        /* Page effect on side */
        .book-pages {
            width: 38px;
            height: 96%;
            background: #eee;
            background: repeating-linear-gradient(90deg, #fff 0px, #ddd 1px, #fff 2px);
            position: absolute;
            top: 2%;
            right: -18px;
            transform: rotateY(90deg);
        }

        /* Scroll Progress */
        #scroll-progress {
            position: fixed;
            top: 0;
            left: 0;
            height: 3px;
            background: linear-gradient(90deg, #22c55e, #3b82f6);
            z-index: 9999;
            width: 0%;
            transition: width 0.1s ease-out;
            box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
            will-change: width;
        }

        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: #000;
        }

        ::-webkit-scrollbar-thumb {
            background: #333;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        .noise {
            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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
            pointer-events: none;
            z-index: 40;
            position: fixed;
            inset: 0;
            opacity: 0.05;
        }

        .spotlight {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 30;
            background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.04), transparent 40%);
            /* Optimized for transforms if we were moving it via transform, but it uses background pos - keep as is or consider simplifying */
        }

        .ambient-glow {
            position: fixed;
            top: 50%;
            left: 50%;
            width: 120vw;
            height: 120vh;
            transform: translate(-50%, -50%);
            background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
            pointer-events: none;
            z-index: 1;
            animation: breathe 10s ease-in-out infinite alternate;
            will-change: transform, opacity;
        }

        @keyframes breathe {
            0% {
                opacity: 0.3;
                transform: translate(-50%, -50%) scale(0.95);
            }

            100% {
                opacity: 0.6;
                transform: translate(-50%, -50%) scale(1.05);
            }
        }

        header {
            transition: background-color 0.3s, backdrop-filter 0.3s;
        }

        header.scrolled-nav {
            background-color: rgba(5, 5, 5, 0.85);
            /* Optimize backdrop filter - can be heavy */
            -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        #fs-menu {
            transition: opacity 0.3s ease, visibility 0.3s ease;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            cursor: pointer;
        }

        #fs-menu.is-active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }

        #fs-menu nav {
            cursor: default;
        }

        .hamburger-btn .bar {
            transition: transform 0.3s ease;
        }

        .hamburger-btn.is-active .bar-top {
            transform: translateY(4px) rotate(45deg);
        }

        .hamburger-btn.is-active .bar-bot {
            transform: translateY(-4px) rotate(-45deg);
        }

        .nav-link {
            position: relative;
            color: #a1a1aa;
            transition: color 0.3s;
        }

        .nav-link:hover,
        .nav-link.active {
            color: #fff;
        }

        .nav-link::before {
            content: '';
            position: absolute;
            bottom: -4px;
            left: 50%;
            width: 0;
            height: 1px;
            background: #fff;
            transition: width 0.3s, left 0.3s;
        }

        .nav-link:hover::before,
        .nav-link.active::before {
            width: 100%;
            left: 0;
        }

        .link-underline {
            text-decoration: none;
            position: relative;
            display: inline-block;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.1em;
            padding-bottom: 4px;
            color: inherit;
        }

        .link-underline::after {
            content: '';
            position: absolute;
            width: 100%;
            transform: scaleX(0);
            height: 1px;
            bottom: 0;
            left: 0;
            background-color: currentColor;
            transform-origin: bottom right;
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .link-underline:hover::after {
            transform: scaleX(1);
            transform-origin: bottom left;
        }

        .cursor-blink {
            display: inline-block;
            width: 2px;
            height: 1em;
            background-color: #a1a1aa;
            margin-left: 4px;
            vertical-align: middle;
            animation: blink 1s step-end infinite;
        }

        @keyframes blink {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0;
            }
        }

        .writing-vertical-lr {
            writing-mode: vertical-lr;
        }

        .libutton {
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 7px;
            text-align: center;
            outline: none;
            text-decoration: none !important;
            color: #ffffff !important;
            width: 100%;
            height: 40px;
            border-radius: 4px;
            background-color: #0A66C2;
            font-family: "Plus Jakarta Sans", Helvetica, sans-serif;
            font-weight: 700;
            font-size: 0.85rem;
            transition: background-color 0.2s, transform 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .libutton:hover {
            background-color: #004182;
            transform: translateY(-2px);
        }

        /* Range Slider Improved for Touch */
        input[type=range] {
            -webkit-appearance: none;
            width: 100%;
            background: transparent;
            cursor: pointer;
            height: 12px;
            border-radius: 2px;
            margin: 10px 0;
        }

        input[type=range]:focus {
            outline: none;
        }

        input[type=range]::-webkit-slider-runnable-track {
            width: 100%;
            height: 4px;
            background: #27272a;
            border-radius: 2px;
            transition: background 0.3s;
        }

        input[type=range]:hover::-webkit-slider-runnable-track {
            background: #3f3f46;
        }

        input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            height: 20px;
            width: 20px;
            border-radius: 0;
            background: #000;
            border: 2px solid #22c55e;
            transform: rotate(45deg);
            margin-top: -8px;
            transition: transform 0.1s, box-shadow 0.3s;
        }

        input[type=range]:active::-webkit-slider-thumb {
            transform: rotate(45deg) scale(1.3);
            box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
        }

        .toggle-btn {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            padding: 8px 24px;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 2rem;
        }

        .toggle-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: #fff;
        }

        .tooltip {
            position: relative;
        }

        .tooltip::after {
            content: "Copied!";
            position: absolute;
            bottom: 120%;
            left: 50%;
            transform: translateX(-50%);
            background: #22c55e;
            color: #000;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: bold;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
            font-family: 'JetBrains Mono', monospace;
            text-transform: uppercase;
        }

        .tooltip.show-tooltip::after {
            opacity: 1;
        }