/* ── Google Fonts ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Base ─────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background-color: rgb(var(--color-surface));
    color: rgb(var(--color-on-surface));
}

h1, h2, h3, h4, h5, h6,
.font-headline {
    font-family: var(--font-headline);
}

/* ── Material Symbols ─────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ── Gradient CTA ─────────────────────────────────────── */
.cta-gradient {
    background: var(--cta-gradient);
    color: var(--cta-color);
}
.cta-gradient:hover {
    filter: brightness(1.08);
}

/* ── Glassmorphism (floating elements) ────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ── Ambient Shadow ───────────────────────────────────── */
.shadow-ambient {
    box-shadow: var(--shadow-ambient);
}

/* ── Ghost Border ─────────────────────────────────────── */
.ghost-border {
    outline: 1px solid rgb(var(--color-outline-variant) / 0.15);
}

/* ── Selection ────────────────────────────────────────── */
::selection {
    background-color: var(--selection-bg);
}

/* ── Prose (long-form content: KB articles, dev diary) ── */
.prose h2  { font-family: var(--font-headline); font-size: 1.5rem; font-weight: 700; margin-top: 2.5rem; margin-bottom: 1rem; color: rgb(var(--color-on-surface)); letter-spacing: -0.01em; }
.prose h3  { font-family: var(--font-headline); font-size: 1.25rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; color: rgb(var(--color-on-surface)); }
.prose p   { margin-bottom: 1.25rem; line-height: 1.75; color: rgb(var(--color-on-surface-variant)); }
.prose ul  { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1.25rem; color: rgb(var(--color-on-surface-variant)); }
.prose ol  { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1.25rem; color: rgb(var(--color-on-surface-variant)); }
.prose li  { margin-bottom: 0.5rem; line-height: 1.6; }
.prose blockquote { border-left: 4px solid rgb(var(--color-primary)); padding-left: 1rem; font-style: italic; color: rgb(var(--color-on-surface-variant)); margin-bottom: 1.25rem; }
.prose code { font-size: 0.875rem; background: rgb(var(--color-surface-container-low)); padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
.prose img  { border-radius: 0.5rem; margin: 1.5rem 0; }
.prose figure { margin: 1.5rem 0 2.25rem; }
.prose figure img { margin: 0; }
.prose figcaption { font-size: 0.875rem; color: rgb(var(--color-outline)); text-align: center; margin-top: 0.625rem; line-height: 1.5; }
.prose figcaption a { color: rgb(var(--color-primary)); text-decoration: underline; text-underline-offset: 2px; }
.prose figcaption a:hover { color: rgb(var(--color-primary-dark)); }

/* ── Callout boxes ─────────────────────────────────────── */
.prose .callout { background: rgb(var(--color-surface-container-low)); border-left: 4px solid rgb(var(--color-primary)); border-radius: 0 0.5rem 0.5rem 0; padding: 1.25rem 1.5rem; margin: 2rem 0; }
.prose .callout-title { font-family: var(--font-headline); font-weight: 700; font-size: 0.9375rem; color: rgb(var(--color-primary)); margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.prose .callout p { margin-bottom: 0.75rem; }
.prose .callout p:last-child { margin-bottom: 0; }

/* ── Console Layout ───────────────────────────────────── */
.console-shell {
    display: flex;
    min-height: 100vh;
}

.console-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.25rem 1.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: inset -1px 0 0 var(--sidebar-border-subtle);
    /* Machined texture from design concept */
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.03) 1px, transparent 0);
    background-size: 4px 4px;
}
@media (max-width: 768px) {
    .console-sidebar { display: none; }
}

.console-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.utility-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--utility-bar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 2.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.console-right {
    width: 260px;
    flex-shrink: 0;
    background: rgb(var(--color-surface-container-low));
    padding: 2rem 1.5rem;
    position: sticky;
    top: 3.5rem;
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    border-left: 1px solid rgb(var(--color-outline-variant) / 0.15);
}
@media (max-width: 1024px) {
    .console-right { display: none; }
}

.content-area {
    flex: 1;
    display: flex;
}
.content-scroll {
    flex: 1;
    overflow-y: auto;
}

/* ── Console Mobile Nav ───────────────────────────────── */
.console-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
    border-top: 1px solid rgb(var(--color-outline-variant) / 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 3.5rem;
    padding: 0 0.5rem;
}
.console-mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    transition: color 0.15s;
    color: rgb(var(--color-on-surface-variant));
    text-decoration: none;
}
.console-mobile-nav-link.active {
    color: rgb(var(--color-primary));
}

/* ── Sections ─────────────────────────────────────────── */
.section {
    padding: 3rem 2.5rem;
}
.section--container {
    background: rgb(var(--color-surface-container));
}
.section--base {
    background: rgb(var(--color-surface));
}
.section--low {
    background: rgb(var(--color-surface-container-low));
}

/* ── Typography Classes ───────────────────────────────── */
.headline-lg {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: rgb(var(--color-on-surface));
}
.headline-md {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: rgb(var(--color-on-surface));
}
.body-md {
    font-size: 0.875rem;
    color: rgb(var(--color-on-surface-variant));
    line-height: 1.65;
}
.label-md {
    font-size: 0.75rem;
    color: rgb(var(--color-on-surface-variant));
    letter-spacing: 0.01em;
    font-feature-settings: 'tnum';
}
.text-primary   { color: rgb(var(--color-primary)); }
.text-secondary  { color: rgb(var(--color-secondary)); }
.text-tertiary   { color: rgb(var(--color-tertiary)); }
.text-dim        { color: rgb(var(--color-on-surface-variant)); }
.text-bright     { color: rgb(var(--color-on-surface)); }

/* ── Panes / Wells ────────────────────────────────────── */
.pane {
    background: rgb(var(--color-surface-container-high));
    padding: 1.25rem;
    border-radius: 2px;
}
.well {
    background: rgb(var(--color-surface-container-lowest));
    box-shadow: inset 0 2px 4px rgba(var(--color-surface-container-lowest) / 0.5);
    padding: 1rem 1.25rem;
    border-radius: 2px;
}

/* ── Status Fillet ────────────────────────────────────── */
.fillet {
    position: relative;
    padding-left: 1rem;
}
.fillet::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
}
.fillet--green::before  { background: var(--fillet-green); }
.fillet--brass::before  { background: var(--fillet-brass); }
.fillet--blue::before   { background: var(--fillet-blue); }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
    display: inline-block;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-color);
    padding: 0.625rem 1.5rem;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: inset 0 1px 0 0 var(--btn-primary-inset);
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
    border: none;
}
.btn-primary:hover {
    background: var(--btn-primary-hover-bg);
}
.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    display: inline-block;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-color);
    padding: 0.625rem 1.5rem;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
    border: none;
}
.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
}
.btn-secondary:active {
    transform: scale(0.97);
}

/* ── Horizontal rule replacement ──────────────────────── */
.tonal-break {
    height: 2px;
    background: linear-gradient(90deg, var(--tonal-break-from) 0%, transparent 100%);
    opacity: 0.3;
    margin: 1.5rem 0;
}

/* ── Details / FAQ ────────────────────────────────────── */
details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: rgb(var(--color-on-surface));
    padding: 0.75rem 1rem;
    background: rgb(var(--color-surface-container-lowest));
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    transition: background 0.15s;
}
details summary:hover {
    background: rgb(var(--color-surface-container-low));
}
details summary::-webkit-details-marker { display: none; }
details[open] summary .expand-icon {
    transform: rotate(180deg);
}
.expand-icon {
    transition: transform 0.2s;
    color: rgb(var(--color-on-surface-variant));
    font-size: 20px;
}
details .answer {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: rgb(var(--color-on-surface-variant));
    line-height: 1.7;
}

/* ── Grid: Persona Grid ───────────────────────────────── */
.persona-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
@media (max-width: 640px) {
    .persona-grid { grid-template-columns: 1fr; }
}

/* ── Feature list ─────────────────────────────────────── */
.feature-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
}
.feature-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feature-icon .material-symbols-outlined {
    font-size: 18px;
    color: rgb(var(--color-primary));
}

/* ── Sidebar internals ────────────────────────────────── */
.sidebar-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sidebar-section-label);
    margin-bottom: 0.5rem;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.8125rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    position: relative;
    /* Beveled button effect from design concept */
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.03), inset -1px -1px 0 rgba(0,0,0,0.12);
}
.sidebar-nav a:hover {
    background: var(--sidebar-nav-hover-bg);
    color: var(--sidebar-text);
}
.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--sidebar-nav-active-from), var(--sidebar-nav-active-to));
    color: var(--sidebar-text);
    border-left: 3px solid var(--sidebar-nav-active-border);
    box-shadow:
        0 0 15px var(--sidebar-nav-active-glow),
        inset 1px 1px 0 rgba(255,255,255,0.05),
        inset -1px -1px 0 rgba(0,0,0,0.2);
}
/* Neon left edge on active */
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--sidebar-section-label);
    box-shadow: 0 0 12px var(--sidebar-section-label);
}
.sidebar-nav a .material-symbols-outlined {
    font-size: 18px;
}
.sidebar-nav a:hover .material-symbols-outlined {
    color: var(--sidebar-section-label);
    transition: color 0.15s;
}
.sidebar-nav a.active .material-symbols-outlined {
    color: var(--sidebar-section-label);
}

/* ── Status fillet inside dark sidebar ─────────────────── */
.console-sidebar .fillet .label-md {
    color: var(--sidebar-text-muted);
}
.console-sidebar .fillet .text-primary,
.console-sidebar .fillet .label-md:first-child {
    color: var(--sidebar-section-label);
}

/* ── Tonal break inside dark sidebar ──────────────────── */
.console-sidebar .tonal-break {
    background: linear-gradient(90deg, var(--sidebar-section-label) 0%, transparent 100%);
    opacity: 0.2;
}

/* ── Logo mark ────────────────────────────────────────── */
.logo-mark {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: rgb(var(--color-on-surface));
    text-decoration: none;
}
.logo-mark span {
    color: rgb(var(--color-primary));
}

/* ── Glassmorphic tooltip/floating ────────────────────── */
.glass-float {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 2px;
}

/* ── Walkthrough: inner sidebar stickiness ────────────── */
.walkthrough-shell { display: flex; min-height: calc(100vh - 4rem); }
.walkthrough-sidebar { position: sticky; top: 3.5rem; height: calc(100vh - 3.5rem); overflow-y: auto; }

/* ── Pagefind overrides ───────────────────────────────── */
:root {
    --pagefind-ui-scale: 0.9;
    --pagefind-ui-primary: rgb(var(--color-primary));
    --pagefind-ui-text: rgb(var(--color-on-surface));
    --pagefind-ui-background: rgb(var(--color-surface-container-lowest));
    --pagefind-ui-border: rgb(var(--color-outline-variant));
    --pagefind-ui-tag: rgb(var(--color-surface-container-low));
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 0.5rem;
    --pagefind-ui-font: var(--font-body);
}
#search-box .pagefind-ui { padding: 0.75rem; }
#search-box .pagefind-ui__search-input { font-size: 0.875rem; }
#search-box .pagefind-ui__results-area { max-height: 24rem; overflow-y: auto; }

/* ── Responsive adjustments ───────────────────────────── */
@media (max-width: 768px) {
    .section { padding: 2rem 1.25rem; }
    .headline-lg { font-size: 1.5rem; }
    .headline-md { font-size: 1.25rem; }
}
