/* ══════════════════════════════════════════════════
   Neil Patel — Personal Site
   Dark editorial aesthetic
   ══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

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

:root {
    --bg-dark: #0a0f1a;
    --bg-card: #111827;
    --bg-card-hover: #172033;
    --bg-nav: rgba(10, 15, 26, 0.92);
    --text-primary: #e8edf5;
    --text-secondary: #e8edf5;
    --text-muted: #e8edf5;
    --accent: #6ea8d7;
    --accent-glow: rgba(110, 168, 215, 0.15);
    --border: rgba(138, 155, 185, 0.12);
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
    font-weight: 400;
    min-height: 100vh;
}

/* ── Navigation ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 56px;
    text-align: left;
    margin: 0;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

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

/* ── Two-Column Layout ── */
.grid-2 {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    padding-top: 56px;
}

/* ── Sidebar ── */
.section-1 {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border);
    background: var(--bg-card);
    text-align: center;
    gap: 0.3rem;
}

.section-1 img {
    max-width: 140px !important;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto 1rem;
    border: 3px solid var(--border);
    background-color: var(--bg-dark);
}

.section-1 h1 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.section-1 p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.section-1 .social-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.section-1 a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.section-1 a:hover {
    color: var(--accent);
}

.section-1 a i.fab,
.section-1 a svg {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.section-1 a:hover i.fab,
.section-1 a:hover svg {
    color: var(--accent);
}

.section-1 a svg path {
    stroke: var(--text-muted);
    transition: stroke 0.2s ease;
}

.section-1 a:hover svg path {
    stroke: var(--accent);
}

/* ── Main Content ── */
.section-2 {
    padding: 3rem 3.5rem 4rem;
    max-width: 820px;
}

.section-2 h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.section-2 h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.section-2 h2[align="center"] {
    text-align: center;
    border-bottom: none;
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.section-2 p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.75;
    font-size: 0.92rem;
}

.section-2 a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.section-2 a:hover {
    color: #93c5f5;
    text-decoration: underline;
}

.section-2 ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.section-2 ul li {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
}

.section-2 ul li:last-child {
    border-bottom: none;
}

.section-2 ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-weight: 300;
}

.section-2 ul li a {
    color: var(--accent);
}

/* ── Button Links ── */
.button {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent) !important;
    background: var(--accent-glow);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-decoration: none !important;
    margin-left: 0.3rem;
    transition: all 0.2s ease;
}

.button:hover {
    background: rgba(110, 168, 215, 0.25);
    color: #93c5f5 !important;
}

/* ── Image Gallery ── */
.gallery {
    position: relative;
    width: 100%;
    margin: 1rem 0 1.5rem;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-dark);
    border: 1px solid var(--border);
}

.gallery-images {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.gallery-images img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-images img.active {
    opacity: 1;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.arrow:hover {
    background: rgba(10, 15, 26, 0.9);
    border-color: var(--accent);
}

.arrow.left { left: 12px; }
.arrow.right { right: 12px; }

/* ── Project Cards (research.html) ── */
.parent {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.box {
    float: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0;
    max-width: calc(50% - 0.75rem);
    width: calc(50% - 0.75rem);
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-color: rgba(110, 168, 215, 0.2);
}

.box img {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.box h2 {
    font-family: var(--font-body) !important;
    font-size: 0.72rem !important;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0.3rem 0 0.8rem;
    padding: 0;
    border: none;
    line-height: 1.4;
}

.box h2 i {
    color: var(--text-muted);
}

.box a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    padding: 0.8rem 1rem 0;
    transition: color 0.2s ease;
}

.box a:hover {
    color: var(--accent);
    text-decoration: none;
}

.box br {
    display: block;
    margin: 0.15rem 0;
    content: "";
}

/* ── Metadata Text ── */
p[style*="color: rgba(255, 255, 255, 0.691)"] {
    font-family: var(--font-mono) !important;
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 0.3rem !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .section-1 {
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 2rem 1.5rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1.5rem;
        justify-content: flex-start;
    }

    .section-1 img {
        max-width: 80px !important;
        width: 80px;
        height: 80px;
        margin: 0;
    }

    .section-1 h1 { font-size: 1.1rem; }

    .section-2 {
        padding: 2rem 1.5rem 3rem;
    }

    .section-2 h1 { font-size: 1.4rem; }

    nav { padding: 0 1rem; }
    .nav-brand { font-size: 1rem; }
    .nav-links a { font-size: 0.7rem; padding: 0.4rem 0.6rem; }

    .parent {
        flex-direction: column;
        gap: 1rem;
    }

    .box {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .section-1 {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nav-links a {
        font-size: 0.65rem;
        padding: 0.35rem 0.45rem;
    }
}
