/* rational.group - Dark scholarly design */
/* Colors: #1a1a2e (deep base), #4a90d9 (primary blue), #f5f0e8 (warm off-white), #e8b84b (accent gold), #6c757d (muted gray) */
/* Fonts: Space Mono, Lora, Inter */

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

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

body {
    font-family: 'Space Mono', monospace;
    background-color: #1a1a2e;
    color: #f5f0e8;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== SIDEBAR ==================== */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: #12121f;
    border-right: 1px solid rgba(232, 184, 75, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 2rem 0;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(232, 184, 75, 0.1);
    margin-bottom: 1rem;
}

.logo-mark {
    width: 48px;
    height: 48px;
    border: 2px solid #e8b84b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e8b84b;
    margin-bottom: 1rem;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.logo-mark:hover {
    transform: rotate(0deg);
}

.sidebar-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f5f0e8;
    letter-spacing: 0.05em;
}

.nav-list {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.8rem;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #e8b84b;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover {
    color: #f5f0e8;
    background-color: rgba(232, 184, 75, 0.05);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    color: #e8b84b;
    background-color: rgba(232, 184, 75, 0.08);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(232, 184, 75, 0.1);
}

.sidebar-footnote {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.65rem;
    color: #6c757d;
}

.footnote-marker-sm {
    color: #e8b84b;
    font-size: 0.75rem;
}

/* ==================== MAIN CONTENT ==================== */

#main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
}

.content-section {
    min-height: 100vh;
    padding: 4rem 5rem;
    position: relative;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.content-section.active {
    display: block;
    opacity: 1;
}

.content-section.fade-in {
    opacity: 1;
}

/* ==================== HERO ==================== */

#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#hero.active {
    display: flex;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

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

.hero-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 2rem;
}

.hero-line {
    display: block;
    font-size: 4rem;
    color: #e8b84b;
    opacity: 0;
    transform: translateY(20px);
    animation: heroLineIn 0.6s ease forwards;
}

.hero-line:nth-child(1) { animation-delay: 0.2s; }
.hero-line:nth-child(2) { animation-delay: 0.4s; }
.hero-line:nth-child(3) { animation-delay: 0.6s; }

.hero-line.accent {
    color: #4a90d9;
}

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

.hero-subtitle {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #f5f0e8;
    opacity: 0.8;
    margin-bottom: 2.5rem;
    max-width: 550px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e8b84b;
}

.meta-label {
    color: #6c757d;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.meta-divider {
    color: rgba(232, 184, 75, 0.3);
    font-size: 1.2rem;
    align-self: center;
}

/* ==================== MARGIN ANNOTATIONS ==================== */

.margin-annotation {
    position: absolute;
    writing-mode: vertical-rl;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.7rem;
    color: rgba(108, 117, 125, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.right-annotation {
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.left-annotation {
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.annotation-marker {
    color: #e8b84b;
    font-weight: 600;
    font-style: normal;
}

/* ==================== SECTION HEADERS ==================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-number {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #e8b84b;
    font-weight: 700;
}

.section-title {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #f5f0e8;
    letter-spacing: -0.02em;
}

.section-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(232, 184, 75, 0.4), transparent);
}

/* ==================== RESEARCH CARDS ==================== */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.research-card {
    background-color: rgba(245, 240, 232, 0.03);
    border: 1px solid rgba(232, 184, 75, 0.12);
    border-radius: 4px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #e8b84b, #4a90d9);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.research-card:hover {
    background-color: rgba(245, 240, 232, 0.06);
    border-color: rgba(232, 184, 75, 0.25);
    transform: translateY(-2px);
}

.research-card:hover::before {
    transform: scaleX(1);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.7rem;
}

.card-tag {
    background-color: rgba(74, 144, 217, 0.15);
    color: #4a90d9;
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-date {
    color: #6c757d;
    font-family: 'Space Mono', monospace;
}

.card-title {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.card-title a {
    color: #f5f0e8;
    text-decoration: none;
}

.card-excerpt {
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #6c757d;
    margin-bottom: 1rem;
}

.card-citation {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.7rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(232, 184, 75, 0.08);
}

.citation-ref {
    color: #e8b84b;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
}

.citation-text {
    color: #6c757d;
    font-family: 'Lora', serif;
    font-style: italic;
}

/* ==================== UNDERLINE-DRAW LINKS ==================== */

.underline-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline;
}

.underline-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background-color: #e8b84b;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.underline-link:hover::after {
    transform: scaleX(1);
}

.underline-link:hover {
    color: #e8b84b;
}

/* ==================== DISCOURSE THREADS ==================== */

.discourse-threads {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.thread-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    background-color: rgba(245, 240, 232, 0.02);
    border: 1px solid rgba(232, 184, 75, 0.08);
    border-radius: 2px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.thread-item:hover {
    background-color: rgba(245, 240, 232, 0.05);
    border-color: rgba(232, 184, 75, 0.2);
}

.thread-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    margin-top: 0.6rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.thread-indicator.active-thread {
    background-color: #e8b84b;
    box-shadow: 0 0 8px rgba(232, 184, 75, 0.4);
}

.thread-content {
    flex: 1;
}

.thread-title {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.thread-title a {
    color: #f5f0e8;
}

.thread-meta {
    display: flex;
    gap: 1.25rem;
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-family: 'Space Mono', monospace;
}

.thread-author {
    color: #4a90d9;
}

.thread-preview {
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(245, 240, 232, 0.5);
}

/* ==================== LIBRARY ==================== */

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.category-heading {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e8b84b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(232, 184, 75, 0.2);
}

.resource-list {
    list-style: none;
}

.resource-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(245, 240, 232, 0.04);
    font-size: 0.85rem;
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.resource-ref {
    font-family: 'Space Mono', monospace;
    color: #4a90d9;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.resource-item a {
    color: #f5f0e8;
    font-family: 'Lora', serif;
}

.resource-author {
    color: #6c757d;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.8rem;
}

/* ==================== MEMBERS ==================== */

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.member-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background-color: rgba(245, 240, 232, 0.03);
    border: 1px solid rgba(232, 184, 75, 0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.member-card:hover {
    border-color: rgba(232, 184, 75, 0.25);
    background-color: rgba(245, 240, 232, 0.05);
}

.member-avatar {
    flex-shrink: 0;
}

.member-avatar svg {
    transition: transform 0.3s ease;
}

.member-card:hover .member-avatar svg {
    transform: rotate(5deg) scale(1.05);
}

.member-name {
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 0.25rem;
}

.member-role {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #4a90d9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.member-bio {
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #6c757d;
}

/* ==================== CONTACT ==================== */

.contact-content {
    max-width: 600px;
}

.contact-intro {
    margin-bottom: 2.5rem;
}

.contact-intro p {
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(245, 240, 232, 0.8);
}

.scholarly-form {
    margin-bottom: 2rem;
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.required-mark {
    color: #e8b84b;
    margin-left: 0.25rem;
}

.form-input {
    width: 100%;
    background-color: rgba(245, 240, 232, 0.04);
    border: 1px solid rgba(232, 184, 75, 0.15);
    border-radius: 2px;
    padding: 0.85rem 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #f5f0e8;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: rgba(108, 117, 125, 0.5);
}

.form-input:focus {
    border-color: #e8b84b;
    background-color: rgba(245, 240, 232, 0.06);
    box-shadow: 0 0 0 2px rgba(232, 184, 75, 0.1);
}

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

.form-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: transparent;
    border: 2px solid #e8b84b;
    color: #e8b84b;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.85rem 2rem;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-submit:hover {
    background-color: #e8b84b;
    color: #1a1a2e;
}

.submit-arrow {
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

.form-submit:hover .submit-arrow {
    transform: translateX(4px);
}

.contact-footnotes {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(232, 184, 75, 0.1);
}

.footnote {
    font-family: 'Lora', serif;
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.footnote .footnote-marker {
    color: #e8b84b;
    font-style: normal;
    font-weight: 600;
    margin-right: 0.3rem;
}

/* ==================== FOOTER ==================== */

#site-footer {
    padding: 3rem 5rem;
    border-top: 1px solid rgba(232, 184, 75, 0.1);
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #6c757d;
}

.footer-divider {
    color: rgba(232, 184, 75, 0.3);
}

.footer-tagline {
    font-family: 'Lora', serif;
    font-style: italic;
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #12121f;
}

::-webkit-scrollbar-thumb {
    background: rgba(232, 184, 75, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 184, 75, 0.35);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    #sidebar {
        width: 60px;
        padding: 1rem 0;
    }

    .sidebar-title,
    .nav-label,
    .sidebar-footnote,
    .sidebar-footer {
        display: none;
    }

    .sidebar-header {
        padding: 0 0.5rem 1rem;
        display: flex;
        justify-content: center;
    }

    .logo-mark {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 0;
    }

    .nav-item {
        justify-content: center;
        padding: 0.85rem;
    }

    #main-content {
        margin-left: 60px;
    }

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

    .hero-line {
        font-size: 2.5rem;
    }

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

    .meta-divider {
        display: none;
    }

    .content-grid,
    .library-grid,
    .members-grid {
        grid-template-columns: 1fr;
    }

    .margin-annotation {
        display: none;
    }

    #site-footer {
        padding: 2rem 1.5rem;
    }
}

/* ==================== SECTION TRANSITION ANIMATION ==================== */

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

.content-section.active {
    animation: sectionFadeIn 0.5s ease forwards;
}
