/* ── Git Tutorial — Terminal Dark Branch-Tree Design ── */
:root {
  --git-orange: #F05032;
  --git-orange-light: #FF7052;
  --git-orange-faint: #FFF2EF;
  --terminal-bg: #0D1117;
  --terminal-surface: #161B22;
  --terminal-card: #1C2128;
  --terminal-border: rgba(255,255,255,0.1);
  --terminal-border-bright: rgba(240,80,50,0.3);
  --branch-green: #3FB950;
  --branch-green-light: #E8F9EC;
  --branch-blue: #58A6FF;
  --branch-purple: #BC8CFF;
  --branch-yellow: #E3B341;
  --text: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #484F58;
  --paper: #F6F8FA;
  --paper-warm: #EAEEF2;
  --light-border: #D0D7DE;
  --mono: 'SF Mono', 'Fira Code', Consolas, monospace;
  --radius: 8px;
  --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, 'Inter', 'Segoe UI', sans-serif; background: var(--terminal-bg); color: var(--text); line-height: 1.65; -webkit-font-smoothing: antialiased; }

.nav { position: sticky; top: 0; z-index: 100; background: rgba(13,17,23,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--terminal-border); padding: 0 24px; height: 52px; display: flex; align-items: center; gap: 16px; }
.nav-back { color: var(--git-orange); text-decoration: none; font-size: 0.88rem; display: flex; align-items: center; gap: 4px; }
.nav-back::before { content: '‹'; font-size: 1.3rem; }
.nav-title { font-size: 0.92rem; font-weight: 600; flex: 1; color: var(--text); }
.nav-badge { background: var(--git-orange); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

.hero { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(240,80,50,0.08) 0%, transparent 60%), var(--terminal-surface); color: var(--text); padding: 80px 24px 70px; text-align: center; position: relative; overflow: hidden; border-bottom: 1px solid var(--terminal-border); }
.hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(to bottom, var(--git-orange), var(--branch-blue), var(--branch-purple)); }
.hero-icon { font-size: 4rem; margin-bottom: 14px; position: relative; display: inline-block; }
.hero-eyebrow { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--git-orange); margin-bottom: 12px; position: relative; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; position: relative; margin-bottom: 16px; }
.hero-sub { font-size: 0.98rem; color: var(--text-secondary); max-width: 520px; margin: 0 auto 28px; position: relative; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; position: relative; }
.chip { background: rgba(255,255,255,0.06); border: 1px solid var(--terminal-border); color: var(--text-secondary); font-size: 0.75rem; padding: 4px 12px; border-radius: 20px; font-family: var(--mono); }

.container { max-width: 860px; margin: 0 auto; padding: 36px 24px 80px; }
.card { background: var(--terminal-card); border: 1px solid var(--terminal-border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 14px; }
.card-list { list-style: none; }
.card-list li { border-bottom: 1px solid var(--terminal-border); }
.card-list li:last-child { border-bottom: none; }
.card-list a { display: flex; align-items: flex-start; gap: 14px; padding: 14px 10px; text-decoration: none; color: inherit; border-radius: var(--radius); transition: background 0.15s; }
.card-list a:hover { background: rgba(240,80,50,0.06); }
.list-num { width: 28px; height: 28px; background: var(--git-orange); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; font-family: var(--mono); }
.list-content { flex: 1; }
.list-title { font-size: 0.93rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.list-desc { font-size: 0.8rem; color: var(--text-muted); }
.list-chevron { color: var(--text-muted); font-size: 1rem; align-self: center; }
.section-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin: 30px 0 10px 2px; }

.chapter-hero { background: linear-gradient(135deg, #1C2128 0%, #161B22 100%); border-bottom: 1px solid var(--terminal-border-bright); color: var(--text); padding: 56px 24px 48px; text-align: center; }
.chapter-hero .ch-num { font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--git-orange); margin-bottom: 10px; font-family: var(--mono); }
.chapter-hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: 12px; color: var(--text); }
.chapter-hero p { color: var(--text-secondary); font-size: 0.93rem; max-width: 520px; margin: 0 auto; }

/* Branch visualization */
.branch-vis { background: var(--terminal-bg); border: 1px solid var(--terminal-border); border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; font-family: var(--mono); font-size: 0.82rem; line-height: 2; }
.b-main { color: var(--git-orange); }
.b-feat { color: var(--branch-blue); }
.b-hot  { color: var(--branch-purple); }
.b-commit { color: var(--branch-yellow); display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.b-line { color: var(--text-muted); }

.content { max-width: 760px; margin: 0 auto; padding: 44px 24px 80px; }
h2 { font-size: 1.35rem; font-weight: 700; color: var(--text); margin: 44px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--terminal-border-bright); }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
h4 { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 8px; }
p { margin-bottom: 14px; color: var(--text-secondary); font-size: 0.93rem; line-height: 1.8; }

.callout { border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; display: flex; gap: 12px; align-items: flex-start; font-size: 0.87rem; line-height: 1.65; border: 1px solid; }
.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.callout p { margin: 0; color: inherit; font-size: inherit; }
.callout strong { display: block; margin-bottom: 3px; font-weight: 700; }
.callout.info { background: rgba(88,166,255,0.08); border-color: rgba(88,166,255,0.25); color: #A0C4F8; }
.callout.tip { background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.25); color: #7EE787; }
.callout.warning { background: rgba(227,179,65,0.08); border-color: rgba(227,179,65,0.25); color: #F0C74C; }
.callout.danger { background: rgba(240,80,50,0.08); border-color: rgba(240,80,50,0.3); color: #FF8070; }

pre { background: #090d12; color: #E6EDF3; border: 1px solid var(--terminal-border); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; font-size: 0.84rem; line-height: 1.7; margin: 14px 0; position: relative; }
pre::before { content: '$ '; color: var(--branch-green); font-family: var(--mono); }
pre.no-prompt::before { content: ''; }
pre .lang-label { position: absolute; top: 8px; right: 12px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(180,185,210,0.4); }
code { font-family: var(--mono); }
p code, li code, td code { background: rgba(240,80,50,0.1); color: var(--git-orange-light); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
.kw { color: #FF79C6; font-weight: 700; }
.ty { color: #8BE9FD; }
.st { color: #F1FA8C; }
.cm { color: #6272A4; font-style: italic; }
.fn { color: #50FA7B; }
.nu { color: #BD93F9; }
.at { color: var(--git-orange); }
.flag { color: #FFB86C; }
.branch { color: var(--branch-blue); }
.hash { color: var(--branch-yellow); font-family: var(--mono); }

table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.86rem; }
th { background: var(--terminal-card); color: var(--text-secondary); font-weight: 700; padding: 10px 14px; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--terminal-border); }
td { padding: 10px 14px; border-top: 1px solid var(--terminal-border); color: var(--text-secondary); }

.def-list { list-style: none; }
.def-list li { padding: 12px 0; border-bottom: 1px solid var(--terminal-border); display: grid; grid-template-columns: 160px 1fr; gap: 16px; font-size: 0.88rem; }
.def-list li:last-child { border-bottom: none; }
.def-term { font-weight: 700; color: var(--git-orange); font-family: var(--mono); font-size: 0.83rem; }
.def-desc { color: var(--text-secondary); }

.progress { height: 4px; background: var(--terminal-border); border-radius: 2px; margin-bottom: 32px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--git-orange), var(--branch-green)); border-radius: 2px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.content ul, .content ol { padding-left: 22px; margin: 10px 0 14px; color: var(--text-secondary); font-size: 0.91rem; line-height: 1.85; }

.chapter-nav { display: flex; gap: 12px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--terminal-border); }
.chapter-nav a { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--terminal-card); border: 1px solid var(--terminal-border); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color 0.2s; }
.chapter-nav a:hover { border-color: var(--git-orange); }
.nav-dir { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.nav-title-text { font-weight: 600; color: var(--git-orange); font-size: 0.88rem; }
.prev { text-align: left; } .next { text-align: right; }

.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.overview-card { background: var(--terminal-bg); border: 1px solid var(--terminal-border); border-radius: var(--radius); padding: 16px; }
.overview-card .ov-icon { font-size: 1.4rem; margin-bottom: 8px; }
.overview-card h3 { font-size: 0.88rem; margin: 0 0 5px; }
.overview-card p { font-size: 0.78rem; margin: 0; color: var(--text-muted); line-height: 1.5; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } .def-list li { grid-template-columns: 1fr; } }

.site-footer { border-top: 1px solid var(--terminal-border); padding: 28px 24px; text-align: center; font-size: 0.78rem; color: var(--text-muted); }
.site-footer a { color: var(--git-orange); text-decoration: none; }
