:root {
  --bg: #f2eee5;
  --bg-elevated: #e9e2d6;
  --surface: #f8f5ee;
  --text: #20201c;
  --muted: #777267;
  --quiet: #a39b8d;
  --line: rgba(32, 32, 28, .14);
  --line-strong: rgba(32, 32, 28, .24);
  --accent: #6b6655;
  --signal: #8b7658;
  --shadow: 0 24px 70px rgba(50, 44, 34, .08);
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --shell: min(1180px, calc(100vw - 48px));
  --radius-sm: 10px;
  --radius-md: 18px;
  --section-space: clamp(72px, 10vw, 136px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11110f;
    --bg-elevated: #191914;
    --surface: #171714;
    --text: #ede9df;
    --muted: #9e998e;
    --quiet: #6f6b63;
    --line: rgba(237, 233, 223, .12);
    --line-strong: rgba(237, 233, 223, .22);
    --accent: #b2aa94;
    --signal: #b49870;
    --shadow: 0 28px 90px rgba(0, 0, 0, .24);
  }
}

html[data-theme="light"] {
  --bg: #f2eee5;
  --bg-elevated: #e9e2d6;
  --surface: #f8f5ee;
  --text: #20201c;
  --muted: #777267;
  --quiet: #a39b8d;
  --line: rgba(32, 32, 28, .14);
  --line-strong: rgba(32, 32, 28, .24);
  --accent: #6b6655;
  --signal: #8b7658;
}

html[data-theme="dark"] {
  --bg: #11110f;
  --bg-elevated: #191914;
  --surface: #171714;
  --text: #ede9df;
  --muted: #9e998e;
  --quiet: #6f6b63;
  --line: rgba(237, 233, 223, .12);
  --line-strong: rgba(237, 233, 223, .22);
  --accent: #b2aa94;
  --signal: #b49870;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }
::selection { background: var(--signal); color: var(--bg); }

.shell { width: var(--shell); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 999; transform: translateY(-160%); padding: 10px 14px; border-radius: 8px; background: var(--text); color: var(--bg); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: border-color .25s ease; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; width: max-content; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px color-mix(in srgb, var(--signal) 12%, transparent); }
.primary-nav { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); }
.primary-nav a:hover, .footer-links a:hover { color: var(--text); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.icon-button, .menu-button, .text-button, .name-note, .filter-button { border: 0; background: none; cursor: pointer; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.icon-button:hover { background: var(--bg-elevated); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.menu-button { display: none; padding: 8px 0 8px 12px; font-size: 14px; }

.search-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.search-inner { padding: 22px 0 26px; }
.search-inner > label { display: block; margin-bottom: 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.search-field-wrap { position: relative; display: flex; align-items: center; }
.search-field-wrap svg { position: absolute; left: 0; width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.search-field-wrap input { width: 100%; border: 0; outline: 0; padding: 8px 48px 8px 38px; background: transparent; color: var(--text); font-size: clamp(24px, 4vw, 44px); letter-spacing: -.035em; }
.search-field-wrap input::placeholder { color: var(--quiet); }
kbd { position: absolute; right: 0; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 3px 7px; color: var(--muted); background: var(--surface); font-family: var(--mono); font-size: 11px; }
.search-status { min-height: 18px; margin: 10px 0 0 38px; color: var(--muted); font-size: 13px; }
.mobile-nav { display: none; }

.intro { padding-top: clamp(64px, 8vw, 112px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; }
.intro-copy { max-width: 820px; }
.eyebrow { margin: 0 0 14px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.intro h1 { max-width: 760px; margin: 0; font-family: var(--serif); font-size: clamp(48px, 7.1vw, 96px); font-weight: 400; line-height: .98; letter-spacing: -.055em; }
.intro-text { max-width: 610px; margin: 28px 0 0; color: var(--muted); font-size: clamp(17px, 1.8vw, 20px); line-height: 1.55; letter-spacing: -.015em; }
.name-note { display: inline-flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; white-space: nowrap; }
.name-note:hover { color: var(--text); }
.name-meaning { grid-column: 1 / -1; max-width: 620px; margin-top: -10px; padding: 18px 0 0; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.6; }
.name-meaning p { margin: 0; }
.name-meaning strong { color: var(--text); }

.section { padding-top: var(--section-space); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 32px; }
.section-heading h2 { margin: 0; font-size: clamp(31px, 4vw, 48px); font-weight: 500; letter-spacing: -.04em; }
.section-heading > p { max-width: 360px; margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.feature-grid { display: grid; grid-template-columns: 1.28fr .72fr; grid-template-rows: repeat(2, minmax(230px, auto)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.feature { position: relative; min-height: 260px; padding: clamp(24px, 3vw, 38px); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: var(--surface); transition: background .3s ease, transform .3s ease; }
.feature-wide { grid-row: 1 / span 2; min-height: 520px; background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 96%, var(--signal)), var(--surface)); }
.feature:hover { background: var(--bg-elevated); }
.feature-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.feature-body { position: relative; z-index: 2; max-width: 440px; }
.feature-kicker { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.feature h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4vw, 58px); letter-spacing: -.035em; }
.feature p { max-width: 350px; margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.feature-arrow { position: absolute; right: clamp(24px, 3vw, 38px); bottom: clamp(24px, 3vw, 38px); font-size: 20px; color: var(--muted); transition: transform .25s ease, color .25s ease; }
.feature:hover .feature-arrow { transform: translate(3px, -3px); color: var(--text); }
.orbit-mark { position: absolute; inset: 20% auto auto 42%; width: 320px; height: 320px; opacity: .22; transform: rotate(-12deg); }
.orbit-mark i { position: absolute; inset: 0; border: 1px solid var(--signal); border-radius: 50%; }
.orbit-mark i:nth-child(2) { inset: 38px -10px; transform: rotate(64deg); }
.orbit-mark i:nth-child(3) { inset: 80px 52px; transform: rotate(112deg); }

.browse-heading { align-items: end; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.filter-button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.filter-button:hover, .filter-button.is-active { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.category-list { border-top: 1px solid var(--line-strong); }
.category-row { display: grid; grid-template-columns: 44px minmax(150px, .65fr) minmax(220px, 1.4fr) 88px 20px; align-items: center; gap: 18px; min-height: 92px; border-bottom: 1px solid var(--line); transition: padding .22s ease, background .22s ease; }
.category-row:hover { padding-inline: 12px; background: color-mix(in srgb, var(--surface) 65%, transparent); }
.category-index, .category-count { color: var(--quiet); font-family: var(--mono); font-size: 11px; }
.category-name { font-family: var(--serif); font-size: clamp(22px, 2.3vw, 29px); letter-spacing: -.025em; }
.category-description { color: var(--muted); font-size: 14px; }
.category-count { text-align: right; text-transform: uppercase; letter-spacing: .08em; }
.category-arrow { color: var(--muted); }
.empty-state { padding: 36px 0; color: var(--muted); }

.recent-list { border-top: 1px solid var(--line-strong); }
.recent-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) 120px 20px; gap: 22px; align-items: center; min-height: 74px; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent-item:hover .recent-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.recent-item time, .recent-type { color: var(--muted); font-size: 12px; }
.recent-title { font-size: 16px; }
.recent-item > span:last-child { color: var(--muted); }

.field-note { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.field-line { width: 100%; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.field-note p { max-width: 700px; margin: 22px 0 0; color: var(--muted); font-family: var(--serif); font-size: clamp(21px, 2.5vw, 30px); line-height: 1.4; }
.field-note p span { display: block; margin-bottom: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--quiet); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 120px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; color: var(--muted); font-size: 12px; }
.footer-inner > p:first-child { color: var(--text); font-weight: 600; }
.footer-links { display: flex; gap: 24px; }
.text-button { padding: 0; color: var(--muted); }
.text-button:hover { color: var(--text); }
.footer-status { justify-self: end; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }

.is-search-hidden, .is-filter-hidden { display: none !important; }

/* Supporting pages */
.page-main { padding: clamp(56px, 8vw, 100px) 0 var(--section-space); }
.page-kicker { margin-bottom: 18px; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.page-title { max-width: 880px; margin: 0; font-family: var(--serif); font-size: clamp(52px, 8vw, 100px); font-weight: 400; line-height: .98; letter-spacing: -.055em; }
.page-lede { max-width: 680px; margin: 30px 0 0; color: var(--muted); font-size: 19px; line-height: 1.6; }
.page-rule { margin: clamp(54px, 8vw, 96px) 0 0; border: 0; border-top: 1px solid var(--line-strong); }
.content-shell { max-width: 850px; }
.content-section { padding-top: 58px; }
.content-section h2 { margin: 0 0 18px; font-size: 26px; letter-spacing: -.025em; }
.content-section p, .content-section li { color: var(--muted); line-height: 1.7; }
.placeholder-box { margin-top: 24px; padding: 30px; border: 1px dashed var(--line-strong); background: color-mix(in srgb, var(--surface) 62%, transparent); }
.placeholder-box strong { display: block; margin-bottom: 6px; color: var(--text); }
.entry-list { margin-top: 28px; border-top: 1px solid var(--line-strong); }
.entry { display: grid; grid-template-columns: 100px 1fr auto; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.entry .entry-tag, .entry time { color: var(--quiet); font-family: var(--mono); font-size: 11px; }
.entry h3 { margin: 0 0 6px; font-size: 17px; }
.entry p { margin: 0; font-size: 14px; }
.back-link { display: inline-flex; gap: 9px; align-items: center; margin-top: 56px; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--text); }

/* Shared planning page */
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr); gap: 58px; align-items: start; margin-top: 70px; }
.workspace-card { padding: 24px 0; border-top: 1px solid var(--line-strong); }
.workspace-card h2 { margin: 0 0 8px; font-size: 18px; }
.workspace-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.workspace-card input, .workspace-card textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: var(--surface); color: var(--text); outline: none; }
.workspace-card input:focus, .workspace-card textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 12%, transparent); }
.workspace-card textarea { min-height: 110px; resize: vertical; }
.action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin-top: 10px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--text); color: var(--bg); cursor: pointer; }
.link-list { list-style: none; padding: 0; margin: 16px 0 0; }
.link-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.link-list a { text-decoration: underline; text-underline-offset: 3px; }
.delete-link { border: 0; background: none; color: var(--muted); cursor: pointer; }
.local-note { padding: 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }

@media (max-width: 820px) {
  :root { --shell: min(100% - 32px, 720px); --section-space: 82px; }
  .header-inner { height: 64px; grid-template-columns: 1fr auto; }
  .primary-nav { display: none; }
  .menu-button { display: block; }
  .mobile-nav { display: grid; gap: 0; padding: 0 16px 16px; background: var(--bg); border-top: 1px solid var(--line); }
  .mobile-nav a { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .intro { grid-template-columns: 1fr; align-items: start; }
  .name-note { justify-self: start; }
  .section-heading { align-items: start; flex-direction: column; gap: 18px; }
  .section-heading > p { max-width: 100%; }
  .feature-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .feature-wide { grid-row: auto; min-height: 390px; }
  .feature { min-height: 235px; }
  .orbit-mark { width: 260px; height: 260px; inset: 17% auto auto 46%; }
  .browse-heading { align-items: stretch; }
  .filter-row { justify-content: flex-start; }
  .category-row { grid-template-columns: 34px 1fr 18px; gap: 12px; min-height: 86px; padding: 14px 0; }
  .category-description, .category-count { display: none; }
  .recent-item { grid-template-columns: 90px 1fr 18px; gap: 14px; min-height: 72px; }
  .recent-type { display: none; }
  .footer-inner { grid-template-columns: 1fr auto; padding: 26px 0; }
  .footer-links { grid-column: 1 / -1; grid-row: 2; }
  .footer-status { grid-column: 2; grid-row: 1; }
  .workspace-grid { grid-template-columns: 1fr; gap: 30px; }
  .entry { grid-template-columns: 1fr auto; }
  .entry .entry-tag { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  :root { --shell: calc(100vw - 28px); }
  .wordmark { font-size: 14px; }
  .icon-button { width: 36px; height: 36px; }
  .menu-button { padding-left: 8px; }
  .intro { padding-top: 48px; }
  .intro h1 { font-size: clamp(44px, 15vw, 68px); }
  .intro-text { margin-top: 22px; font-size: 17px; }
  .feature-grid { border-left: 0; border-top: 1px solid var(--line-strong); }
  .feature { border-right: 0; padding: 24px 0; background: transparent; }
  .feature:hover { background: transparent; }
  .feature-wide { min-height: 360px; }
  .feature-arrow { right: 0; bottom: 24px; }
  .orbit-mark { right: -100px; left: auto; }
  .filter-row { gap: 5px; }
  .filter-button { padding: 6px 10px; }
  .search-inner { padding-top: 18px; }
  .search-field-wrap input { font-size: 28px; }
  .search-field-wrap kbd { display: none; }
  .recent-item { grid-template-columns: 78px 1fr 16px; }
  .recent-item time { font-size: 10px; }
  .footer-status { display: none; }
  .footer-inner { display: block; }
  .footer-links { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Content-managed media and native entry pages */
.feature { overflow: hidden; }
.feature-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; filter: saturate(.72) contrast(1.04); transition: transform .45s ease, opacity .3s ease; }
.feature:hover .feature-image { transform: scale(1.018); opacity: .34; }
.feature-image ~ .feature-meta, .feature-image ~ .feature-body, .feature-image ~ .feature-arrow { position: relative; z-index: 2; }
.entry h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.entry-hero { margin-top: 46px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); max-height: 620px; overflow: hidden; }
.entry-hero img { display: block; width: 100%; max-height: 620px; object-fit: cover; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 42px; }
.prose h3 { margin: 34px 0 10px; font-size: 20px; }
.prose p, .prose li { color: var(--muted); font-size: 16px; line-height: 1.78; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.prose img { display: block; max-width: min(100%, 920px); height: auto; margin: 34px 0; border: 1px solid var(--line); }
.prose blockquote { margin: 32px 0; padding: 2px 0 2px 22px; border-left: 1px solid var(--signal); color: var(--muted); font-size: 18px; line-height: 1.65; }
.prose code { padding: 2px 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-family: var(--mono); font-size: .88em; }
.attachment-box { max-width: 760px; margin-top: 44px; padding: 22px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.attachment-box a { display: flex; justify-content: space-between; gap: 20px; margin-top: 8px; font-size: 15px; }
.content-error { width: 100%; padding: 22px; border: 1px dashed var(--line-strong); color: var(--muted); line-height: 1.55; }
.content-error strong, .content-error span { display: block; }
.content-error strong { margin-bottom: 5px; color: var(--text); }
.empty-state { color: var(--quiet); font-family: var(--mono); font-size: 12px; }
.footer-links a[rel="nofollow"] { color: var(--quiet); }

@media (max-width: 520px) {
  .entry-hero { margin-top: 34px; }
  .prose p, .prose li { font-size: 15px; }
}
