/* ─── The Mirror Protocol — Brand Styles ─── */

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #121214;
  --bg-card: #1a1a1e;
  --bg-card-hover: #222228;
  --border: #2a2a30;
  --border-light: #3a3a42;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --accent: #22c55e;
  --accent-dim: #16a34a;
  --accent-glow: rgba(34, 197, 94, 0.15);
  --purple: #a855f7;
  --blue: #3b82f6;
  --orange: #f97316;
  --pink: #ec4899;
  --yellow: #eab308;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-logo-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

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

.nav-cta {
  background: var(--accent) !important;
  color: #000 !important;
  font-weight: 600 !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-sm) !important;
}

.nav-cta:hover {
  background: var(--accent-dim) !important;
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* ─── Hero ─── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 800px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 36px;
  font-size: 16px;
}

/* ─── Sections ─── */
.section {
  padding: 100px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.section-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Pillars Grid ─── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s;
}

.pillar-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.pillar-card-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.pillar-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pillar-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.pillar-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  margin-top: 14px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.pillar-card-status-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

/* ─── Pipeline ─── */
.pipeline {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-node {
  text-align: center;
  flex: 1;
  min-width: 120px;
}

.pipeline-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.pipeline-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pipeline-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.pipeline-arrow {
  font-size: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ─── Architecture Sub-page ─── */
.arch-section {
  margin-bottom: 48px;
}

.arch-section h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.arch-diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  overflow-x: auto;
}

.arch-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: fit-content;
}

.arch-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  min-width: 140px;
  text-align: center;
}

.arch-node-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.arch-node-value {
  font-size: 13px;
  font-weight: 500;
}

.arch-node-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 6px;
}

.arch-arrow {
  color: var(--text-tertiary);
  font-size: 18px;
  flex-shrink: 0;
}

.code-block {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  color: var(--text-secondary);
}

.code-block .keyword { color: var(--purple); }
.code-block .string { color: var(--accent); }
.code-block .comment { color: var(--text-tertiary); }
.code-block .fn { color: var(--blue); }

/* ─── Login Section ─── */
.login-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 32px;
  text-align: center;
}

.login-section h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-section p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
}

.login-btn:hover {
  background: var(--accent-dim);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 8px 0;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-alt {
  color: var(--text-tertiary);
  font-size: 13px;
}

.login-alt a {
  color: var(--accent);
  text-decoration: none;
}

.login-alt a:hover {
  text-decoration: underline;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}

/* ─── Pricing ─── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s;
}

.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
}

.pricing-card.featured::before {
  content: "Most Popular";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  padding: 4px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  text-align: center;
}

.footer p {
  color: var(--text-tertiary);
  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ─── Sub-page Header ─── */
.subpage-header {
  padding-top: 96px;
  padding-bottom: 48px;
  text-align: center;
}

.subpage-header h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}

.subpage-header p {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Tech Stack ─── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

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

.tech-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.tech-name {
  font-size: 14px;
  font-weight: 600;
}

.tech-desc {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

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

.stat-number {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
  }

  .nav-links.open a { width: 100%; }

  .pipeline-flow { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); }

  .arch-flow { flex-direction: column; }
  .arch-arrow { transform: rotate(90deg); }

  .hero { padding-top: 100px; min-height: auto; }
  .section { padding: 60px 20px; }
  .pillars-grid { grid-template-columns: 1fr; }
}

/* ─── Animations ─── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.2s; }

.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}
