:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-alt: #f0f0ec;
  --border: #111111;
  --text: #111111;
  --muted: #5d5d57;
  --accent: #111111;
  --shadow: 0 12px 28px rgba(17, 17, 17, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body {
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--muted);
}

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

h1,
h2,
h3 {
  margin: 0 0 0.8rem;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.1rem;
}

p,
ul {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  padding: 0.15em 0.4em;
  background: var(--surface-alt);
  border-radius: 6px;
  font-family: "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 0.92em;
}

.site-shell {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 3rem;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0 1.2rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
}

.header-spacer {
  min-width: 220px;
  min-height: 1px;
}

.brand {
  display: inline-block;
  min-width: 220px;
  font-family: "Courier New", monospace;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.94;
  color: var(--text);
}

.brand .typing-line {
  display: block;
  white-space: nowrap;
}

.brand .typing-line span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.15rem);
}

.brand .typing-line span.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.brand .typing-line.line2::after {
  content: "|";
  opacity: 0;
  animation: caretBlink 1s step-end infinite;
  animation-delay: 1.25s;
}

.brand.is-ready .typing-line span {
  visibility: visible;
  opacity: 1;
}

.brand.is-ready .typing-line.line2::after {
  opacity: 1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-self: center;
  padding-top: 0;
}

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

.site-nav a.active {
  color: var(--text);
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.page-main {
  padding-top: 2rem;
}

.right-column-flow {
  display: grid;
}

.right-column-flow .section:first-child {
  padding-top: 0;
}

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  padding: 1rem 0 2.25rem;
}

.hero-identity,
.hero-summary {
  display: grid;
  align-content: start;
}

.hero-identity {
  gap: 0.8rem;
}

.hero-summary {
  gap: 0.45rem;
  padding-top: 0;
}

.hero-section-title {
  margin-bottom: 0;
}

.hero h1 {
  margin-bottom: 0;
}

.hero-brand {
  min-width: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 0.94;
}

.hero-role {
  max-width: 24ch;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
  color: var(--muted);
}

.hero-avatar {
  width: 108px;
  height: 108px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid rgba(17, 17, 17, 0.16);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-copy {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.social-links a {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
}

.social-links a:hover,
.social-links a:focus {
  color: var(--text);
  border-color: rgba(17, 17, 17, 0.3);
}

.section {
  padding: 1.4rem 0 0;
}

.section + .section {
  margin-top: 1.2rem;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
}

.section-title {
  margin-bottom: 0.9rem;
}

.category-grid,
.info-grid {
  display: grid;
  gap: 1rem;
}

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

.category-card,
.content-card,
.empty-card,
.template-note {
  padding: 1.15rem;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.category-card strong,
.content-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.category-card span,
.content-card span,
.content-card p,
.empty-card,
.muted-text {
  color: var(--muted);
}

.content-stack {
  display: grid;
  gap: 1rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-links {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.inline-links li + li {
  margin-top: 0.55rem;
}

.inline-links a,
.template-link {
  text-decoration: underline;
}

.page-lead {
  max-width: 62ch;
  color: var(--muted);
}

.category-page-head {
  margin-bottom: 1.5rem;
}

.empty-card {
  max-width: 62ch;
}

.back-link {
  display: inline-flex;
  margin-top: 1.2rem;
  color: var(--muted);
  text-decoration: underline;
}

.template-content h2 {
  margin-top: 2rem;
}

.template-content h3 {
  margin-top: 1.35rem;
}

.template-callout {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes caretBlink {
  from,
  to {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

body.dark-mode {
  --bg: #0e0e0d;
  --surface: #151514;
  --surface-alt: #1d1d1b;
  --border: #efefeb;
  --text: #efefeb;
  --muted: #bbbbaf;
  --accent: #efefeb;
  --shadow: none;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 2.5rem;
  }

  .hero-summary {
    padding-top: 0.1rem;
  }

  .right-column-flow {
    margin-left: calc(clamp(260px, 32vw, 340px) + 2.5rem);
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 1.2rem, 100%);
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .site-nav {
    justify-self: start;
  }

  .site-nav {
    gap: 0.75rem;
  }

  .theme-toggle {
    justify-self: start;
  }

  .header-spacer {
    display: none;
  }
}
