:root {
  color-scheme: light;
  --bg: #f4efe6;
  --bg-accent: #ece4d6;
  --surface: #fffdf8;
  --surface-hover: #f7f1e6;
  --ink: #1d1914;
  --muted: #5d564c;
  --line: #d8cfc0;
  --accent: #0f5c4c;
  --accent-soft: #d7efe7;
  --badge: #8a4b12;
  --badge-bg: #f3dfc7;
  --shadow: 0 10px 30px rgb(29 25 20 / 0.06);
  --radius: 18px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 68rem;
  --prose: 42rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110e;
  --bg-accent: #1c1814;
  --surface: #1e1a16;
  --surface-hover: #27221c;
  --ink: #f0e8db;
  --muted: #b3a898;
  --line: #3a332b;
  --accent: #8fd9c0;
  --accent-soft: #204038;
  --badge: #f0c48a;
  --badge-bg: #3a2c18;
  --shadow: 0 12px 32px rgb(0 0 0 / 0.28);
}

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

html {
  font-size: 112.5%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 420px at 10% -10%, var(--bg-accent), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.5rem 0.8rem;
  background: var(--surface);
  border-radius: 8px;
}

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

.wrap {
  width: min(var(--measure), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner,
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-inner {
  justify-content: space-between;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.brand-tagline {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
}

[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

.site-main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.hero {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
}

.hero h1,
.hub-header h1,
.not-found h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.byline {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.byline a {
  color: inherit;
  font-weight: 600;
}

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

.hero .byline {
  margin-bottom: 1rem;
}

.lede,
.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: 1.15rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.idea-card {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}

.idea-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  height: 100%;
  padding: 1.2rem 1.25rem 1.15rem;
  color: inherit;
  text-decoration: none;
}

.card-link h2 {
  margin: 0;
  font-size: 1.4rem;
}

.card-link p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.card-meta,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge);
  font-size: 0.75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
}

.file-count {
  white-space: nowrap;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.crumbs a {
  color: inherit;
}

.hub-header {
  margin-bottom: 1.75rem;
}

.hub-header .tags {
  margin-top: 0.9rem;
}

.prose {
  max-width: var(--prose);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin-top: 2rem;
}

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

.prose pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--bg-accent);
  border: 1px solid var(--line);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--bg-accent);
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose img {
  border-radius: 12px;
  border: 1px solid var(--line);
}

.related {
  margin-top: 2.75rem;
}

.related h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.file-list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.file-list a:hover {
  background: var(--surface-hover);
}

.file-title {
  font-weight: 600;
}

.file-summary {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state,
.not-found {
  max-width: 38rem;
}

.empty-state {
  padding: 1.5rem 0;
}

.text-link {
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer code,
.empty-state code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

@media (max-width: 640px) {
  .brand-tagline {
    display: none;
  }

  .site-main {
    padding-top: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .idea-card {
    transition: none;
  }
}
