@import url('/public/css/xplug-responsive.css');

/**
 * Xplug Thesis - a16z Research Memo Style
 * Editorial essay layout with restrained, readable design
 * Scoped classes only: .xplug-thesis-*
 */

/* ============================================================
   Reset & Base
   ============================================================ */
.xplug-thesis-wrapper {
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    padding-top: 120px; /* Account for logo only */
}

/* Ambient System Field Background */
.xplug-thesis-wrapper {
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

/* Base gradient layer - static */
.xplug-thesis-wrapper::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 45% 55%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 55% 45%, rgba(255, 255, 255, 0.02) 0%, transparent 60%),
        #0a0a0a;
    pointer-events: none;
    z-index: 0;
    will-change: background-position;
}

/* Animated gradient layer - ultra-slow motion */
.xplug-thesis-wrapper::after {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.025) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
    animation: thesis-ambient-shift 100s ease-in-out infinite;
    will-change: opacity, transform;
}

/* Ultra-slow ambient animation - barely perceptible */
@keyframes thesis-ambient-shift {
    0%, 100% {
        opacity: 0.6;
        transform: translate(0, 0) scale(1);
    }
    25% {
        opacity: 0.62;
        transform: translate(-1%, 1%) scale(1.005);
    }
    50% {
        opacity: 0.6;
        transform: translate(1%, -1%) scale(0.998);
    }
    75% {
        opacity: 0.58;
        transform: translate(0, 0) scale(1);
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .xplug-thesis-wrapper::after {
        animation: none;
        opacity: 0.6;
    }
}

/* ============================================================
   Two-Column Layout (Desktop)
   ============================================================ */
.xplug-thesis-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    position: relative;
    z-index: 1; /* Ensure content sits above background */
}

@media (min-width: 1024px) {
    .xplug-thesis-container {
        grid-template-columns: 780px 1fr;
        gap: 80px;
        padding: 0 48px 0 80px; /* Shift content to the right */
        align-items: start;
    }
}

/* ============================================================
   Main Content Area
   ============================================================ */
.xplug-thesis-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 60px 0;
}

@media (min-width: 1024px) {
    .xplug-thesis-main {
        margin: 0 0 0 32px; /* Shift content to the right */
        padding: 80px 0;
    }
}

/* ============================================================
   Typography - a16z Memo Style
   ============================================================ */
.xplug-thesis-title {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.98);
    margin-bottom: 12px;
    text-align: left;
}

@media (min-width: 768px) {
    .xplug-thesis-title {
        font-size: 48px;
    }
}

.xplug-thesis-subtitle {
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin-bottom: 48px;
    text-align: left;
}

@media (min-width: 768px) {
    .xplug-thesis-subtitle {
        font-size: 19px;
    }
}

/* Lead paragraph (intro) */
.xplug-thesis-intro {
    font-size: 16.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 64px;
    text-align: left;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.xplug-thesis-intro p {
    margin-bottom: 16px;
}

.xplug-thesis-intro p:last-child {
    margin-bottom: 0;
}

/* Body text */
.xplug-thesis-section-body {
    font-size: 16.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.8);
    text-align: left;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.xplug-thesis-section-body p {
    margin-bottom: 16px;
}

.xplug-thesis-section-body p:last-child {
    margin-bottom: 0;
}

/* Section headings */
.xplug-thesis-section-heading {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 0;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
    text-align: left;
}

@media (min-width: 768px) {
    .xplug-thesis-section-heading {
        font-size: 32px;
    }
}

/* ============================================================
   Spacing System
   ============================================================ */
.xplug-thesis-header {
    margin-bottom: 0;
}

.xplug-thesis-section {
    margin-bottom: 88px;
}

@media (min-width: 768px) {
    .xplug-thesis-section {
        margin-bottom: 104px;
    }
}

.xplug-thesis-section:last-of-type {
    margin-bottom: 64px;
}

/* Lists */
.xplug-thesis-section-body ul {
    list-style: none;
    padding-left: 0;
    margin: 18px 0;
}

.xplug-thesis-section-body li {
    margin-bottom: 10px;
    padding-left: 0;
}

.xplug-thesis-section-body li:last-child {
    margin-bottom: 0;
}

.xplug-thesis-section-body p + ul,
.xplug-thesis-section-body ul + p {
    margin-top: 18px;
}

/* ============================================================
   Section Numbering (subtle)
   ============================================================ */
.xplug-thesis-section-heading {
    display: flex;
    align-items: baseline;
    gap: 0;
}

.xplug-thesis-section:nth-of-type(1) .xplug-thesis-section-heading::before {
    content: '01';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(2) .xplug-thesis-section-heading::before {
    content: '02';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(3) .xplug-thesis-section-heading::before {
    content: '03';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(4) .xplug-thesis-section-heading::before {
    content: '04';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(5) .xplug-thesis-section-heading::before {
    content: '05';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(6) .xplug-thesis-section-heading::before {
    content: '06';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(7) .xplug-thesis-section-heading::before {
    content: '07';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

.xplug-thesis-section:nth-of-type(8) .xplug-thesis-section-heading::before {
    content: '08';
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    margin-right: 12px;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Memo Callouts (Blockquotes)
   ============================================================ */
.xplug-thesis-callout {
    position: relative;
    padding: 1.25rem 1.5rem 1.25rem 2rem;
    margin: 24px 0;
    background: rgba(255, 255, 255, 0.015);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    text-align: left;
    font-style: normal;
}

.xplug-thesis-callout br {
    display: block;
}

/* ============================================================
   Table of Contents (Desktop)
   ============================================================ */
.xplug-thesis-toc {
    display: none;
}

@media (min-width: 1024px) {
    .xplug-thesis-toc {
        display: block;
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-top: 80px;
    }

    .xplug-thesis-toc-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .xplug-thesis-toc-item {
        margin-bottom: 4px;
    }

    .xplug-thesis-toc-link {
        display: block;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.4);
        text-decoration: none;
        padding: 3px 0 3px 8px;
        border-left: 1px solid transparent;
        transition: all 0.2s ease;
        line-height: 1.4;
        letter-spacing: -0.01em;
    }

    .xplug-thesis-toc-link:hover {
        color: rgba(255, 255, 255, 0.55);
    }

    .xplug-thesis-toc-link.active {
        color: rgba(255, 255, 255, 0.8);
        border-left-color: rgba(255, 255, 255, 0.45);
        font-weight: 500;
    }
}

/* Mobile TOC (collapsed dropdown) */
@media (max-width: 1023px) {
    .xplug-thesis-toc-mobile {
        display: block;
        margin-bottom: 32px;
        padding-top: 40px;
    }

    .xplug-thesis-toc-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        color: rgba(255, 255, 255, 0.7);
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        text-align: left;
    }

    .xplug-thesis-toc-mobile-list {
        display: none;
        list-style: none;
        padding: 12px 0;
        margin: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .xplug-thesis-toc-mobile-list.open {
        display: block;
    }

    .xplug-thesis-toc-mobile-item {
        margin-bottom: 6px;
    }

    .xplug-thesis-toc-mobile-link {
        display: block;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.6);
        text-decoration: none;
        padding: 6px 16px;
        transition: color 0.2s;
    }

    .xplug-thesis-toc-mobile-link:hover {
        color: rgba(255, 255, 255, 0.8);
    }
}

@media (min-width: 1024px) {
    .xplug-thesis-toc-mobile {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xplug-thesis-toc-link {
        transition: none;
    }
}

/* ============================================================
   End of Thesis Marker & CTA
   ============================================================ */
.xplug-thesis-end-signal {
    text-align: left;
    margin: 64px 0 24px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.xplug-thesis-end-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 0.02em;
    margin: 0;
}

.xplug-thesis-cta-container {
    margin: 32px 0 80px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    text-align: left;
    transition: all 0.2s ease;
}

.xplug-thesis-cta-container:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.xplug-thesis-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.xplug-thesis-cta:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 1);
}

.xplug-thesis-cta:active {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .xplug-thesis-cta-container,
    .xplug-thesis-cta {
        transition: none;
    }
}

/* ============================================================
   Strong/Bold Text
   ============================================================ */
.xplug-thesis-section-body strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* ============================================================
   Remove Line Breaks (normalize)
   ============================================================ */
.xplug-thesis-section-body br {
    display: none;
}

.xplug-thesis-callout br {
    display: block;
}

