/* =============================================
   ARB Personal Site — Full Redesign
   ============================================= */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0c0c0e;
    --bg-secondary: #111113;
    --bg-card: rgba(255, 255, 255, 0.025);
    --text-primary: #e8e6e3;
    --text-secondary: #a8a5a0;
    --text-muted: #6b6966;
    --accent: #c9a96e;
    --accent-dim: rgba(201, 169, 110, 0.15);
    --accent-glow: rgba(201, 169, 110, 0.3);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.light-mode {
    --bg-primary: #faf9f7;
    --bg-secondary: #f0efec;
    --bg-card: rgba(0, 0, 0, 0.03);
    --text-primary: #1a1918;
    --text-secondary: #4a4744;
    --text-muted: #7a7774;
    --accent: #8a6a2a;
    --accent-dim: rgba(138, 106, 42, 0.12);
    --accent-glow: rgba(138, 106, 42, 0.25);
    --border: rgba(0, 0, 0, 0.12);
    --border-hover: rgba(0, 0, 0, 0.22);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

a:hover {
    color: var(--text-primary);
}

::selection {
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* ========== NAVIGATION ========== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 180px;
    z-index: 100;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.nav-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 3rem;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.15em;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 400;
    transition: all var(--transition);
    letter-spacing: 0.03em;
    position: relative;
    padding-left: 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    padding-left: 4px;
}

.nav-links a.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
}

.nav-settings {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.language-switcher {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

.language-switcher a {
    text-decoration: none;
    opacity: 0.4;
    transition: opacity var(--transition), transform var(--transition);
}

.language-switcher a:hover,
.language-switcher a.active {
    opacity: 1;
    transform: scale(1.05);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: 180px;
    position: relative;
    z-index: 1;
}

/* ========== HERO ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 6rem;
    position: relative;
    overflow: hidden;
    background: url('../images/Columbia%20Skyline.jpeg') center/cover no-repeat;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(12,12,14,0.7) 0%, rgba(12,12,14,0.3) 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.hero-fullname {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 400;
    margin-bottom: 0;
}

.hero-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    color: #ffffff;
    border-color: var(--accent);
    background: rgba(201, 169, 110, 0.15);
    transform: translateY(-2px);
}

/* ========== SECTIONS ========== */
.section {
    position: relative;
    z-index: 1;
    padding: 7rem 6rem;
}

.container {
    max-width: 1100px;
    margin: 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 3rem;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent);
}

/* ========== BIO ========== */
.bio-content p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    max-width: 680px;
    line-height: 1.8;
}

/* ========== RESUME / CV ========== */
.resume {
    background: var(--bg-primary);
}

.cv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.cv-column-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cv-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.cv-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.cv-item {
    position: relative;
    padding-bottom: 2.5rem;
}

.cv-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateX(-50%);
}

.cv-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
}

.cv-details h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.cv-company {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.cv-details p:last-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== TAG FILTER ========== */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.tag-filter-btn {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.9rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.tag-filter-btn:hover {
    color: var(--text-secondary);
    border-color: var(--border-hover);
}

.tag-filter-btn.active {
    color: var(--bg-primary);
    background: var(--accent);
    border-color: var(--accent);
}

/* ========== PROJECT CARDS ========== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
    height: 100%;
}

.project-card:hover {
    background: rgba(201, 169, 110, 0.03);
    border-color: rgba(201, 169, 110, 0.2);
    transform: translateY(-2px);
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-header h3 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.collapse-icon {
    transition: transform var(--transition);
    color: var(--text-muted);
    flex-shrink: 0;
}

.project-description {
    /* controlled by JS */
}

.project-card p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-tech span {
    font-size: 0.72rem;
    background: var(--accent-dim);
    border: none;
    border-radius: 4px;
    padding: 0.2rem 0.6rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.project-external-link {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.project-external-link:hover {
    color: var(--text-primary);
}

/* ========== WRITINGS / ARTICLES ========== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    cursor: pointer;
    transition: all var(--transition);
}

.article-card:hover {
    background: rgba(201, 169, 110, 0.03);
    border-color: rgba(201, 169, 110, 0.2);
    transform: translateY(-2px);
}

.article-date {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.35;
}

.article-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-link {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ========== DOCUMENTS ========== */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.document-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
}

.document-item:hover {
    background: rgba(201, 169, 110, 0.03);
    border-color: rgba(201, 169, 110, 0.2);
    transform: translateY(-1px);
}

.doc-icon {
    margin-right: 1.25rem;
    color: var(--accent);
}

.doc-info {
    flex-grow: 1;
}

.doc-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.doc-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.doc-action {
    opacity: 0.4;
    transition: opacity var(--transition);
    color: var(--accent);
}

.document-item:hover .doc-action {
    opacity: 1;
}

/* ========== ARTICLE MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    color: var(--text-primary);
}

.modal-content h1,
.modal-content h2,
.modal-content h3 {
    font-family: var(--font-display);
    margin-bottom: 1rem;
    font-weight: 500;
}

.modal-content h1 { font-size: 1.8rem; }
.modal-content h2 { font-size: 1.3rem; margin-top: 2rem; }
.modal-content h3 { font-size: 1.1rem; margin-top: 1.5rem; }

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    line-height: 1.8;
    font-size: 1rem;
}

.modal-content em {
    font-style: italic;
}

.modal-content blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--accent);
}

/* ========== FOOTER ========== */
.footer {
    padding: 3rem 6rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}

/* ========== ANIMATIONS ========== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in.delay-1 { transition-delay: 0.15s; }
.fade-in.delay-2 { transition-delay: 0.3s; }
.fade-in.delay-3 { transition-delay: 0.45s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 5rem 3rem;
    }

    .hero {
        padding: 0 3rem;
    }

    .footer {
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    .nav {
        width: 100%;
        height: auto;
        bottom: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1.5rem;
        flex-direction: row;
    }

    .nav-content {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    .nav-links {
        flex-direction: row;
        gap: 1.25rem;
    }

    .nav-links a:hover {
        padding-left: 0;
    }

    .nav-links a.active::before {
        display: none;
    }

    .nav-settings {
        flex-direction: row;
        margin-top: 0;
        width: auto;
        align-items: center;
    }

    .language-switcher {
        flex-direction: row;
        gap: 0.5rem;
    }

    .main-content {
        margin-left: 0;
        padding-top: 55px;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .hero {
        padding: 0 1.5rem;
        justify-content: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-socials {
        justify-content: center;
    }

    .projects-grid,
    .articles-grid,
    .cv-grid {
        grid-template-columns: 1fr;
    }

    .cv-grid {
        gap: 2rem;
    }

    .footer {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .nav-links {
        display: none;
    }

    .hero-name {
        font-size: 3rem;
    }
}

/* ========== CONTACT FORM ========== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    max-width: 500px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-submit {
    padding: 0.9rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.form-submit:hover {
    filter: brightness(1.1);
}

/* ========== LINKS ========== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

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

.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
}

.link-card:hover {
    background: rgba(201, 169, 110, 0.03);
    border-color: rgba(201, 169, 110, 0.2);
    transform: translateY(-2px);
}

.link-icon-wrap {
    color: var(--accent);
    flex-shrink: 0;
}

.link-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.link-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.link-arrow {
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.link-card:hover .link-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

/* ========== GRID BACKGROUND (subtle) ========== */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
}

/* ========== LIGHT MODE OVERRIDES ========== */
:root.light-mode .nav {
    background: var(--bg-primary);
    border-right-color: var(--border);
}

:root.light-mode .project-card:hover,
:root.light-mode .article-card:hover,
:root.light-mode .document-item:hover {
    background: rgba(138, 106, 42, 0.06);
    border-color: rgba(138, 106, 42, 0.3);
}

:root.light-mode .tag-filter-btn.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

:root.light-mode .project-tech span {
    background: rgba(138, 106, 42, 0.1);
    color: #6b5020;
}

:root.light-mode .modal-content {
    background: var(--bg-primary);
    border-color: var(--border);
}

:root.light-mode .cv-item::before {
    background: var(--accent);
}

:root.light-mode .section-title::after {
    background: var(--accent);
}

:root.light-mode .grid-bg {
    opacity: 0.15;
}
