/* Flesh · Bones · Marrow — shared presentation and navigation layer */

:root {
  --nav-height: 78px;
  --nav-shadow: 0 16px 38px oklch(10% 0.01 60 / 0.08);
}

html {
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  letter-spacing: 0.008em;
  word-spacing: 0.038em;
}

p,
li,
blockquote {
  letter-spacing: 0.011em;
  word-spacing: 0.045em;
}

.site-nav {
  box-sizing: border-box;
  position: sticky !important;
  top: 0;
  z-index: 100;
  min-height: var(--nav-height);
  height: 78px !important;
  width: 100%;
  padding: 0.55rem clamp(1rem, 3vw, 2rem) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  border-bottom: 1px solid var(--line) !important;
  background: oklch(from var(--bg) l c h / 0.94) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-link {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  line-height: 0;
}

.brand-logo {
  display: block;
  width: clamp(168px, 18vw, 205px);
  height: auto;
}

.brand-logo--paper {
  display: none;
}

[data-theme="dark"] .brand-logo--ink {
  display: none;
}

[data-theme="dark"] .brand-logo--paper {
  display: block;
}

.nav-menu {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.35rem !important;
}

.nav-menu .nav-link {
  min-height: 44px;
  padding: 0.65rem 0.8rem !important;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  width: 19px;
  height: 1px;
  display: block;
  position: relative;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-lines::before { top: -6px; }
.menu-toggle-lines::after { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-lines {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Homepage: retain contemplative transitions without making content feel absent. */
body.home-page .skin {
  padding: clamp(2.8rem, 7vw, 4.3rem) 0 clamp(2.4rem, 5vw, 3.4rem) !important;
}

body.home-page .threshold {
  padding: clamp(2rem, 5vw, 3.25rem) 0 !important;
}

body.home-page .flesh {
  padding-bottom: clamp(2.3rem, 5vw, 3.3rem) !important;
}

body.home-page .bones-section {
  padding: clamp(3.2rem, 7vw, 4.5rem) 0 !important;
}

body.home-page .marrow {
  padding: clamp(3.5rem, 8vw, 5rem) 0 clamp(3rem, 6vw, 4rem) !important;
}

body.home-page .contact {
  padding: clamp(3rem, 7vw, 4.25rem) 0 !important;
}

body.home-page .skin .lead,
body.home-page .skin .sub,
body.home-page .flesh p,
body.home-page .bones-desc,
body.home-page .marrow-text,
body.home-page .entry-blurb,
body.home-page .contact .line,
body.home-page .contact .note {
  letter-spacing: 0.012em;
  word-spacing: 0.05em;
}

.corpus-note {
  margin-top: 1rem;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  line-height: 1.7;
  letter-spacing: 0.07em;
  word-spacing: normal;
  color: var(--muted);
}

.corpus-note a {
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}

/* Shared static essay pages */
.static-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

.essay-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(2.8rem, 7vw, 5rem) clamp(1.35rem, 5vw, 3rem) 5rem;
}

.essay-kicker,
.essay-byline,
.layer-kicker {
  font-family: "DM Mono", monospace;
  text-transform: lowercase;
  letter-spacing: 0.13em;
  word-spacing: normal;
  color: var(--muted);
}

.essay-kicker {
  margin-bottom: 1.1rem;
  font-size: 0.64rem;
}

.essay-title {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 4.3rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.018em;
  word-spacing: 0.02em;
  color: var(--fg-strong, var(--fg));
  text-wrap: balance;
}

.essay-deck {
  max-width: 36ch;
  margin-top: 1.4rem;
  font-size: clamp(1.06rem, 2.5vw, 1.22rem);
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
}

.essay-byline {
  margin-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.6rem;
}

.prose {
  padding-top: 2.8rem;
  font-size: 1.08rem;
  line-height: 1.82;
}

.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.006em;
}

.prose h3 {
  margin-top: 2.5rem;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.3;
}

.prose hr {
  width: 3rem;
  margin: 3.5rem auto;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose blockquote {
  margin: 2rem 0;
  padding-left: 1.3rem;
  border-left: 1px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose ol,
.prose ul {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.8rem;
}

.prose table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.prose th {
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.official-story {
  max-width: 68ch;
}

.quadrum-intro {
  margin: 3.5rem 0 1.5rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quadrum-intro p {
  max-width: 55ch;
  color: var(--muted);
  font-style: italic;
}

.quadrum-layer {
  margin-top: 0 !important;
  padding: clamp(2.7rem, 7vw, 4rem) 0;
  border-bottom: 1px solid var(--line);
}

.quadrum-layer:last-of-type {
  border-bottom: 0;
}

.layer-heading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.4rem !important;
}

.layer-symbol {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
}

.layer-heading span {
  font-family: "DM Mono", monospace;
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: lowercase;
}

.quadrum-layer--flesh {
  max-width: 610px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.quadrum-layer--flesh p {
  font-size: 1.16rem;
  line-height: 1.9;
  font-style: italic;
}

.quadrum-layer--bones ol {
  padding-left: 0;
  list-style: none;
  counter-reset: bones;
}

.quadrum-layer--bones li {
  counter-increment: bones;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.quadrum-layer--bones li::before {
  content: counter(bones, decimal-leading-zero);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  color: var(--muted);
}

.quadrum-layer--marrow {
  max-width: 620px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.quadrum-layer--marrow p {
  line-height: 1.92;
}

.next-reading {
  margin-top: 3.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.next-reading small {
  display: block;
  margin-bottom: 0.5rem;
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.next-reading a {
  font-size: 1.45rem;
  font-style: italic;
  color: var(--accent);
}

.site-footer {
  padding: 1.6rem clamp(1rem, 3vw, 2rem);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
}

/* Archive */
.archive-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.35rem, 5vw, 3rem) 5rem;
}

.archive-intro {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.archive-list {
  list-style: none;
}

.archive-item a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.archive-item a:hover .archive-title {
  color: var(--accent);
}

.archive-title {
  display: block;
  font-size: 1.35rem;
  line-height: 1.25;
  font-style: italic;
  transition: color 160ms ease;
}

.archive-blurb {
  display: block;
  margin-top: 0.35rem;
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
  word-spacing: normal;
  color: var(--muted);
}

.archive-date {
  padding-top: 0.2rem;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 760px) {
  :root { --nav-height: 66px; }

  .site-nav {
    min-height: var(--nav-height);
    height: 66px !important;
    padding: 0.45rem 0.8rem !important;
  }

  .brand-logo {
    width: 158px;
  }

  .menu-toggle {
    display: grid;
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 1px);
    right: 0.75rem;
    width: min(15rem, calc(100vw - 1.5rem));
    padding: 0.55rem !important;
    display: none !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 0 !important;
    border: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--nav-shadow);
  }

  .nav-menu.is-open {
    display: flex !important;
  }

  .nav-menu .nav-link,
  .nav-menu .theme-btn {
    width: 100% !important;
    min-height: 46px;
    justify-content: flex-start !important;
    padding: 0.7rem 0.85rem !important;
  }

  .nav-menu .theme-btn::after {
    content: "appearance";
    margin-left: 0.75rem;
    font-family: "DM Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.09em;
    color: var(--muted);
  }

  body.home-page .skin h1 {
    font-size: clamp(2.55rem, 13vw, 3.45rem);
  }

  .essay-shell,
  .archive-shell {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .prose {
    font-size: 1.04rem;
    line-height: 1.78;
  }

  .prose table {
    display: block;
    overflow-x: auto;
  }

  .archive-item a {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .archive-date {
    grid-row: 1;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Compact homepage: orientation first, explanation by choice. */
.home-main {
  width: 100%;
}

.home-hero {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(3.2rem, 8vw, 6rem) clamp(1.35rem, 5vw, 3rem) clamp(2.7rem, 6vw, 4.5rem);
}

.hero-eyebrow,
.section-kicker,
.door-context,
.recent-context {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  line-height: 1.5;
  letter-spacing: 0.13em;
  word-spacing: normal;
  text-transform: lowercase;
  color: var(--muted);
}

.hero-eyebrow {
  margin-bottom: 1.2rem;
}

.hero-title {
  max-width: 12ch;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
  word-spacing: 0;
  color: var(--fg-strong);
  text-wrap: balance;
}

.hero-title--identity {
  max-width: none;
  font-size: clamp(4.25rem, 10vw, 7rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.04em;
}

.hero-title--identity span,
.hero-title--identity em {
  display: block;
}

.hero-title--identity em {
  font-weight: inherit;
  color: var(--accent);
}

.hero-subheading {
  margin-top: clamp(2.6rem, 6vw, 4.2rem);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.008em;
  white-space: nowrap;
}

.hero-tag {
  max-width: 43ch;
  margin-top: 1.5rem;
  font-size: clamp(1.12rem, 2.5vw, 1.3rem);
  line-height: 1.65;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.hero-action {
  min-height: 46px;
  padding: 0.72rem 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  word-spacing: normal;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hero-action--primary {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.hero-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-action--primary:hover {
  background: var(--accent);
  color: var(--bg);
}

.home-section {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(2.8rem, 6vw, 4.5rem) clamp(1.35rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 18ch;
  margin-top: 0.55rem;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--fg-strong);
}

.door-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2rem;
  background: var(--line);
  border: 1px solid var(--line);
}

.door-intro {
  max-width: 58ch;
  margin-top: 1.1rem;
  font-size: 1.05rem;
  line-height: 1.68;
  color: var(--muted);
}

.door {
  min-height: 250px;
  padding: clamp(1.35rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: background 180ms ease, color 180ms ease;
}

.door:hover {
  background: var(--bg-soft, var(--faint));
}

.door-title {
  margin-top: 1rem;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -0.008em;
}

.door-blurb {
  margin-top: 0.9rem;
  font-size: 0.96rem;
  line-height: 1.62;
  color: var(--muted);
}

.door-arrow {
  margin-top: auto;
  padding-top: 1.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  color: var(--accent);
}

.recent-list {
  margin-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.recent-item {
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.recent-title {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.25;
  transition: color 160ms ease;
}

.recent-item:hover .recent-title {
  color: var(--accent);
}

.recent-date {
  padding-top: 0.2rem;
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  word-spacing: normal;
  color: var(--muted);
  white-space: nowrap;
}

.section-link {
  margin-top: 1.2rem;
  display: inline-block;
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  word-spacing: normal;
  color: var(--accent);
}

.depth-intro {
  max-width: 55ch;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.68;
}

.depth-key {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.depth-item {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.depth-item svg {
  width: 30px;
  height: 30px;
  display: block;
  margin-bottom: 1rem;
}

.depth-name {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  word-spacing: normal;
  text-transform: lowercase;
}

.depth-function {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.home-context {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}

.home-context-copy {
  max-width: 55ch;
  margin-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.72;
  color: var(--muted);
}

.contact-address {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .home-hero {
    padding-top: 3.2rem;
  }

  .hero-title {
    max-width: 11ch;
  }

  .hero-title--identity {
    max-width: none;
    font-size: clamp(3.7rem, 19vw, 5.2rem);
  }

  .hero-subheading {
    margin-top: 2.6rem;
    font-size: clamp(1.18rem, 6vw, 1.45rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .door-grid {
    grid-template-columns: 1fr;
  }

  .door {
    min-height: 0;
  }

  .depth-key {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-context {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
