@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --paper: rgb(241, 238, 229);
    --paper-raised: rgb(251, 250, 246);
    --ink: rgb(28, 31, 27);
    --ink-soft: rgb(75, 79, 73);
    --ink-faint: rgb(118, 123, 114);
    --line: rgba(28, 31, 27, 0.14);
    --line-soft: rgba(28, 31, 27, 0.08);

    --accent: rgb(225, 78, 44);
    --accent-soft: rgba(225, 78, 44, 0.10);
    --accent-line: rgba(225, 78, 44, 0.35);

    --blue: rgb(42, 92, 138);
    --blue-soft: rgba(42, 92, 138, 0.10);

    --term-bg: rgb(26, 28, 32);
    --term-bg-raised: rgb(34, 37, 43);
    --term-text: rgb(217, 222, 230);
    --term-prompt: rgb(126, 231, 135);
    --term-comment: rgb(124, 132, 148);

    --error-red: rgb(179, 38, 30);
    --error-bg: rgba(179, 38, 30, 0.06);

    --radius-sm: 5px;
    --radius: 10px;
    --radius-lg: 14px;

    --sidebar-w: 272px;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Menlo', 'Consolas', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
    min-height: 100vh;
}

/* layout shell */

.app {
    display: block;
    width: 100%;
}

.main {
    display: flex;
    justify-content: center;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    box-sizing: border-box;
    padding: 56px clamp(20px, 5vw, 64px) 100px;
}

.content {
    width: 100%;
    max-width: 760px;
    min-width: 0;
}

/* sidebar */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid var(--line);
    background: var(--paper-raised);
    z-index: 35;
}

.sidebar-inner {
    padding: 32px 26px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 6px;
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--ink);
    letter-spacing: -0.3px;
}

.brand-mark::before {
    content: '$ ';
    color: var(--accent);
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.5px;
}

.sidebar-tagline {
    font-size: 13.5px;
    color: var(--ink-faint);
    line-height: 1.6;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

/* cross-page guide switcher */

.site-nav {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.site-nav-label,
.toc-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 8px;
    padding: 0 10px;
}

.site-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-nav-list a {
    display: block;
    padding: 7px 10px;
    margin: 0 -10px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--ink-soft);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav-list a:hover {
    background: var(--line-soft);
    color: var(--ink);
    text-decoration: none;
}

.site-nav-list a.current {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: sec;
    flex: 1;
}

.toc-list li {
    counter-increment: sec;
    margin-bottom: 2px;
}

.toc-list a {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 7px 10px;
    margin: 0 -10px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.toc-list a::before {
    content: counter(sec, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-faint);
    flex-shrink: 0;
    padding-top: 1px;
}

.toc-list a:hover {
    background: var(--line-soft);
    color: var(--ink);
    text-decoration: none;
}

.toc-list a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.toc-list a.active::before {
    color: var(--accent);
}

.sidebar-footer-link {
    display: inline-block;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
}

.sidebar-footer-link:hover {
    text-decoration: underline;
}

/* mobile nav toggle */

.nav-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    background: var(--ink);
    color: var(--paper);
    border: none;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 18, 0.45);
    z-index: 25;
}

.nav-overlay.show {
    display: block;
}

/* hero */

.hero {
    margin-bottom: 8px;
    opacity: 0;
    animation: rise 0.6s ease forwards;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

h1 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.8px;
    margin-bottom: 14px;
}

.lede {
    font-size: 18px;
    color: var(--ink-soft);
    max-width: 56ch;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero {
        animation: none;
        opacity: 1;
    }
}

/* section headings & prose */

h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    margin-top: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

h3 .num {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}

h4 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin: 22px 0 10px;
}

p {
    color: var(--ink-soft);
    margin: 12px 0 16px;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
    color: rgb(26, 79, 122);
    text-decoration: underline;
}

section {
    margin-bottom: 12px;
    scroll-margin-top: 24px;
}

hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 44px 0;
}

b,
strong {
    color: var(--ink);
    font-weight: 600;
}

ul {
    padding-left: 22px;
    margin: 14px 0;
}

li {
    margin-bottom: 10px;
    color: var(--ink-soft);
    line-height: 1.7;
}

li b {
    color: var(--ink);
}

code {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    background-color: var(--accent-soft);
    padding: 2px 6px;
    border-radius: 4px;
}

/* terminal component */

.term {
    background: var(--term-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 14px 0 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--term-bg-raised);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-r {
    background: rgb(255, 95, 86);
}

.dot-y {
    background: rgb(255, 189, 46);
}

.dot-g {
    background: rgb(39, 201, 63);
}

.term-title {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--term-comment);
    margin-left: 4px;
    flex: 1;
}

.copy-btn {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--term-comment);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--term-text);
}

.copy-btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.term-body {
    padding: 14px 16px 16px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.term-body .line {
    display: flex;
    gap: 9px;
    padding: 2px 0;
    color: var(--term-text);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.term-body .line>.cmd,
.term-body .line>.prompt {
    white-space: normal;
}

.term-body .prompt {
    color: var(--term-prompt);
    flex-shrink: 0;
    user-select: none;
}

.term-body .line.output {
    color: var(--term-comment);
    padding-left: 20px;
}

.term-body .comment {
    color: var(--term-comment);
}

/* file component (e.g .gitignore contents) */

.file {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 14px 0 18px;
    overflow: hidden;
}

.file-bar {
    padding: 9px 14px;
    background: var(--line-soft);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.file-body {
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.9;
}

/* error card */

.error-card {
    border: 1px solid var(--line);
    border-left: 3px solid var(--error-red);
    border-radius: var(--radius-sm);
    background: var(--error-bg);
    padding: 16px 18px;
    margin: 16px 0;
}

.error-msg {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--error-red);
    margin-bottom: 8px;
    word-break: break-word;
}

.error-msg::before {
    content: '✗ ';
}

.error-fix {
    font-size: 15px;
    color: var(--ink-soft);
    margin: 0;
}

.error-fix b {
    color: var(--ink);
}

/* info note card (blue variant of error-card) */

.note-card {
    border: 1px solid var(--line);
    border-left: 3px solid var(--blue);
    border-radius: var(--radius-sm);
    background: var(--blue-soft);
    padding: 16px 18px;
    margin: 16px 0;
}

.note-card p {
    margin: 0;
    font-size: 15px;
    color: var(--ink-soft);
}

.note-card p + p {
    margin-top: 10px;
}

.note-card b {
    color: var(--ink);
}

/* hub page: guide cards grid */

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 22px 0 8px;
}

.guide-card {
    display: block;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper-raised);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.guide-card:hover {
    border-color: var(--accent-line);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(28, 31, 27, 0.08);
    text-decoration: none;
}

.guide-card .num {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.guide-card h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--ink);
}

.guide-card p {
    margin: 0;
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.6;
}

@media (max-width: 700px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }
}

/* diagram */

.diagram-wrap {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    margin: 20px 0 8px;
    overflow-x: auto;
}

.diagram-wrap svg {
    display: block;
    min-width: 560px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* cheat sheet table */

.git-cheat-sheet {
    border-collapse: collapse;
    width: 100%;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.git-cheat-sheet tr {
    border-bottom: 1px solid var(--line);
    transition: background-color 0.15s ease;
}

.git-cheat-sheet tr:hover {
    background-color: var(--accent-soft);
}

.git-cheat-sheet tr:last-child {
    border-bottom: none;
}

.git-cheat-sheet td {
    padding: 11px 16px;
    vertical-align: top;
    color: var(--ink-soft);
    font-size: 15px;
}

.command {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 13px;
    color: var(--accent);
    white-space: nowrap;
    width: 1%;
    background-color: var(--accent-soft);
    letter-spacing: 0.2px;
}

/* practice checklist */

.checklist {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    margin: 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    color: var(--ink-soft);
}

.checklist li:last-child {
    border-bottom: none;
}

.checklist input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checklist li:has(input:checked) {
    color: var(--ink-faint);
    text-decoration: line-through;
    background: var(--line-soft);
}

.checklist-note {
    font-size: 13px;
    color: var(--ink-faint);
    margin-top: -6px;
}

/* footer */

.page-footer {
    text-align: center;
    margin-top: 48px;
}

.page-footer p {
    color: var(--ink-soft);
    margin-bottom: 16px;
}

.linkedin-btn {
    display: inline-block;
    background-color: var(--ink);
    color: var(--paper) !important;
    padding: 11px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.linkedin-btn:hover {
    background-color: var(--accent);
}

/* back to top */

.back-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    z-index: 30;
}

.back-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-top:hover {
    background: var(--accent);
}

/* responsive */

@media (min-width: 981px) and (max-width: 1180px) {
    :root {
        --sidebar-w: 232px;
    }

    .sidebar-inner {
        padding: 26px 20px 32px;
    }
}

@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 84%;
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.15);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .nav-toggle {
        display: block;
    }

    .main {
        margin-left: 0;
        padding: 88px 20px 80px;
        width: 100%;
    }

    h1 {
        font-size: 32px;
    }

    h3 {
        font-size: 19px;
    }

    body {
        font-size: 16px;
    }

    .git-cheat-sheet td {
        padding: 10px 12px;
        font-size: 13.5px;
    }

    .diagram-wrap svg {
        min-width: 480px;
    }
}