/* --- Main Design System & Global Variables --- */

:root {
    /* Color Palette (Dark Theme - Softer for Readability) */
    --color-bg: #151517;       /* Slightly lighter than pitch black */
    --color-bg-alt: #1e1e21;   /* Elevated cards background */
    --color-bg-alt-rgb: 30, 30, 33;
    --color-text: #cccccc;     /* Softer off-white to prevent glowing/halation */
    --color-text-muted: #8e8e93;
    --color-accent: #e5e5ea;   /* Not pure white for accents */
    --color-accent-dim: rgba(255, 255, 255, 0.12);
    --color-link: #66b3ff;

    /* Dynamic Theme Variables */
    --color-text-main: #e5e5ea;
    --nav-bg: rgba(21, 21, 23, 0.7);
    --nav-bg-scrolled: rgba(21, 21, 23, 0.9);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --tooltip-bg: rgba(30, 30, 33, 0.98);
    --tooltip-shadow: rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-primary: 'Crimson Pro', Georgia, serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing System */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --space-2xl: 12rem;

    /* Layout & Borders */
    --essay-max-width: 820px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --transition-fast: 0.2s ease;
    --transition-slow: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Global HTML & Body Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.theme-auto {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    line-height: 1.7;
    text-transform: lowercase;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-secondary);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-accent);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

section {
    padding: var(--space-xl) 0;
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-accent-dim);
    padding-bottom: var(--space-sm);
}

/* --- Navigation Bar --- */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 8px var(--space-md);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 600px) {
    .glass-nav {
        padding: 8px 16px;
    }

    .nav-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        padding: 0;
    }
}

.nav-logo {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text-main);
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .nav-logo {
        font-size: 1rem;
        text-transform: lowercase;
        visibility: hidden;
        position: relative;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 400px;
    }

    .nav-logo::after {
        content: var(--logo-text, "özgen tunç türker.");
        visibility: visible;
        position: absolute;
        left: 0;
        font-size: 1rem;
        font-weight: 600;
    }
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: var(--space-xs);
}

.nav-links a {
    font-size: 1.15rem;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--color-text-muted);
    padding: 12px 24px;
    border-radius: 28px;
    transition: all var(--transition-fast) ease;
}

.nav-links a:hover {
    color: var(--color-text-main);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .nav-links a {
        font-size: 0.85rem;
        padding: 4px 10px;
        background: rgba(125, 125, 125, 0.08);
        border: 1px solid var(--glass-border);
    }

    .nav-links {
        gap: 4px;
        justify-content: flex-end;
        width: auto;
        flex-wrap: nowrap;
    }
}

@media (max-width: 380px) {
    .glass-nav {
        padding: 8px 8px;
    }

    .nav-links {
        gap: 2px;
    }

    .nav-links a {
        font-size: 0.8rem;
        padding: 4px 6px;
    }
}

.nav-links a.active {
    color: var(--color-accent);
    font-weight: 600;
}

/* --- Footer --- */
footer {
    padding: var(--space-md) 0;
    text-align: center;
    border-top: 1px solid var(--color-accent-dim);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* --- Micro-interactions --- */
::selection {
    background-color: var(--color-link);
    color: #ffffff;
}

::-moz-selection {
    background-color: var(--color-link);
    color: #ffffff;
}