/* Clun public site — calm product presentation */

/* Brand tokens: https://f00.sh/theme/f00-theme.css */
:root {
  --radius: 10px;
  --shell: min(1120px, calc(100% - 2.5rem));
  --header-h: 3.5rem;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

/* Announcement */
.announcement {
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  text-align: center;
  font-size: 0.9rem;
}

.announcement a {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
}

.announcement a:hover {
  color: var(--text);
}

.announcement span:first-child {
  color: var(--ok);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 14, 0.92);
  backdrop-filter: blur(8px);
}

.nav-shell {
  width: var(--shell);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
}

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

.menu-button {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.menu-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-lines i {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

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

.btn-ghost:hover {
  background: #0a0a0a;
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 2.75rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: stretch;
  margin-bottom: 1.75rem;
}

.hero-copy-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-logo-col {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100%;
}

.hero-logo {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #0a0a0a;
}

.hero .eyebrow {
  margin: 0 0 0.85rem;
}

.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.75rem, 3.8vw, 2.55rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

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

.hero-copy {
  max-width: 38rem;
  margin: 0 0 0.85rem;
  color: var(--text-muted);
}

.hero-emphasis {
  color: var(--text);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

/* Features */
.feature-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  background: #0a0a0a;
}

.feature h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.feature ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.feature li {
  margin-bottom: 0.4rem;
}

.feature li:last-child {
  margin-bottom: 0;
}

/* Lisp */
.lisp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.lisp-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  background: #0a0a0a;
}

.lisp-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.lisp-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}


/* Installer */
.installer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0a0a;
  padding: 1.25rem 1.35rem;
  margin: 0 0 1.5rem;
}

.installer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.installer-kicker {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.installer h2 {
  margin: 0;
  font-size: 1.15rem;
}

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

.command-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #000000;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.command-row .prompt {
  color: var(--text-dim);
  user-select: none;
}

.command-row code {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
}

.copy-button,
.code-copy-button {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #0a0a0a;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.copy-button:hover,
.code-copy-button:hover {
  color: var(--text);
}

.installer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.installer-note {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0;
}

.stat-strip div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: var(--bg-muted);
}

.stat-strip dt {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.stat-strip dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Sections */
.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section-muted {
  background: var(--bg-muted);
}

.section-intro {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}

.section-intro h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  letter-spacing: -0.02em;
}

.section-intro p {
  margin: 0;
  color: var(--text-muted);
}

.doc-list {
  margin: 0;
  padding-left: 1.25rem;
  max-width: 40rem;
  color: var(--text);
  line-height: 1.7;
}

.doc-list a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.doc-list a:hover {
  color: var(--accent);
}

.muted {
  color: var(--text-muted);
}

.scene-card {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  max-width: 52rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000000;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  background: #0a0a0a;
}

.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Code */
.code-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2rem;
  align-items: start;
}

.code-copy h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.code-copy > p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.code-tabs button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.code-tabs button[aria-selected="true"] {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--text);
}

.code-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000000;
  overflow: hidden;
}

.code-window-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.code-window pre {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  overflow-x: auto;
  line-height: 1.5;
}

.tok-key { color: #ffffff; }
.tok-str { color: #e5e5e5; }
.tok-num { color: #cccccc; }
.tok-type { color: #ffffff; }

/* Matrix table — fit viewport; wrap cells; no horizontal scroll */
.table-wrap {
  overflow-x: hidden;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0a0a;
}

.compare-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  hyphens: auto;
}

.compare-table thead th {
  background: var(--bg-muted);
  font-weight: 600;
  font-size: 0.85rem;
  position: sticky;
  top: 0;
}

.compare-table th span,
.compare-table .source-note {
  display: block;
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.compare-table .clun-col {
  background: rgba(124, 156, 255, 0.04);
}

.compare-group th {
  background: var(--bg-muted);
  font-size: 0.85rem;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.mark .state {
  font-weight: 600;
}

.mark-yes .state,
.mark-yes .mark-glyph { color: var(--ok); }
.mark-partial .state,
.mark-partial .mark-glyph { color: var(--partial); }
.mark-no .state,
.mark-no .mark-glyph,
.mark-separate .state,
.mark-separate .mark-glyph { color: var(--no); }

.exceed-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  max-width: 12rem;
}

.source-note {
  margin: 0;
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.source-note a {
  color: var(--text-muted);
}

/* Lisp / contract */
.contract-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.contract-list li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0a0a;
}

.contract-list li > span {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--mono);
}

.contract-list strong {
  display: block;
  margin-bottom: 0.25rem;
}

.contract-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* GitHub */
.github-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.github-layout h2 {
  margin: 0 0 0.5rem;
}

.github-layout > div > p {
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}

.github-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #0a0a0a;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Closing */
.closing {
  padding: 3.5rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.closing-inner {
  max-width: 36rem;
}

.closing-mark {
  margin: 0 auto 1rem;
  border-radius: 16px;
}

.closing h2 {
  margin: 0 0 1.1rem;
  font-size: 1.5rem;
}

.closing-command {
  text-align: left;
  margin-bottom: 0.85rem;
}

.closing-caveat {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.footer-brand p {
  margin: 0.75rem 0 0;
  max-width: 22rem;
  line-height: 1.5;
}

.footer-grid h2 {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-grid a {
  display: block;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
  }

  .hero-logo-col {
    order: -1;
    max-height: 220px;
  }

  .hero-logo {
    max-height: 220px;
    object-fit: contain;
    background: transparent;
    border: none;
  }

  .stat-strip,
  .feature-blocks,
  .lisp-grid {
    grid-template-columns: 1fr 1fr;
  }

  .code-layout,
  .github-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: #0a0a0a;
    border-bottom: 1px solid var(--border);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 560px) {
  .stat-strip,
  .feature-blocks,
  .lisp-grid,
  .github-stats {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

/* Generated matrix class names */
.compat-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.88rem;
}

.compat-table th,
.compat-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  hyphens: auto;
}

/* Capability | Bun | Node | Deno | Clun */
.compat-table th:first-child,
.compat-table td:first-child,
.compat-table tbody th {
  width: 28%;
}

.compat-table thead th:not(:first-child),
.compat-table tbody td {
  width: 18%;
}

.compat-table thead th {
  background: var(--bg-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.compat-table th span {
  display: block;
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compat-table .clun-col {
  background: rgba(124, 156, 255, 0.04);
}

.compat-table .compare-group th {
  background: var(--bg-muted);
  font-size: 0.85rem;
}

.mark-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mark-cell .mark,
.mark-cell .exceed-note {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.exceed-note {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Intro line under Capability matrix — wrap, do not force wide line */
#compatibility .section-intro p {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
