@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --blush: #47333a;
  --blush-dark: #5c424d;
  --cream: #141011;
  --elevated: #1c171a;
  --ink: #f5edf0;
  --ink-muted: #b8a8ad;
  --accent: #db94ab;
  --card: #2b2429;
  --border: #4d3d45;
  --header-height: 4.25rem;
  --page: 72rem;
  --font-display: "EB Garamond", "Times New Roman", Times, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--cream);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

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

a:hover {
  color: var(--ink);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--accent);
  color: #1c171a;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
  color: #1c171a;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  background: color-mix(in srgb, var(--cream) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-height);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
}

.wordmark img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
}

.wordmark:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1.35rem;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

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

.hero {
  position: relative;
  padding: 4.5rem 0 1rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8rem;
  width: 46rem;
  height: 32rem;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  pointer-events: none;
}

.hero-inner,
.chapter-inner {
  position: relative;
  text-align: center;
}

.hero-mark {
  width: 7rem;
  height: 7rem;
  margin: 0 auto 1.5rem;
  border-radius: 1.6rem;
}

.kicker {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 34rem;
  margin: 1.35rem auto 0;
  color: var(--ink-muted);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
}

.stage-wrap {
  position: relative;
  margin-top: 3.5rem;
}

.window {
  margin: 0 auto;
  max-width: 52rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-align: left;
}

.window-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 70%, var(--elevated));
}

.titlebar img {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 0.25rem;
}

.titlebar-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.status {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: 0.05em;
}

.window-body {
  display: grid;
  grid-template-columns: 11.5rem 1fr;
  min-height: 18rem;
}

.sidebar {
  padding: 1rem 0.75rem;
  background: var(--cream);
  border-right: 1px solid var(--border);
}

.sidebar-label,
.shelf-label,
.panel-kicker,
.thinking {
  margin: 0 0 0.45rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-item {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.sidebar-item.is-current {
  background: var(--blush);
  color: var(--ink);
}

.thread {
  padding: 1.25rem 1.35rem 1.5rem;
}

.bubble {
  margin: 0 0 1.1rem auto;
  max-width: 22rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: var(--blush);
  color: var(--ink);
  font-size: 0.98rem;
}

.reply-title,
.panel-reply h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.reply ul,
.panel-reply ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reply li,
.panel-reply li {
  position: relative;
  margin: 0.28rem 0 0;
  padding-left: 0.95rem;
  color: var(--ink-muted);
}

.reply li::before,
.panel-reply li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
}

.chapter {
  padding: 7.5rem 0;
  scroll-margin-top: calc(var(--header-height) + 0.75rem);
}

.chapter h2 {
  margin: 0 auto 1rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.chapter-inner > p {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 1.15rem;
}

.chapter-inner > p + p {
  margin-top: 1rem;
}

.panel {
  max-width: 32rem;
  margin: 2.25rem auto 0;
  padding: 1.25rem 1.3rem 1.35rem;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.panel-quiet {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
}

.panel-reply h3 {
  margin-top: 0.35rem;
}

.code {
  margin: 0.9rem 0 0;
}

.lede code,
.chapter code,
.reply code,
.panel-reply code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--ink);
}

.code code {
  display: inline-block;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blush) 65%, var(--card));
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.shelf-label {
  margin-top: 0.85rem;
}

.shelf-label:first-child {
  margin-top: 0;
}

.shelf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  color: var(--ink);
}

.shelf-row > span:first-child {
  margin-right: auto;
}

.shelf-action {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
}

.path {
  margin: 0;
  padding: 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
}

.write {
  margin: 0.9rem 0 0;
  color: var(--accent);
  font-weight: 600;
}

.names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.names li {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.92rem;
}

.chapter-quiet {
  padding-top: 2rem;
  padding-bottom: 6rem;
}

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

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-inner p {
  margin: 0;
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.85rem 0;
  }

  .site-nav {
    justify-content: center;
    width: 100%;
  }

  .window-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-label {
    width: 100%;
    margin-bottom: 0.15rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .chapter {
    padding: 5rem 0;
  }

  .display {
    font-size: clamp(3.6rem, 18vw, 5rem);
  }
}
