/* tracking.rocks — focused architecture guide */

:root {
    --bg: #0c1117;
    --bg-elevated: #151b24;
    --bg-card: #1a222d;
    --text: #e8edf4;
    --text-muted: #8b9cb3;
    --border: #2a3544;
    --accent: #3b82f6;
    --simple: #10b981;
    --medium: #f59e0b;
    --expert: #8b5cf6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --header-h: 60px;
    --font: "DM Sans", system-ui, sans-serif;
    --mono: "JetBrains Mono", monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img, svg {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, 100% - 2rem);
    margin-inline: auto;
}

.content-narrow {
    width: min(720px, 100% - 2rem);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 200;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 1rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(12, 17, 23, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--header-h);
    gap: 0.75rem;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    justify-self: start;
}

.logo span {
    color: var(--accent);
}

.alpha-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    justify-self: center;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.08));
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12), 0 0 20px rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    animation: alpha-pulse 2.8s ease-in-out infinite;
}

.alpha-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--medium);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
    flex-shrink: 0;
}

.alpha-badge-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.alpha-badge-text {
    color: #fde68a;
    font-weight: 500;
}

@keyframes alpha-pulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12), 0 0 16px rgba(245, 158, 11, 0.16);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28), 0 0 28px rgba(245, 158, 11, 0.32);
    }
}

@media (max-width: 699px) {
    .header-inner {
        grid-template-columns: 1fr auto auto;
    }

    .alpha-badge {
        justify-self: end;
        padding: 0.35rem 0.65rem;
        font-size: 0.68rem;
    }

    .alpha-badge-text {
        display: none;
    }
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin-inline: auto;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.site-nav.is-open {
    display: flex;
}

.site-nav a {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.95rem;
}

.site-nav a:hover {
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
}

.site-nav a.is-active {
    color: var(--text);
    background: var(--bg-card);
    box-shadow: inset 0 -2px 0 var(--accent);
}

@media (min-width: 700px) {
    .nav-toggle {
        display: none;
    }

    .site-nav {
        display: flex;
        position: static;
        flex-direction: row;
        padding: 0;
        background: none;
        border: none;
        gap: 0.25rem;
        justify-self: end;
    }

    .site-nav a {
        padding: 0.45rem 0.85rem;
        font-size: 0.9rem;
    }

    .site-nav a.is-active {
        background: transparent;
    }
}

/* Hero / landing */
.hero {
    padding: 3.5rem 0 3rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(59, 130, 246, 0.18), transparent),
        var(--bg);
}

.hero-event {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 1rem;
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.5rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.hero-cta {
    display: inline-block;
    padding: 0.85rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: inherit;
}

.hero-cta:hover {
    filter: brightness(1.1);
    text-decoration: none;
}

.complexity-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.complexity-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-muted);
    opacity: 0.5;
}

.complexity-pill.is-active {
    opacity: 1;
}

.complexity-simple.is-active { border-color: var(--simple); color: var(--simple); }
.complexity-medium.is-active { border-color: var(--medium); color: var(--medium); }
.complexity-expert.is-active { border-color: var(--expert); color: var(--expert); }

.complexity-simple { --level-color: var(--simple); }
.complexity-medium { --level-color: var(--medium); }
.complexity-expert { --level-color: var(--expert); }

.landing-purpose {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.landing-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0 0 2rem;
    line-height: 1.7;
}

.landing-cta-section {
    padding: 0 0 4rem;
}

.landing-cta-panel {
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.landing-preview-link {
    margin: 1.5rem 0 0;
    text-align: center;
}

.landing-preview-link a {
    font-weight: 600;
}

/* Page hero */
.page-hero {
    padding: 2.5rem 0 2rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% -30%, rgba(59, 130, 246, 0.12), transparent),
        var(--bg);
    border-bottom: 1px solid var(--border);
}

.page-hero-kicker {
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.page-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    margin: 0 0 0.75rem;
    line-height: 1.15;
}

.page-hero-lead {
    margin: 0;
    color: var(--text-muted);
    max-width: 60ch;
    font-size: 1.05rem;
}

/* Sections shared */
.section-heading {
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    margin: 0 0 0.75rem;
}

.section-lead {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    max-width: 55ch;
}

.overview-section {
    padding: 3rem 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 540px) {
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.overview-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--level-color, var(--border));
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.overview-card:hover {
    transform: translateY(-2px);
    border-color: var(--level-color);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.overview-number {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--level-color);
}

.overview-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.overview-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Architecture subnav */
.arch-subnav {
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    background: rgba(12, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.arch-subnav-inner {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.arch-subnav-inner::-webkit-scrollbar {
    display: none;
}

.arch-subnav a {
    flex-shrink: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.arch-subnav a:hover {
    color: var(--text);
    background: var(--bg-card);
}

/* Divider */
.divider-section {
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.divider-inner {
    max-width: 640px;
}

.complexity-bar--inline {
    justify-content: center;
    margin-bottom: 1.5rem;
}

.divider-title {
    font-size: clamp(1.25rem, 3.5vw, 1.6rem);
    margin: 0 0 1rem;
}

.divider-quote {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-style: italic;
    color: var(--text-muted);
}

/* Architecture sections */
.architecture-section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
}

.architecture-section--modern {
    background:
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(139, 92, 246, 0.1), transparent),
        var(--bg-elevated);
}

.architecture-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .architecture-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.architecture-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-right: 0.5rem;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--level-color);
    color: #fff;
    border-radius: 6px;
    vertical-align: middle;
}

.architecture-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--level-color);
    color: var(--level-color);
    border-radius: 999px;
    vertical-align: middle;
}

.architecture-title {
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    margin: 0.75rem 0 1rem;
    line-height: 1.25;
}

.architecture-intro {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.content-group {
    margin-bottom: 1.25rem;
}

.content-group-heading {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.content-group-subtitle {
    font-size: 0.85rem;
    color: var(--level-color);
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.content-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.content-list li {
    margin-bottom: 0.4rem;
}

.content-list strong {
    color: var(--text);
    display: block;
    font-weight: 600;
}

.caution-box {
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left: 4px solid var(--medium);
    border-radius: var(--radius-sm);
}

.caution-box strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--medium);
}

.caution-box p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Diagrams */
.diagram-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
}

.diagram {
    display: block;
    width: 100%;
    min-width: 280px;
    min-height: 120px;
}

.diagram-edge {
    stroke: var(--text-muted);
    stroke-width: 1.5;
    opacity: 0.6;
}

.diagram-arrow-head {
    fill: var(--text-muted);
}

.diagram-edge-label {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font);
}

.diagram-node {
    cursor: pointer;
    outline: none;
}

.diagram-node-bg {
    fill: var(--bg-elevated);
    stroke: var(--border);
    stroke-width: 1.5;
    transition: stroke 0.15s, fill 0.15s, filter 0.15s;
}

.diagram-node-bg--dotted {
    stroke-dasharray: 3 3;
}

.diagram-node-bg--dashed {
    stroke-dasharray: 7 4;
}

.diagram-node-bg--solid {
    stroke-dasharray: none;
}

.diagram-node-icon {
    pointer-events: none;
}

.diagram-node-label {
    fill: var(--text);
    font-size: 10px;
    font-family: var(--font);
    font-weight: 500;
    pointer-events: none;
}

.diagram-node-label--below {
    fill: var(--text-muted);
    font-size: 9px;
}

.diagram-node:hover .diagram-node-bg,
.diagram-node:focus-visible .diagram-node-bg,
.diagram-node.is-active .diagram-node-bg {
    stroke: var(--accent);
    fill: rgba(59, 130, 246, 0.12);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.25));
}

.diagram-node--circle:hover .diagram-node-bg,
.diagram-node--circle:focus-visible .diagram-node-bg,
.diagram-node--circle.is-active .diagram-node-bg {
    fill: rgba(59, 130, 246, 0.18);
}

.diagram-hint {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Detail panel */
.detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.detail-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.detail-panel {
    position: fixed;
    z-index: 160;
    inset: auto 0 0 0;
    max-height: 70dvh;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow);
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.detail-panel.is-open {
    transform: translateY(0);
}

.detail-panel-inner {
    padding: 1.5rem 1.5rem 2rem;
    overflow-y: auto;
    max-height: 70dvh;
}

.detail-panel-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.detail-panel-kicker {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin: 0 0 0.25rem;
}

.detail-panel-title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem;
    padding-right: 3rem;
}

.detail-panel-body {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.65;
}

@media (min-width: 640px) {
    .detail-panel {
        inset: 50% auto auto 50%;
        width: min(420px, calc(100% - 2rem));
        max-height: none;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        pointer-events: none;
    }

    .detail-panel.is-open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .detail-panel-inner {
        max-height: 80dvh;
    }
}

/* Legal pages */
.legal-section {
    padding: 2.5rem 0 4rem;
}

.legal-content h2 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content p,
.legal-content li {
    color: var(--text-muted);
    line-height: 1.7;
}

.legal-content ul {
    padding-left: 1.25rem;
}

.legal-note {
    padding: 0.85rem 1rem;
    margin: 0 0 2rem;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--medium);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legal-updated {
    margin-top: 2rem;
    font-size: 0.85rem;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand {
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.footer-brand span {
    color: var(--accent);
}

.footer-meta p {
    margin: 0;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav a {
    color: var(--text-muted);
}

.footer-nav a:hover {
    color: var(--text);
}
