/* ============================================================
   Techalicious Academy - Static Archive
   Design language adapted from the RAG Proxy / TKF 2026
   companion site. Navy / blue / ice with vibrant accents.
   ============================================================ */

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

:root {
    /* Techalicious variation - indigo nav, violet primary, magenta spark.
       Same proven structure as the ragproxy companion site, shifted
       toward the wizard/builder vibe of the Techalicious logo.
       Page background is pure #ffffff (per operator). */
    --navy:        #2D2B6C;  /* indigo navy - top nav, headings, dark surfaces */
    --navy-deep:   #1F1D5A;  /* deeper indigo - gradient anchor, code blocks */
    --blue:        #6366F1;  /* violet-indigo - primary links, CTAs */
    --blue-bright: #A5B4FC;  /* light violet - footer accents */
    --purple:      #EC4899;  /* magenta pink - secondary spark accent */
    --green:       #10B981;  /* emerald - status / "ok" highlights */
    --amber:       #F59E0B;  /* warning amber - archive banner */
    --red:         #EF4444;
    --ice:         #F5F3FF;  /* faint lavender ice - card / section fills */
    --ice-deep:    #E0E7FF;  /* deeper lavender - section rules */
    --white:       #ffffff;  /* pure white - page background */
    --text:        #1F2937;  /* slate-800 - body text */
    --text-light:  #6B7280;  /* slate-500 */
    --shadow:       rgba(45, 43, 108, 0.12);
    --shadow-heavy: rgba(45, 43, 108, 0.24);
    --radius:      10px;
    --radius-lg:   14px;
    --code-bg:     #1F1D5A;  /* deep indigo code blocks */
    --code-text:   #E0E7FF;  /* lavender code text */
}

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 (sticky navy bar, pill links, mobile hamburger)
   ------------------------------------------------------------ */
.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 a.logo,
.top-nav .logo {
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    transition: opacity 0.15s;
}
.top-nav a.logo:hover { opacity: 0.85; color: var(--white); }
.top-nav .logo img { display: none; }
.top-nav .logo span {
    opacity: 0.6;
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.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); }
.nav-links a.club-cta {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: var(--white);
    font-weight: 700;
}
.nav-links a.club-cta:hover { filter: brightness(1.1); background: linear-gradient(135deg, var(--blue), var(--purple)); }

.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;
}
.page.narrow { max-width: 820px; }

/* ------------------------------------------------------------
   Archive notice banner - top of every page
   ------------------------------------------------------------ */
.archive-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.5rem auto 0;
    max-width: 1100px;
    color: #78350f;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}
.archive-banner .archive-icon {
    font-size: 1.35rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.archive-banner .archive-text {
    max-width: 760px;
}
.archive-banner .archive-text strong { color: #78350f; font-weight: 800; }
.archive-banner a.archive-link {
    background: var(--navy);
    color: var(--white) !important;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: background 0.15s, transform 0.12s;
}
.archive-banner a.archive-link:hover {
    background: var(--blue);
    transform: translateY(-1px);
}

/* ------------------------------------------------------------
   Hero (root index)
   ------------------------------------------------------------ */
.hero {
    text-align: center;
    padding: 0.25rem 1rem 2rem;
}
.hero .hero-logo {
    display: block;
    width: 100%;
    max-width: 620px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.25rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.hero h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -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: 680px;
    margin: 0 auto 0.75rem;
    line-height: 1.5;
}
.hero .event-line {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ------------------------------------------------------------
   Stat cards
   ------------------------------------------------------------ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 2rem 0 2.5rem;
}
.stat-card {
    background: var(--ice);
    border-radius: var(--radius-lg);
    padding: 1.4rem 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;
    color: var(--navy);
}
.stat-card .number.blue   { color: var(--blue); }
.stat-card .number.green  { color: var(--green); }
.stat-card .number.purple { color: var(--purple); }
.stat-card .number.amber  { color: var(--amber); }
.stat-card .label {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ------------------------------------------------------------
   Time notice - warm "accurate at the time" disclaimer-as-content
   ------------------------------------------------------------ */
.time-notice {
    background: var(--ice);
    border: 1px solid var(--blue);
    border-left: 5px solid var(--blue);
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    margin: 1.75rem 0;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.6;
    box-shadow: 0 2px 10px var(--shadow);
}
.time-notice .time-notice-icon {
    font-size: 1.2rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.time-notice strong { color: var(--navy); font-weight: 800; }
.time-notice .spark {
    color: var(--purple);
    font-weight: 700;
    font-style: italic;
}

/* ------------------------------------------------------------
   Section header (the "Tutorials" rule)
   ------------------------------------------------------------ */
.section-header {
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--ice-deep);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.section-header h2 { margin-bottom: 0; }
.section-header .meta {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

/* ------------------------------------------------------------
   Tutorial cards - root index grid
   ------------------------------------------------------------ */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.tutorial-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid rgba(15, 38, 74, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px var(--shadow);
    border-color: var(--blue);
}
.tutorial-card .tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tutorial-card .tag-row .date {
    background: var(--ice);
    color: var(--navy);
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
}
.tutorial-card .tag-row .files { color: var(--blue); }
.tutorial-card h3 {
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.3;
}
.tutorial-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
}
.tutorial-card .read-arrow {
    margin-top: 0.85rem;
    color: var(--blue);
    font-weight: 700;
    font-size: 0.88rem;
}

/* ------------------------------------------------------------
   Chapter cards - per-tutorial index page
   ------------------------------------------------------------ */
.chapter-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 1.25rem;
}
.chapter-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--ice);
    border: 1px solid rgba(15, 38, 74, 0.06);
    border-radius: var(--radius);
    padding: 0.85rem 1.15rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.chapter-card:hover {
    background: var(--white);
    border-color: var(--blue);
    transform: translateX(2px);
}
.chapter-card .chapter-num {
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    background: var(--navy);
    color: var(--white);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}
.chapter-card .chapter-info { flex: 1; min-width: 0; }
.chapter-card .chapter-title {
    color: var(--navy);
    font-weight: 700;
    font-size: 0.98rem;
    margin-bottom: 0.1rem;
}
.chapter-card .chapter-meta {
    color: var(--text-light);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.chapter-card .chapter-arrow {
    color: var(--blue);
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   Breadcrumb
   ------------------------------------------------------------ */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--blue); font-weight: 600; }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb .sep { color: var(--text-light); opacity: 0.6; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------
   Tutorial header block (sits above chapter cards / prose)
   ------------------------------------------------------------ */
.tut-head {
    background: linear-gradient(135deg, var(--navy), var(--purple));
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.85rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 22px var(--shadow-heavy);
}
.tut-head h1 {
    color: var(--white);
    font-size: 1.85rem;
    margin-bottom: 0.55rem;
    background: none;
    -webkit-text-fill-color: initial;
}
.tut-head .tut-meta {
    color: rgba(255,255,255,0.65);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.7rem;
}
.tut-head .tut-desc {
    color: rgba(255,255,255,0.88);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 780px;
}

/* ------------------------------------------------------------
   Prose (chapter page body)
   ------------------------------------------------------------ */
.prose {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.02rem;
}
.prose h1 {
    font-size: 1.9rem;
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--ice-deep);
    /* Tutorial parser emits ALL CAPS - normalize visually */
    text-transform: none;
}
.prose h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    font-size: 1.4rem;
    color: var(--navy);
    border-left: 4px solid var(--blue);
    padding-left: 0.85rem;
}
.prose h3 { margin-top: 1.6rem; margin-bottom: 0.5rem; font-size: 1.1rem; }
.prose p { margin-bottom: 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--navy); }

.prose pre.md-fences {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1.25rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
    box-shadow: 0 4px 14px var(--shadow);
    /* Wrap instead of side-scroll - no horizontal overflow */
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
.prose pre.md-fences code {
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: inherit;
    color: inherit;
    background: none;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.prose code {
    background: var(--ice-deep);
    color: var(--navy);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

.prose .highlight-box {
    background: var(--ice);
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.1rem 1.35rem;
    margin: 1.4rem 0;
    font-size: 0.96rem;
}
.prose .highlight-box.green { border-left-color: var(--green); }
.prose .highlight-box.red   { border-left-color: var(--red); }
.prose .highlight-box.amber { border-left-color: var(--amber); }

/* ------------------------------------------------------------
   Prev / next chapter nav (bottom of chapter page)
   ------------------------------------------------------------ */
.chapter-nav {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--ice-deep);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.chapter-nav a {
    display: inline-block;
    background: var(--ice);
    border: 1px solid rgba(15, 38, 74, 0.08);
    border-radius: var(--radius);
    padding: 0.7rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--navy);
    transition: border-color 0.15s, transform 0.12s;
    max-width: 48%;
}
.chapter-nav a:hover {
    border-color: var(--blue);
    transform: translateY(-1px);
}
.chapter-nav a.next { margin-left: auto; text-align: right; }
.chapter-nav a.prev { text-align: left; }
.chapter-nav .label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

/* ------------------------------------------------------------
   CTA button (gradient, big)
   ------------------------------------------------------------ */
.cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white !important;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 12px;
    border: 3px solid var(--blue);
    box-shadow: 0 6px 0 rgba(45, 43, 108, 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(45, 43, 108, 0.35), 0 16px 28px var(--shadow-heavy);
    color: white !important;
}
.cta-btn:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(45, 43, 108, 0.35), 0 6px 12px var(--shadow-heavy);
}

/* ------------------------------------------------------------
   "Visit the club" callout block (root + about)
   ------------------------------------------------------------ */
.club-callout {
    background: linear-gradient(135deg, var(--navy-deep), var(--purple));
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem;
    margin: 2.5rem 0;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-heavy);
}
.club-callout h2 {
    color: var(--white);
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
}
.club-callout p {
    color: rgba(255,255,255,0.85);
    max-width: 620px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}
.club-callout .cta-btn {
    background: var(--white);
    color: var(--navy) !important;
    border-color: var(--white);
    box-shadow: 0 6px 0 rgba(0,0,0,0.25), 0 12px 24px rgba(0,0,0,0.25);
}
.club-callout .cta-btn:hover { background: var(--ice); color: var(--navy) !important; }

/* ------------------------------------------------------------
   Footer (navy strip)
   ------------------------------------------------------------ */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.75rem 1.5rem;
    font-size: 0.85rem;
    margin-top: auto;
    letter-spacing: 0.01em;
    line-height: 1.65;
}
.site-footer strong { color: rgba(255,255,255,0.92); font-weight: 700; }
.site-footer a { color: var(--blue-bright); font-weight: 600; }
.site-footer a:hover { color: var(--white); }
.site-footer .footer-row {
    max-width: 880px;
    margin: 0 auto;
}
.site-footer .footer-links {
    margin: 0.55rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem 1.25rem;
}
.site-footer .disclaimer {
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    margin-top: 0.85rem;
    font-style: italic;
}

/* ------------------------------------------------------------
   Feature cards (home: "What goes on here")
   Blue left-accent + contained icon-box. Sibling to .tutorial-card.
   ------------------------------------------------------------ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.feature-card {
    display: flex;
    gap: 1.15rem;
    align-items: stretch;
    background: var(--white);
    border: 1px solid var(--ice-deep);
    border-left: 5px solid var(--blue);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.4rem 1.2rem 1.1rem;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s, border-left-color 0.15s;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px var(--shadow);
    border-left-color: var(--purple);
}

.feature-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background: var(--ice);
    border: 1px solid var(--ice-deep);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
}

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

.feature-tag {
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.feature-body h3 {
    color: var(--navy);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.feature-body p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 0.7rem;
}

.feature-arrow {
    color: var(--blue);
    font-weight: 700;
    font-size: 0.88rem;
}

/* ------------------------------------------------------------
   Bio split layout - photo on the left, prose on the right.
   Mirrors the RAG Proxy bio.html structure.
   ------------------------------------------------------------ */
.bio-split {
    display: flex;
    flex-direction: row-reverse;
    gap: 2.5rem;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto 0.5rem;
}
.bio-split-photo {
    flex-shrink: 0;
    width: 210px;
    max-width: 210px;
}
.bio-split-img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    background: transparent;
    display: block;
}
.bio-split-text { flex: 1; min-width: 0; max-width: 700px; }
@media (max-width: 820px) {
    .bio-split { flex-direction: column; align-items: center; }
    .bio-split-photo { width: 100%; max-width: 280px; }
    .bio-split-text { max-width: 100%; }
}

/* ------------------------------------------------------------
   Personal projects cards (bio page) - pulled from RAG Proxy
   ------------------------------------------------------------ */
.project-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}
.project-card {
    background: var(--ice);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    border: 1px solid rgba(45, 43, 108, 0.06);
    box-shadow: 0 2px 8px var(--shadow);
    transition: box-shadow 0.15s, transform 0.15s;
}
.project-card:hover {
    box-shadow: 0 6px 24px var(--shadow);
    transform: translateY(-2px);
}
.project-card .project-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.2rem;
}
.project-card .project-tagline {
    font-size: 0.92rem;
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 0.85rem;
}
.project-card .project-desc {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.65;
}
.project-card .project-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}
.project-card .project-stats span {
    background: var(--navy);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.section-divider {
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--ice);
}
@media (max-width: 768px) {
    .project-card { padding: 1.25rem 1.35rem; }
    .project-card .project-name { font-size: 1.15rem; }
}

/* ------------------------------------------------------------
   Auth forms (login / register / check-email)
   ------------------------------------------------------------ */
.auth-box {
    max-width: 460px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--ice-deep);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: 0 6px 24px var(--shadow);
}
.auth-lead {
    text-align: center;
    color: var(--text-light);
    margin: 0.5rem 0 1.75rem;
    line-height: 1.55;
    font-size: 0.95rem;
}
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}
.auth-form label small {
    color: var(--text-light);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.35rem;
}
.auth-form input {
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--ice);
    border: 1px solid var(--ice-deep);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.auth-form button.cta-btn {
    margin-top: 0.5rem;
    width: 100%;
    border: 3px solid var(--blue);
    cursor: pointer;
}
.auth-alt {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.92rem;
    color: var(--text-light);
}

/* ------------------------------------------------------------
   Flash messages
   ------------------------------------------------------------ */
.flash {
    max-width: 1100px;
    margin: 1.25rem auto 0;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    font-size: 0.93rem;
    line-height: 1.5;
}
.flash ul { margin: 0 0 0 1.25rem; padding: 0; }
.flash-ok  { background: #ECFDF5; border: 1px solid var(--green); color: #065F46; }
.flash-err { background: #FEF2F2; border: 1px solid var(--red);   color: #7F1D1D; }

/* ------------------------------------------------------------
   Slide grid + lightbox (tutorial show page)
   ------------------------------------------------------------ */
.slide-grid-help {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--ice);
    border: 1px solid var(--ice-deep);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    margin: 1.25rem 0 1.5rem;
    font-size: 0.92rem;
    color: var(--text);
}
.slide-grid-help .help-icon { font-size: 1.15rem; }

.slide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.25rem;
    margin: 1.5rem 0 2.5rem;
}
@media (max-width: 560px) { .slide-grid { grid-template-columns: 1fr; } }

.slide-card {
    background: var(--white);
    border: 3px solid var(--ice-deep);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 3px 10px var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
}
.slide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px var(--shadow);
    border-color: var(--blue);
}

.slide-thumb-btn {
    display: block;
    background: #1F1D5A;            /* dark fill behind 4:3 letterbox bars */
    border: 0;
    padding: 0;
    cursor: zoom-in;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.slide-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--white);
}

.slide-card-foot {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    background: var(--white);
    border-top: 1px solid var(--ice-deep);
}
.slide-num-pill {
    flex-shrink: 0;
    background: var(--navy);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
}
.slide-title-link {
    flex: 1;
    color: var(--navy);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    line-height: 1.3;
}
.slide-title-link:hover { color: var(--blue); }
.slide-title-link .arrow { color: var(--blue); font-weight: 800; margin-left: 0.2rem; }

/* ------------------------------------------------------------
   Deep dive index, second-route bulleted list below the slide grid
   ------------------------------------------------------------ */
.deep-dive-index {
    margin: 2.5rem 0 1.5rem;
    padding: 1.4rem 1.6rem;
    background: var(--ice);
    border: 1px solid var(--ice-deep);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
}
.deep-dive-index h2 {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
    color: var(--navy);
}
.deep-dive-index-help {
    margin: 0 0 1rem;
    color: var(--text-mid);
    font-size: 0.95rem;
}
.deep-dive-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.3rem 1.2rem;
}
.deep-dive-list li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--ice-deep);
}
.deep-dive-list li:last-child { border-bottom: none; }
.deep-dive-list a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}
.deep-dive-list a:hover { color: var(--blue); }
.deep-dive-list a:hover .dd-title { text-decoration: underline; }
.deep-dive-list .dd-num {
    flex-shrink: 0;
    color: var(--blue);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    min-width: 1.8rem;
}
.deep-dive-list .dd-title {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.35;
}
.deep-dive-list li.no-deep-dive {
    color: var(--text-light);
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.deep-dive-list .dd-note {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* ------------------------------------------------------------
   Lightbox overlay
   ------------------------------------------------------------ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 14, 60, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox-figure {
    margin: 0;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.lightbox-figure img {
    max-width: 95vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    background: #fff;
}
#lightbox-caption {
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.lightbox-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 0;
    border-radius: 999px;
    width: 44px; height: 44px;
    font-size: 1.6rem;
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 0;
    border-radius: 999px;
    width: 52px; height: 52px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
@media (max-width: 600px) {
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}

/* ------------------------------------------------------------
   Slide deep-dive page
   ------------------------------------------------------------ */
.slide-deepdive-head { margin-bottom: 1.5rem; }
.slide-deepdive-head .dd-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.dd-slide-figure {
    margin: 0;
    background: #1F1D5A;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--ice-deep);
    box-shadow: 0 6px 22px var(--shadow);
}
.dd-slide-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--white);
}
.deepdive-body { margin-top: 2rem; }
.deepdive-body h1:first-of-type { margin-top: 0; }

/* Tables rendered by Text::MultiMarkdown inside deep-dive prose */
.deepdive-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.94rem;
    background: var(--white);
    border: 1px solid var(--ice-deep);
    border-radius: var(--radius);
    overflow: hidden;
}
.deepdive-body th,
.deepdive-body td {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--ice-deep);
    vertical-align: top;
}
.deepdive-body thead th {
    background: var(--ice);
    color: var(--navy);
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--ice-deep);
}
.deepdive-body tbody tr:last-child td { border-bottom: 0; }
.deepdive-body tbody tr:hover { background: var(--ice); }

/* Code blocks (fenced + inline) inside deep-dive */
.deepdive-body pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1.25rem 0;
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: 0 4px 14px var(--shadow);
}
.deepdive-body pre code {
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    color: inherit;
    background: none;
    padding: 0;
    font-size: inherit;
}
.deepdive-body code {
    background: var(--ice-deep);
    color: var(--navy);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 0.92em;
}
.deepdive-body blockquote {
    border-left: 4px solid var(--blue);
    background: var(--ice);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.9rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--text);
    font-size: 1rem;
}
.deepdive-body blockquote p:last-child { margin-bottom: 0; }
.deepdive-body hr {
    border: 0;
    border-top: 2px solid var(--ice-deep);
    margin: 2rem 0;
}

.dd-chapter-nav {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--ice-deep);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.dd-chapter-nav a {
    display: block;
    background: var(--ice);
    border: 1px solid var(--ice-deep);
    border-radius: var(--radius);
    padding: 0.8rem 1.1rem;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.12s;
}
.dd-chapter-nav a:hover { border-color: var(--blue); transform: translateY(-1px); }
.dd-chapter-nav a.next  { text-align: right; }
.dd-chapter-nav .label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.dd-chapter-nav .t {
    display: block;
    color: var(--navy);
    font-weight: 700;
    font-size: 0.92rem;
}
.back-to-grid {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}
.back-to-grid:hover { color: var(--navy); }

/* ------------------------------------------------------------
   Empty state (tutorials index when no rows)
   ------------------------------------------------------------ */
.empty-state {
    background: var(--ice);
    border: 1px dashed var(--blue);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    text-align: center;
    margin: 1.5rem 0;
}
.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.empty-state h2 {
    color: var(--navy);
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
}
.empty-state p {
    color: var(--text-light);
    max-width: 580px;
    margin: 0 auto 0.85rem;
    line-height: 1.6;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero .hero-logo { max-width: 420px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .stat-card .number { font-size: 1.8rem; }
    .tutorial-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; }

    .archive-banner a.archive-link { align-self: stretch; text-align: center; }

    .tut-head { padding: 1.4rem 1.35rem; }
    .tut-head h1 { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.85rem; }
    .hero .subtitle { font-size: 1.05rem; }
    .page { padding: 1.5rem 1rem 2rem; }
    h2 { font-size: 1.3rem; }
    .prose pre.md-fences { font-size: 0.82rem; padding: 0.85rem 1rem; }
}
