/* ============================================================
   Satyalogos.org — Stylesheet
   Clean academic aesthetic, responsive, no external dependencies
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 17px;
    line-height: 1.7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: normal;
    line-height: 1.3;
    color: #0f0f23;
}

h1 { font-size: 2.8rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.9rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; font-style: italic; }

p {
    margin-bottom: 1.2rem;
    max-width: 70ch;
}

a {
    color: #2d5aa0;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1a3d6e;
    text-decoration: underline;
}

strong { font-weight: 600; }

/* --- Layout --- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 4rem 0;
}

section:nth-child(even) {
    background: #f7f8fa;
}

/* --- Navigation --- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.8rem 0;
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    color: #0f0f23;
    letter-spacing: 0.02em;
}

.nav-brand:hover {
    text-decoration: none;
    color: #2d5aa0;
}

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

.nav-links a {
    font-size: 0.88rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.nav-links a:hover {
    color: #2d5aa0;
    text-decoration: none;
}

/* Mobile nav toggle — hidden, dropdowns always visible */
.nav-toggle {
    display: none;
}

/* --- Hero --- */
.hero {
    padding: 3rem 0 2rem;
    text-align: center;
    background: linear-gradient(180deg, #f7f8fa 0%, #fff 100%);
}

.hero h1 {
    font-size: 3.2rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.hero .tagline {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    color: #555;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.hero .elevator {
    font-size: 1.05rem;
    color: #333;
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero .hero-links {
    font-size: 0.95rem;
    color: #666;
    margin-top: 1.5rem;
}

.hero .hero-links a {
    color: #1a3a5c;
    text-decoration: none;
    font-weight: 500;
}

.hero .hero-links a:hover {
    text-decoration: underline;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #2d5aa0;
    color: #fff;
}

.btn-primary:hover {
    background: #1a3d6e;
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: #2d5aa0;
    border: 2px solid #2d5aa0;
}

.btn-outline:hover {
    background: #2d5aa0;
    color: #fff;
    text-decoration: none;
}

/* --- Section Headers --- */
.section-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #2d5aa0;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* --- Content Cards --- */
.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-featured {
    border-left: 4px solid #2d5aa0;
}

/* --- Three-Column Grid --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.grid-3 .card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.grid-3 .card h3 {
    font-size: 1.2rem;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* --- Paper Card --- */
.paper-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 2.5rem;
    margin-top: 2rem;
    max-width: 750px;
}

.paper-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.paper-card .meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.paper-card .abstract-excerpt {
    font-size: 0.92rem;
    color: #333;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    border-left: 3px solid #ddd;
    padding-left: 1rem;
}

.paper-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Episode List --- */
.episode-list {
    list-style: none;
    margin-top: 1.5rem;
}

.episode-list li {
    padding: 1rem 0;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.episode-list li:last-child {
    border-bottom: none;
}

.episode-num {
    font-family: Georgia, serif;
    font-weight: bold;
    color: #2d5aa0;
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 1.5rem;
}

/* --- Collaboration Section --- */
.collab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.collab-grid .card {
    display: flex;
    flex-direction: column;
}

.collab-grid .card .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* --- Contact Section --- */
.contact-section {
    text-align: center;
    padding: 4rem 0;
}

.contact-section p {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-email {
    font-size: 1.15rem;
    font-family: Georgia, serif;
}

.contact-bio {
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.92rem;
}

/* --- Footer --- */
footer {
    background: #0f0f23;
    color: #aaa;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.8;
}

footer a {
    color: #8ab4f8;
}

footer .legal {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #777;
}

/* --- Paper Page Specifics --- */
.paper-page-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.paper-page-header h1 {
    font-size: 1.8rem;
    line-height: 1.4;
}

.paper-page-header .meta {
    color: #666;
    margin-top: 0.5rem;
}

.abstract-full {
    font-size: 0.95rem;
    line-height: 1.8;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
    max-width: 75ch;
}

.abstract-full p {
    max-width: 75ch;
}

.bibtex-block {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin: 1.5rem 0;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #2d5aa0;
    color: #fff;
    border-color: #2d5aa0;
}

.ip-notice {
    background: #fffbe6;
    border: 1px solid #e6d96c;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    font-size: 0.88rem;
    margin-top: 2rem;
    line-height: 1.6;
}

/* --- Math Guide --- */
.guide-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.guide-header h1 {
    font-size: 2rem;
    line-height: 1.4;
}

.guide-header .subtitle {
    font-family: Georgia, serif;
    font-size: 1.1rem;
    color: #555;
    font-style: italic;
    margin-top: 0.5rem;
}

.guide-toc {
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.guide-toc h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.guide-toc ol {
    padding-left: 1.5rem;
    max-width: 65ch;
}

.guide-toc li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.guide-toc li a {
    font-weight: 500;
}

.guide-toc ol ol {
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

.guide-section {
    padding: 3rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.guide-section h2 {
    font-size: 1.7rem;
    margin-bottom: 0.3rem;
}

.guide-section h3 {
    margin-top: 2rem;
    font-size: 1.25rem;
    color: #1a1a2e;
}

.guide-section h4 {
    margin-top: 1.5rem;
    font-size: 1.05rem;
    font-style: normal;
    font-weight: 600;
    color: #2d5aa0;
}

.equation-block {
    background: #f7f8fa;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #2d5aa0;
    border-radius: 4px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    text-align: center;
    line-height: 1.8;
    overflow-x: auto;
}

.equation-block .eq-label {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2d5aa0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.symbol-table {
    width: 100%;
    max-width: 650px;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
}

.symbol-table th {
    text-align: left;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid #2d5aa0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
}

.symbol-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: top;
}

.symbol-table td:first-child {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    white-space: nowrap;
    width: 120px;
    color: #0f0f23;
}

.insight-box {
    background: #eef3fb;
    border: 1px solid #c5d5ea;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    max-width: 70ch;
}

.insight-box .insight-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2d5aa0;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.insight-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.history-note {
    background: #faf9f6;
    border-left: 3px solid #c9b97a;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    max-width: 65ch;
}

.history-note .history-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a7a3a;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.analogy-box {
    background: #f0f8f0;
    border: 1px solid #c5dcc5;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    max-width: 70ch;
}

.analogy-box .analogy-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #3a7a3a;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.analogy-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.connection-box {
    background: #faf0f5;
    border: 1px solid #dcc5d5;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    max-width: 70ch;
    font-size: 0.92rem;
}

.connection-box .connection-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7a3a6a;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.connection-box p {
    margin-bottom: 0;
}

.eq-map {
    background: #f7f8fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 2rem;
    margin: 2rem 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre;
}

.guide-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
    max-width: 70ch;
}

.guide-section li {
    margin-bottom: 0.4rem;
}

.inline-eq {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 1.02em;
}

/* --- Philosophy Page --- */
.axiom-block {
    background: #f7f8fa;
    border-left: 4px solid #2d5aa0;
    border-radius: 4px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    max-width: 75ch;
}

.axiom-block p {
    margin-bottom: 0.5rem;
    font-size: 1.02rem;
    line-height: 1.8;
}

.axiom-block p:last-child {
    margin-bottom: 0;
}

.axiom-limits {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.axiom-limits li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.depth-state {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem 2rem;
    margin: 1.25rem 0;
    max-width: 75ch;
}

.depth-state h4 {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-style: italic;
    font-weight: normal;
    color: #2d5aa0;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.depth-state p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.closing-aphorisms {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.aphorism {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-style: italic;
    color: #333;
    line-height: 1.8;
    padding: 1rem 0;
    border-bottom: 1px solid #e8e8e8;
    max-width: 70ch;
}

.aphorism:last-child {
    border-bottom: none;
}

/* --- Dropdown Navigation --- */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #0f0f23;
    border: 1px solid #333;
    border-radius: 6px;
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.nav-dropdown-menu li { list-style: none; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1.2rem;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}
.nav-dropdown-menu a:hover { background: rgba(45, 90, 160, 0.2); color: #fff; }
.nav-dropdown-menu a.active { color: #8ab4f8; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.dropdown-toggle { cursor: pointer; }
.caret { font-size: 0.7em; margin-left: 0.2em; }
.nav-dropdown.active > a.dropdown-toggle { color: #2d5aa0; }

/* --- Responsive --- */
@media (max-width: 768px) {
    html { font-size: 16px; }

    .hero h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }

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

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

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        font-size: 0.82rem;
    }

    .nav-links a {
        font-size: 0.78rem;
        letter-spacing: 0.03em;
    }

    /* Mobile: dropdowns expand inline on tap */
    .nav-dropdown-menu {
        position: static;
        display: none;
        border: none;
        box-shadow: none;
        padding-left: 0.5rem;
        background: transparent;
        min-width: auto;
    }
    .nav-dropdown:hover .nav-dropdown-menu { display: none; }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav-dropdown-menu li { display: inline; }
    .nav-dropdown-menu a {
        color: #444;
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
        display: inline-block;
    }
    .nav-dropdown-menu a:hover { color: #2d5aa0; background: transparent; }
    .nav-dropdown-menu a.active { color: #2d5aa0; }

    section { padding: 3rem 0; }
    .hero { padding: 4rem 0 3rem; }
    .container { padding: 0 1.25rem; }

    .paper-page-header h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero .tagline { font-size: 1.05rem; }
    .btn { padding: 0.65rem 1.5rem; font-size: 0.9rem; }
}
