:root {
    /* UPDATED to match original upper/lower background palette */
    --color-bg-dark: #0a0e1a;
    --color-bg-navy: #111827;

    /* Existing accent + text colors unchanged */
    --color-bg: #1b3264;
    --color-cyan: #06b6d4;
    --color-orange: #f97316;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;

    /* Compatibility vars for below-stats sections */
    --color-accent-cyan: var(--color-cyan);
    --color-accent-orange: var(--color-orange);
    --color-text-primary: var(--color-text);
    --color-text-secondary: #cbd5e1;
    --font-display: 'Playfair Display', serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-elegant: 'Cormorant Garamond', serif;
}

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

body {
    font-family: 'IBM Plex Sans', sans-serif;
    /* UPDATED to use the dark base background */
    background: var(--color-bg-dark);
    color: var(--color-text);
    line-height: 1.6;
}

/* Nav */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    background: rgba(27, 50, 100, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-cyan);
}

/* Hero */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    /* UPDATED to use the dark base background */
    background: var(--color-bg-dark);
    /* ADDED for pseudo-element glow containment */
    overflow: hidden;
}

/* ADDED: hero glow as pseudo-element */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background:
        radial-gradient(ellipse at center, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(249, 115, 22, 0.10) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ADDED: ensure hero content is above the glow */
.hero > * {
    position: relative;
    z-index: 1;
}

.hero-name {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 700;
    margin-bottom: 4rem;
}

.hero-main {
    display: grid;
    grid-template-columns: 1fr 400px 1fr;
    gap: 4rem;
    max-width: 1400px;
    width: 100%;
    align-items: start;
}

.brain-image-container {
    position: relative;
    display: flex;
    justify-content: center;
}

.brain-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

.copy-left,
.copy-right {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.copy-block h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-cyan);
    margin-bottom: 1rem;
}

.copy-block.technologist h2 {
    color: var(--color-orange);
}

.copy-block.storyteller h2 {
    color: #ef4444;
}

.copy-block p {
    font-size: 1rem;
    color: rgba(248, 250, 252, 0.9);
    margin-bottom: 1rem;
}

.copy-block blockquote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-style: italic;
    border-left: 3px solid var(--color-cyan);
    padding-left: 1.5rem;
    color: rgba(248, 250, 252, 0.85);
    margin: 1.5rem 0;
}

.copy-block.technologist blockquote {
    border-left-color: var(--color-orange);
}

.copy-block.storyteller blockquote {
    border-left-color: #ef4444;
}

.copy-block cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-family: 'IBM Plex Sans', sans-serif;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1400px;
    margin: 4rem auto;
    padding: 3rem 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section Styles */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 4rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.section-title-alt {
    font-family: var(--font-elegant);
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--color-text-secondary);
}

.section-intro {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* About Section */
.about {
    background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-navy) 100%);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(249, 115, 22, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.about-content {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-intro {
    font-family: var(--font-elegant);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}

.about-text strong {
    color: var(--color-accent-orange);
    font-weight: 600;
}

.about-achievements {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    position: sticky;
    top: 120px;
    backdrop-filter: blur(10px);
}

.about-achievements h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent-orange);
}

.about-achievements ul {
    list-style: none;
}

.about-achievements li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.about-achievements li:last-child {
    border-bottom: none;
}

.about-achievements li::before {
    content: '->';
    position: absolute;
    left: 0;
    color: var(--color-accent-cyan);
    font-weight: 600;
}

/* Innovator Section */
.innovator-section {
    background: var(--color-bg-navy);
    position: relative;
}

.work-block {
    background: rgba(17, 24, 39, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.work-header h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-text-primary);
}

.work-role {
    font-size: 1.1rem;
    color: var(--color-accent-cyan);
    margin-top: 0.5rem;
}

.work-date {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.work-description {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.work-description p {
    margin-bottom: 1.5rem;
}

/* =========================
   Apple (single image only)
   ========================= */
/* Use this wrapper in HTML:
   <div class="apple-image"><img ...></div>
*/
.apple-image {
    max-width: 600px;     /* change this to size it */
    margin: 2rem auto 0;  /* centers it */
}

.apple-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.video-placeholder {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    border-color: var(--color-accent-cyan);
    background: rgba(17, 24, 39, 0.8);
}

.video-placeholder span {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.video-placeholder p {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.video-placeholder small {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Video Embeds (used in CLEAN HTML) */
.video-embed {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.video-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}

.video-title {
    padding: 0.9rem 1rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* =========================
   DC "More DC Stories" carousel + lightbox (FIXED SECTION ONLY)
   ========================= */

/* Title line above the carousel */
.more-dc-title {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Carousel layout: [<] [viewport] [>] */
.dc-carousel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Button styling */
.dc-carousel-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(17, 24, 39, 0.45);
    color: var(--color-text);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    flex: 0 0 auto;
    font-size: 1.5rem;
    line-height: 1;
}

.dc-carousel-btn:hover {
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(17, 24, 39, 0.65);
    transform: translateY(-1px);
}

/* IMPORTANT: viewport is the scroll container (matches your JS viewport.scrollBy) */
.dc-carousel-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 0.25rem 0.25rem 0.6rem;
}

.dc-carousel-viewport::-webkit-scrollbar {
    height: 10px;
}
.dc-carousel-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}
.dc-carousel-viewport::-webkit-scrollbar-track {
    background: transparent;
}

/* Track is NOT the scroll container; it just needs to be wider than the viewport */
.dc-carousel-track {
    display: inline-flex;
    gap: 1rem;
    width: max-content;
}

/* Thumb buttons */
.dc-thumb {
    flex: 0 0 auto;
    width: 150px;
    height: 95px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.55);
    overflow: hidden;
    cursor: pointer;
    display: block;
    scroll-snap-align: start;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dc-thumb:hover {
    transform: translateY(-2px);
    border-color: rgba(249, 115, 22, 0.30);
}

.dc-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Lightbox: supports your JS that toggles `hidden` */
.dc-lightbox[hidden] {
    display: none !important;
}

.dc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dc-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 0;
}

.dc-lightbox-figure {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: min(1200px, 92vw);
    max-height: 86vh;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dc-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 86vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Responsive tweaks for thumbs */
@media (max-width: 900px) {
    .dc-thumb {
        width: 140px;
        height: 90px;
    }
}

@media (max-width: 520px) {
    .dc-carousel {
        gap: 0.5rem;
    }

    .dc-carousel-btn {
        width: 38px;
        height: 38px;
    }

    .dc-thumb {
        width: 132px;
        height: 86px;
    }
}

/* Book Card Text (container) */
.book-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* DC Projects */
.dc-projects {
    margin-top: 2rem;
}

.dc-projects h4 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent-orange);
}

.project-list {
    list-style: none;
}

.project-list li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-secondary);
    position: relative;
    padding-left: 2rem;
}

.project-list li:last-child {
    border-bottom: none;
}

.project-list li::before {
    content: 'â—†';
    position: absolute;
    left: 0;
    color: var(--color-accent-cyan);
    font-size: 0.8rem;
    top: 1.1rem;
}

/* Storyteller Section */
.storyteller-section {
    background: linear-gradient(180deg, var(--color-bg-navy) 0%, var(--color-bg-dark) 100%);
    position: relative;
}

.storyteller-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 20%, rgba(239, 68, 68, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 30% 80%, rgba(249, 115, 22, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.books-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.book-cover-container {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
}

.book-card:hover .book-cover-container {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(249, 115, 22, 0.3);
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9) 0%, rgba(10, 14, 26, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.book-cover-placeholder p {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    color: var(--color-text-primary);
}

.book-info h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-text-primary);
}

.book-description {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.book-link {
    color: var(--color-accent-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-block;
}

.book-link:hover {
    color: var(--color-accent-orange);
    transform: translateX(4px);
}

.books-cta {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

.books-cta a {
    color: var(--color-accent-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.books-cta a:hover {
    color: var(--color-accent-cyan);
}

/* Contact Section */
.contact {
    background: var(--color-bg-dark);
    padding: 4rem 0;
}

.contact-intro {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.contact-link:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent-cyan);
    background: rgba(17, 24, 39, 0.8);
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-accent-cyan), var(--color-accent-orange));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-bg-dark);
}

/* Footer */
.footer {
    background: var(--color-bg-navy);
    padding: 3rem 4rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Responsive adjustments (below stats only) */
@media (max-width: 900px) {
    .section-container {
        padding: 4rem 2rem;
    }

    .section-title,
    .section-title-alt {
        font-size: 2.6rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .work-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-link {
        width: 100%;
        justify-content: center;
    }

    /* keep Apple image sensible on smaller screens too */
    .apple-image {
        max-width: 100%;
    }
}

@media (max-width: 520px) {
    .section-title,
    .section-title-alt {
        font-size: 2.2rem;
    }

    .section-intro {
        font-size: 1.1rem;
    }

    .about-achievements {
        padding: 2rem;
    }
}

/* --- Added: hero deep-link styling + page smooth scroll (minimal) --- */

/* Ensure hero "Technologist" / "Storyteller" links keep existing colors */
.hero .copy-block a.hero-deeplink{
  color: inherit;
  text-decoration: none;
}
.hero .copy-block a.hero-deeplink:hover,
.hero .copy-block a.hero-deeplink:focus-visible{
  text-decoration: underline;
  text-underline-offset: .15em;
}

/* Smooth in-page anchor scrolling */
html{
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}