/* ==========================================================================
   ARCHITAPE GLOBAL STYLESHEET
   Core variables, shared resets, and base typography for all templates.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

/* Unified Variables */
:root {
    /* Brand Colors */
    --primary-color: #559ab3;
    --primary-dark: #3d7a8f;
    --primary-light: #7bb3c7;
    --primary-lighter: #ffffff;

    --at-accent: #73c5d8;
    --at-accent-light: #e6f7fb;

    --brand-blue: #559ab3;

    /* Text & Greys */
    --text-dark: #1a1a1a;
    --text-main: #0f172a;
    --text-medium: #4a4a4a;
    --text-light: #6b6b6b;
    --text-muted: #475569;

    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --white: #ffffff;

    --at-dark: #1a1a1a;
    --at-gray: #f8f9fa;
    --at-gray-text: #666666;

    --at-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    background-color: #ffffff;
}

/* Common Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Inter", sans-serif;
    color: var(--text-dark);
    font-weight: 700;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--at-transition);
}

a:hover {
    color: var(--primary-dark);
}
/* PRISTINE HANDWRITTEN CSS FOR KNOWLEDGE PAGE */

:root {
    --brand-blue: #559ab3;
    --text-main: #0f172a;
    --text-muted: #334155;
    /* Darkened for WCAG AA compliance */
    --border-light: #e2e8f0;
}

.kh-glossary-page {
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    color: var(--text-main);
    scroll-behavior: smooth;
    line-height: 1.8;
}

/* 
   Strict Academic Layout
   Max width of 800px ensures lines don't get too long (optimal ~65 characters per line).
   This prevents eye strain when reading dense technical text.
*/
.kh-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px 120px 40px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
}

@media (max-width: 1024px) {
    .kh-container {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }
}

/* Sidebar Navigation */
.kh-sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 20px;
    border-right: 1px solid var(--border-light);
}

@media (max-width: 1024px) {
    .kh-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 40px;
        margin-bottom: 40px;
    }
}

/* Typographic Hierarchy */
.kh-hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 2rem;
    border-bottom: 8px solid var(--text-main);
    padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .kh-hero-title {
        font-size: 5rem;
    }
}

.kh-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 4rem;
}

/* The Index */
.kh-index {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kh-index-link {
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.kh-index-link:hover {
    color: var(--text-main);
    border-color: var(--text-main);
    background: #f8fafc;
}

/* Section & Term Architecture */
.kh-section {
    margin-bottom: 100px;
}

.kh-section-header {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--border-light);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.kh-section-header::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border-light);
}

.kh-term {
    margin-bottom: 60px;
}

.kh-term-title {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.kh-term-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand-blue);
    margin-bottom: 1.5rem;
}

/* Core Description - Massive Readability */
.kh-term-desc {
    font-size: 1.25rem;
    /* Massive 20px base text */
    font-weight: 400;
    color: var(--text-main);
    margin-bottom: 2rem;
}

/* Sub-bullet text blocks */
.kh-sub-block {
    padding-left: 24px;
    border-left: 2px solid var(--border-light);
    margin-top: 2rem;
}

.kh-sub-title {
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kh-sub-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.kh-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 40px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Mobile Quick Nav */
@media (max-width: 1024px) {
    .kh-mobile-nav {
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border-light);
        display: flex;
        overflow-x: auto;
        padding: 12px;
        gap: 12px;
        margin: -40px -24px 40px -24px;
        -webkit-overflow-scrolling: touch;
    }

    .kh-mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .kh-mobile-nav-link {
        white-space: nowrap;
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 6px 12px;
        border: 1px solid var(--border-light);
        color: var(--text-muted);
    }
}

@media (min-width: 1025px) {
    .kh-mobile-nav {
        display: none;
    }
}

/* Internal Linking */
.kh-internal-link:hover {
    color: var(--text-main);
}

/* Utility: Back to Top */
#kh-back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--text-main);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

#kh-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#kh-back-to-top:hover {
    background: var(--brand-blue);
}

/* Utility: Copy Link */
.kh-copy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 12px;
    color: var(--border-light);
    cursor: pointer;
    vertical-align: middle;
    transition: color 0.2s;
    position: relative;
}

.kh-copy-link:hover {
    color: var(--brand-blue);
}

.kh-copy-link svg {
    width: 14px;
    height: 14px;
}

.kh-copy-success::after {
    content: 'Link Copied';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Added Standard Classes (Replacing Tailwind) */
.kh-sidebar-header {
    margin-bottom: 3rem;
}

.kh-intelligence-label {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #0284c7;
    /* sky-600 */
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.kh-index-title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    margin-bottom: 2rem;
}

.kh-hero-wrapper {
    margin-bottom: 5rem;
}

.kh-term-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2rem;
}

@media (min-width: 768px) {
    .kh-term-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.kh-sub-desc-mb {
    margin-bottom: 1rem;
}

.kh-sub-desc-mt {
    margin-top: 1rem;
}

.kh-spec-section {
    margin-top: 5rem;
    padding: 3rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.kh-spec-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.kh-spec-desc {
    color: #475569;
    margin-bottom: 2rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.kh-btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.kh-btn-primary {
    padding: 1rem 2rem;
    background-color: #0f172a;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.kh-btn-primary:hover {
    background-color: #0284c7;
    color: #ffffff;
}

.kh-btn-outline {
    padding: 1rem 2rem;
    border: 2px solid #0f172a;
    color: #0f172a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    background-color: transparent;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.kh-btn-outline:hover {
    background-color: #0f172a;
    color: #ffffff;
}

.kh-icon-md {
    width: 1.5rem;
    height: 1.5rem;
}
