/* =============================================================
   TinyHarness — Landing Page Styles
   Dark theme inspired by GitHub + Rustacean green
   ============================================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-code: #161b22;
  --border: #30363d;
  --border-hover: #484f58;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #3fb950;
  --accent-hover: #46c95b;
  --accent-dim: rgba(63, 185, 80, 0.15);
  --link: #58a6ff;
  --warning: #d29922;
  --warning-bg: rgba(210, 153, 34, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  --max-width: 1100px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  text-decoration: none;
}

.nav-github {
  display: flex !important;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
}

.nav-github:hover {
  border-color: var(--border-hover) !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero --- */
.hero {
  padding: 140px 0 80px;
  text-align: center;
}

.hero-badge {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
}

.badge-link {
  text-decoration: none;
  transition: border-color 0.15s;
}

.badge-link:hover {
  border-color: var(--border-hover);
  text-decoration: none;
}

.badge-sm {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #3fb950 0%, #58a6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #0d1117;
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  text-decoration: none;
  color: var(--text-primary);
}

.hero-screenshot {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero-screenshot img {
  width: 100%;
  display: block;
}

/* --- Sections --- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.15s, transform 0.15s;
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-card code {
  font-size: 0.82em;
}

.feature-card-full {
  grid-column: 1 / -1;
}

/* --- Installation --- */
.install-steps {
  max-width: 700px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: bold;
}

.step-note {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Code Blocks --- */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.code-dot:nth-child(1) { background: #ff5f56; }
.code-dot:nth-child(2) { background: #ffbd2e; }
.code-dot:nth-child(3) { background: #27c93f; }

.copy-btn {
  margin-left: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: var(--border-hover);
  color: var(--text-primary);
}

.copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.code-block.small pre {
  padding: 12px 16px;
}

.code-block.small code {
  font-size: 0.82rem;
}

/* --- Usage --- */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.usage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.usage-card h4 {
  margin-bottom: 12px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-card p {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.usage-note {
  margin-top: 30px;
  max-width: 700px;
}

.usage-note h4 {
  font-size: 1rem;
  margin-bottom: 10px;
}

/* --- Modes Table --- */
.table-wrapper {
  overflow-x: auto;
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.modes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.modes-table th {
  background: var(--bg-card);
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.modes-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.modes-table tr:last-child td {
  border-bottom: none;
}

.modes-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.modes-table td code {
  font-size: 0.82em;
  white-space: nowrap;
}

.mode-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: lowercase;
}

.mode-casual    { background: rgba(139, 148, 158, 0.2); color: #8b949e; }
.mode-planning  { background: rgba(88, 166, 255, 0.2);  color: #58a6ff; }
.mode-agent     { background: rgba(63, 185, 80, 0.2);   color: #3fb950; }
.mode-research  { background: rgba(210, 153, 34, 0.2);  color: #d29922; }

/* --- Commands Grid --- */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.command-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--accent);
}

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

/* --- Project Structure --- */
.structure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.structure-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.structure-col h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.structure-col h4 code {
  font-size: 0.9em;
}

.file-tree ul {
  list-style: none;
}

.file-tree li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tree-folder {
  color: #58a6ff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.tree-file {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* --- Security --- */
.security-note {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  max-width: 700px;
  margin: 30px auto 0;
  padding: 24px;
  background: var(--warning-bg);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: var(--radius-lg);
}

.security-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.security-note p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

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

.security-note code {
  font-size: 0.82em;
}

/* --- Footer --- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.footer-license {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  margin-top: 2px;
}

.footer-right a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-right a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 10px 14px;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 100px 0 50px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .structure-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

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

  .commands-grid {
    grid-template-columns: 1fr;
  }

  .usage-grid {
    grid-template-columns: 1fr;
  }

  .command-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
