/* ============================================================
   RAG Proxy Companion Site — TKF 2026
   Faculty of Dentistry, University of Toronto
   ============================================================ */

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

:root {
    --navy:   #1E3765;
    --blue:   #0F71B5;
    --green:  #22863a;
    --red:    #d73a49;
    --ice:    #f8fafc;
    --white:  #ffffff;
    --text:   #334155;
    --text-light: #64748b;
    --shadow: rgba(15, 38, 74, 0.12);
    --shadow-heavy: rgba(15, 38, 74, 0.22);
    --radius: 10px;
    --radius-lg: 14px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; }
h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }

a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--navy); }

img { max-width: 100%; height: auto; display: block; }

/* --- Top Nav Bar --- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navy);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 12px var(--shadow-heavy);
}

.top-nav .logo {
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.top-nav .logo span {
    opacity: 0.6;
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

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

.nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

.nav-links a.active {
    background: rgba(255,255,255,0.22);
}

/* Mobile hamburger */
.nav-toggle { display: none; }
.nav-toggle-label {
    display: none;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: white;
    height: 2px;
    width: 22px;
    border-radius: 2px;
    position: relative;
    transition: transform 0.25s;
}
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
}
.nav-toggle-label span::before { top: -7px; }
.nav-toggle-label span::after { top: 7px; }

/* --- Page Wrapper --- */
.page {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* --- Hero Section (index) --- */
.hero {
    text-align: center;
    padding: 0.25rem 1rem 2rem;
}

.hero h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text);
    max-width: 640px;
    margin: 0 auto 0.75rem;
    line-height: 1.5;
}

.hero .event-line {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- Stat Cards --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 2.5rem 0;
}

.stat-card {
    background: var(--ice);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid rgba(15, 38, 74, 0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
}

.stat-card .number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.stat-card .number.green { color: var(--green); }
.stat-card .number.red { color: var(--red); }
.stat-card .number.blue { color: var(--blue); }

.stat-card .label {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* --- Navigation Cards (index) --- */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.nav-card {
    display: block;
    background: var(--white);
    border: 1px solid rgba(15, 38, 74, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--blue);
}

.nav-card .card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.nav-card h3 {
    color: var(--navy);
    margin-bottom: 0.35rem;
}

.nav-card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.45;
}

/* --- CTA Button (gradient nav style) --- */
.cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, #0F71B5 0%, #1E3765 100%);
    color: white !important;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 12px;
    border: 3px solid #0F71B5;
    box-shadow: 0 6px 0 rgba(15, 38, 74, 0.35), 0 12px 24px var(--shadow-heavy);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    letter-spacing: 0.04em;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(15, 38, 74, 0.35), 0 16px 28px var(--shadow-heavy);
    color: white !important;
}

.cta-btn:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(15, 38, 74, 0.35), 0 6px 12px var(--shadow-heavy);
}

/* --- Section Headers --- */
.section-header {
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--ice);
}

/* --- Content Cards (glossary, links) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.content-card {
    background: var(--ice);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    border: 1px solid rgba(15, 38, 74, 0.06);
    box-shadow: 0 1px 4px var(--shadow);
    transition: box-shadow 0.15s;
}

.content-card:hover {
    box-shadow: 0 4px 16px var(--shadow);
}

.content-card .term {
    font-weight: 800;
    color: var(--navy);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.content-card .definition {
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.55;
}

/* --- Slide Grid --- */
.slide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.slide-card {
    display: block;
    background: var(--white);
    border: 1px solid rgba(15, 38, 74, 0.1);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.slide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.slide-card img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid rgba(15, 38, 74, 0.06);
}

.slide-card .slide-label {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slide-card .slide-num {
    background: var(--navy);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    min-width: 1.6rem;
    text-align: center;
}

/* --- Prose (about page) --- */
.prose {
    max-width: 740px;
    margin: 0 auto;
}

.prose h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.prose p {
    margin-bottom: 1.25rem;
    font-size: 1.02rem;
}

.prose .highlight-box {
    background: var(--ice);
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.prose .highlight-box.green { border-left-color: var(--green); }
.prose .highlight-box.red { border-left-color: var(--red); }

/* --- Bio Page --- */
.bio-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    max-width: 800px;
    margin: 0 auto;
}

.bio-photo {
    flex-shrink: 0;
    max-width: 280px;
    width: 100%;
    height: auto;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: none;
    border: none;
}

.bio-photo-placeholder {
    flex-shrink: 0;
    width: 280px;
    height: 280px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    font-weight: 800;
    box-shadow: 0 4px 16px var(--shadow);
}

.bio-info h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.bio-info .title {
    font-size: 1.05rem;
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.bio-info .org {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.bio-info .bio-text {
    font-size: 1rem;
    line-height: 1.7;
}

.bio-info .bio-text p {
    margin-bottom: 1rem;
}

/* --- Links Page --- */
.link-section {
    margin-bottom: 2.5rem;
}

.link-card {
    display: block;
    background: var(--ice);
    border-radius: var(--radius);
    padding: 1.1rem 1.35rem;
    border: 1px solid rgba(15, 38, 74, 0.06);
    box-shadow: 0 1px 4px var(--shadow);
    text-decoration: none;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
}

.link-card:hover {
    box-shadow: 0 4px 16px var(--shadow);
    border-color: var(--blue);
    transform: translateY(-2px);
}

.link-card .link-title {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.98rem;
    margin-bottom: 0.25rem;
}

.link-card .link-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.45;
}

.link-card .link-url {
    font-size: 0.78rem;
    color: var(--blue);
    margin-top: 0.35rem;
    word-break: break-all;
}

/* --- Footer --- */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.82rem;
    margin-top: auto;
    letter-spacing: 0.02em;
}

.site-footer strong {
    color: rgba(255,255,255,0.9);
}

/* --- Attribution line (index) --- */
.attribution {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--ice);
    color: var(--text-light);
    font-size: 0.92rem;
    font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .stat-card .number { font-size: 1.8rem; }
    .bio-layout { flex-direction: column; align-items: center; text-align: center; }
    .bio-photo { max-width: 220px; height: auto; }
    .bio-photo-placeholder { width: 220px; height: 220px; }
    .nav-cards { grid-template-columns: 1fr; }
    .slide-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }

    .nav-toggle-label { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--navy);
        flex-direction: column;
        padding: 0.5rem 1rem 1rem;
        gap: 0.25rem;
        box-shadow: 0 8px 24px var(--shadow-heavy);
    }
    .nav-links a { padding: 0.6rem 1rem; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero .subtitle { font-size: 1.05rem; }
    .page { padding: 1.5rem 1rem 2rem; }
    h2 { font-size: 1.35rem; }
}
