/* ========================================
   Badlands Labs - Warm Editorial Theme
   ======================================== */

/* CSS Custom Properties */
:root {
  --bg-cream: #F7F4ED;
  --ink-dark: #1F1D1A;
  --gold-accent: #B8862B;
  --gold-light: #D4A84B;
  --border-warm: #E5DFD2;
  --border-light: #F0EDE5;
  --text-muted: #6B635A;
  --text-light: #8A8379;
  --card-bg: #FFFFFF;
  --hover-bg: #FAF8F3;
  --success-green: #4A7C59;
  --warning-amber: #C4842D;
  --error-red: #A63D3D;

  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(31, 29, 26, 0.06);
  --shadow-md: 0 4px 12px rgba(31, 29, 26, 0.08);
  --shadow-lg: 0 8px 24px rgba(31, 29, 26, 0.12);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-cream);
  color: var(--ink-dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--ink-dark);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--gold-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold-light);
}

/* Eyebrow Labels */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-accent);
  font-weight: 500;
}

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

/* ========================================
   Header & Navigation
   ======================================== */

.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-warm);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: var(--ink-dark);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo svg {
  width: 20px;
  height: 20px;
  fill: var(--gold-accent);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink-dark);
  letter-spacing: 0.04em;
}

.brand-name em {
  font-style: normal;
  color: var(--gold-accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header-nav a:hover {
  background: var(--hover-bg);
  color: var(--ink-dark);
}

.header-nav a.active {
  background: var(--ink-dark);
  color: var(--card-bg);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-eyebrow {
  margin-bottom: 16px;
}

.hero-title {
  font-size: 4rem;
  margin-bottom: 20px;
  line-height: 1.1;
}

.hero-title em {
  font-style: normal;
  color: var(--gold-accent);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--ink-dark);
  color: var(--card-bg);
}

.btn-primary:hover {
  background: #2D2A26;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--ink-dark);
  border: 1.5px solid var(--border-warm);
}

.btn-secondary:hover {
  border-color: var(--ink-dark);
  background: var(--hover-bg);
}

/* ========================================
   Tab Navigation
   ======================================== */

.tab-section {
  padding: 40px 0 80px;
}

.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-warm);
  margin-bottom: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-body);
}

.tab-btn:hover {
  color: var(--ink-dark);
  background: var(--hover-bg);
}

.tab-btn.active {
  background: var(--ink-dark);
  color: var(--card-bg);
}

/* Tab Panels */
.tab-panels {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tab-panel {
  display: none;
  padding: 40px;
}

.tab-panel.active {
  display: block;
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-cream);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.card-body {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ========================================
   Code Blocks
   ======================================== */

.code-block {
  background: var(--ink-dark);
  border-radius: var(--radius-md);
  margin: 20px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
 background: #2D2A26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.copy-btn.copied {
  background: var(--success-green);
  color: #fff;
}

.code-content {
  padding: 20px;
  overflow-x: auto;
}

.code-content pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: #E8E4DC;
  margin: 0;
}

.code-content .comment {
  color: #6B635A;
}

.code-content .keyword {
  color: var(--gold-light);
}

.code-content .string {
  color: #8FBC8F;
}

.code-content .url {
  color: #7CB9E8;
}

/* Inline Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-cream);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--gold-accent);
}

/* ========================================
   Lists
   ======================================== */

.styled-list {
  list-style: none;
  margin: 16px 0;
}

.styled-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.styled-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--gold-accent);
  border-radius: 50%;
}

.styled-list li strong {
  color: var(--ink-dark);
}

/* ========================================
   Forms
   ======================================== */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-dark);
  margin-bottom: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  background: var(--bg-cream);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-md);
  color: var(--ink-dark);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(184, 134, 43, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========================================
   Status Dashboard
   ======================================== */

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.status-card {
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-indicator.operational {
  background: var(--success-green);
  box-shadow: 0 0 8px rgba(74, 124, 89, 0.5);
}

.status-indicator.degraded {
  background: var(--warning-amber);
  box-shadow: 0 0 8px rgba(196, 132, 45, 0.5);
}

.status-indicator.outage {
  background: var(--error-red);
  box-shadow: 0 0 8px rgba(166, 61, 61, 0.5);
}

.status-value {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 12px 0 4px;
}

.status-label {
  font-size: 0.8125rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Uptime Chart */
.uptime-chart {
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-light);
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.bars-container {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 80px;
  padding: 8px 0;
}

.bar {
  flex: 1;
  min-width: 6px;
  max-width: 12px;
  background: var(--success-green);
  border-radius: 2px 2px 0 0;
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.bar:hover {
  opacity: 1;
}

.bar.higher {
  opacity: 0.7;
}

.bar.peak {
  opacity: 1;
}

.bar.outage {
  background: var(--error-red);
  opacity: 1;
}

.bar.degraded {
  background: var(--warning-amber);
  opacity: 0.8;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* Latency Grid */
.latency-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.latency-item {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.latency-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--ink-dark);
  margin-bottom: 4px;
}

.latency-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Section Headers */
.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  margin: 0;
}

/* Feature List */
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.feature-check {
  width: 24px;
  height: 24px;
  background: var(--success-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-check svg {
  width: 14px;
  height: 14px;
  fill: white;
}

.feature-text h4 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-text p {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin: 0;
}

/* ========================================
   Legal Content (Privacy / Terms)
   ======================================== */

.legal-content {
  max-width: 720px;
}

.legal-content h3 {
  font-size: 1.25rem;
  margin: 32px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-warm);
}

.legal-content h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-content p {
  margin-bottom: 16px;
}

.legal-content ul {
  margin: 16px 0;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 8px;
  color: var(--text-muted);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  background: var(--ink-dark);
  padding: 48px 0;
  margin-top: auto;
}

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

.footer-brand {
  color: rgba(255, 255, 255, 0.9);
}

.footer-brand .brand-name {
  color: #fff;
  margin-bottom: 4px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--gold-light);
}

/* ========================================
   Utilities
   ======================================== */

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.text-center { text-align: center; }
.text-gold { color: var(--gold-accent); }
.text-muted { color: var(--text-muted); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }

  .hero {
    padding: 60px 0 40px;
  }

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

  .hero-subtitle {
    font-size: 1.0625rem;
  }

  .tab-nav {
    gap: 2px;
    padding: 4px;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 0.8125rem;
    min-width: 80px;
  }

  .tab-panel {
    padding: 24px;
  }

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

  .latency-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    flex-direction: column;
    gap: 16px;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .bars-container {
    height: 60px;
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel.active {
  animation: fadeIn 0.3s ease;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-warm) 25%,
    var(--border-light) 50%,
    var(--border-warm) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
