/* ============================================================
   codexgrill — site styles
   Self-contained (no Bootstrap CSS). Mobile-first.
   ============================================================ */

/* ---------- design tokens ---------- */
:root {
  /* warm orange family (Claude Code) */
  --cg-orange:        #d97757;
  --cg-orange-hover:  #c2654a;
  --cg-orange-soft:   #e9a484;
  --cg-orange-glow:   rgba(217, 119, 87, 0.16);
  --cg-orange-shadow: rgba(217, 119, 87, 0.28);

  /* semantic */
  --cg-ok:   #6cb573;
  --cg-warn: #d9a557;
  --cg-bad:  #c46c5e;

  --cg-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --cg-font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  --radius:    14px;
  --radius-md: 10px;
  --radius-sm: 7px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h: 64px;
  --container: 1180px;
}

/* dark (default) */
[data-theme="dark"] {
  --bg:           #181614;
  --bg-2:         #1f1c1a;
  --bg-3:         #25221f;
  --surface:      #25221f;
  --surface-2:    #2c2925;
  --surface-3:    #34302b;

  --fg:           #efece7;
  --fg-strong:    #fbfaf7;
  --fg-muted:     #b8b1a8;  /* lifted for ~9:1 on bg */
  --fg-dim:       #8e887f;  /* lifted for ~5.2:1 on bg */

  --border:       #3d3a35;
  --border-strong: #4a4641;
  --border-soft:  rgba(255,255,255,0.07);
  --hairline:     rgba(255,255,255,0.06);

  --code-bg:      #100f0e;
  --code-border:  #2e2b27;
  --code-fg:      #e8e3db;

  --nav-bg:       rgba(24, 22, 20, 0.82);
  --hero-glow:    radial-gradient(60% 70% at 50% -10%, rgba(217,119,87,0.22), transparent 70%);
  --hero-grid-color: rgba(255,255,255,0.028);
  --shadow-card:  0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.28);
  --shadow-lift:  0 12px 32px rgba(0,0,0,0.4);
  --focus-ring:   0 0 0 3px rgba(217,119,87,0.4);
}

/* light */
[data-theme="light"] {
  --bg:           #fdfbf8;
  --bg-2:         #f6f3ed;
  --bg-3:         #f0ece4;
  --surface:      #ffffff;
  --surface-2:    #f6f3ed;
  --surface-3:    #f0ece4;

  --fg:           #2b2723;
  --fg-strong:    #14110f;
  --fg-muted:     #5a5650;  /* lifted for stronger read */
  --fg-dim:       #7d7972;

  --border:       #e2dccf;
  --border-strong: #d3ccbd;
  --border-soft:  rgba(0,0,0,0.07);
  --hairline:     rgba(0,0,0,0.06);

  --code-bg:      #f5f1ea;
  --code-border:  #e2dccf;
  --code-fg:      #2b2723;

  --nav-bg:       rgba(253, 251, 248, 0.85);
  --hero-glow:    radial-gradient(60% 70% at 50% -10%, rgba(217,119,87,0.16), transparent 70%);
  --hero-grid-color: rgba(0,0,0,0.04);
  --shadow-card:  0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lift:  0 14px 38px rgba(0,0,0,0.10);
  --focus-ring:   0 0 0 3px rgba(217,119,87,0.35);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  font-family: var(--cg-font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* skip-link (a11y / SEO) */
.skip-link {
  position: absolute;
  left: 0; top: 0;
  padding: 0.7rem 1rem;
  background: var(--cg-orange);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 9999;
  transform: translateY(-110%);
  transition: transform 0.18s var(--ease);
  text-decoration: none;
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: none;
  color: #fff;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cg-orange); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--cg-orange-hover); }
button { font: inherit; cursor: pointer; }
ul { padding: 0; margin: 0; list-style: none; }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
a:focus-visible, button:focus-visible {
  box-shadow: var(--focus-ring);
}

/* container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--space-6); }
}

/* ============================================================
   TYPE
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg-strong);
  margin: 0 0 var(--space-4);
}
h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.075rem; }
p  { margin: 0 0 var(--space-4); text-wrap: pretty; }

.h-sub { font-size: 1.05rem; margin: var(--space-6) 0 var(--space-3); }
.muted { color: var(--fg-muted); }
.dim   { color: var(--fg-dim); }
.small { font-size: 0.92rem; }
.mt-l  { margin-top: var(--space-5); }
.mt-xl { margin-top: var(--space-7); }
.hide-sm { display: inline; }
@media (max-width: 520px) { .hide-sm { display: none; } }

code, kbd, pre, samp { font-family: var(--cg-font-mono); }

:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--cg-orange);
  padding: 0.1em 0.42em;
  border-radius: 5px;
  font-size: 0.86em;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.5;
}

em {
  font-style: normal;
  font-weight: 600;
  color: var(--fg-strong);
  font-family: var(--cg-font-mono);
  font-size: 0.92em;
  letter-spacing: 0.02em;
}

/* anchor heading */
.section-anchor { color: inherit; text-decoration: none; position: relative; }
.section-anchor::after {
  content: "#";
  position: absolute; left: -0.85em; top: 0;
  color: var(--cg-orange); opacity: 0;
  transition: opacity 0.15s var(--ease);
  font-weight: 700;
}
.section-anchor:hover::after { opacity: 0.55; }
@media (max-width: 768px) { .section-anchor::after { display: none; } }

/* ============================================================
   SCROLL PROGRESS
   ============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 1000;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cg-orange), var(--cg-orange-soft));
  transition: width 0.1s linear;
}

/* ============================================================
   NAV
   ============================================================ */
.cg-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.cg-nav.scrolled { border-bottom-color: var(--border-soft); }

.nav-row {
  height: var(--nav-h);
  display: flex; align-items: center;
  gap: var(--space-4);
}
.cg-brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--fg-strong);
  font-family: var(--cg-font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.cg-brand:hover { color: var(--cg-orange); }
.cg-brand-mark { color: var(--cg-orange); display: inline-flex; }
.cg-brand-name { color: inherit; }
.cg-brand-version {
  font-size: 0.7rem; font-weight: 500;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  background: var(--surface);
}
@media (max-width: 480px) { .cg-brand-version { display: none; } }

.cg-nav-links {
  display: flex; align-items: center; gap: 0.15rem;
  margin: 0 auto;
}
.cg-nav-links li a {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  transition: color .15s var(--ease), background .15s var(--ease);
  position: relative;
}
.cg-nav-links li a:hover { color: var(--fg-strong); background: var(--surface); }
.cg-nav-links li a.active,
.cg-nav-links li a.active-page { color: var(--cg-orange); background: var(--cg-orange-glow); }

.cg-nav-actions { display: inline-flex; align-items: center; gap: 0.45rem; margin-left: auto; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 50%;
  transition: all .18s var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--cg-orange); color: var(--cg-orange); }
.icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-sun  { display: inline; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }
[data-theme="light"] .icon-btn .icon-sun  { display: none; }
[data-theme="light"] .icon-btn .icon-moon { display: inline; }
[data-theme="dark"] [data-theme-toggle]:hover { transform: rotate(20deg); }

.nav-menu-btn { display: none; }
.nav-menu-btn .icon-close { display: none; }
@media (max-width: 1024px) {
  .nav-menu-btn { display: inline-flex; }

  .cg-nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
    padding: var(--space-4) var(--space-5) var(--space-5);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .28s var(--ease), opacity .22s var(--ease);
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .cg-nav-links li a {
    padding: 0.95rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    border-bottom: 1px solid var(--hairline);
    color: var(--fg);
  }
  .cg-nav-links li:last-child a { border-bottom: none; }
  .cg-nav-links li a:hover { background: var(--surface); }

  .cg-nav.menu-open .cg-nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .cg-nav.menu-open .nav-menu-btn .icon-open { display: none; }
  .cg-nav.menu-open .nav-menu-btn .icon-close { display: inline; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}
.btn-primary {
  background: var(--cg-orange);
  border-color: var(--cg-orange);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 -1px 0 rgba(0,0,0,0.12) inset,
    0 4px 14px var(--cg-orange-shadow);
}
.btn-primary:hover {
  background: var(--cg-orange-hover);
  border-color: var(--cg-orange-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 -1px 0 rgba(0,0,0,0.12) inset,
    0 8px 22px var(--cg-orange-shadow);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--cg-orange);
  color: var(--cg-orange);
  background: var(--cg-orange-glow);
  transform: translateY(-1px);
}
.btn-ghost:active { transform: translateY(0); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.86rem; gap: 0.4rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + var(--space-8)) 0 var(--space-8);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-glow { position: absolute; inset: 0; background: var(--hero-glow); }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hero-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(50% 50% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(50% 50% at 50% 30%, #000 30%, transparent 75%);
}

.hero-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  position: relative;
}
.hero-grid-layout > * { min-width: 0; }
@media (min-width: 980px) {
  .hero-grid-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-7);
  }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-5);
  font-family: var(--cg-font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-card);
}
.hero-badge .dot {
  width: 7px; height: 7px;
  background: var(--cg-orange);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cg-orange);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.hero-title {
  font-size: clamp(2.1rem, 5.6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: var(--space-5);
  color: var(--fg-strong);
}
.hero-title .accent-line { display: block; }
.hero-title .accent { color: var(--cg-orange); }

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 0 var(--space-6);
  line-height: 1.6;
}
.hero-cta {
  display: flex; flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: var(--space-6);
}
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn-primary, .hero-cta .btn-ghost { justify-content: center; }
}

.hero-checks {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.hero-checks li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-checks i {
  color: var(--cg-orange);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cg-orange-glow);
}

/* ============================================================
   TERMINAL (hero side)
   ============================================================ */
.hero-terminal { position: relative; }
@media (max-width: 979px) {
  .hero-terminal { margin-top: var(--space-6); }
}
.term {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 20px 60px rgba(0,0,0,0.35);
  position: relative;
}
[data-theme="light"] .term { box-shadow: var(--shadow-card); }

.term::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--cg-orange-glow), transparent 50%);
  pointer-events: none; opacity: 0.5;
}
.term-bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0.55rem 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--code-border);
  font-family: var(--cg-font-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
  position: relative; z-index: 1;
}
.term-dots { display: inline-flex; gap: 6px; }
.term-dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border);
}
.term-dots i:nth-child(1) { background: #ef6a5e; }
.term-dots i:nth-child(2) { background: #d9a557; }
.term-dots i:nth-child(3) { background: #6cb573; }
.term-title { flex: 1; text-align: center; opacity: 0.8; }
.term-meta {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--fg-muted);
  background: var(--bg);
  margin-left: auto;
  white-space: nowrap;
}

.term-body {
  padding: 1rem 1.1rem;
  font-family: var(--cg-font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--fg);
  position: relative; z-index: 1;
  min-height: 380px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.term-body > .term-line { white-space: nowrap; }
@media (max-width: 520px) {
  .term-body { font-size: 0.72rem; min-height: 300px; padding: 0.75rem 0.85rem; line-height: 1.65; }
  .term-bar { padding: 0.5rem 0.75rem; font-size: 0.72rem; }
  .term-title { display: none; }
}
.term-line {
  opacity: 0;
  transform: translateY(2px);
  animation: term-in 0.35s var(--ease) forwards;
}
.term-line:nth-child(1)  { animation-delay: 0.10s; }
.term-line:nth-child(2)  { animation-delay: 0.40s; }
.term-line:nth-child(3)  { animation-delay: 0.70s; }
.term-line:nth-child(4)  { animation-delay: 1.00s; }
.term-line:nth-child(5)  { animation-delay: 1.25s; }
.term-line:nth-child(6)  { animation-delay: 1.50s; }
.term-line:nth-child(7)  { animation-delay: 1.80s; }
.term-line:nth-child(8)  { animation-delay: 2.05s; }
.term-line:nth-child(9)  { animation-delay: 2.30s; }
.term-line:nth-child(10) { animation-delay: 2.55s; }
.term-line:nth-child(11) { animation-delay: 2.85s; }
.term-line:nth-child(12) { animation-delay: 3.10s; }
.term-line:nth-child(13) { animation-delay: 3.35s; }
.term-line:nth-child(14) { animation-delay: 3.60s; }
.term-line:nth-child(15) { animation-delay: 3.85s; }
.term-line:nth-child(16) { animation-delay: 4.10s; }
.term-line:nth-child(n+17) { animation-delay: 4.35s; }
@keyframes term-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .term-line { opacity: 1; transform: none; animation: none; }
}

.term-prompt { color: var(--cg-orange); margin-right: 0.4rem; }
.term-cmd    { color: var(--fg-strong); font-weight: 600; }
.term-out    { color: var(--fg-muted); }
.term-indent { padding-left: 1.5rem; }
.term-dim    { color: var(--fg-dim); }
.term-bullet { color: var(--cg-orange); margin-right: 0.35rem; }

.term-tag-codex, .term-tag-claude {
  font-weight: 700; letter-spacing: 0.04em;
}
.term-tag-codex  { color: #9b8cff; }
.term-tag-claude { color: var(--cg-orange); }

.term-ok   { color: var(--cg-ok);   font-weight: 700; }
.term-warn { color: var(--cg-warn); font-weight: 700; }
.term-bad  { color: var(--cg-bad);  font-weight: 700; }

.term-caret {
  display: inline-block;
  color: var(--cg-orange);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: var(--space-9) 0; position: relative; }
@media (max-width: 768px) { .section { padding: var(--space-8) 0; } }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--hairline); }

.section-head { max-width: 720px; margin-bottom: var(--space-7); }
.section-eyebrow {
  display: inline-block;
  font-family: var(--cg-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cg-orange);
  margin-bottom: var(--space-3);
}
.section-title { margin-bottom: var(--space-4); }
.section-lead {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: var(--fg-muted);
  margin-bottom: 0;
}

/* ============================================================
   FEATURE GRID
   ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 720px)  { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px)  { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 0% 0%, var(--cg-orange-glow), transparent 50%);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
.feature-card:hover {
  border-color: var(--cg-orange);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.feature-card:hover::before { opacity: 1; }
.feature-card > * { position: relative; }
.feature-card h3 { font-size: 1.12rem; margin: 0 0 var(--space-2); }
.feature-card p  { color: var(--fg-muted); margin: 0; font-size: 0.95rem; line-height: 1.6; }
@media (max-width: 520px) {
  .feature-card { padding: var(--space-5); }
}

/* ============================================================
   FLOW CARDS (landing "Choose your flow" section)
   ============================================================ */
.flow-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
}
@media (min-width: 820px) { .flow-cards { grid-template-columns: repeat(2, 1fr); } }

.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.flow-card:hover {
  border-color: var(--cg-orange);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.flow-card > header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.flow-card > header .icon-pill { margin-bottom: 0; }
.flow-card h3 { margin: 0; font-size: 1.2rem; }
.flow-card p { margin: 0; color: var(--fg-muted); font-size: 0.96rem; line-height: 1.65; }
.flow-card-cmds {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.flow-card-cmds li {
  font-size: 0.92rem;
  color: var(--fg-muted);
}
.flow-card-cmds code {
  color: var(--fg-strong);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.flow-card .btn-primary { align-self: flex-start; }

.icon-pill {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, var(--cg-orange-glow), rgba(217,119,87,0.04));
  color: var(--cg-orange);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--space-4);
  border: 1px solid rgba(217,119,87,0.18);
}

/* Section: features — pull up to overlap hero base */
.section-features { padding-top: var(--space-7); }

/* ============================================================
   INSTALL GRID
   ============================================================ */
.install-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 880px) {
  .install-grid { grid-template-columns: 1fr 1.25fr; gap: var(--space-7); }
}

.check-list { display: grid; gap: 0; }
.check-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--fg);
  line-height: 1.55;
}
.check-list.compact li { border-bottom: none; padding: 0.35rem 0; }
.check-list li:last-child { border-bottom: none; }
.check-list li > i {
  color: var(--cg-orange);
  font-size: 1.05rem;
  margin-top: 0.15rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.check-list li > div .dim {
  display: block;
  color: var(--fg-dim);
  font-size: 0.88rem;
  margin-top: 0.2rem;
  line-height: 1.55;
}

/* ============================================================
   CODE BLOCK
   ============================================================ */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-4) 0 var(--space-5);
  box-shadow: var(--shadow-card);
}
.code-block-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--code-border);
  font-family: var(--cg-font-mono);
  font-size: 0.74rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.code-block-header .lang {
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.code-block-header .lang::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cg-orange);
  box-shadow: 0 0 6px var(--cg-orange);
}
.code-block pre {
  margin: 0;
  padding: 1rem 1.15rem;
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--code-fg);
  -webkit-overflow-scrolling: touch;
  tab-size: 2;
}
@media (max-width: 520px) {
  .code-block pre {
    padding: 0.85rem 0.95rem;
    font-size: 0.78rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
.code-block pre code { color: inherit; background: transparent; padding: 0; border: none; font-size: inherit; font-weight: 500; }
.code-block pre .cmt { color: var(--fg-dim); font-style: italic; }

.copy-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  font-size: 0.74rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  display: inline-flex; align-items: center; gap: 0.35rem;
  transition: all .15s var(--ease);
  font-family: var(--cg-font-mono);
  font-weight: 600;
}
.copy-btn:hover { color: var(--cg-orange); border-color: var(--cg-orange); background: var(--cg-orange-glow); }
.copy-btn.copied { color: var(--cg-ok); border-color: var(--cg-ok); background: rgba(108,181,115,0.08); }

/* ============================================================
   TABS
   ============================================================ */
.cg-tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-5);
  max-width: 100%;
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}
.cg-tab-btn {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-family: var(--cg-font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  min-height: 40px;
  border-radius: 6px;
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.cg-tab-btn.active {
  background: var(--cg-orange);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 12px var(--cg-orange-shadow);
}
.cg-tab-btn:not(.active):hover { color: var(--fg-strong); background: var(--bg-2); }
.cg-tab-panel { display: none; }
.cg-tab-panel.active { display: block; animation: fade-in 0.25s var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   SEE-IN-CHAT CARDS
   ============================================================ */
.see-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 720px) { .see-grid { grid-template-columns: repeat(2, 1fr); } }
.see-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  position: relative;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.see-card:hover { border-color: var(--cg-orange); transform: translateY(-2px); }
.see-num {
  display: inline-block;
  font-family: var(--cg-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--cg-orange);
  margin-bottom: var(--space-2);
  padding: 0.1rem 0.45rem;
  background: var(--cg-orange-glow);
  border-radius: 4px;
  font-weight: 600;
}
.see-card strong { display: block; color: var(--fg-strong); margin-bottom: 0.45rem; font-size: 1.02rem; }
.see-card p { margin: 0; color: var(--fg-muted); font-size: 0.94rem; line-height: 1.6; }

/* ============================================================
   FLOW (how it works)
   ============================================================ */
.flow {
  position: relative;
  padding: 0;
  margin: 0;
  list-style: none;
}
.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-5);
  padding-bottom: var(--space-6);
}
.flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 23px; top: 44px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--cg-orange) 0%, var(--border) 75%);
  opacity: 0.55;
}
.flow-step:last-child { padding-bottom: 0; }
.step-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cg-orange);
  color: var(--cg-orange);
  font-family: var(--cg-font-mono);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  box-shadow: 0 0 0 4px var(--bg), 0 0 24px var(--cg-orange-glow);
  transition: transform .25s var(--ease);
}
.flow-step:hover .step-num { transform: scale(1.06); }
.section-alt .step-num { box-shadow: 0 0 0 4px var(--bg-2), 0 0 24px var(--cg-orange-glow); background: var(--bg-2); }
.step-body h4 { margin: 0.5rem 0 var(--space-2); font-size: 1.12rem; }
.step-body p  { color: var(--fg-muted); margin: 0 0 var(--space-2); line-height: 1.65; }
.step-body p:last-child { margin-bottom: 0; }
.step-body .footnote { font-size: 0.88rem; color: var(--fg-dim); padding-left: 0.85rem; border-left: 2px solid var(--border); }
@media (max-width: 480px) {
  .flow-step { grid-template-columns: 40px 1fr; gap: var(--space-4); }
  .step-num { width: 40px; height: 40px; font-size: 0.9rem; }
  .flow-step:not(:last-child)::before { left: 19px; top: 38px; }
}

/* ============================================================
   SAFETY GRID
   ============================================================ */
.safety-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 720px) { .safety-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   TABLE — desktop rows, mobile stacked
   ============================================================ */
.table-wrap {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: var(--space-4) 0 var(--space-5);
  background: var(--surface);
  overflow: hidden;
}
.cg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.cg-table th, .cg-table td {
  padding: 0.9rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--fg);
}
.cg-table th {
  color: var(--cg-orange);
  font-family: var(--cg-font-mono);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cg-table tr:last-child td { border-bottom: none; }
.cg-table tbody tr { transition: background .15s var(--ease); }
.cg-table tbody tr:hover td { background: color-mix(in srgb, var(--cg-orange) 5%, transparent); }
.cg-table td:first-child { width: 1%; white-space: nowrap; }
.cg-table td code, .cg-table th code { white-space: nowrap; }
.cg-table td:last-child { color: var(--fg-muted); }

.exit-table .exit-ok  { color: var(--cg-ok); border-color: rgba(108,181,115,0.35); background: rgba(108,181,115,0.10); }
.exit-table .exit-err { color: var(--cg-bad); border-color: rgba(196,108,94,0.35); background: rgba(196,108,94,0.10); }
.exit-table td:first-child code {
  font-weight: 700;
  min-width: 2.2em;
  text-align: center;
  display: inline-block;
  padding: 0.25em 0.55em;
}

/* stacked on small screens */
@media (max-width: 640px) {
  .cg-table thead { display: none; }
  .cg-table, .cg-table tbody, .cg-table tr, .cg-table td { display: block; width: 100%; }
  .cg-table tr {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--hairline);
  }
  .cg-table tr:last-child { border-bottom: none; }
  .cg-table td {
    padding: 0;
    border: none;
  }
  .cg-table td:first-child {
    margin-bottom: 0.35rem;
    width: auto;
  }
  .cg-table td:last-child { color: var(--fg-muted); font-size: 0.92rem; line-height: 1.55; }
  .cg-table tbody tr:hover td { background: transparent; }
  .cg-table tbody tr:hover { background: color-mix(in srgb, var(--cg-orange) 5%, transparent); }
}

/* ============================================================
   CALLOUT
   ============================================================ */
.callout {
  background:
    linear-gradient(135deg, var(--cg-orange-glow), transparent 70%),
    var(--surface);
  border: 1px solid rgba(217,119,87,0.28);
  border-left: 3px solid var(--cg-orange);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  position: relative;
}
.callout h5 {
  color: var(--cg-orange);
  font-size: 0.74rem;
  font-family: var(--cg-font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 var(--space-2);
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.callout h5::before {
  content: "!";
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cg-orange);
  color: #fff;
  font-family: var(--cg-font-sans);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}
.callout p { margin: 0; color: var(--fg); font-size: 0.95rem; line-height: 1.6; }

/* ============================================================
   CTA
   ============================================================ */
.section-cta { padding: var(--space-8) 0; }
.cta-card {
  background:
    linear-gradient(135deg, var(--cg-orange-glow), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(217,119,87,0.35);
  pointer-events: none;
}
.cta-card::after {
  content: "";
  position: absolute; inset: auto -10% -60% -10%;
  height: 200px;
  background: radial-gradient(50% 100% at 50% 0%, var(--cg-orange-glow), transparent 70%);
  pointer-events: none;
}
.cta-card h2 { margin-bottom: var(--space-3); font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-card p { color: var(--fg-muted); margin-bottom: var(--space-5); font-size: 1.05rem; max-width: 480px; margin-left: auto; margin-right: auto; }
.cta-card .hero-cta { justify-content: center; margin: 0; position: relative; }

/* ============================================================
   FOOTER
   ============================================================ */
.cg-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-8) 0 var(--space-6);
  color: var(--fg-muted);
  font-size: 0.92rem;
  background: var(--bg-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: var(--space-7); }
}
.footer-brand .cg-brand { font-size: 1.1rem; margin-bottom: var(--space-3); }
.footer-brand p { max-width: 480px; margin: 0; line-height: 1.65; }
.footer-col strong {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--fg-strong);
  font-size: 0.78rem;
  font-family: var(--cg-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.footer-col ul { display: grid; gap: 0.5rem; }
.footer-col a { color: var(--fg); display: inline-block; transition: color .15s var(--ease), transform .15s var(--ease); }
.footer-col a:hover { color: var(--cg-orange); transform: translateX(2px); }
.footer-disclaimer {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
  font-size: 0.82rem;
  color: var(--fg-dim);
}
.footer-disclaimer a { color: var(--fg-muted); }
.footer-disclaimer a:hover { color: var(--cg-orange); }
.footer-disclaimer p { margin: 0 0 0.5rem; line-height: 1.6; }
.footer-disclaimer p:last-child { margin: 0; }

/* ============================================================
   MISC
   ============================================================ */
::selection { background: var(--cg-orange); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--cg-orange); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
