:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --accent: #7dd3fc;
    --accent-dim: #38bdf8;
    --accent-glow: rgba(125, 211, 252, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #1e293b;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 18px;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1.25rem;
    color: var(--accent);
    font-style: italic;
    white-space: nowrap;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.1rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

nav a:hover {
    color: var(--text-primary);
    background: var(--accent-glow);
}

nav a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* Main content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem 4rem;
}

/* Title */
.title-section {
    text-align: center;
    padding: 4rem 0 6rem;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.title-section h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-section .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Sections */
section {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

h2 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--accent);
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Lists */
ul, ol {
    margin: 1rem 0 1.5rem;
    padding-left: 0;
    list-style: none;
}

li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
    color: var(--text-secondary);
}

li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

li strong {
    color: var(--text-primary);
}

/* Links */
a {
    color: var(--accent-dim);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Blockquote */
blockquote {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(18, 18, 26, 0.5) 100%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    font-family: 'Instrument Serif', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
}

/* Thesis block */
.thesis-block {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(18, 18, 26, 0.5) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.thesis-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.thesis-block .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.thesis-block p {
    font-family: 'Instrument Serif', serif;
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0;
}

.thesis-block strong {
    color: var(--accent);
    font-style: normal;
}

/* Content card */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
}

.content-card h4 {
    margin-top: 0;
}

/* Code */
code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-card);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--border);
}

th {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
}

td {
    color: var(--text-secondary);
}

tr:nth-child(even) td {
    background: rgba(18, 18, 26, 0.3);
}

/* Images */
.image-container {
    margin: 2rem 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.image-container .caption {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
}

/* ASCII diagram */
.ascii-diagram {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    white-space: pre;
    color: var(--accent);
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 3rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    nav ul {
        justify-content: center;
    }

    main {
        padding: 5rem 1.25rem 2rem;
    }

    .thesis-block {
        padding: 1.5rem;
    }

    pre {
        padding: 1rem;
    }
}

/* Scroll margin for anchors */
[id] {
    scroll-margin-top: 80px;
}
