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

:root {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --bg-code: #1a1a1a;
  --text: #e8e8e8;
  --text-secondary: #999;
  --text-muted: #666;
  --border: #262626;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --max-width: 860px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --bg-surface: #fff;
    --bg-code: #f3f4f6;
    --text: #111;
    --text-secondary: #555;
    --text-muted: #999;
    --border: #e5e5e5;
    --accent: #059669;
    --accent-dim: #047857;
  }
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.logo:hover {
  text-decoration: none;
}

.logo:hover .logo-text span {
  color: var(--accent) !important;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.nav-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

section:last-child {
  border-bottom: none;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--text);
}

/* Hero */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.subtitle {
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.install-cmd {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  position: relative;
  user-select: all;
}

.install-cmd:hover {
  border-color: var(--accent);
}

.install-cmd code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
}

.copy-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.install-cmd:hover .copy-icon {
  color: var(--accent);
}

.copy-ok {
  position: absolute;
  top: -1.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.btn {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  color: #000;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

/* Demo video */
.demo-section {
  padding: 0;
  border-bottom: none;
  text-align: center;
}

.demo-video {
  max-width: 100%;
  width: 720px;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
  border: 1px solid var(--border);
}

/* Problem */
.problem p {
  font-size: 1.05rem;
  line-height: 1.75;
}

/* What Synix is */
.what-synix-is > p {
  font-size: 1.05rem;
  line-height: 1.75;
}

/* Code blocks */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
}

pre code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  color: var(--text);
}

.kw { color: #c084fc; }
.str { color: var(--accent); }
.cmt { color: var(--text-muted); }
.num { color: #fbbf24; }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

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

.feature-card h3 {
  color: var(--text);
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Mapping list */
.mapping-list {
  margin-top: 1rem;
}

.mapping-row {
  display: flex;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.mapping-row:last-child {
  border-bottom: none;
}

.mapping-from {
  color: var(--text-muted);
  min-width: 160px;
  flex-shrink: 0;
}

.mapping-to {
  color: var(--text-secondary);
}

.mapping-to code {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Bottom CTA */
.bottom-cta {
  text-align: center;
  padding: 4rem 0 5rem;
}

.bottom-cta p {
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto 2rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Back link */
.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Case study hero */
.case-study-hero {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.case-study-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.case-study-hero .lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Case study content */
section > h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Artifact blocks */
.artifact-block {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.artifact-label {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--accent-dim);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.artifact-content {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.artifact-meta {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}

/* Case study card (home page) */
.case-study-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  transition: border-color 0.15s;
}

.case-study-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.case-study-card h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.case-study-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.case-study-card .card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Experimental badge */
.experimental-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  vertical-align: middle;
  margin-left: 0.4rem;
}

@media (prefers-color-scheme: light) {
  .experimental-badge {
    background: rgba(180, 130, 0, 0.12);
    color: #92600a;
    border-color: rgba(180, 130, 0, 0.3);
  }
}

/* Components section */
.components > h3:first-of-type {
  margin-top: 1.5rem;
}

.components .mapping-from {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

/* CLI reference */
.cli-ref .mapping-from {
  min-width: 170px;
}

.cli-ref .mapping-from code {
  font-size: 0.85rem;
  white-space: nowrap;
}

/* 404 */
.not-found {
  text-align: center;
  padding: 6rem 1.5rem;
}

.not-found h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.not-found p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Article hero */
.article-hero {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.article-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

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

/* Article body */
.article-body {
  padding: 2rem 0 3rem;
}

.article-body p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body h2 {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  margin-bottom: 1rem;
}

.article-body h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-body ol li {
  margin-bottom: 0.25rem;
}

.article-body em {
  color: var(--text);
}

.article-body code {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Tables — center on viewport when wider than article */
.article-body table {
  border-collapse: collapse;
  width: max-content;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 2rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.article-body thead {
  border-bottom: 2px solid var(--border);
}

.article-body th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.article-body td {
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body td:first-child {
  white-space: nowrap;
  color: var(--text);
}

/* Tables (landing page) */
main table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
  display: block;
}

main thead {
  border-bottom: 2px solid var(--border);
}

main th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

main td {
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

main tbody tr:last-child td {
  border-bottom: none;
}

main td:first-child {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.8rem;
}

main td code {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Synthesis ops section */
.synthesis-ops > p {
  font-size: 1.05rem;
  line-height: 1.75;
}

.synthesis-ops pre {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

/* Built-in transforms section */
.builtin-transforms > p {
  font-size: 1.05rem;
  line-height: 1.75;
}

/* Diagram */
.diagram {
  margin: 2.5rem 0;
  border-radius: 6px;
  overflow: hidden;
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

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

.article-footer p {
  font-size: 0.9rem;
}

.article-disclaimer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article list */
.article-list {
  padding: 2rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

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

  section {
    padding: 3rem 0;
  }

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

  pre {
    font-size: 0.8rem;
    padding: 1rem;
  }

  .mapping-row {
    flex-direction: column;
    gap: 0.15rem;
  }

  .mapping-from {
    min-width: 0;
  }

  .case-study-hero h1 {
    font-size: 1.75rem;
  }

  .artifact-block {
    padding: 1rem;
  }

  .artifact-content {
    font-size: 0.82rem;
  }

  .article-hero h1 {
    font-size: 1.75rem;
  }

  .diagram {
    margin: 2rem -1rem;
    border-radius: 0;
  }
}
