/* Anchour Knowledge Base — Shared Styles */

/* Fonts */
@font-face {
    font-family: 'Reckless Condensed';
    src: url('/fonts/reckless-condensed/RecklessCondensedMVF.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Saans';
    src: url('/fonts/saans/SaansVF.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Saans Semimono';
    src: url('/fonts/saans-semimono/SaansSemiMonoVF.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

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

/* Theme tokens */
:root {
    --bg: #F7F7F5;
    --surface: #FFFFFF;
    --surface-2: #FFFDF8;
    --border: #ECE8E1;
    --border-mid: #E3DED6;
    --fg: #121213;
    --text-body: #3A3842;
    --text-muted: #6B6875;
    --text-soft: #938FA0;
    --blurple: #4452F5;
    --light-blurple: #E7E9FF;
    --purple: #7857FF;
    --coral: #FF7676;
    --cream: #FFF5E5;
    --green: #10b981;
    --green-bg: #ecfdf5;
    --green-text: #065f46;
    --amber: #f59e0b;
    --amber-bg: #fffbeb;
    --amber-text: #92400e;
    --coral-bg: #fff1f0;
    --coral-text: #c85353;
}

html.dark {
    --bg: #161618;
    --surface: #1e1e22;
    --surface-2: #242428;
    --border: rgba(255, 255, 255, 0.10);
    --border-mid: rgba(255, 255, 255, 0.14);
    --fg: #f0eff2;
    --text-body: #c8c6ce;
    --text-muted: #908d99;
    --text-soft: #6b6875;
    --light-blurple: rgba(68, 82, 245, 0.15);
    --green-bg: rgba(16, 185, 129, 0.12);
    --green-text: #6ee7b7;
    --amber-bg: rgba(245, 158, 11, 0.12);
    --amber-text: #fcd34d;
    --coral-bg: rgba(255, 118, 118, 0.12);
    --coral-text: #fca5a5;
    --cream: rgba(255, 245, 229, 0.06);
}

body {
    font-family: 'Saans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--blurple);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── Shared nav bar ─── */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
}

html.dark .site-nav {
    background: rgba(30,30,34,0.85);
}

.site-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--blurple);
}

.site-nav-brand:hover {
    text-decoration: none;
    opacity: 0.8;
}

.site-nav-brand svg {
    width: 22px;
    height: 24px;
}

.site-nav-brand span {
    font-family: 'Saans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme toggle */
.theme-toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    border-color: var(--border-mid);
    background: var(--surface-2);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.icon-sun, .icon-moon { display: none; }
html:not(.dark) .icon-moon { display: block; }
html.dark .icon-sun { display: block; }

/* ─── Doc page layout ─── */
.doc-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

@media (min-width: 640px) {
    .doc-container { padding: 64px 32px 96px; }
}

.doc-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Saans Semimono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.2s;
}

.doc-back:hover {
    color: var(--blurple);
    text-decoration: none;
}

.doc-back svg {
    width: 14px;
    height: 14px;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.doc-tag {
    display: inline-flex;
    align-items: center;
    font-family: 'Saans Semimono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--light-blurple);
    color: var(--blurple);
}

.doc-header .eyebrow {
    font-family: 'Saans Semimono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blurple);
    margin-bottom: 12px;
}

.doc-header h1 {
    font-family: 'Reckless Condensed', Georgia, serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.0;
    letter-spacing: -0.03em;
    color: var(--fg);
    margin-bottom: 12px;
}

@media (min-width: 640px) {
    .doc-header h1 { font-size: 48px; }
}

.doc-header .subtitle {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.doc-header .doc-date {
    font-family: 'Saans Semimono', monospace;
    font-size: 12px;
    color: var(--text-soft);
}

/* ─── Doc content styles ─── */
.doc-content h2 {
    font-family: 'Saans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--fg);
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    margin-top: 56px;
}

.doc-content h2:first-child {
    margin-top: 0;
}

.doc-content p {
    margin-bottom: 14px;
}

.doc-content p + p {
    margin-top: 0;
}

.doc-content code {
    font-family: 'Saans Semimono', monospace;
    font-size: 0.9em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

/* TLDR card */
.tldr {
    background: var(--light-blurple);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 48px;
}

.tldr-label {
    font-family: 'Saans Semimono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--blurple);
    margin-bottom: 8px;
}

.tldr p {
    color: var(--fg);
    font-size: 16px;
    line-height: 1.55;
    margin-bottom: 0;
}

/* Comparison table */
.table-wrap {
    overflow-x: auto;
    margin: 24px -4px 8px;
    padding: 0 4px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0 8px;
    font-size: 15px;
}

.comparison-table th {
    font-family: 'Saans', sans-serif;
    font-weight: 500;
    text-align: left;
    padding: 10px 16px;
    color: var(--fg);
    border-bottom: 2px solid var(--border-mid);
    font-size: 14px;
}

.comparison-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.45;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table td:first-child {
    font-family: 'Saans Semimono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    width: 160px;
}

/* Status pills */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Saans Semimono', monospace;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

.status-good {
    background: var(--green-bg);
    color: var(--green-text);
}

.status-caution {
    background: var(--amber-bg);
    color: var(--amber-text);
}

.status-bad {
    background: var(--coral-bg);
    color: var(--coral-text);
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Fact cards */
.fact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}

@media (min-width: 640px) {
    .fact-grid { grid-template-columns: 1fr 1fr; }
}

.fact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
}

.fact-card-label {
    font-family: 'Saans Semimono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.fact-card-value {
    font-family: 'Saans Semimono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 6px;
}

.fact-card-detail {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Divider */
.doc-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* Lists */
.doc-content ul {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.doc-content li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.doc-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blurple);
}

/* Callout */
.callout {
    background: var(--cream);
    border-radius: 14px;
    padding: 24px 28px;
    margin: 32px 0;
}

.callout-label {
    font-family: 'Saans Semimono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--amber-text);
    margin-bottom: 8px;
}

html.dark .callout-label {
    color: var(--amber);
}

.callout p {
    font-size: 15px;
    line-height: 1.5;
}

/* Role perspective cards */
.role-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 28px 0;
}

@media (min-width: 640px) {
    .role-grid { grid-template-columns: 1fr 1fr; }
}

.role-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 24px 20px;
}

.role-card--full {
    grid-column: 1 / -1;
}

.role-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.role-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-icon svg {
    width: 18px;
    height: 18px;
}

.role-icon--dev {
    background: var(--light-blurple);
    color: var(--blurple);
}

.role-icon--content {
    background: var(--green-bg);
    color: var(--green-text);
}

.role-icon--design {
    background: rgba(120, 87, 255, 0.1);
    color: var(--purple);
}

html.dark .role-icon--design {
    background: rgba(120, 87, 255, 0.15);
}

.role-icon--stakeholder {
    background: var(--amber-bg);
    color: var(--amber-text);
}

.role-card-role {
    font-family: 'Saans Semimono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    margin-bottom: 2px;
}

.role-card-title {
    font-family: 'Saans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
}

.role-card p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-body);
}

.role-card ul {
    margin: 12px 0 0;
}

.role-card li {
    font-size: 14px;
    margin-bottom: 7px;
    color: var(--text-body);
}

.role-card li::before {
    top: 8px;
    width: 5px;
    height: 5px;
}

.role-card li strong {
    color: var(--fg);
    font-weight: 600;
}

/* Footer */
.doc-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-family: 'Saans Semimono', monospace;
    font-size: 12px;
    color: var(--text-soft);
}

/* Source refs */
.source-ref {
    font-family: 'Saans Semimono', monospace;
    font-size: 11px;
    color: var(--text-soft);
    vertical-align: super;
}
