/*
 * Copyright (c) 2024-2026 Luca Vitiello. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-Proprietary
 */

/* ═══════════════════════════════════════════════════════════════════════
   Dousen Marketing Site — Design System
   Flat tool-gray · Brand blue · Big Shoulders Display + IBM Plex
═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* Headline face — self-hosted (SIL OFL 1.1, see fonts/LICENSE-Iosevka.md) */
@font-face {
  font-family: 'Iosevka';
  src: url('../fonts/iosevka-bold-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
  --blue:    #0088ff;
  --blue-hi: #47b1ff;
  --blue-lo: rgba(0, 136, 255, 0.08);
  --blue-md: rgba(0, 136, 255, 0.18);

  --bg:        #131417;
  --surface-1: #191b1f;
  --surface-2: #202329;
  --surface-3: #282c33;

  --border-1: #26292f;
  --border-2: #33373f;
  --border-3: #454a54;

  --text-1: #eceef1;
  --text-2: #a4abb5;
  --text-3: #6e757f;

  --green: #46b26b;
  --amber: #d9993f;
  --red:   #d95c4a;

  --f-hed: 'Iosevka', 'IBM Plex Mono', monospace;
  --f-dis: 'IBM Plex Sans', system-ui, sans-serif;
  --f-ui:  'IBM Plex Sans', system-ui, sans-serif;
  --f-mon: 'IBM Plex Mono', monospace;

  --max: 1120px;
  --r:   3px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* ── Utilities ────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ── Navigation ───────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.2s, border-color 0.2s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(19, 20, 23, 0.92);
  border-bottom-color: var(--border-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-hed);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-1);
}

.nav-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r);
  transition: color 0.12s, background 0.12s;
}

.nav-links a:hover {
  color: var(--text-1);
  background: rgba(255,255,255,0.04);
}

.btn-nav {
  margin-left: 0.5rem;
  padding: 0.4rem 1rem !important;
  background: transparent !important;
  border: 1px solid var(--border-3) !important;
  color: var(--text-1) !important;
  border-radius: var(--r) !important;
}

.btn-nav:hover {
  border-color: var(--blue) !important;
  color: var(--blue-hi) !important;
  background: transparent !important;
}

/* Burger (injected by main.js, shown only on small screens) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0 10px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-1);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav.open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: var(--blue);
  color: #fff;
  border-radius: var(--r);
  font-family: var(--f-ui);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--blue);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary:hover {
  background: var(--blue-hi);
  border-color: var(--blue-hi);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  transition: color 0.12s, border-color 0.12s;
}

.btn-ghost:hover {
  color: var(--text-1);
  border-color: var(--border-3);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: 150px 0 4.5rem;
}

.hero-eyebrow {
  font-family: var(--f-mon);
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}

.hero-eyebrow .path { color: var(--blue); }

.hero-title {
  font-family: var(--f-hed);
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-1);
  margin-bottom: 1.75rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 56ch;
  margin-bottom: 2.25rem;
}

.hero-sub strong {
  color: var(--text-1);
  font-weight: 500;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-cta-note {
  font-family: var(--f-mon);
  font-size: 0.78rem;
  color: var(--text-3);
  margin-left: 0.5rem;
}

/* ── Pipeline log (signature) ─────────────────────────────────────────── */
.log-section {
  padding: 0 0 5rem;
}

.log-panel {
  border: 1px solid var(--border-2);
  background: var(--surface-1);
}

.log-titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 38px;
  padding: 0 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-2);
}

.log-tab {
  font-family: var(--f-mon);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-1);
}

.log-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--f-mon);
  font-size: 0.7rem;
  color: var(--text-3);
  margin-left: auto;
}

.log-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.log-body {
  padding: 1.25rem 1rem;
  font-family: var(--f-mon);
  font-size: 0.85rem;
  line-height: 2.1;
  overflow-x: auto;
}

.log-line {
  display: grid;
  grid-template-columns: 7.5ch 11ch 13ch 1fr;
  gap: 1.25rem;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  min-width: 640px;
}

/* hidden only while the tail animation is armed, so no-JS still shows the log */
.log-panel.anim .log-line { opacity: 0; }
.log-panel.anim .log-line.on { opacity: 1; }

.log-line .lt { color: var(--text-3); }
.log-line .ls { color: var(--amber); }
.log-line .le { color: var(--blue-hi); }
.log-line .lp { color: var(--text-2); }
.log-line .lp b { color: var(--text-1); font-weight: 500; }
.log-line .ok { color: var(--green); }

.log-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--text-3);
  vertical-align: middle;
  animation: caretBlink 1.1s steps(1) infinite;
}

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

.log-caption {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-top: 1rem;
}

.log-caption b {
  color: var(--text-2);
  font-weight: 500;
}

/* ── Integrations strip ───────────────────────────────────────────────── */
.integrations {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
}

.integrations-inner {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.integrations-label {
  font-family: var(--f-mon);
  font-size: 0.75rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.integrations-list {
  font-family: var(--f-mon);
  font-size: 0.82rem;
  color: var(--text-2);
  display: flex;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
}

.integrations-list span { white-space: nowrap; }

/* ── Section shared ───────────────────────────────────────────────────── */
.section {
  padding: 6.5rem 0;
}

.section-label {
  font-family: var(--f-mon);
  font-size: 0.8rem;
  color: var(--blue);
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--f-hed);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-1);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 56ch;
  line-height: 1.7;
}

/* ── Features (event hooks) ───────────────────────────────────────────── */
.features-header {
  margin-bottom: 3.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-2);
  border: 1px solid var(--border-2);
}

.feature-card {
  background: var(--bg);
  padding: 2.25rem 2.25rem 2rem;
  transition: background 0.15s;
}

.feature-card:hover {
  background: var(--surface-1);
}

.feature-hook {
  font-family: var(--f-mon);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 1rem;
}

.feature-title {
  font-family: var(--f-dis);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.6rem;
}

.feature-desc {
  font-size: 0.925rem;
  color: var(--text-2);
  line-height: 1.7;
}

.feature-example {
  font-family: var(--f-mon);
  font-size: 0.78rem;
  color: var(--text-3);
  background: var(--surface-1);
  border-left: 2px solid var(--border-3);
  padding: 0.5rem 0.75rem;
  margin-top: 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
}

.feature-card:hover .feature-example {
  background: var(--surface-2);
}

.feature-example b {
  color: var(--text-2);
  font-weight: 500;
}

/* ── How it works ─────────────────────────────────────────────────────── */
.how-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4.5rem;
  align-items: start;
}

.steps {
  display: flex;
  flex-direction: column;
  margin-top: 2.5rem;
}

.step {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-1);
}

.step-num {
  font-family: var(--f-mon);
  font-size: 0.8rem;
  color: var(--text-3);
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.step.active .step-num { color: var(--blue); }

.step-title {
  font-family: var(--f-dis);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.4rem;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.7;
}

/* Pipeline topology diagram */
.pipeline-diagram {
  border: 1px solid var(--border-2);
  background: var(--surface-1);
  padding: 2rem 1.5rem;
}

.pipeline-tier {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pipeline-box {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  padding: 0.45rem 0.8rem;
  font-family: var(--f-mon);
  font-size: 0.72rem;
  color: var(--text-2);
  white-space: nowrap;
}

.pipeline-box.highlight {
  background: var(--blue-lo);
  border-color: var(--blue);
  color: var(--blue-hi);
  padding: 0.6rem 1.25rem;
  font-size: 0.78rem;
}

.pipeline-link {
  width: 1px;
  height: 22px;
  background: var(--border-3);
  margin: 0 auto;
}

.pipeline-note {
  text-align: center;
  font-family: var(--f-mon);
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 0.5rem;
}

/* ── CTA ──────────────────────────────────────────────────────────────── */
.cta-section {
  padding: 6.5rem 0;
  border-top: 1px solid var(--border-1);
}

.cta-inner {
  border: 1px solid var(--border-2);
  background: var(--surface-1);
  padding: 3.5rem 3rem;
}

.cta-title {
  font-family: var(--f-hed);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text-1);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.cta-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 56ch;
  margin-bottom: 2.25rem;
  line-height: 1.7;
}

.cta-sub a { color: var(--blue-hi); }
.cta-sub a:hover { color: var(--blue); }

.cta-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-1);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-hed);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.footer-logo { width: 20px; height: 20px; }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-3);
  transition: color 0.12s;
}

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

.footer-copy {
  font-family: var(--f-mon);
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ── Pricing page ─────────────────────────────────────────────────────── */
.pricing-hero {
  padding: 140px 0 4rem;
  text-align: center;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 0 1px;
  background: var(--border-2);
  border: 1px solid var(--border-2);
  max-width: var(--max);
  margin: 0 auto 6.5rem;
}

.pricing-card {
  background: var(--bg);
  padding: 2.25rem 2rem;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 6;
  gap: 0;
  transition: background 0.15s;
}

.pricing-card:hover { background: var(--surface-1); }

.pricing-card.featured {
  background: var(--surface-1);
  position: relative;
  box-shadow: inset 0 2px 0 var(--blue);
}

.pricing-featured-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--f-mon);
  font-size: 0.68rem;
  color: var(--blue-hi);
  border: 1px solid var(--border-2);
  padding: 0.15rem 0.5rem;
}

.pricing-tier {
  font-family: var(--f-mon);
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.pricing-price {
  font-family: var(--f-hed);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.pricing-price span {
  font-family: var(--f-ui);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-3);
}

.pricing-cadence {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 1.75rem;
}

.pricing-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-size: 0.875rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-1);
}

.pricing-features li:last-child { border-bottom: none; }

.pricing-check {
  color: var(--blue);
  font-size: 0.875rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.pricing-btn {
  display: block;
  text-align: center;
  padding: 0.7rem;
  border-radius: var(--r);
  font-family: var(--f-ui);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.pricing-btn:hover {
  color: var(--text-1);
  border-color: var(--border-3);
}

.pricing-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pricing-btn.primary:hover { background: var(--blue-hi); border-color: var(--blue-hi); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (min-width: 1440px) {
  :root { --max: 1220px; }
}

@media (max-width: 900px) {
  .how-inner { grid-template-columns: 1fr; gap: 3rem; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto auto auto 1fr auto auto auto auto auto 1fr auto;
    gap: 1px;
  }
}

@media (max-width: 768px) {
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border-1);
  }
  .nav.open { background: var(--bg); border-bottom-color: var(--border-1); }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 0.7rem 0.75rem; }
  .btn-nav {
    margin: 0.5rem 0.75rem 0 !important;
    text-align: center;
  }
  .section { padding: 4.5rem 0; }
  .cta-section { padding: 4.5rem 0; }
  .hero { padding: 120px 0 3rem; }
  .cta-inner { padding: 2.5rem 1.5rem; }
  .pricing-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .pricing-card {
    grid-row: auto;
    grid-template-rows: none;
  }
}

@media (max-width: 640px) {
  .log-body { font-size: 0.75rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Accessibility ────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

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