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

:root {
    --color-bg: #FAFAF8;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #555555;
    --color-text-muted: #888888;
    --color-accent: #2C3E50;
    --color-accent-light: #3D5A73;
    --color-border: #E8E6E1;
    --color-border-light: #F0EEEA;
    --color-highlight: #D4A853;
    --header-bg: rgba(250, 250, 248, 0.95);
    --mobile-nav-bg: rgba(250, 250, 248, 0.98);
    --card-shadow: rgba(0, 0, 0, 0.06);
    --btn-shadow: rgba(44, 62, 80, 0.2);
    --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container-width: 1120px;
    --section-spacing: 120px;
}

/* Dark mode */
[data-theme="dark"] {
    --color-bg: #0F1117;
    --color-surface: #1A1D27;
    --color-text: #E8E6E1;
    --color-text-secondary: #A0A0A8;
    --color-text-muted: #6B6B75;
    --color-accent: #8AACCC;
    --color-accent-light: #A3C1D9;
    --color-border: #2A2D38;
    --color-border-light: #22252E;
    --color-highlight: #E0B860;
    --header-bg: rgba(15, 17, 23, 0.95);
    --mobile-nav-bg: rgba(15, 17, 23, 0.98);
    --card-shadow: rgba(0, 0, 0, 0.25);
    --btn-shadow: rgba(138, 172, 204, 0.2);
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.25;
}

h1 { font-size: 3.2rem; }
h2 { font-size: 2.4rem; }
h3 { font-size: 1.35rem; }

p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light);
    padding: 14px 0;
}

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

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    flex-shrink: 0;
}

.logo-words {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.logo-sub {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.main-nav {
    display: flex;
    gap: 36px;
}

.main-nav a {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    position: relative;
}

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

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

.main-nav a:hover::after {
    width: 100%;
}

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

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

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

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

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -5px);
}

/* ===== Hero ===== */
.hero {
    padding: 200px 0 140px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 1px 1px, var(--color-border) 1px, transparent 0) 0 0 / 40px 40px,
        linear-gradient(180deg, rgba(44, 62, 80, 0.03) 0%, transparent 60%);
    opacity: 0.4;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(86, 134, 255, 0.06) 0%, rgba(255, 117, 86, 0.04) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    100% { transform: translate(-40px, 30px) scale(1.1); opacity: 0.8; }
}

.hero-layout {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 640px;
    flex: 1;
}

.hero h1 {
    margin-bottom: 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #5686ff 0%, var(--color-text) 40%, var(--color-text) 60%, #e6b33d 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.hero-accent-line {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #5686ff, #ff7556, #ffc956);
    margin: 24px 0;
    border-radius: 2px;
}

body.loaded .hero-accent-line {
    animation: drawLine 1.2s ease 0.4s forwards;
}

@keyframes drawLine {
    to { width: 120px; }
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 560px;
}

/* Hero stats */
.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text);
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
}

body.loaded .hero-stats {
    animation: fadeSlideUp 0.8s ease 0.5s forwards;
    opacity: 0;
}

/* Hero decorative logo */
.hero-visual {
    flex-shrink: 0;
    position: relative;
}

.hero-logo {
    width: 320px;
    height: 320px;
    opacity: 0.12;
    animation: heroLogoSpin 60s linear infinite;
    filter: drop-shadow(0 0 40px rgba(86, 134, 255, 0.1));
}

[data-theme="dark"] .hero-logo {
    opacity: 0.08;
    filter: drop-shadow(0 0 60px rgba(86, 134, 255, 0.15));
}

@keyframes heroLogoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

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

/* ===== Sections ===== */
.section {
    padding: var(--section-spacing) 0;
}

.section-header {
    margin-bottom: 60px;
}

.section-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-highlight);
    margin-bottom: 16px;
}

.section-header h2 {
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* ===== About ===== */
.about {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-text p {
    margin-bottom: 20px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-principles {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.principle {
    padding-left: 24px;
    border-left: 2px solid var(--color-border);
    transition: border-color 0.3s ease;
}

.principle:hover {
    border-left-color: var(--color-highlight);
}

.principle h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.principle p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* ===== Research ===== */
.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.research-card {
    padding: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.research-card:hover {
    border-color: var(--color-border);
    box-shadow: 0 8px 32px var(--card-shadow);
    transform: translateY(-2px);
}

.research-icon {
    color: var(--color-accent-light);
    margin-bottom: 20px;
}

.research-card h3 {
    font-family: var(--font-serif);
    margin-bottom: 12px;
    color: var(--color-text);
}

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

/* ===== Publications ===== */
.publications {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}

.publications-intro {
    max-width: 640px;
    margin-bottom: 48px;
}

.publications-intro p {
    font-size: 1.05rem;
}

.publication-item {
    padding: 32px 40px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.publication-item.coming-soon {
    border-style: dashed;
    text-align: center;
}

.pub-status {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-highlight);
    background: rgba(212, 168, 83, 0.1);
    padding: 4px 14px;
    border-radius: 3px;
    margin-bottom: 16px;
}

.publication-item p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ===== Founder ===== */
.founder-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: start;
}

.founder-bio p {
    margin-bottom: 20px;
}

.founder-bio p:last-child {
    margin-bottom: 0;
}

.founder-credentials {
    position: sticky;
    top: 100px;
}

.credential-group {
    margin-bottom: 32px;
}

.credential-group h3 {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.credentials-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credentials-list li {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    padding: 6px 0;
}

.credentials-list li strong {
    color: var(--color-text);
    font-weight: 500;
}

.credentials-list li em {
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

.linkedin-link {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    padding-top: 8px;
    transition: color 0.2s ease;
}

.linkedin-link:hover {
    color: var(--color-highlight);
}

/* ===== About Us Teaser ===== */
.about-us-content {
    max-width: 640px;
}

.about-us-content p {
    margin-bottom: 28px;
}

/* ===== Contact ===== */
.contact-content {
    max-width: 480px;
}

.contact-content p {
    margin-bottom: 24px;
}

.contact-email {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 4px;
    transition: all 0.3s ease;
}

.contact-email:hover {
    color: var(--color-highlight);
    border-bottom-color: var(--color-highlight);
}

.mailing-address {
    font-style: normal;
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

/* ===== Footer ===== */
.site-footer {
    padding: 48px 0;
    border-top: 1px solid var(--color-border-light);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand .logo-text {
    font-size: 1.15rem;
}

.footer-brand .logo-sub {
    font-size: 0.65rem;
}

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

.footer-copy a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

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

/* ===== Skip to Content ===== */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 200;
    background: var(--color-accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: 16px;
}

/* ===== Focus Styles ===== */
*:focus-visible {
    outline: 2px solid var(--color-highlight);
    outline-offset: 3px;
    border-radius: 2px;
}

.btn:focus-visible {
    outline-offset: 4px;
}

.theme-toggle:focus-visible {
    outline-offset: 2px;
}

/* ===== Active Nav ===== */
.main-nav a.active {
    color: var(--color-text);
}

.main-nav a.active::after {
    width: 100%;
}

/* ===== Research Card Accents ===== */
.research-card {
    border-top: 3px solid transparent;
}

.research-card:nth-child(1) { border-top-color: #5686ff; }
.research-card:nth-child(2) { border-top-color: #ff7556; }
.research-card:nth-child(3) { border-top-color: #ffc956; }
.research-card:nth-child(4) { border-top-color: #4572e6; }

/* ===== Division Tabs ===== */
.division-tabs-section {
    padding: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header.scrolled ~ main .division-tabs-section {
    top: 69px; /* scrolled header: 14px padding ×2 + 40px logo + 1px border */
}

.division-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
}

.tab-btn {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: none;
    border: none;
    padding: 20px 36px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.tab-btn:hover {
    color: var(--color-text);
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-highlight);
    transition: width 0.3s ease;
}

.tab-btn.active {
    color: var(--color-text);
}

.tab-btn.active::after {
    width: 60%;
}

/* Tab content panels */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Studios ===== */
.studios-about {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.studios-intro {
    max-width: 640px;
    margin-bottom: 48px;
}

.studios-intro p {
    font-size: 1.05rem;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a.app-card:hover {
    border-color: var(--color-border);
    box-shadow: 0 8px 32px var(--card-shadow);
    transform: translateY(-2px);
}

.app-card-icon img {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    flex-shrink: 0;
}

.app-card-icon-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-text-muted);
    border: 2px dashed var(--color-border);
    border-radius: 18px;
}

.app-card-body {
    flex: 1;
    min-width: 0;
}

.app-card-body h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.app-card-body p {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.app-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.privacy-badge,
.platform-badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 3px;
}

.privacy-badge {
    color: #2d8a4e;
    background: rgba(45, 138, 78, 0.1);
}

[data-theme="dark"] .privacy-badge {
    color: #5ec484;
    background: rgba(94, 196, 132, 0.12);
}

.platform-badge {
    color: var(--color-text-muted);
    background: var(--color-border-light);
}

.app-card-arrow {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

a.app-card:hover .app-card-arrow {
    transform: translateX(4px);
    color: var(--color-highlight);
}

.app-card-placeholder {
    border-style: dashed;
    cursor: default;
}

/* ===== Publishing / Book Cards ===== */
.publishing-about {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.book-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.book-card {
    align-items: stretch;
    gap: 28px;
}

.book-card-cover {
    flex-shrink: 0;
    width: 100px;
}

.book-card-cover img {
    width: 100px;
    height: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 6px 20px var(--card-shadow);
}

.book-card-subtitle {
    font-family: var(--font-serif);
    font-size: 0.98rem !important;
    color: var(--color-text-secondary) !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
}

.new-badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 3px;
    color: var(--color-highlight);
    background: rgba(212, 168, 83, 0.12);
}

[data-theme="dark"] .new-badge {
    color: var(--color-highlight);
    background: rgba(224, 184, 96, 0.14);
}

@media (max-width: 640px) {
    .book-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .book-card-cover,
    .book-card-cover img {
        width: 120px;
    }
}

/* ===== Scroll Animations ===== */
.animate {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }

/* ===== Page Load Animation ===== */
body:not(.loaded) .hero-content {
    opacity: 0;
}

.hero-content {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

body.loaded .hero h1 {
    animation: fadeSlideUp 0.8s ease forwards;
}

body.loaded .hero-sub {
    animation: fadeSlideUp 0.8s ease 0.15s forwards;
    opacity: 0;
}

body.loaded .hero .btn {
    animation: fadeSlideUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px var(--card-shadow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    :root {
        --section-spacing: 80px;
    }

    h1 { font-size: 2.4rem; }
    h2 { font-size: 1.8rem; }

    .hero { padding: 160px 0 100px; }

    .hero-logo {
        width: 240px;
        height: 240px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

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

    .founder-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .founder-credentials {
        position: static;
    }

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

@media (max-width: 640px) {
    :root {
        --section-spacing: 64px;
    }

    .container {
        padding: 0 20px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .hero {
        padding: 140px 0 80px;
    }

    .hero-layout {
        flex-direction: column;
        gap: 0;
    }

    .hero-visual {
        position: absolute;
        top: 50%;
        right: -10%;
        transform: translateY(-50%);
    }

    .hero-logo {
        width: 200px;
        height: 200px;
        opacity: 0.07;
    }

    .hero-sub {
        font-size: 1.05rem;
    }

    .hero-stats {
        gap: 24px;
        margin-top: 36px;
        padding-top: 24px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--mobile-nav-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--color-border-light);
        padding: 16px 32px;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 12px 0;
        border-bottom: 1px solid var(--color-border-light);
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a::after {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .research-card {
        padding: 28px;
    }

    .publication-item {
        padding: 24px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .tab-btn {
        padding: 16px 24px;
        font-size: 0.8rem;
    }

    .app-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .app-card-meta {
        justify-content: center;
    }

    .app-card-arrow {
        display: none;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .animate {
        opacity: 1;
        transform: none;
        transition: none;
    }

    body.loaded .hero h1,
    body.loaded .hero-sub,
    body.loaded .hero .btn {
        animation: none;
        opacity: 1;
    }

    .hero::after {
        animation: none;
    }

    .hero h1 {
        animation: none;
        background-size: 100% 100%;
    }

    .hero-accent-line {
        width: 120px;
    }

    body.loaded .hero-accent-line,
    body.loaded .hero-stats {
        animation: none;
        opacity: 1;
    }

    .hero-logo {
        animation: none;
    }
}
