/* ── Mere site — shared design system ─────────────────────────────────────── */

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

:root {
  --bg:        #080808;
  --bg-card:   rgba(255,255,255,0.03);
  --bg-code:   #0d0d12;
  --border:    #1e1e2e;
  --text:      #e8e8f0;
  --muted:     #8888a0;
  --accent:    #60a5fa;
  --accent-dim: rgba(96,165,250,0.08);
  --accent-dim2: rgba(96,165,250,0.15);
  --green:     #7ee787;
  --orange:    #f0b060;
  --radius:    6px;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Grid background ──────────────────────────────────────────────────────── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

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

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,8,8,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}

nav .logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.3px;
}

nav .logo span {
  color: var(--accent);
}

nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

nav a:hover {
  color: var(--text);
  background: var(--bg-card);
}

nav a.active {
  color: var(--accent);
}

/* ── Typography ───────────────────────────────────────────────────────────── */

h1 {
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text);
}

h2 {
  font-family: var(--mono);
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 16px;
}

h3 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  max-width: 64ch;
}

p + p { margin-top: 12px; }

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

/* ── Label pill ───────────────────────────────────────────────────────────── */

.label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim2);
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 20px;
}

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

code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.cm  { color: var(--muted); }           /* comment */
.ct  { color: var(--green); }           /* tag name */
.ca  { color: var(--accent); }          /* attribute name */
.cv  { color: var(--orange); }          /* attribute value */
.ck  { color: #c084fc; }               /* sigil keyword */

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dim2);
}

/* ── Grid layouts ─────────────────────────────────────────────────────────── */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* ── Workbook frame ───────────────────────────────────────────────────────── */

.workbook-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.workbook-frame iframe {
  width: 100%;
  height: 480px;
  border: none;
  display: block;
}

.workbook-frame .frame-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.workbook-frame .frame-label span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.workbook-frame .frame-label a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.workbook-frame .frame-label a:hover {
  color: var(--accent);
}

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

section { padding: 80px 0; }
section + section { border-top: 1px solid var(--border); }
section.tight { padding: 48px 0; }

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

.hero {
  padding: 100px 0 80px;
  text-align: left;
}

.hero h1 {
  margin-bottom: 20px;
}

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

.hero .tagline {
  font-size: 18px;
  color: var(--muted);
  max-width: 54ch;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: #93c5fd;
  text-decoration: none;
}

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

.btn-ghost:hover {
  border-color: var(--accent-dim2);
  background: var(--accent-dim);
  text-decoration: none;
}

/* ── Table ────────────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  color: var(--muted);
}

td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

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

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}

footer .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

footer .wordmark {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

footer .wordmark span { color: var(--accent); }

footer nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 0 12px;
}

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

/* ── Spec page specifics ──────────────────────────────────────────────────── */

.sigil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.sigil-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.sigil-card .sym {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.sigil-card .name {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.sigil-card p {
  font-size: 13px;
  line-height: 1.55;
  max-width: none;
}

/* ── Commitment list ──────────────────────────────────────────────────────── */

.commitments {
  list-style: none;
  display: grid;
  gap: 2px;
  margin-top: 24px;
}

.commitments li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 15px;
}

.commitments li .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 2px;
}

.commitments li strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Step list (get started) ──────────────────────────────────────────────── */

.steps {
  list-style: none;
  display: grid;
  gap: 24px;
  counter-reset: step;
  margin-top: 32px;
}

.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.steps li .step-body h3 { margin-bottom: 8px; }
.steps li .step-body pre { margin-top: 12px; }
