/* SL Mar Design System — v3.0 · Dark-only (maritime night bridge) */
:root {
    --ground: #0c1118;
    --surface: #131d28;
    --surface-raised: #1a2838;
    --border: #1e2e40;
    --border-hover: #2c4260;
    --text: #c8d4df;
    --text-muted: #6b7f92;
    --text-dim: #485e72;
    --accent: #c4963e;
    --accent-light: #dbb164;
    --accent-dim: rgba(196,150,62,0.12);
    --link: #5ba4d4;
    --link-hover: #7fc0ee;
    --surface-glass: rgba(19,29,40,0.85);

    --fs-xs: 0.8rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 1.875rem;
    --fs-3xl: 2.375rem;
    --fs-4xl: 3rem;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
}

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

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--fs-base);
    line-height: 1.65;
    color: var(--text);
    background: var(--ground);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Bitter', Georgia, serif;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    text-wrap: balance;
}

img, video {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
}

/* Navigation */
nav {
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.nav-brand-text {
    font-family: 'Bitter', Georgia, serif;
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--text);
    line-height: 1;
}

.nav-brand-sub {
    color: var(--text-dim);
    font-size: var(--fs-xs);
    border-left: 1px solid var(--border);
    padding-left: 0.6rem;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-social {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-social a {
    font-size: var(--fs-md);
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-social a:hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--r-sm);
    font-family: 'Work Sans', sans-serif;
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: var(--ground);
}

.btn-primary:hover {
    background: var(--accent-light);
    color: var(--ground);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-dim);
}

.btn-secondary,
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover,
.btn-ghost:hover {
    border-color: var(--border-hover);
    background: var(--surface);
    color: var(--text);
    transform: translateY(-1px);
}

/* Sections */
section {
    padding: 5rem 0;
}

section:last-of-type {
    border-bottom: none;
}

h2 {
    font-size: var(--fs-2xl);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: var(--fs-xl);
    margin-bottom: 1rem;
}

p {
    text-align: left;
}

.section-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: var(--fs-md);
    max-width: 560px;
    margin-bottom: 2.5rem;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

/* Cards (shared — used by publications, projects, etc.) */
.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: stretch;
}

.cards > a {
    display: flex;
    min-height: 100%;
}

.card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 3px 8px rgba(0,0,0,0.24);
    transform: translateY(-2px);
}

.card h3 {
    font-size: var(--fs-lg);
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin: 0;
}

/* Project Card */
.project {
    background: var(--surface);
    padding: 2.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
}

.project-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 1.25rem;
}

.project:hover {
    border-color: var(--border-hover);
    box-shadow: 0 3px 8px rgba(0,0,0,0.24);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project h3 {
    font-size: 1.65rem;
    margin-bottom: 0.6rem;
}

.project p {
    color: var(--text-muted);
    font-size: var(--fs-base);
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 1rem;
    font-size: var(--fs-sm);
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

.tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech span {
    padding: 0.3rem 0.85rem;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-dim);
}

/* Publications */
.pub {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.pub:hover {
    border-color: var(--border-hover);
    box-shadow: 0 3px 8px rgba(0,0,0,0.24);
    transform: translateY(-2px);
}

.pub h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.pub h3 a {
    color: var(--text);
}

.pub h3 a:hover {
    color: var(--accent);
}

.pub-meta {
    font-size: 0.8125rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.pub p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin: 0;
}

.pub-section {
    margin-bottom: 3rem;
}

.pub-section h2 {
    font-size: var(--fs-xl);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    margin-bottom: 1.5rem;
}

.pub-section h2::after {
    content: ' ▼';
    font-size: 0.8em;
    transition: transform 0.3s;
    display: inline-block;
    margin-left: 0.5rem;
}

.pub-section h2.collapsed::after {
    content: ' ▶';
}

.pub-section-content {
    max-height: 10000px;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
}

.pub-section-content.hidden {
    max-height: 0;
}

/* Contact */
.social {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: var(--fs-sm);
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.social a:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 3px 8px rgba(0,0,0,0.24);
    transform: translateY(-2px);
}

.social svg {
    width: 20px;
    height: 20px;
}

/* Footer */
footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    color: var(--text-dim);
    font-size: var(--fs-sm);
    margin-bottom: 0.25rem;
}

footer a {
    color: var(--text-dim);
}

footer a:hover {
    color: var(--accent);
}

/* Project Images */
.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Hero (legacy — used by sub-pages like publications) */
.hero {
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: var(--fs-4xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: var(--fs-md);
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.hero p {
    font-size: var(--fs-lg);
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 700px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-brand-text {
        font-size: 0.9rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .nav-links a {
        font-size: var(--fs-xs);
    }

    .nav-social {
        gap: 0.5rem;
    }

    .nav-social a {
        font-size: var(--fs-base);
    }

    .nav-brand-sub {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .nav-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: var(--fs-3xl);
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .nav-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-links a {
        font-size: var(--fs-xs);
    }

    h2 {
        font-size: 1.75rem;
    }
}
