:root {
  --ink: #0f172a;
  --muted: #475569;
  --rule: #e2e8f0;
  --bg: #ffffff;
  --paper: #fafaf8;
  --accent: #3b82c4;
  --accent-dark: #1a5590;
  --code-bg: #f1f5f9;
  --code-ink: #1e293b;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

header.site {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  z-index: 10;
}
header.site nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
header.site .brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
header.site .brand .logo-mark {
  font-family: 'Patrick Hand', cursive;
  background: var(--ink);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  transform: rotate(-3deg);
  font-size: 18px;
}
header.site nav .links { display: flex; gap: 20px; margin-left: auto; }
header.site nav .links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
header.site nav .links a:hover, header.site nav .links a.active { color: var(--ink); }
header.site nav .links .gh-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
header.site nav .links .gh-icon:hover { background: rgba(0, 0, 0, 0.06); }
header.site nav .links .gh-icon svg { display: block; }
header.site nav .links .gh-star {
  display: inline-flex;
  align-items: center;
  height: 32px;
}
header.site nav .links .gh-star img { display: block; height: 20px; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 96px;
}

.hero {
  padding: 64px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.hero .tagline {
  font-size: 22px;
  color: var(--muted);
  margin: 0 auto 28px;
  max-width: 720px;
  font-style: italic;
}
.hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .cta {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1.5px solid transparent;
}
.hero .cta.primary {
  background: var(--ink);
  color: white;
}
.hero .cta.primary:hover { background: var(--accent-dark); color: white; }
.hero .cta.secondary {
  border-color: var(--rule);
  color: var(--ink);
}
.hero .cta.secondary:hover { border-color: var(--ink); }

section {
  margin-top: 48px;
}

h2 {
  font-size: 28px;
  margin: 56px 0 8px;
  letter-spacing: -0.015em;
  font-weight: 700;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
}

h3 {
  font-size: 19px;
  margin: 32px 0 6px;
  font-weight: 600;
}

p, .note {
  color: var(--muted);
  margin: 8px 0 16px;
}

.lead {
  font-size: 17px;
  margin-bottom: 24px;
}

boceto-view, boceto-edit {
  display: block;
  margin: 12px 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

details {
  margin: 8px 0 28px;
  font-size: 13px;
}
summary {
  cursor: pointer;
  color: var(--accent-dark);
  user-select: none;
  padding: 6px 0;
  font-weight: 500;
}
summary:hover { color: var(--accent); }
pre {
  background: var(--code-bg);
  padding: 14px 18px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 8px 0 0;
  border: 1px solid var(--rule);
}
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.92em;
}
:not(pre) > code {
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.feature {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px;
}
.feature h4 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; font-size: 14px; }

.element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.element-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px;
  background: white;
}
.element-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: ui-monospace, monospace;
  color: var(--ink);
}
.element-card .desc {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 10px;
  min-height: 32px;
}
.element-card boceto-view {
  margin: 0;
  border: 1px dashed var(--rule);
}
.element-card .src {
  font-size: 11px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 6px 8px;
  margin-top: 8px;
  font-family: ui-monospace, monospace;
  overflow-x: auto;
  white-space: nowrap;
}

.category-pill {
  display: inline-block;
  font-size: 11px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 10px;
  margin: 4px 6px 4px 0;
  color: var(--muted);
  font-weight: 500;
}

footer.site {
  border-top: 1px solid var(--rule);
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 96px;
}
footer.site a { color: var(--muted); }

.coming-soon {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 2px dashed var(--rule);
  border-radius: 12px;
  text-align: center;
  padding: 48px;
  color: var(--muted);
  margin-top: 24px;
}
.coming-soon h3 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--ink);
}

.scenarios > article {
  margin: 36px 0 48px;
}
.scenarios > article h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.scenarios > article h3 .num {
  font-family: ui-monospace, monospace;
  color: var(--accent);
  font-weight: 700;
  font-size: 17px;
}

@media (max-width: 720px) {
  .hero h1 { font-size: 36px; }
  .hero .tagline { font-size: 17px; }
  .feature-grid { grid-template-columns: 1fr; }
  header.site nav { gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
  main { padding: 0 16px 64px; }
}
