/* ============================================================
   GitManager landing — hand-written, zero-build.
   Dark by default; [data-theme="light"] flips the tokens.
   ============================================================ */

:root {
  --bg: #090c10;
  --bg-elev: #0d1117;
  --surface: #11161d;
  --surface-2: #161b22;
  --border: #21262d;
  --border-strong: #30363d;
  --text: #e6edf3;
  --muted: #9198a1;
  --accent: #3fb950;
  --accent-2: #56d364;
  --accent-soft: rgba(63, 185, 80, 0.12);
  --on-accent: #03190d;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  --radius: 12px;
  --maxw: 1080px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --border: #d1d9e0;
  --border-strong: #afb8c1;
  --text: #1f2328;
  --muted: #59636e;
  --accent: #1a7f37;
  --accent-2: #1a7f37;
  --accent-soft: rgba(26, 127, 55, 0.10);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06);
}

/* ------------------------------- reset ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* contain transient slide-in transforms */
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
code { font-family: var(--font-mono); font-size: 0.86em; }
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------ layout ------------------------------- */
.section,
.hero__inner,
.site-header,
.site-footer__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.section { padding-block: clamp(56px, 9vw, 104px); }
.section__head { max-width: 680px; margin-bottom: 40px; }

/* ------------------------------ header ------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  background: var(--bg); /* fallback where color-mix() is unsupported */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand__logo { border-radius: 6px; }
.brand__name { letter-spacing: -0.01em; }
.brand--sm .brand__name { font-size: 0.95rem; }

.site-nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.5rem); }
.site-nav a { color: var(--muted); font-size: 0.92rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-2); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ------------------------------- hero -------------------------------- */
.hero { padding-block: clamp(56px, 10vw, 110px) clamp(40px, 6vw, 72px); }
.hero__inner { text-align: center; }
.eyebrow {
  display: inline-block;
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  max-width: 16ch;
  margin-inline: auto;
}
.hero__sub {
  max-width: 60ch;
  margin: 1.4rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 2rem;
}
.hero__note { margin-top: 1.1rem; color: var(--muted); font-size: 0.88rem; }

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.7rem 1.3rem;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--accent); }

/* ------------------------------ preview ------------------------------ */
/* Two hero visuals side by side: small terminal + large screenshot, each
   sliding in from its own side. Stacks (small above large) on narrow screens. */
/* Interactive showcase: two panels side by side; the selected one is bumped
   out at full colour, the other stays visible but dimmed/greyed. Each panel is
   a button (click / Enter / Space / arrows to select). Stacks below 960px. */
.showcase {
  max-width: var(--maxw);
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.showcase__panel {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  border-radius: var(--radius);
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}
.showcase__panel--shot     { flex: 1.5 1 0; }
.showcase__panel--terminal { flex: 1.1 1 0; }
.showcase__panel .preview,
.showcase__panel .terminal { width: 100%; max-width: none; margin: 0; }
.showcase__panel .terminal { box-shadow: none; } /* the panel owns elevation */
/* not selected — visible but dimmed and recessed */
.showcase__panel[aria-pressed="false"] {
  opacity: 0.4;
  filter: grayscale(0.7) saturate(0.6);
  transform: scale(0.9);
}
.showcase__panel[aria-pressed="false"]:hover,
.showcase__panel[aria-pressed="false"]:focus-visible {
  opacity: 0.8;
  filter: grayscale(0.25) saturate(0.9);
  transform: scale(0.94);
}
/* selected — full colour, popped well out */
.showcase__panel[aria-pressed="true"] {
  opacity: 1;
  filter: none;
  transform: scale(1.06);
  position: relative;
  z-index: 2;
}
.showcase__panel[aria-pressed="true"] .preview,
.showcase__panel[aria-pressed="true"] .terminal {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
  box-shadow:
    0 36px 84px -26px rgba(0, 0, 0, 0.72),
    0 0 0 1px var(--accent-soft);
}
.showcase__panel:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }

@media (max-width: 960px) {
  .showcase { flex-direction: column; gap: 18px; }
  .showcase__panel { width: 100%; }
  .showcase__panel--shot     { flex: none; max-width: 880px; }
  .showcase__panel--terminal { flex: none; max-width: 660px; }
  .showcase__panel[aria-pressed="true"]  { transform: scale(1.02); }
  .showcase__panel[aria-pressed="false"] { transform: scale(0.95); }
}
.preview {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.6);
}
/* Real screenshot fills the framed window (it carries its own chrome). */
.shot { display: block; width: 100%; height: auto; }

/* --------------------- terminal (secondary visual) ------------------- */
.terminal {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 14px 36px -28px rgba(0, 0, 0, 0.55);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.terminal__bar .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border-strong);
}
.terminal__bar .title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.terminal__body {
  margin: 0;
  padding: 18px 20px 20px;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  line-height: 1.95;
  color: var(--text);
  overflow-x: auto;
  background:
    radial-gradient(130% 130% at 0% 0%, var(--accent-soft), transparent 55%),
    var(--bg-elev);
}
.terminal__body code { font-family: inherit; font-size: inherit; }
.terminal__body .pr { color: var(--accent-2); font-weight: 700; }
.terminal__body .c { color: var(--muted); }
.terminal__body .cur {
  display: inline-block;
  color: var(--accent-2);
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --------------------------- section heads --------------------------- */
.kicker {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.section__head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.section__lede { margin: 1rem 0 0; color: var(--muted); font-size: 1.05rem; }

/* ------------------------------- cards ------------------------------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h3 { font-size: 1.18rem; margin-bottom: 0.5rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.card__tag {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}
.card__icon { font-size: 1.5rem; display: block; margin-bottom: 0.6rem; line-height: 1; }

.more {
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 2;
}
.more span { white-space: nowrap; }

/* ------------------------------- steps ------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.step__body { min-width: 0; }
.step__num {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 50%;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.step__body h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.step__body > p { margin: 0 0 1rem; color: var(--muted); }
.step__hint { font-size: 0.88rem; color: var(--muted); margin: 0.9rem 0 0 !important; }

/* ----------------------------- code blocks --------------------------- */
.code { position: relative; margin-top: 0.9rem; }
.code[data-label]::before {
  content: attr(data-label);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.code pre {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 84px 14px 16px;
  overflow-x: auto;
}
[data-theme="light"] .code pre { background: var(--surface-2); }
.code pre code {
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre;
}
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.code[data-label] .copy { top: 30px; }
.copy:hover { color: var(--accent-2); border-color: var(--accent); }
.copy.copied { color: var(--accent-2); border-color: var(--accent); }

/* ---------------------------- disclosure ----------------------------- */
.disclosure {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.disclosure summary {
  cursor: pointer;
  padding: 18px 24px;
  font-weight: 600;
  list-style: none;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: "+ "; color: var(--accent-2); font-family: var(--font-mono); }
.disclosure[open] summary::before { content: "− "; }
.disclosure__body { padding: 0 24px 24px; }
.disclosure__body p { color: var(--muted); }

/* ------------------------------ footer ------------------------------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 24px; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-block: 32px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ----------------------------- responsive ---------------------------- */
@media (max-width: 860px) {
  .cards--3, .cards--2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-nav a:not(:last-of-type) { display: none; }
  .step { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* --------------------------- scroll reveal --------------------------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.js .reveal.from-left  { transform: translateX(-36px); }
.js .reveal.from-right { transform: translateX(36px); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal,
  .js .reveal.from-left,
  .js .reveal.from-right { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
  .terminal__body .cur { animation: none; }
  .showcase__panel { transition: none; }
}
