/* ─── RESET & BASE ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --accent: #F07060;
    --accent-soft: rgba(240, 112, 96, 0.15);
    --accent-hover: #e8594a;
    --transition-speed: 0.45s;
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg-primary: #0e0e0e;
    --bg-secondary: #161616;
    --bg-tertiary: #1c1c1c;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222;
    --bg-nav: rgba(14, 14, 14, 0.7);
    --text-primary: #e8e8e8;
    --text-secondary: #999;
    --text-muted: #555;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.5);
    --input-bg: #1a1a1a;
    --logo-dark-display: block;
    --logo-light-display: none;
}

[data-theme="light"] {
    --bg-primary: #f5f5f3;
    --bg-secondary: #eeeee9;
    --bg-tertiary: #e8e8e3;
    --bg-card: #fff;
    --bg-card-hover: #fafaf8;
    --bg-nav: rgba(245, 245, 243, 0.75);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #aaa;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --shadow-card: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.1);
    --input-bg: #fff;
    --logo-dark-display: none;
    --logo-light-display: block;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
    line-height: 1.7;
    font-weight: 300;
    overflow-x: hidden;
}

/* ─── THEME TRANSITION ─── */
body *, body *::before, body *::after {
    transition: background-color var(--transition-speed) ease,
                color var(--transition-speed) ease,
                border-color var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
}

/* ─── NAVIGATION ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

.nav.scrolled {
    background: var(--bg-nav);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 1px 0 var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-brand img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.nav-brand span {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
    padding: 0.2em 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg-primary);
    opacity: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active { display: flex; opacity: 1; }

.mobile-overlay a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    transition: color 0.3s;
}

.mobile-overlay a:hover { color: var(--accent); }

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

/* ─── HERO ─── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6rem 2rem 4rem;
}

.hero canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    max-width: min(560px, 80vw);
    height: auto;
    opacity: 0;
    transform: translateY(16px);
    animation: heroFadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.hero-logo.dark-logo { display: var(--logo-dark-display); }
.hero-logo.light-logo { display: var(--logo-light-display); }

.hero-tagline {
    margin-top: 1.8rem;
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(12px);
    animation: heroFadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

.hero-divider {
    width: 40px;
    height: 1px;
    background: var(--accent);
    margin-top: 2.5rem;
    opacity: 0;
    animation: heroFadeIn 1s ease 0.9s forwards;
}

.hero-scroll-cue {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: heroFadeIn 1s ease 1.3s forwards;
}

.hero-scroll-cue span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.scroll-line {
    width: 1px;
    height: 32px;
    position: relative;
    overflow: hidden;
    background: var(--border);
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0% { top: -100%; }
    50% { top: 100%; }
    100% { top: 100%; }
}

@keyframes heroFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SECTIONS ─── */
.section {
    padding: clamp(5rem, 10vw, 8rem) clamp(1.5rem, 5vw, 3rem);
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 400;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 520px;
    line-height: 1.8;
}

.section-header {
    margin-bottom: 3.5rem;
}

/* Reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── RESEARCH ─── */
.research-section {
    background: var(--bg-secondary);
    transition: background var(--transition-speed) ease;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

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

.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.8rem;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: default;
}

.research-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

.research-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.4rem;
}

.research-card-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.research-card h3 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 0.7rem;
}

.research-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

.research-card-tag {
    display: inline-block;
    margin-top: 1.2rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent-soft);
    padding: 0.3em 0.8em;
    border-radius: 20px;
}

/* ─── ABOUT ─── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.about-quote {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    line-height: 1.45;
    font-style: italic;
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--accent);
}

.about-text {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.9;
}

.about-text p + p {
    margin-top: 1.2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3.5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
    .about-stats { grid-template-columns: 1fr; text-align: center; }
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* ─── TEAM ─── */
.team-section {
    background: var(--bg-secondary);
    transition: background var(--transition-speed) ease;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .team-grid { grid-template-columns: 1fr; max-width: 280px; margin: 0 auto; }
}

.team-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.team-card:hover {
    border-color: var(--border);
    background: var(--bg-card);
}

.team-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    transition: border-color 0.3s ease;
}

.team-card:hover .team-avatar { border-color: var(--accent); }

.team-avatar svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
}

.team-name {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.team-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── CONTACT ─── */
.contact-inner {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
    transition: color 0.3s;
}

.contact-email:hover { color: var(--accent); }

.contact-email svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 300;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

.btn-submit {
    margin-top: 0.5rem;
    padding: 0.9rem 2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(240, 112, 96, 0.25);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.social-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ─── FOOTER ─── */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem clamp(1.5rem, 5vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* ─── UTILITY ─── */
::selection {
    background: var(--accent);
    color: #fff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
