/* Shared styles for the homepage and its section pages (EN and ES).
   They used to live inline in index.html; ten pages now use them, so one
   file instead of ten copies to keep in step. */
        /* Cambridge Style Typography: Classical yet sharp */
        .font-display { font-family: 'Cinzel', serif; } /* For names/logos */
        .font-serif { font-family: 'Cormorant Garamond', serif; } /* For headings */
        .font-sans { font-family: 'Lato', sans-serif; } /* For body text */

        /* Smooth reveal animation classes */
        .reveal {
            opacity: 0;
            transform: translateY(30px); /* Slightly more movement */
            transition: all 1.4s cubic-bezier(0.16, 1, 0.3, 1); /* Slower, more elegant ease */
        }
        .reveal.active {
            opacity: 1;
            transform: translateY(0);
        }

        /* Deep, rich background with Noise Texture */
        .bg-cambridge-dark {
            background-color: #080808; /* Slightly darker */
            position: relative;
        }
        
        /* Noise Overlay - Adds texture like high-quality paper */
        .bg-noise {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 50;
            opacity: 0.035;
            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)'/%3E%3C/svg%3E");
        }

        /* Custom selection color */
        ::selection {
            background: #A3C1AD;
            color: #000000;
        }
        
        /* Book hover effect */
        .book-card {
            transition: transform 0.5s ease, box-shadow 0.5s ease;
        }
        .book-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 25px 50px -12px rgba(255,255,255,0.03); /* Softer shadow */
        }
        .book-cover-shell {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.15);
            padding: 0;
            box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
            overflow: hidden;
        }
        .book-cover-image {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: contain;
            background: transparent;
            transition: transform 0.7s ease;
        }
        .book-card:hover .book-cover-image {
            transform: scale(1.02);
        }

        /* Drop Cap for the first letter of About section */
        .drop-cap::first-letter {
            float: left;
            font-family: 'Cormorant Garamond', serif;
            font-size: 4.5rem;
            line-height: 0.85;
            margin-right: 0.75rem;
            margin-top: -0.2rem;
            color: #e5e7eb; /* gray-200 */
            font-style: italic;
        }

        /* Light Theme Styles */
        html.light body {
            background-color: #f5f5f4;
            color: #1c1917;
        }
        html.light .bg-cambridge-dark {
            background-color: #f5f5f4;
        }
        html.light .bg-noise {
            opacity: 0.02;
        }
        html.light .book-cover-shell {
            background: transparent;
            border-color: rgba(17, 24, 39, 0.14);
            box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
        }
        html.light .book-cover-image {
            background: transparent;
        }
        html.light nav {
            background-color: rgba(250, 250, 249, 0.85) !important;
            border-color: rgba(0, 0, 0, 0.05) !important;
        }
        html.light .text-gray-100,
        html.light .text-gray-200,
        html.light .text-white {
            color: #1c1917 !important;
        }
        html.light .text-gray-300 {
            color: #292524 !important;
        }
        html.light .text-gray-400 {
            color: #44403c !important;
        }
        html.light .text-gray-500 {
            color: #57534e !important;
        }
        html.light .text-gray-600 {
            color: #78716c !important;
        }
        html.light .text-gray-700 {
            color: #a8a29e !important;
        }
        html.light .border-white\/5,
        html.light .border-white\/10,
        html.light .border-white\/20 {
            border-color: rgba(0, 0, 0, 0.1) !important;
        }
        html.light .bg-white\/\[0\.01\],
        html.light .bg-white\/\[0\.02\],
        html.light .bg-white\/\[0\.04\] {
            background-color: rgba(0, 0, 0, 0.02) !important;
        }
        html.light .hover\:bg-white\/\[0\.02\]:hover,
        html.light .hover\:bg-white\/\[0\.04\]:hover {
            background-color: rgba(0, 0, 0, 0.04) !important;
        }
        html.light #mobile-menu {
            background-color: #fafaf9 !important;
        }
        html.light .bg-black {
            background-color: #fafaf9 !important;
        }
        html.light .drop-cap::first-letter {
            color: #1c1917;
        }
        html.light .bg-neutral-900 {
            background-color: #e7e5e4 !important;
        }
        html.light footer {
            background-color: #f5f5f4;
        }
        html.light .hover\:text-white:hover {
            color: #1c1917 !important;
        }
        html.light .grayscale {
            filter: grayscale(100%) contrast(100%) brightness(100%);
        }

        /* Theme Toggle Button */
        .theme-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: transparent;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .theme-toggle:hover {
            border-color: rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.05);
        }
        html.light .theme-toggle {
            border-color: rgba(0, 0, 0, 0.1);
        }
        html.light .theme-toggle:hover {
            border-color: rgba(0, 0, 0, 0.3);
            background: rgba(0, 0, 0, 0.05);
        }
        .theme-toggle .sun-icon {
            display: none;
        }
        .theme-toggle .moon-icon {
            display: block;
        }
        html.light .theme-toggle .sun-icon {
            display: block;
        }
        html.light .theme-toggle .moon-icon {
            display: none;
        }

        /* Intellectual clusters map */
        .cluster-map-stage {
            position: relative;
            min-height: 34rem;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background:
                radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.1), transparent 42%),
                radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.08), transparent 46%),
                rgba(255, 255, 255, 0.01);
            overflow: hidden;
        }
        .cluster-lines {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }
        .cluster-lines line {
            stroke: rgba(148, 163, 184, 0.35);
            stroke-width: 1.2;
            stroke-dasharray: 6 7;
            animation: clusterFlow 14s linear infinite;
        }
        @keyframes clusterFlow {
            to {
                stroke-dashoffset: -160;
            }
        }
        .cluster-node {
            position: absolute;
            transform: translate(-50%, -50%);
            width: 11.5rem;
            min-height: 8.2rem;
            padding: 0.95rem;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(10, 10, 10, 0.78);
            backdrop-filter: blur(2px);
            text-align: center;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 0.4rem;
            transition: transform 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
            z-index: 2;
        }
        .cluster-node:hover {
            transform: translate(-50%, -50%) translateY(-4px);
            border-color: rgba(255, 255, 255, 0.4);
            background: rgba(15, 15, 15, 0.92);
        }
        .cluster-node-center {
            width: 14rem;
            min-height: 8.8rem;
            border-color: rgba(16, 185, 129, 0.45);
            background:
                radial-gradient(circle at 50% 10%, rgba(16, 185, 129, 0.18), transparent 52%),
                rgba(10, 10, 10, 0.86);
        }
        .cluster-eyebrow {
            font-size: 0.52rem;
            text-transform: uppercase;
            letter-spacing: 0.22em;
            color: #94a3b8;
        }
        .cluster-title {
            font-family: 'Cormorant Garamond', serif;
            font-size: 1.1rem;
            line-height: 1.15;
            color: #e7e5e4;
            font-style: italic;
        }
        .cluster-meta {
            font-size: 0.62rem;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: #78716c;
        }
        html.light .cluster-map-stage {
            border-color: rgba(0, 0, 0, 0.1);
            background:
                radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.11), transparent 42%),
                radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.1), transparent 46%),
                rgba(0, 0, 0, 0.02);
        }
        html.light .cluster-lines line {
            stroke: rgba(71, 85, 105, 0.5);
        }
        html.light .cluster-node {
            border-color: rgba(0, 0, 0, 0.12);
            background: rgba(250, 250, 249, 0.9);
        }
        html.light .cluster-node:hover {
            border-color: rgba(0, 0, 0, 0.28);
            background: rgba(255, 255, 255, 1);
        }
        html.light .cluster-node-center {
            border-color: rgba(5, 150, 105, 0.45);
            background:
                radial-gradient(circle at 50% 10%, rgba(16, 185, 129, 0.2), transparent 52%),
                rgba(255, 255, 255, 0.95);
        }
        html.light .cluster-eyebrow {
            color: #64748b;
        }
        html.light .cluster-title {
            color: #292524;
        }
        html.light .cluster-meta {
            color: #57534e;
        }
        html.light .cluster-node-center .cluster-title {
            color: #1c1917;
        }

        /* Publication actions (cite/repository) */
        .paper-actions {
            margin-top: 1rem;
            display: flex;
            gap: 0.55rem;
            flex-wrap: wrap;
            align-items: center;
        }
        .paper-action-btn,
        .paper-action-link {
            font-size: 0.62rem;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            border: 1px solid rgba(255, 255, 255, 0.14);
            color: #9ca3af;
            padding: 0.45rem 0.65rem;
            background: rgba(255, 255, 255, 0.01);
            transition: all 0.28s ease;
        }
        .paper-action-btn:hover,
        .paper-action-link:hover {
            border-color: rgba(255, 255, 255, 0.52);
            color: #f5f5f4;
            background: rgba(255, 255, 255, 0.05);
        }
        .paper-action-btn {
            cursor: pointer;
        }

        /* Citation modal */
        .citation-modal {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.72);
            backdrop-filter: blur(2px);
            z-index: 90;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        .citation-modal.active {
            display: flex;
        }
        .citation-modal-card {
            width: min(860px, 100%);
            max-height: 88vh;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: #0b0b0b;
            padding: 1rem;
            overflow: auto;
        }
        .citation-modal-head {
            display: flex;
            justify-content: space-between;
            gap: 1rem;
            align-items: flex-start;
            margin-bottom: 0.9rem;
        }
        .citation-modal-title {
            font-family: 'Cormorant Garamond', serif;
            font-size: 1.25rem;
            color: #f5f5f4;
            line-height: 1.2;
        }
        .citation-modal-close {
            border: 1px solid rgba(255, 255, 255, 0.14);
            color: #a8a29e;
            background: transparent;
            padding: 0.35rem 0.6rem;
            font-size: 0.62rem;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            cursor: pointer;
        }
        .citation-modal-close:hover {
            border-color: rgba(255, 255, 255, 0.45);
            color: #f5f5f4;
        }
        .citation-modal pre {
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(255, 255, 255, 0.02);
            color: #d6d3d1;
            padding: 0.9rem;
            font-size: 0.72rem;
            line-height: 1.55;
            white-space: pre-wrap;
            word-break: break-word;
            margin-bottom: 0.9rem;
        }

        html.light .paper-action-btn,
        html.light .paper-action-link {
            border-color: rgba(0, 0, 0, 0.14);
            color: #57534e;
            background: rgba(0, 0, 0, 0.02);
        }
        html.light .paper-action-btn:hover,
        html.light .paper-action-link:hover {
            border-color: rgba(0, 0, 0, 0.35);
            color: #1c1917;
            background: rgba(0, 0, 0, 0.05);
        }
        html.light .citation-modal {
            background: rgba(0, 0, 0, 0.4);
        }
        html.light .citation-modal-card {
            border-color: rgba(0, 0, 0, 0.12);
            background: #fafaf9;
        }
        html.light .citation-modal-title {
            color: #1c1917;
        }
        html.light .citation-modal-close {
            border-color: rgba(0, 0, 0, 0.15);
            color: #44403c;
        }
        html.light .citation-modal-close:hover {
            border-color: rgba(0, 0, 0, 0.35);
            color: #1c1917;
        }
        html.light .citation-modal pre {
            border-color: rgba(0, 0, 0, 0.1);
            background: rgba(0, 0, 0, 0.03);
            color: #292524;
        }

        /* Overview call-to-action buttons */
        .overview-cta {
            display: inline-flex;
            align-items: center;
            border: 1px solid rgba(255, 255, 255, 0.14);
            padding: 0.42rem 0.65rem;
            font-size: 0.62rem;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: #9ca3af;
            transition: all 0.28s ease;
        }
        .overview-cta:hover {
            border-color: rgba(255, 255, 255, 0.48);
            color: #f5f5f4;
            background: rgba(255, 255, 255, 0.05);
        }
        html.light .overview-cta {
            border-color: rgba(0, 0, 0, 0.14);
            color: #57534e;
            background: rgba(0, 0, 0, 0.02);
        }
        html.light .overview-cta:hover {
            border-color: rgba(0, 0, 0, 0.32);
            color: #1c1917;
            background: rgba(0, 0, 0, 0.05);
        }
    
