/* ==========================================================================
   tgit CSS Stylesheet - Premium Dark Theme with Glassmorphism & Animations
   ========================================================================== */

/* Design Tokens & Custom Variables */
:root {
  --bg-primary: #080810;
  --bg-secondary: #0d0d18;
  --bg-tertiary: #131326;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-yellow: #eab308;
  
  --gradient-cyan-blue: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-green-cyan: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-purple-cyan: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-dark: linear-gradient(180deg, #080810 0%, #0d0d18 100%);
  
  --glass-bg: rgba(15, 15, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: rgba(0, 0, 0, 0.5);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  
  --header-height: 80px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) var(--bg-primary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scroll Snap Container (Four full-screen frames) */
.scroll-container {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.scroll-section {
  height: 100vh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding-top: var(--header-height);
  overflow: hidden;
}

/* Background Glowing Orbs */
.glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  mix-blend-mode: screen;
}

.orb-1 {
  top: -10%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  animation: floatOrb 25s infinite alternate ease-in-out;
}

.orb-2 {
  bottom: 10%;
  right: 5%;
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  animation: floatOrb 30s infinite alternate-reverse ease-in-out;
}

.orb-3 {
  top: 40%;
  left: 50%;
  width: 450px;
  height: 450px;
  background: var(--accent-green);
  animation: floatOrb 20s infinite alternate ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -80px) scale(1.1); }
  100% { transform: translate(-30px, 40px) scale(0.9); }
}

/* Glassmorphism Styles */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.5));
}

.highlight {
  color: var(--accent-cyan);
}

.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-link {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  position: relative;
  padding: 6px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  width: 100%;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
}

.mini-cta {
  background: var(--glass-border);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.mini-cta:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

/* Sections - General Content Layout */
.section-content {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}

.section-header {
  text-align: center;
  margin-bottom: 45px;
}

.section-tag {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
}

.align-left {
  text-align: left;
}
.align-left .section-desc {
  margin-left: 0;
}

/* ==========================================================================
   Section 1: Hero
   ========================================================================== */
.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 60px;
  height: calc(100vh - var(--header-height));
}

.badge-container {
  margin-bottom: 20px;
}

.hero-badge {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-title {
  font-size: 4rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

.gradient-text {
  background: var(--gradient-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 20px;
}

.primary-cta {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  padding: 14px 28px;
  font-size: 1.05rem;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.secondary-cta {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 14px 28px;
  font-size: 1.05rem;
}

.secondary-cta:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

/* Hero Code Visual */
.visual-wrapper {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.visual-header {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
}

.dots {
  display: flex;
  gap: 6px;
  margin-right: 18px;
}

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

.dot.red { background: var(--accent-rose); }
.dot.yellow { background: var(--accent-yellow); }
.dot.green { background: var(--accent-green); }

.window-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.visual-body {
  padding: 24px;
  background: rgba(10, 10, 18, 0.4);
  overflow-x: auto;
}

.visual-body pre {
  margin: 0;
}

.visual-body code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.keyword { color: #f472b6; }
.key { color: #38bdf8; }
.string { color: #34d399; }
.number { color: #fbbf24; }
.comment { color: var(--text-muted); font-style: italic; }

/* ==========================================================================
   Section 2: Concept / Performance
   ========================================================================== */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.concept-card {
  padding: 40px 30px;
  border-radius: 16px;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 380px;
}

.concept-card:hover {
  transform: translateY(-8px);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 12px 40px rgba(6, 182, 212, 0.1);
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.concept-card h3 {
  font-size: 1.35rem;
  font-weight: 600;
}

.concept-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-grow: 1;
}

.card-visual {
  margin-top: auto;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 10px;
}

.tree-svg {
  width: 100%;
  height: auto;
}

.svg-node {
  fill: var(--bg-tertiary);
  stroke-width: 2px;
}

.root-node {
  fill: var(--accent-cyan);
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 3px var(--accent-cyan));
}

.worktree-node {
  fill: var(--accent-green);
  stroke: var(--accent-green);
  filter: drop-shadow(0 0 3px var(--accent-green));
}

.ignored-node {
  fill: var(--text-muted);
  stroke: var(--text-muted);
  opacity: 0.4;
}

.svg-line {
  stroke-width: 1.5px;
}

.svg-line.scanned {
  stroke: var(--accent-cyan);
  stroke-dasharray: 4;
  animation: dash 15s linear infinite;
}

.svg-line.ignored {
  stroke: var(--text-muted);
  opacity: 0.3;
}

.svg-text {
  font-family: var(--font-sans);
  font-size: 8px;
  fill: var(--text-secondary);
  font-weight: 500;
}

.svg-text-small {
  font-family: var(--font-sans);
  font-size: 6px;
  fill: var(--text-muted);
  opacity: 0.7;
}

@keyframes dash {
  to {
    stroke-dashoffset: -40;
  }
}

/* Concurrency progress animation */
.progress-bar-simulation {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 15px;
  margin-top: auto;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-item span {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.bar-container {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--gradient-cyan-blue);
  border-radius: 3px;
  width: 0;
  transition: width 1.5s ease-in-out;
}

.concept-card:hover .bar-fill {
  animation: fillProgress 1.5s forwards ease-out;
}

@keyframes fillProgress {
  0% { width: 0; }
  100% { width: 100%; }
}

/* Output previews */
.output-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 15px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  justify-content: center;
}

.preview-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 4px;
}

.json-badge {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.plain-badge {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tty-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Section 3: Interactive Terminal Simulator
   ========================================================================== */
.demo-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: stretch;
  height: 580px;
}

.demo-controls {
  padding: 30px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-header {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.buttons-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmd-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition-smooth);
}

.cmd-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(6, 182, 212, 0.2);
}

.cmd-btn.active {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.cmd-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.cmd-btn.active .cmd-name {
  color: var(--text-primary);
}

.cmd-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Terminal Window */
.terminal-window {
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.terminal-header {
  background: rgba(0,0,0,0.4);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.terminal-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.terminal-clear:hover {
  color: var(--accent-rose);
}

.terminal-body {
  flex-grow: 1;
  padding: 24px;
  background: rgba(5, 5, 10, 0.8);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-y: auto;
  color: #e2e8f0;
}

.input-line {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.prompt {
  color: var(--accent-purple);
  margin-right: 10px;
  font-weight: bold;
}

.typed-command {
  color: var(--text-primary);
  font-weight: bold;
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent-cyan);
  font-weight: bold;
}

@keyframes blink {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

.terminal-output {
  white-space: pre-wrap;
  word-break: break-all;
}

/* Colored parts in simulator output */
.term-cyan { color: var(--accent-cyan); }
.term-green { color: var(--accent-green); }
.term-purple { color: var(--accent-purple); }
.term-yellow { color: var(--accent-yellow); }
.term-red { color: var(--accent-rose); }
.term-bold { font-weight: bold; }
.term-dim { color: var(--text-muted); }

/* ==========================================================================
   Section 4: Installation & Getting Started
   ========================================================================== */
.install-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 30px;
}

.step-item {
  display: flex;
  gap: 20px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.step-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

.step-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.copy-box {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow-x: auto;
}

.copy-box code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.copy-btn:hover {
  color: var(--accent-cyan);
}

/* Footer card */
.footer-card {
  padding: 40px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-btn {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.social-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent-cyan);
}

.card-divider {
  border: none;
  height: 1px;
  background: var(--glass-border);
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive & Adaptive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-layout {
    height: auto;
  }

  .nav-menu {
    gap: 15px;
  }

  .logo {
    font-size: 1.3rem;
  }

  .hero-layout,
  .install-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 40px;
  }
  
  .hero-visual {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
  }
  
  .concept-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .scroll-section {
    height: auto;
    min-height: 100vh;
    scroll-snap-align: none;
    padding-top: 100px;
    padding-bottom: 60px;
  }
  
  .scroll-container {
    height: auto;
    scroll-snap-type: none;
  }
  
  .demo-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .terminal-window {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.8rem;
  }
  
  .section-title {
    font-size: 2rem;
  }

  .nav-menu {
    display: none; /* In a real layout we'd do a hamburger, but let's keep clean links visible or mini */
  }
  
  .footer-meta {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  .hero-actions .cta-button {
    width: 100%;
    justify-content: center;
  }
  .social-links {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .section-desc {
    font-size: 1rem;
  }
  .concept-card {
    padding: 30px 20px;
    min-height: auto;
  }
  .demo-controls {
    padding: 20px;
  }
  .terminal-body {
    padding: 15px;
    font-size: 0.8rem;
  }
}
