:root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: rgba(0, 0, 0, 0.4);
    --border: #000000;
    --accent-ai: #ff5500;
    --accent-ps: #0066ff;
    --accent-c4d: #000000;
    --accent-ae: #000000;
    --accent-pr: #000000;
    --accent-vs: #000000;
    --font-main: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-accent: 'Manrope', sans-serif;
    --transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-main);
    line-height: 1.4;
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    height: 4.5rem; /* Fixed height for header */
}

.header .content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--fg);
}

.logo-container {
    cursor: pointer;
    font-family: var(--font-accent);
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 2rem;
    width: 100%;
}

/* Removed .header-wave and .wave-dot from here as they moved to hero */

.logo-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0em;
    color: var(--fg);
    width: fit-content;
    transform-origin: center;
    /* Optimization to prevent flicker */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    will-change: transform;
}

.logo-short {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: center;
    white-space: nowrap;
    z-index: 2;
    gap: 0.05em;
}

.logo-full {
    display: flex;
    justify-content: flex-start;
    white-space: nowrap;
    z-index: 1;
    opacity: 1;
    gap: 0.05em;
    /* Tight spacing */
}

.char {
    display: inline-block;
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.hero-content-left {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-wave {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: transparent;
}

.hero-text {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    width: fit-content;

    /* White box design element */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    padding: 3rem 3.5rem 3rem 0;
    border: none;
}

.hero-text .muted {
    font-family: var(--font-main);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    display: block;
    margin-top: 2rem;
    color: var(--muted);
    letter-spacing: -0.02em;
    line-height: 1.4;
    max-width: 45ch;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    display: flex;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 10;
}

/* Client Section */
.client-section {
    padding: 8rem 0;
    border-bottom: 1px solid var(--border);
    background-color: #ffffff;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.marquee-wrapper {
    width: 100vw;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 0;
    /* Removed padding to center perfectly */
    margin: 0;
}

.marquee-content {
    display: inline-flex;
    align-items: center;
    gap: 3rem;
    animation: scroll 120s linear infinite;
    width: max-content;
}

.client-item {
    font-family: var(--font-mono);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 500;
    color: var(--fg);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.dot {
    font-family: var(--font-main);
    font-size: 1.5rem;
    color: var(--muted);
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Section Common Styling */
.tool-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (max-width: 900px) {
    .header {
        height: 60px;
    }
    .content-wrapper {
        padding: 0 1.5rem;
        gap: 2rem;
    }
    .tool-section {
        padding: 3rem 0;
        height: auto;
        min-height: 100vh;
    }
    /* Hide desktop nav, show hamburger */
    .main-nav {
        display: none !important;
    }
    .hamburger {
        display: flex !important;
    }
}

/* ── Hamburger Button ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    pointer-events: auto;
    z-index: 1001;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: #000;
    transition: all 0.3s ease;
}

/* ── Mobile Full-Screen Menu ── */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 1.5rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.18, 1);
    pointer-events: auto;
}
.mobile-menu.open {
    transform: translateX(0);
}
.mobile-menu-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    pointer-events: auto;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.mobile-menu-close:hover { opacity: 1; }

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mobile-nav-link {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 12vw, 4.5rem);
    font-weight: 400;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    line-height: 1.15;
    transition: color 0.2s ease, letter-spacing 0.2s ease;
    pointer-events: auto;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #ff6b00;
    letter-spacing: 0.02em;
}
.mobile-menu-footer {
    position: absolute;
    bottom: 3rem;
    left: 1.5rem;
}


#three-d .micro-label,
#three-d .sub-caption {
    color: var(--muted);
}

#three-d .tool-interface::before {
    background: #fff; /* White divider for dark mode */
}

#three-d.mode-light .tool-interface::before {
    background: #000; /* Black divider for light mode */
}

.film-bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    /* Above content-wrapper (30) to cover text */
    pointer-events: none;
    overflow: hidden;
    /* Clip film roll to section boundaries */
}

.aftereffects-theme {
    background: var(--bg) !important;
    color: var(--fg);
}

.aftereffects-theme .muted,
.aftereffects-theme .sub-caption {
    color: var(--muted);
}

.aftereffects-theme .micro-label {
    color: var(--muted);
}

/* Ensure content wrapper is higher */
.content-wrapper {
    position: relative;
    z-index: 30;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    pointer-events: none;
    transition: all 1.15s cubic-bezier(0.33, 0, 0, 1);
}

.text-content,
.tool-interface {
    pointer-events: auto;
    /* Re-enable for text and controls */
    transition: all 1.15s cubic-bezier(0.33, 0, 0, 1);
}

/* Tour Mode UI overrides removed to match Studio grid position */
#three-d.tour-active .view-tour {
    opacity: 1;
    pointer-events: auto;
}

/* Ensure UI elements remain reachable over the canvas */
#three-d .content-wrapper {
    position: relative;
    z-index: 30;
}


.text-content {
    max-width: 600px;
}

.micro-label {
    font-family: var(--font-mono);
    /* Increased size as requested */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    opacity: 0.5;
    position: relative;
    /* Default back to relative flow */
    top: auto;
    left: auto;
    margin: 0 0 2rem 0;
}

/* Specific override for the center-aligned marquee section */
.client-section .micro-label {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    margin: 0;
}

.caption {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    transform-origin: left center;
    transition: transform 0.1s ease;
}

.sub-caption {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 400;
    white-space: nowrap;
    margin-top: 0;
    transition: transform 0.1s ease-out;
}

/* Bounding Box Styling */
.bounding-box {
    position: relative;
    padding: 1.5rem;
    margin: -1.5rem;
    display: inline-block;
    border: 1px solid transparent;
    transform-origin: left top;
    transition: border-color 0.3s;
}

.bounding-box:hover,
.bounding-box.active {
    border: 1px solid var(--accent-ps);
    border-style: solid;
}

.handle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border: 1px solid var(--accent-ps);
    border-radius: 50%;
    display: none;
    pointer-events: auto;
    z-index: 10;
}

.bounding-box:hover .handle,
.bounding-box.active .handle {
    display: block;
}

.handle-tl {
    top: -4px;
    left: -4px;
    cursor: nwse-resize;
    width: 10px;
    height: 10px;
}

.handle-tr {
    top: -4px;
    right: -4px;
    cursor: nesw-resize;
    width: 10px;
    height: 10px;
}

.handle-bl {
    bottom: -4px;
    left: -4px;
    cursor: nesw-resize;
    width: 10px;
    height: 10px;
}

.handle-br {
    bottom: -4px;
    right: -4px;
    cursor: nwse-resize;
    width: 10px;
    height: 10px;
}

/* Interaction Controls */
.tool-interface {
    /* Removed standard border to control start position */
    border-left: none;
    position: relative;
    padding-left: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

/* Vertical divider restored for all tool sections */
.tool-interface::before {
    content: '';
    position: absolute;
    left: 0;
    width: 1px;
    background: var(--border);
    /* Start line from top to match label */
    top: 0;
    bottom: 0;
    opacity: 0.2; /* Subtle presence */
}

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

.control-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.5;
}

select {
    padding: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
}

.canvas-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Flashlight Reveal Section */
.reveal-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* Reveal Section Structure */
.reveal-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through to controls */
    clip-path: circle(0px at 0px 0px);

    /* Mirror the .tool-section layout exactly */
    display: flex;
    align-items: center;
    padding: 6rem 4rem;
}

.reveal-bg {
    position: absolute;
    inset: 0;
    transition: opacity 0.3s ease;
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.reveal-content {
    /* Reset to normal flow to respect flex centering */
    position: relative;
    width: 100%;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    pointer-events: none;
}

.reveal-content .text-content {
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.reveal-content .micro-label {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reveal-content .sub-caption {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reveal-content .preset {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    pointer-events: auto;
    /* Re-enable clicks on buttons */
}

.reveal-content .preset.active,
.reveal-content .preset:hover {
    background: #ffffff;
    color: #000000;
}


/* Ensure static content handles interactivity */
.static-content {
    position: relative;
    z-index: 1;
}

/* Background Color Tuning */
#illustration {
    background-color: #ffffff;
}

#design {
    background-color: #f4f4f4 !important;
    /* Premium neutral gray shifted here */
}

#illustration .caption,
#illustration .sub-caption {
    mix-blend-mode: normal;
}

.tool-section#illustration:hover .background-text-layer {
    opacity: 1;
}

.grain-overlay {
    position: absolute;
    inset: 0;
    /* Clean CSS Noise - No external dependency */
    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");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.brush-presets {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1rem;
}

.preset {
    background: transparent;
    border: 1px solid var(--border);
    border-bottom: none;
    /* Fuse borders */
    color: var(--fg);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease-out;
    position: relative;
    width: 100%;
    transform-origin: right center;
}

.preset:last-child {
    border-bottom: 1px solid var(--border);
}

.preset:hover {
    background: #f5f5f5;
    padding-left: 1.5rem;
    /* Subtle internal push */
}

.preset.active {
    background: #000000;
    color: #ffffff;
    /* Pop out visual to the left */
    width: calc(100% + 20px);
    margin-left: -20px;
    padding-left: calc(1rem + 20px);
    /* Compensate padding to keep text aligned with others */

    z-index: 10;
    border-color: #000;
    border: 1px solid #000;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
}

/* Cleaned up duplicate style block */

.camera-toggle {
    cursor: pointer;
    padding: 2rem;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.timeline-container {
    width: 100%;
}

.timeline-track {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
    margin-top: 20px;
}

.timeline-markers-bottom {
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 0;
    height: 12px;
}

.marker-tick {
    position: absolute;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.marker-tick[style*="left: 0%"] {
    transform: none;
}

.marker-tick[style*="left: 100%"] {
    transform: translateX(-100%);
}

.film-metadata {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.meta-value {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg);
}

.playhead {
    width: 2px;
    height: 100%;
    background: var(--fg);
    position: absolute;
    left: 0;
    cursor: ew-resize;
    z-index: 10;
}

.playhead::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -4px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--fg);
}

.playhead-counter {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg);
    user-select: none;
}

/* 5 — FEATURE SPREAD (Interactive Flip Book) */
.premiere-theme {
    background: #f4f1ea;
    background-image:
        radial-gradient(#dcd9d0 1px, transparent 1px),
        linear-gradient(to bottom, #f4f1ea, #ece9e0);
    background-size: 40px 40px, 100% 100%;
    color: #1a1a1a;
}


.feature-spine {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #000;
    transform: translateX(-50%);
    z-index: 100;
    /* Higher than pages */
    pointer-events: none;
    opacity: 1;
}

/* Common Page Styles */
.book-leaf {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
    /* Improve anti-aliasing */
    backface-visibility: hidden;
}

/* Shadows for 3D realism */
.depth-shadow {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent 40%);
    opacity: 0;
    transition: opacity 0.8s;
    pointer-events: none;
    z-index: 5;
}

/* Static Base Layers */
.layer-bottom-left {
    left: 0;
    z-index: 1;
}

.layer-bottom-right {
    right: 0;
    z-index: 1;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* --- FLIPPERS --- */

/* Right Flipper (Next) */
.layer-flipper-right {
    right: 0;
    z-index: 10;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}

.layer-flipper-right.flipped {
    transform: rotateY(-180deg);
}

/* Left Flipper (Prev) */
.layer-flipper-left {
    left: 0;
    z-index: 10;
    transform-origin: right center;
    /* Pivots on spine (right side of this leaf) */
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}

.layer-flipper-left.flipped {
    transform: rotateY(180deg);
}

/* 5 — FEATURE SPREAD (Interactive Flip Book) */
.premiere-theme {
    background: #f4f1ea;
    color: #1a1a1a;
}




/* 3D Book Container for page-flip */
.feature-spread-book {
    position: relative;
    /* Aspect ratio for two portrait pages (spread) */
    aspect-ratio: 3 / 2;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: min(1000px, 95vw);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Individual Pages */
.page {
    background-color: #fff;
    overflow: hidden;
    border: none !important;
    /* Strictly no borders */
    box-shadow: none !important;
    /* Let container handle shadow */
}

.page.-left {
    border: none !important;
}

/* Page Content */
.page-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.page-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Page 0: The Base (Left) */
.page-base {
    background: #f4f1ea;
    /* Matches section bg, or slightly darker to define "Base" paper */
    height: 100%;
    width: 100%;
    /* Optional: Texture or subtle shading to show it's a "base" */
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.05));
}

/* Page 1: The Cover (Right) */
.cover-content {
    background: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    /* Remove inner border if user wants full black block look */
    border: none;
}

.cover-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

.cover-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    opacity: 0.7;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Page 2: Inner Cover (Back of Front Cover - Left) */
/* Reference: Beige Page with Black Strip on Right (Spine) */
.inner-cover-style {
    background: #f4f1ea;
    height: 100%;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inner-cover-style::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    /* Strip on the right (spine side for a Left page) */
    width: 15%;
    /* Approx width based on image */
    height: 100%;
    background: #1a1a1a;
}

.page-info-wrap {
    padding: 15% 10%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
    position: relative;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle spine line */
}

/* Black Intro Pages */
.page-intro-black {
    background-color: #1a1a1a;
    color: #fff;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 10%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .page-intro-black {
        padding: 8% 6%;
    }
}

.intro-left {
    align-items: flex-start;
    text-align: left;
}

.intro-right {
    align-items: flex-end;
    justify-content: flex-end;
    text-align: right;
}

.intro-title-large {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 10vw, 2.8rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.flip-hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.flip-hint:hover {
    color: rgba(255, 255, 255, 0.8);
}

.flip-icon {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Typography */
.unique-id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #999;
    margin-bottom: 2rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.feature-title {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    line-height: 1.2;
    color: #000;
    margin-bottom: 2rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    /* Limit to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feature-desc {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    max-width: 100%;
    margin-bottom: 3rem;
}

.feature-cta {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    text-align: center;
    color: #000;
    border: 1px solid #000;
    padding: 12px 24px;
    width: fit-content;
    height: auto;
    border-radius: 0;
    /* Box instead of circle */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    letter-spacing: 0.1em;
    line-height: 1.2;
    box-sizing: border-box;
}

.feature-cta:hover {
    background: #000;
    color: #fff;
    transform: scale(1.05);
}




.code-font {
    font-family: var(--font-mono);
    font-weight: 500;
}

.code-text {
    position: relative;
}

.code-text::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: var(--fg);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Syntax Highlighting for Logic Systems */
.syntax-keyword {
    color: #d19a66;
}

/* Orange */
.syntax-logic {
    color: #98c379;
}

/* Green */
.syntax-tech {
    color: #61afef;
}

/* Blue */
.syntax-creative {
    color: #c678dd;
}

/* Purple */
.syntax-string {
    color: #e06c75;
}

/* Red/Pink */
.syntax-comment {
    color: #5c6370;
    opacity: 0.6;
}

.logic-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    padding: 1rem;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.logic-btn.processing {
    border-color: transparent !important;
}

@property --glow-angle {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0deg;
}

/* Base styles for the glow layers - Instant ON, Soft OFF */
.tool-section::before,
.tool-section::after {
    content: '';
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Faster fade-out for snap response */
}

/* Internal Border Frame Overlay - Green Theme */
.tool-section::before {
    inset: 0;
    padding: 3px;
    background:
        linear-gradient(var(--bg), var(--bg)) padding-box,
        conic-gradient(from var(--glow-angle), #4CAF50, #81C784, #00E676, #81C784, #4CAF50) border-box;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.5s ease;
}

.tool-section.processing {
    animation: rotateGlow 3s linear infinite;
}

.tool-section.processing::before {
    opacity: 1;
    animation: rotateGlow 3s linear infinite;
}

/* REQ: After generating, take 0.5s change to white */
.tool-section.completed::before {
    opacity: 1;
    background:
        linear-gradient(var(--bg), var(--bg)) padding-box,
        linear-gradient(to right, #fff, #eee, #fff) border-box;
    transition: background 0.5s ease;
}

@keyframes rotateGlow {
    from {
        --glow-angle: 0deg;
    }

    to {
        --glow-angle: 360deg;
    }
}

.footer.mandala-theme {
    background: #000;
    color: #fff;
    padding: 8rem 0 0 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.footer-top {
    padding: 0 0 4rem 0;
    z-index: 10;
}

.footer-top .content-wrapper {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border: none;
    pointer-events: auto;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-link {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

#footer-email {
    color: #8a7eff;
    border-bottom-color: rgba(138, 126, 255, 0.2);
}

#footer-linkedin {
    color: #ff6b00;
    border-bottom-color: rgba(255, 107, 0, 0.2);
}

#footer-portfolio {
    color: #00a8a8;
    border-bottom-color: rgba(0, 168, 168, 0.2);
}

.footer-link:hover {
    border-bottom-color: currentColor;
    opacity: 0.8;
}

.footer-credit {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.5;
    text-align: right; /* Added for clarity */
}

.footer-marquee {
    width: 100%;
    overflow: hidden;
    background: #000;
    padding: 2rem 0 4rem 0;
}

.marquee-inner {
    display: flex;
    white-space: nowrap;
    animation: marquee-scroll 90s linear infinite;
    width: max-content;
}

.marquee-inner span {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: clamp(8rem, 20vw, 22rem);
    line-height: 0.8;
    letter-spacing: 0.05em;
    padding-right: 0.2em;
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 900px) {
    .footer-top {
        padding: 0 0 4rem 0;
    }
    .footer-top .content-wrapper {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
        padding: 0 1.5rem;
    }
    .footer-credit {
        text-align: left;
    }
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .content-wrapper {
        grid-template-columns: minmax(0, 1fr); /* STRICT constraint: prevents grid item blowout */
        gap: 2rem;
    }

    .tool-interface {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 3rem;
        margin-top: 2rem;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .tool-interface::before {
        display: none !important; /* Force hide vertical line on mobile */
    }

    .hero {
        padding: 6rem 1.5rem 2rem 1.5rem;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        height: auto;
        min-height: 100vh;
    }

    .hero-content-left {
        max-width: 100%;
    }

    .hero-text {
        font-size: 2.8rem;
        line-height: 1.1;
        padding: 2rem 1.5rem 2rem 0;
        width: 100%;
        margin-bottom: 1.5rem;
        background: rgba(255, 255, 255, 0.92);
    }

    .hero-text .muted {
        font-size: 1.1rem;
        margin-top: 1.5rem;
        max-width: 100%;
    }

    .bounding-box {
        margin: 0; /* Remove negative margins that cause overflow on small screens */
        padding: 0.5rem 0;
        width: 100%;
        border: none !important; /* Cleaner look on mobile */
    }

    .handle {
        display: none !important; /* Handles are hard to use on touch */
    }

    .text-content, .tool-interface {
        width: 100%;
        max-width: 100vw; /* Strict boundary */
        min-width: 0; /* Prevent grid column stretching */
        overflow-x: hidden; /* Hard clip */
        box-sizing: border-box;
    }

    .sub-caption {
        white-space: normal !important; /* Force override */
        word-wrap: break-word;
        word-break: break-word;
        line-height: 1.4;
        width: 100%;
    }

    input[type="range"], select {
        width: 100% !important;
        max-width: 100% !important; /* Ensure controls do not leak out of their container */
        box-sizing: border-box !important;
    }
    
    .color-picker-wrapper {
        display: block; /* Shields the input from flex column layout */
        width: 44px;
        height: 44px;
        border-radius: 50%;
        overflow: hidden;
    }
    
    input[type="color"] {
        display: block !important;
        width: 44px !important; /* Standard touch target size */
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        flex-basis: 44px !important;
        border-radius: 50% !important;
        border: none !important;
        padding: 0 !important;
        overflow: hidden !important;
        align-self: flex-start !important; /* Fix Chrome flex column stretch bug */
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }

    select {
        height: 44px; /* Native touch target height */
        background-color: transparent;
    }

    .reveal-container {
        padding: 4rem 1.5rem;
    }

    .reveal-content {
        grid-template-columns: minmax(0, 1fr); /* STRICT constraint */
        gap: 2rem;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .caption {
        font-size: 1.8rem !important; /* Smaller to prevent overlapping long phrases */
        line-height: 1.2;
        margin-bottom: 2rem;
    }

    .micro-label {
        font-size: 0.7rem;
        margin-bottom: 1.5rem;
        letter-spacing: 0.2em;
    }

    .footer-tagline {
        font-size: 2.5rem;
    }

    .feature-spread-book {
        aspect-ratio: 1.5 / 1;
        /* Wide aspect ratio for two-page spread on mobile */
        width: 100% !important;
        max-width: none;
        margin: 2rem auto 0;
    }

    .page-info-wrap {
        padding: 1.5rem !important;
    }

    .unique-id {
        font-size: 0.5rem !important;
        margin-bottom: 0.8rem !important;
    }

    .feature-title {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }

    .feature-cta {
        padding: 8px 16px !important;
        font-size: 8px !important;
        margin-top: 0.5rem;
    }

    .custom-cursor {
        display: none !important;
    }
}

/* Fix for mid-viewport clipping identified in deep check */
@media (min-width: 901px) and (max-width: 1150px) {
    .content-wrapper {
        grid-template-columns: 0.8fr 1.2fr;
        /* Give more space to the book */
        gap: 2rem;
    }

    .feature-spread-book {
        max-width: 100%;
    }
}

@media (min-width: 1151px) and (max-width: 1400px) {
    .feature-spread-book {
        max-width: 800px;
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 96px;
    /* Scale accordingly */
    height: 96px;
    pointer-events: none;
    z-index: 2147483647;
    opacity: 0;
    /* Hidden by default */
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, transform 0.1s ease-out;
    /* mix-blend-mode removed for visibility */
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 900px) {
    .custom-cursor {
        display: none !important;
    }
}
}

.custom-cursor img,
.custom-cursor svg {
    width: 100%;
    height: 100%;
    display: block;
    /* Animation handled by JS now */
}

@keyframes cursorPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.15) rotate(5deg);
    }
}

/* Hide default cursor only in Hero/Creator section */
.hero:hover {
    cursor: none;
}

/* Camera Controls (3-Button Layout) */
.camera-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cam-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none; /* Removed default blue focus ring */
}

.cam-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cam-btn:focus-visible {
    /* Subtle focus indicator that doesn't push edges */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.cam-btn.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.hidden-btn {
    display: none !important;
}

/* 3D Views */
.view-tour,
.view-render {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.view-tour.active,
.view-render.active {
    opacity: 1;
    pointer-events: auto;
}

/* 3D Tour Engine (Three.js) */
.view-tour {
    background: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.view-tour canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Scroll Hint Overlay */
.view-tour .scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    /* Move to bottom-left to avoid blocking the tour */
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    z-index: 40;
    pointer-events: none;
    letter-spacing: 0.1em;
}

.nav-hint {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: var(--muted);
    font-weight: 500;
}

.nav-hint.visible {
    opacity: 0.8;
}

/* Light Switch Styles */
.light-switch-wrap {
    position: absolute;
    bottom: 4.5rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
    pointer-events: auto;
}

.switch-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.switch-outer {
    width: 44px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-knob {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2.5px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* On State */
.switch-outer.active {
    background: #fff;
    border-color: #fff;
}

.switch-outer.active .switch-knob {
    background: #000;
    left: 24px;
}

/* Dynamic colors for the switch based on lightsOn (Dark/Light mode) */
#three-d .light-switch-wrap.mode-light .switch-label {
    color: rgba(0, 0, 0, 0.6);
}

#three-d .light-switch-wrap.mode-light .switch-outer {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

#three-d .light-switch-wrap.mode-light .switch-outer.active {
    background: #000;
    border-color: #000;
}

#three-d .light-switch-wrap.mode-light .switch-outer.active .switch-knob {
    background: #fff;
}

#three-d .light-switch-wrap.mode-light .switch-knob {
    background: #000;
}

#three-d.tour-active .view-tour .scroll-hint {
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
}

#three-d.tour-active .view-tour .light-switch-wrap {
    bottom: 4rem; /* Moved up to avoid overlap */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (max-width: 900px) {
    #three-d.tour-active .view-tour .light-switch-wrap {
        bottom: 2rem;
        padding: 0.5rem 1rem;
    }
    
    #three-d.tour-active .view-tour .scroll-hint {
        display: none; /* Less clutter on mobile */
    }
    
    .camera-controls {
        flex-wrap: wrap; /* Allow buttons to wrap if screen is very narrow */
        justify-content: flex-start; /* Left align on mobile */
    }

    /* Remove frames (filmstrip) for mobile only */
    .film-bg-layer {
        display: none !important;
    }

    /* Remove metadata for mobile only to keep it clean */
    .film-metadata {
        display: none !important;
    }

    /* Adjust timeline track margin for mobile */
    .timeline-track {
        margin-top: 10px;
    }
}

.switch-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-ctrl-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.switch-ctrl-btn:hover {
    color: #fff;
    opacity: 1;
}

#three-d .light-switch-wrap.mode-light .switch-ctrl-btn {
    color: rgba(0, 0, 0, 0.4);
}

#three-d .light-switch-wrap.mode-light .switch-ctrl-btn:hover {
    color: #000;
}

/* Flipbook Loading Indicator */
.flipbook-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    /* Dark background like intro page */
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: opacity 0.3s ease;
}

.loading-bar {
    width: 240px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: #ffffff;
    /* White progress bar for contrast */
    width: 0%;
    animation: loadingProgress 1.5s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
        margin-left: 0%;
    }

    50% {
        width: 60%;
        margin-left: 20%;
    }

    100% {
        width: 0%;
        margin-left: 100%;
    }
}

.loading-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    /* Light text for dark background */
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Portfolio Link Button - Closing Page */
.portfolio-link-btn {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: #fff;
    background: transparent;
    border: 2px solid #fff;
    width: 220px;
    height: 280px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    line-height: 1.3;
    z-index: 1;
}

@media (max-width: 900px) {
    .portfolio-link-btn {
        width: 100% !important;
        max-width: 280px;
        height: auto !important;
        padding: 1rem 2rem;
        font-size: 1.2rem;
        border-width: 1px;
    }
}

.portfolio-link-btn::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #fff;
    transition: height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

.portfolio-link-btn:hover {
    color: #1a1a1a;
    border-color: #fff;
}

.portfolio-link-btn:hover::before {
    height: 100%;
}

/* Closing Page (Want to See More) Styles */
.close-page-left {
    align-items: flex-start;
    justify-content: center;
    padding: 12% 10%;
}

.close-page-right {
    align-items: flex-end;
    justify-content: center;
    padding: 12% 10%;
}

.close-page-content {
    width: 100%;
    max-width: 400px;
}

.close-page-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

.close-page-title {
    font-family: var(--font-serif);
    font-weight: 300;
    margin-bottom: 2rem;
    font-size: 3.2rem;
    line-height: 1.1;
    color: #fff;
}

.close-page-desc {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 2.5rem;
}

.close-page-divider {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 900px) {
    .close-page-left, .close-page-right {
        padding: 5% 8%; 
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .close-page-title {
        font-size: 1.6rem; 
        margin-bottom: 0.8rem;
    }

    .close-page-label {
        font-size: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .close-page-desc {
        font-size: 0.8rem;
        margin-bottom: 1.2rem;
        line-height: 1.4;
    }

    .close-page-right {
        align-items: center; 
    }
}

/* ==================================================
   NEW INTERNAL PAGES (Tools, About, Contact) 
================================================== */
.page-container {
    padding-top: 8rem; /* Account for fixed header */
    min-height: calc(100vh - 400px); /* Fill space between header and footer */
    background: var(--bg);
}

.page-content {
    display: block !important;
    pointer-events: auto !important; /* Fixes unclickable links caused by content-wrapper wrapper */
}

.page-header {
    margin-bottom: 4rem;
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 4rem);
    font-weight: 500;
    line-height: 1;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-family: var(--font-main);
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 60ch;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    margin-bottom: 6rem;
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--fg);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: var(--border);
    background-size: cover;
    background-position: center;
}

.tool-card-content {
    padding: 1.5rem;
    background: #fff;
}

.tool-card-title {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-card-tagline {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Plugin Detail Template Layout - Landing Page Style */

.plugin-page-wrapper {
    pointer-events: auto;
    width: 100%;
}

.plugin-hero {
    text-align: center;
    max-width: 1000px;
    margin: 4rem auto 4rem auto;
    padding: 0 2rem;
    pointer-events: auto;
}

.back-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    margin-bottom: 3rem;
    letter-spacing: 0.15em;
    pointer-events: auto;
}

.back-link:hover {
    color: var(--fg);
}

.plugin-status-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-ai);
    border-radius: 50%;
}

.plugin-title {
    font-family: var(--font-main);
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.9;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.plugin-tagline {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--fg);
    text-transform: uppercase;
    margin-bottom: 3rem;
    letter-spacing: 0.1em;
}

.plugin-header-image {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background-color: #f5f5f5;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.plugin-intro-section {
    max-width: 900px;
    margin: 10rem auto;
    text-align: center;
    padding: 0 2rem;
}

.plugin-intro {
    font-family: var(--font-main);
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.plugin-video-band {
    width: 100%;
    background: #000;
    color: #fff;
    padding: 8rem 2rem;
    margin-bottom: 10rem;
}

.plugin-video-wrapper {
    max-width: 1100px;
    margin: 0 auto;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 3rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.plugin-highlights-section {
    max-width: 1200px;
    margin: 0 auto 10rem auto;
    padding: 0 2rem;
}

.highlights-header {
    text-align: center;
    margin-bottom: 5rem;
}

.highlights-header h3 {
    font-family: var(--font-main);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--border);
    border: 1px solid var(--border);
}

.highlight-item {
    padding: 3rem 2rem;
    background: var(--bg);
}

.highlight-item-number {
    font-family: var(--font-mono);
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: 0.7rem;
    display: block;
}

.highlight-item-text {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.primary-button {
    display: inline-block;
    background: #000;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1.25rem 3rem;
    letter-spacing: 0.1em;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
    border-radius: 2px;
    border: 1px solid #000;
}

.primary-button:hover {
    background: #ff6b00;
    border-color: #ff6b00;
    color: #fff;
    transform: translateY(-3px);
}

.primary-button:active {
    transform: translateY(0);
}

/* Outline variant hover (LinkedIn, Portfolio) */
.primary-button[style*="transparent"]:hover {
    background: #00a8a8 !important;
    color: #fff !important;
    border-color: #00a8a8 !important;
    transform: translateY(-3px);
}

.plugin-pricing-band {
    text-align: center;
    padding: 10rem 2rem;
    background: #f8f8f8; /* Light gray */
    margin-bottom: 10rem;
}

.pricing-title {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 3rem;
    line-height: 1;
}

.creator-block {
    max-width: 1000px;
    margin: 5rem auto 10rem auto;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    padding: 4rem;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
    align-items: center;
}

.creator-avatar {
    width: 200px;
    height: 200px;
    background-color: #f0f0f0;
    background-image: none;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.creator-bio {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.creator-bio h3 {
    font-family: var(--font-main) !important;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #000;
}

.creator-bio p {
    font-family: var(--font-main) !important;
    color: var(--muted) !important;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 50ch;
}

/* Specific styling for LinkedIn link to prevent browser defaults */
.linkedin-link, #p-linkedin {
    margin-top: 2rem;
    padding: 0.8rem 2rem;
    border: 1px solid #000 !important;
    text-decoration: none !important;
    font-family: var(--font-mono) !important;
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #000 !important;
    transition: all 0.3s ease;
    display: inline-block;
    background: transparent;
}

.linkedin-link:visited, #p-linkedin:visited {
    color: #000 !important;
}

.linkedin-link:hover, #p-linkedin:hover {
    background: #000 !important;
    color: #fff !important;
}

@media (max-width: 900px) {
    .highlights-grid {
        grid-template-columns: 1fr;
    }
    .creator-block {
        grid-template-columns: 1fr;
        gap: 1.5rem !important;
        text-align: center;
        margin: 0 1.5rem 10rem 1.5rem;
        padding: 3rem 1.5rem;
    }
    .creator-bio {
        align-items: center !important;
        text-align: center;
        width: 100%;
    }
    .creator-avatar {
        margin: 0 auto 1.5rem auto;
        flex-shrink: 0;
    }
    .linkedin-link {
        margin-left: auto;
        margin-right: auto;
    }
}