/* borescope marketing site. No framework. Just CSS. */

@import url("tokens.css");

:root { --max-w: 1080px; }

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* Skip link. */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: var(--z-skip);
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: oklch(0.99 0 0);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

.skip-link:focus { top: 0.75rem; color: oklch(0.99 0 0); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Buttons. */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: oklch(0.99 0 0);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: oklch(0.99 0 0);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Navigation. */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

@supports not (backdrop-filter: blur(10px)) {
  nav { background: var(--bg); }
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

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

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

.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* Mobile nav toggle. */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

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

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

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.5rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.7rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-of-type { border-bottom: none; }

  .nav-links .btn-sm {
    margin-top: 0.5rem;
    text-align: center;
    justify-content: center;
  }
}

/* Theme switcher. */
.theme-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 0;
}

.theme-switcher button {
  background: none;
  border: none;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
  white-space: nowrap;
}

.theme-switcher button:hover { color: var(--text); }

.theme-switcher button[aria-pressed="true"] {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .theme-switcher {
    align-self: stretch;
    margin-top: 0.5rem;
    justify-content: center;
  }

  .theme-switcher button {
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    flex: 1;
  }
}

/* Hero. A split layout: copy and a live terminal mock. The terminal IS
   the visual anchor; the headline takes the right column on desktop and
   stacks above on mobile. */
.hero {
  position: relative;
  padding: clamp(6.5rem, 12vh, 9rem) 0 clamp(3rem, 6vh, 5rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 75% 30%, var(--accent-bg) 0%, transparent 55%);
  opacity: 0.35;
  z-index: var(--z-backdrop);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: center;
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.hero-copy { min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.035em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  display: block;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 32rem;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Terminal mock. Real-looking shell window with a typing animation that
   pauses at the prompt. Reduced motion stops it on the final frame. */
.hero-term {
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: var(--radius);
  border: 1px solid var(--term-border);
  box-shadow: 0 6px 18px oklch(0.2 0.02 240 / 0.08), 0 1px 2px oklch(0.2 0.02 240 / 0.04);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  overflow: hidden;
}

.hero-term-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--term-bar-bg);
  border-bottom: 1px solid var(--term-border);
}

.hero-term-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.hero-term-bar i:nth-child(1) { background: var(--term-dot-red); }
.hero-term-bar i:nth-child(2) { background: var(--term-dot-amber); }
.hero-term-bar i:nth-child(3) { background: var(--term-dot-green); }

.hero-term-bar span {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--term-dim);
  letter-spacing: 0.04em;
}

.hero-term-body {
  padding: 1rem 1.25rem 1.5rem;
  overflow-x: auto;
}

.hero-term-body .ln { display: block; white-space: pre; }
.hero-term-body .prompt  { color: var(--term-prompt); }
.hero-term-body .pebble  { color: var(--term-accent); }
.hero-term-body .cmd     { color: var(--term-fg); }
.hero-term-body .out     { color: var(--term-muted); }
.hero-term-body .out-ok  { color: var(--term-ok); }
.hero-term-body .out-em  { color: var(--term-fg); }
.hero-term-body .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--term-prompt);
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* Sections. */
section { padding: clamp(3.5rem, 7vh, 5.5rem) 0; }

section h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.section-head { margin-bottom: 2.5rem; }

/* Features. Mixed-weight grid: two lead cards span wider, four compact
   tiles follow. The variety breaks the identical-cards trope while the
   shared shell keeps it cohesive. */
.features { background: var(--bg-subtle); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  grid-column: span 2;
}

.feature-card.lead {
  grid-column: span 3;
  padding: 2rem 2rem 1.75rem;
}

@media (max-width: 920px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card, .feature-card.lead { grid-column: span 1; }
}

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

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin-bottom: 0.5rem;
}

.feature-card.lead h3 { font-size: 1.25rem; }

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

.feature-card pre {
  margin-top: 1rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
}

.feature-card pre .prompt  { color: var(--accent); }
.feature-card pre .comment { color: var(--text-muted); }

/* How it works. Sequence is genuine here, so the numbering is earned. */
.steps {
  max-width: 640px;
  list-style: none;
  counter-reset: step;
  margin-top: 0.5rem;
}

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

.step:last-child { border-bottom: none; }

.step::before {
  content: counter(step, decimal-leading-zero);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  min-width: 2.5rem;
  padding-top: 0.15rem;
}

.step-content h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.step-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-content code {
  font-size: 0.85em;
}

/* Ecosystem. Tight inline list, not a card grid. */
.ecosystem { background: var(--bg-subtle); }

.eco-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.eco-list li {
  list-style: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.eco-list strong { font-weight: 650; }
.eco-list span   { color: var(--text-muted); font-size: 0.85rem; }

/* Quick start. */
.code-block {
  max-width: 640px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: var(--shadow-lg);
  margin-top: 0.5rem;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--code-bg);
  border-bottom: 1px solid var(--code-border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.code-header i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.code-block pre {
  background: var(--code-bg);
  padding: 1.25rem;
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
}

.prompt  { color: var(--accent); }
.comment { color: var(--text-muted); }
.dim     { opacity: 0.6; }

.quickstart-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 640px;
  margin-top: 1.25rem;
  line-height: 1.65;
}

/* Interfaces. */
.interfaces { background: var(--bg-subtle); }

.interface-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.interface-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.interface-card h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.interface-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.interface-card code {
  display: inline-block;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

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

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-sep { color: var(--text-muted); }
.footer-left span:last-child { color: var(--text-muted); font-weight: 400; }

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }

/* Animations. */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.feature-grid .fade-in:nth-child(2) { transition-delay: 0.04s; }
.feature-grid .fade-in:nth-child(3) { transition-delay: 0.08s; }
.feature-grid .fade-in:nth-child(4) { transition-delay: 0.12s; }
.feature-grid .fade-in:nth-child(5) { transition-delay: 0.16s; }
.feature-grid .fade-in:nth-child(6) { transition-delay: 0.20s; }

.steps .fade-in:nth-child(2) { transition-delay: 0.05s; }
.steps .fade-in:nth-child(3) { transition-delay: 0.10s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
  .hero-term-body .cursor { animation: none; opacity: 1; }
}
