:root {
  --ink: #0f1115;
  --surface: #171a21;
  --surface-alt: #12141a;
  --line: #262b35;
  --text: #e8e6e1;
  --muted: #8b8f98;
  --accent: #e0a458;
  --sidebar-w: 240px;
}

[data-theme="light"] {
  --ink: #f7f5f0;
  --surface: #ffffff;
  --surface-alt: #efece5;
  --line: #ddd7cb;
  --text: #1f1c17;
  --muted: #6b6558;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.65;
  transition: background-color 0.15s ease, color 0.15s ease;
}


.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  background: var(--surface-alt);
  border-right: 1px solid var(--line);
  padding: 2rem 1.5rem;
}

.brand {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.utility-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.utility-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.brand-sub {
  color: var(--accent);
}

.nav-group {
  margin-bottom: 1.75rem;
}

.nav-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.nav-link {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.35rem 0;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--accent);
}


.content {
  margin-left: var(--sidebar-w);
  max-width: 780px;
  padding: 4rem 3rem 6rem;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 2.5rem;
}

.demo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.demo-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.preview-canvas {
  position: relative;
  width: 100%;
  height: 180px;
  background: #1a1d24;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(232, 230, 225, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 230, 225, 0.04) 1px, transparent 1px);
  background-size: 12px 12px;
}

.preview-square {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 70px;
  height: 70px;
  background: rgba(224, 164, 88, 0.18);
  border: 2px solid var(--accent);
  border-radius: 10px;
  cursor: grab;
  box-shadow: 0 0 0 4px rgba(224, 164, 88, 0.06);
}

.preview-square.dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 4px rgba(224, 164, 88, 0.14);
}

.preview-caption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
}


.section {
  padding-top: 3.5rem;
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
}

.section h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  color: var(--accent);
  margin: 1.75rem 0 0.6rem;
}

.shape-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.shape-details summary {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  color: var(--text);
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-alt);
  user-select: none;
}

.shape-details summary::-webkit-details-marker {
  display: none;
}

.shape-details summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}

.shape-details[open] summary::after {
  transform: rotate(45deg);
}

.shape-details summary:hover {
  color: var(--accent);
}

.shape-details > *:not(summary) {
  margin-left: 1.2rem;
  margin-right: 1.2rem;
}

.shape-details > pre.code-block {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.shape-details > .param-table {
  width: calc(100% - 2.4rem);
  margin-bottom: 1rem;
}

.shape-details > p {
  margin-top: 0;
  padding-bottom: 1.2rem;
}

.section p {
  color: var(--muted);
  max-width: 68ch;
}

.section p strong {
  color: var(--text);
}

.section code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: var(--text);
}

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

.gotcha-list {
  list-style: none;
  padding: 0;
  color: var(--muted);
  max-width: 68ch;
}

.gotcha-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.gotcha-list li:last-child {
  border-bottom: none;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.85rem;
}

.param-table th {
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.param-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

.param-table td:first-child {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  white-space: nowrap;
}

.param-table td:nth-child(2) {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text);
  white-space: nowrap;
}

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


.code-block {
  background: #171a21;
  border: 1px solid #262b35;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
}

.code-block code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e8e6e1;
  background: none;
  border: none;
  padding: 0;
  white-space: pre;
}

.tab-toggle {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 0.5rem;
}

.tab-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  padding: 0.35rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  color: #171a21;
  border-color: var(--accent);
}

.c-kw { color: var(--accent); }
.c-class { color: #7fb3d5; }
.c-string { color: #9bc99b; }
.c-number { color: #d19a66; }
.c-comment { color: #6b7280; font-style: italic; }
.c-tag { color: #6b7280; }


.foot {
  display: flex;
  justify-content: space-between;
  padding-top: 3rem;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.foot-dim {
  opacity: 0.6;
}


@media (max-width: 900px) {
  .demo-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .content {
    margin-left: 0;
    padding: 2.5rem 1.5rem 4rem;
  }
  .nav-group {
    display: inline-block;
    margin-right: 1.5rem;
  }
}

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