/* ============================================================
   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: 500px;
    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;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero .hero-logo { max-width: 360px; }
    .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; }
}
