/* ─────────────────────────────────────────────────────────────────
 * Weft site styles
 * Plain CSS, no preprocessor, no framework. Designed for the
 * tech-exploration aesthetic: high contrast, generous whitespace,
 * monospace numbers, single accent color.
 * ──────────────────────────────────────────────────────────────── */

:root {
  --bg: #faf9f6;
  --bg-elevated: #ffffff;
  --bg-dark: #0e1416;
  --bg-dark-elevated: #1a2226;
  --text: #1a1f23;
  --text-muted: #5b6770;
  --text-on-dark: #e8eef0;
  --text-on-dark-muted: #8a9aa3;
  --accent: #0a6d7d;
  --accent-bright: #16a3b6;
  --accent-light: #e0f0f2;
  --border: #e3e0d8;
  --border-strong: #c8c4b8;
  --code-bg: #f0ede5;
  --positive: #2d7a4f;
  --negative: #b14545;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --maxw: 64rem;
  --maxw-narrow: 44rem;

  --shadow-sm: 0 1px 2px rgba(14, 20, 22, 0.06);
  --shadow-md: 0 4px 16px rgba(14, 20, 22, 0.08);
  --shadow-lg: 0 12px 40px rgba(14, 20, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

a:hover {
  border-bottom-color: var(--accent);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

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

.wrap.narrow {
  max-width: var(--maxw-narrow);
}

/* ── Navigation ─────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  border: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  border: none;
}

.brand-mark {
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
}

.brand-name {
  font-weight: 600;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.75rem;
}

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

.nav-links a:hover {
  color: var(--accent);
  border: none;
}

/* ── Hero ───────────────────────────────────────────────────────── */

.hero {
  padding: 5rem 0 6rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 38rem;
  margin: 0 0 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 2.5rem;
  margin: 0 0 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  min-width: 0;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  white-space: nowrap;
}

.stat-div {
  color: var(--text-muted);
  font-weight: 400;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  font-size: 0.98rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  border-bottom: 1px solid var(--accent-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--text);
}

/* ── Sections ──────────────────────────────────────────────────── */

.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  line-height: 1.15;
}

.section-lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 3rem;
  max-width: 44rem;
  line-height: 1.55;
}

.section.narrow p {
  font-size: 1.075rem;
  margin-bottom: 1.5rem;
}

.section.section-dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-bottom: none;
}

.section-dark .section-title,
.section-dark h3,
.section-dark h4 {
  color: var(--text-on-dark);
}

.section-dark .section-lede,
.section-dark p {
  color: var(--text-on-dark-muted);
}

.section-dark code {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
}

.section-dark a {
  color: var(--accent-bright);
}

/* ── Bases grid ────────────────────────────────────────────────── */

.bases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
}

.basis-card {
  padding: 2rem 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  transition: all 0.15s ease;
}

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

.basis-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.basis-card h3 {
  font-size: 1.2rem;
  margin: 0 0 0.85rem;
  letter-spacing: -0.01em;
}

.basis-card p {
  margin: 0 0 1.5rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.basis-tag {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.4rem 0.65rem;
  border-radius: 3px;
  display: inline-block;
}

/* ── Gallery (image-comparison sliders) ────────────────────────── */

.gallery-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.gallery-toggle-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-on-dark-muted);
}

.gallery-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px;
  gap: 2px;
}

.toggle-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1rem;
  color: var(--text-on-dark-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.toggle-btn:hover {
  color: var(--text-on-dark);
}

.toggle-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.toggle-btn.active:hover {
  background: var(--accent-bright);
}

.toggle-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.7;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.gallery-loading {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-on-dark-muted);
  padding: 4rem 0;
}

.gallery-card {
  background: var(--bg-dark-elevated);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gallery-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.gallery-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gallery-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  margin: 0;
}

.gallery-variant {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-bright);
}

.gallery-delta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
}

.gallery-delta.positive {
  color: #4dd28a;
}

.gallery-delta.negative {
  color: #ff8a8a;
}

.gallery-note {
  padding: 0 1.75rem 1.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-on-dark-muted);
  margin: 0;
}

/* The slider itself */

.compare-slider {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  background: #000;
  cursor: ew-resize;
}

.compare-slider img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.compare-slider .compare-a {
  position: relative;
}

.compare-slider .compare-b {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 0 50%);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.compare-handle::before,
.compare-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  left: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.compare-handle::after {
  width: 18px;
  height: 18px;
  background: var(--accent);
}

.compare-labels {
  position: absolute;
  top: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1.25rem;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compare-labels span {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.compare-labels .compare-label-b {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.gallery-stat {
  background: var(--bg-dark-elevated);
  padding: 1rem 1.75rem 1.25rem;
}

.gallery-stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-on-dark-muted);
  margin-bottom: 0.4rem;
}

.gallery-stat-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-on-dark);
}

.gallery-stat-num strong {
  font-weight: 700;
}

/* ── Benchmark table ───────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
}

.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.bench-table th,
.bench-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.bench-table th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: #f5f3ec;
  border-bottom: 2px solid var(--border-strong);
}

.bench-table tbody tr:hover {
  background: var(--accent-light);
}

.bench-table tbody tr:last-child td {
  border-bottom: 1px solid var(--border-strong);
}

.bench-table tfoot tr td {
  background: #f5f3ec;
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid var(--border-strong);
}

.col-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-name {
  white-space: nowrap;
}

.delta-positive {
  color: var(--positive);
  font-weight: 700;
}

.delta-negative {
  color: var(--negative);
  font-weight: 700;
}

.tbody-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ── Limits list ───────────────────────────────────────────────── */

.limits-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.limits-list li {
  padding: 1.25rem 0 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.limits-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 1.25rem;
  color: var(--accent);
  font-weight: 700;
}

.limits-list li:first-child {
  padding-top: 0;
}

.limits-list li:first-child::before {
  top: 0;
}

.limits-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.limits-list strong {
  color: var(--text);
}

/* ── Code block ────────────────────────────────────────────────── */

.code-block {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 1.5rem 1.75rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-on-dark);
}

.code-block code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* ── Footer ────────────────────────────────────────────────────── */

.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  padding: 4rem 0 3rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  margin: 0;
  font-size: 0.92rem;
}

.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-on-dark);
  margin: 0 0 1rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.55rem;
}

.footer-col a {
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
  border: none;
}

.footer-col a:hover {
  color: var(--accent-bright);
  border: none;
}

.footer-bottom {
  padding-top: 2rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom code {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-on-dark);
}

.footer-meta {
  color: var(--text-on-dark-muted);
  font-size: 0.85rem;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
    font-size: 0.85rem;
  }

  .nav-links li:nth-child(3),
  .nav-links li:nth-child(4),
  .nav-links li:nth-child(5) {
    display: none;
  }

  .hero {
    padding: 3rem 0 4rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-num {
    font-size: 1.85rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .bench-table {
    font-size: 0.82rem;
  }

  .bench-table th,
  .bench-table td {
    padding: 0.7rem 0.6rem;
  }

  .compare-handle::before {
    width: 28px;
    height: 28px;
  }

  .compare-handle::after {
    width: 14px;
    height: 14px;
  }
}

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

  .stat-num {
    font-size: 2rem;
  }
}
