/* ─── Design tokens ──────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Palette — near-monochromatic */
  --ink:      #0d0d0d;
  --ink-2:    #1a1a1a;
  --secondary:#4a4a4a;
  --tertiary: #888888;
  --subtle:   #b8b8b8;
  --line:     #ebebeb;
  --line-2:   #d8d8d8;
  --paper:    #f8f8f6;
  --white:    #ffffff;

  /* For dark sections */
  --dark-bg:  #1c1a17;
  --dark-2:   #161411;
  --dark-line:rgba(255,255,255,0.09);
  --dark-muted:rgba(240,237,232,0.55);
  --dark-text: #f0ede8;

  /* Depth */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 16px 48px rgba(0,0,0,0.08);

  --radius: 3px;

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  line-height: 1.65;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

/* ─── Typography ─────────────────────────────────────────────────── */
h1, h2, h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  line-height: 1.06;
}

h1 { font-size: clamp(3.2rem, 6.5vw, 6.4rem); }
h2 { font-size: clamp(2.2rem, 4vw, 4rem); }
h3 { font-size: 1.32rem; font-weight: 500; }

.section-kicker {
  display: block;
  margin-bottom: 14px;
  color: var(--tertiary);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ─── Navigation ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 80px);
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 32px);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.site-nav a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  min-height: min(860px, calc(88svh - 60px));
  display: grid;
  align-items: end;
  padding: clamp(48px, 6vw, 96px) clamp(20px, 5vw, 80px);
  background: var(--dark-bg);
  color: var(--dark-text);
}

.hero-copy {
  width: min(780px, 100%);
  padding-bottom: clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--dark-line);
}

.hero h1 {
  color: var(--dark-text);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-lede {
  width: min(620px, 100%);
  margin: 28px 0 0;
  color: var(--dark-muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  font-weight: 300;
  line-height: 1.7;
}

/* ─── Shared section structure ───────────────────────────────────── */
.section {
  padding: clamp(72px, 9vw, 128px) clamp(20px, 5vw, 80px);
}

.split,
.bio-layout,
.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 100px);
}

.align-center { align-items: center; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 40px;
}

.section-heading p {
  width: min(420px, 100%);
  margin: 0;
  color: var(--secondary);
}

/* Prose text */
.prose p,
.section-heading p,
.book-copy p,
.bio-copy p,
.project-card p,
.pillar-card p,
.note-list p,
.archive-card p {
  color: var(--secondary);
  font-size: 0.96rem;
  line-height: 1.75;
}

/* ─── Pillars ────────────────────────────────────────────────────── */
.pillars {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.pillar-card {
  padding: 36px 32px;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.pillar-card:last-child { border-right: none; }

.pillar-card .icon {
  display: none;
}

.pillar-card h3 {
  margin-bottom: 12px;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.pillar-card p {
  margin: 0 0 20px;
}

.pillar-card a,
.project-card a,
.archive-card a,
.note-list a {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}

.pillar-card a:hover,
.project-card a:hover,
.archive-card a:hover,
.note-list a:hover {
  text-decoration-color: var(--ink);
}

/* ─── Book ───────────────────────────────────────────────────────── */
.book-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  align-items: stretch;
  background: var(--dark-bg);
  color: var(--dark-text);
}

.book-media {
  min-height: 640px;
  overflow: hidden;
}

.book-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 50%;
  filter: brightness(0.9);
}

.book-copy {
  align-self: center;
  padding: clamp(48px, 7vw, 96px);
}

.book-copy .section-kicker {
  color: rgba(255,255,255,0.38);
}

.book-copy h2 {
  color: var(--dark-text);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 20px 0 28px;
  font-size: 1.15rem;
  color: rgba(240,237,232,0.75);
  font-weight: 300;
}

.book-copy p {
  color: rgba(240,237,232,0.65);
  font-size: 0.94rem;
}

.book-actions,
.bio-links,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.button.primary {
  background: var(--dark-text);
  border-color: var(--dark-text);
  color: var(--dark-bg);
}

.button.primary:hover {
  background: rgba(240,237,232,0.88);
}

.button.secondary {
  background: transparent;
  border-color: rgba(255,255,255,0.22);
  color: var(--dark-text);
}

.button.secondary:hover {
  border-color: rgba(255,255,255,0.5);
}

.button.ghost {
  border-color: rgba(255,255,255,0.16);
  color: rgba(240,237,232,0.65);
}

.button.ghost:hover {
  border-color: rgba(255,255,255,0.36);
  color: var(--dark-text);
}

/* Light section button overrides */
.light-buttons .button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.light-buttons .button.secondary {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}

.light-buttons .button.ghost {
  border-color: var(--line-2);
  color: var(--secondary);
}

.bio-links .button.secondary {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}

.bio-links .button.ghost {
  border-color: var(--line);
  color: var(--secondary);
}

/* ─── Book facts ─────────────────────────────────────────────────── */
.book-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 40px 0 0;
}

.book-facts div {
  padding-top: 16px;
  border-top: 1px solid var(--dark-line);
}

.book-facts dt {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
}

.book-facts dd {
  margin: 8px 0 0;
  color: rgba(240,237,232,0.65);
  font-size: 0.9rem;
}

/* ─── Framework ──────────────────────────────────────────────────── */
.framework-section {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.framework-section h2 {
  font-weight: 400;
  letter-spacing: -0.01em;
}

.framework-figure {
  margin: 0;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.framework-figure img {
  border-radius: 2px;
}

/* ─── Work / Projects ────────────────────────────────────────────── */
.work-section {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.work-section h2 {
  font-weight: 400;
  letter-spacing: -0.01em;
}

.work-section .prose p,
.work-section > .split > div > p {
  color: var(--secondary);
  font-size: 0.94rem;
  line-height: 1.75;
}

.meta {
  display: block;
  margin: 0 0 10px;
  color: var(--tertiary);
  font-size: 0.70rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--line);
}

.project-card {
  padding: 32px 28px 32px 0;
  border-right: 1px solid var(--line);
  padding-right: 28px;
  margin-right: -1px;
}

.project-card:first-child { padding-left: 0; }

.project-card:last-child {
  border-right: none;
  padding-right: 0;
  padding-left: 28px;
}

.project-card:nth-child(2) {
  padding-left: 28px;
  padding-right: 28px;
}

.project-card h3 {
  margin: 0 0 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
}

.project-card p {
  margin-bottom: 16px;
}

/* ─── Archive ────────────────────────────────────────────────────── */
.archive-section {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.archive-heading {
  align-items: flex-start;
}

.archive-heading h2 {
  font-weight: 400;
  letter-spacing: -0.01em;
}

.archive-controls {
  display: grid;
  gap: 14px;
  width: min(480px, 100%);
  padding-top: 8px;
}

.search-field {
  display: grid;
  gap: 6px;
}

.search-field label {
  color: var(--tertiary);
  font-size: 0.70rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.search-field input {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s;
}

.search-field input:focus {
  border-color: var(--ink);
}

.search-field input::placeholder {
  color: var(--subtle);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 40px;
  padding: 3px;
  background: var(--line);
  border-radius: var(--radius);
  gap: 0;
}

.segmented-control button {
  border: 0;
  border-radius: calc(var(--radius) - 1px);
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.segmented-control button.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.archive-summary {
  margin-bottom: 24px;
  color: var(--tertiary);
  font-size: 0.80rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.archive-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.archive-card:nth-child(odd) {
  padding-right: 40px;
  border-right: 1px solid var(--line);
}

.archive-card:nth-child(even) {
  padding-left: 40px;
}

.archive-type {
  display: block;
  margin: 0 0 10px;
  color: var(--tertiary);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-card h3 {
  margin-bottom: 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.3;
}

.archive-card p {
  margin-bottom: 12px;
  font-size: 0.84rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 14px;
  padding: 0;
  list-style: none;
}

.topic-list li {
  padding: 3px 9px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--tertiary);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--tertiary);
  font-size: 0.9rem;
  padding: 32px 0;
}

/* ─── Bio / Johannes ─────────────────────────────────────────────── */
.johannes-section {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.bio-layout {
  align-items: center;
}

.bio-photo {
  margin: 0;
}

.bio-photo img {
  width: min(400px, 100%);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(12%);
  box-shadow: var(--shadow-md);
}

.bio-copy h2 {
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.bio-copy p {
  margin-bottom: 16px;
}

.bio-copy p:last-of-type {
  margin-bottom: 0;
}

/* ─── Contact ────────────────────────────────────────────────────── */
.contact-section {
  padding: clamp(56px, 7vw, 96px) clamp(20px, 5vw, 80px);
  background: var(--dark-bg);
  color: var(--dark-text);
  align-items: start;
}

.contact-main .section-kicker {
  color: rgba(255,255,255,0.32);
}

.contact-main h2 {
  color: var(--dark-text);
  margin-bottom: 20px;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 400;
}

.contact-section address {
  margin: 0 0 16px;
  font-style: normal;
  color: var(--dark-muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

.contact-section a {
  color: var(--dark-text);
  text-decoration-color: rgba(255,255,255,0.25);
}

.contact-section a:hover {
  text-decoration-color: rgba(255,255,255,0.7);
}

.legal {
  align-self: end;
  color: rgba(255,255,255,0.28);
  font-size: 0.80rem;
  line-height: 1.8;
}

.legal h3 {
  font-family: "Inter", sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin-bottom: 12px;
}

.legal p { margin: 0 0 4px; }

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px clamp(20px, 5vw, 80px);
  background: var(--dark-2);
  border-top: 1px solid var(--dark-line);
  color: rgba(255,255,255,0.28);
  font-size: 0.78rem;
}

.footer p { margin: 0; }

.footer a {
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover { color: rgba(255,255,255,0.72); }

/* ─── Governance (used on sub-pages) ─────────────────────────────── */
.governance-section { background: var(--paper); }

.governance-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.governance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.governance-grid article {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.governance-grid p {
  margin-bottom: 0;
  color: var(--secondary);
  font-size: 0.88rem;
}

/* ─── Notes / sub-page ───────────────────────────────────────────── */
.notes-section,
.notes-archive { background: var(--paper); }

.note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.note-list article {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.note-list article:nth-child(odd) {
  padding-right: 40px;
  border-right: 1px solid var(--line);
}

.note-list article:nth-child(even) { padding-left: 40px; }

.subpage { background: var(--white); }

.page-hero {
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 80px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 980px;
  color: var(--ink);
  font-weight: 400;
}

.page-hero .hero-lede {
  color: var(--secondary);
}

.page-meta {
  margin: 18px 0 0;
  color: var(--tertiary);
  font-size: 0.80rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.post-content {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content p,
.post-content ul,
.post-content ol { margin: 0 0 1.4em; }

.post-content li + li { margin-top: 0.5em; }

.post-content a {
  color: var(--ink);
  font-weight: 500;
}

.post-content img {
  width: 100%;
  height: auto;
  margin: 36px auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.post-content iframe {
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  margin: 32px 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .split,
  .bio-layout,
  .contact-section,
  .book-section,
  .governance-layout {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .pillar-card {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 28px 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
    margin-top: 48px;
  }

  .project-card,
  .project-card:first-child,
  .project-card:nth-child(2),
  .project-card:last-child {
    border-right: none;
    padding: 28px 0;
    margin-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .book-media { min-height: 440px; }

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

@media (max-width: 720px) {
  .hero {
    min-height: calc(84svh - 80px);
    align-items: center;
  }

  h1 { font-size: clamp(2.8rem, 13vw, 3.8rem); }

  .archive-grid,
  .note-list,
  .book-facts {
    grid-template-columns: 1fr;
  }

  .archive-card:nth-child(odd),
  .archive-card:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-right: none;
  }

  .note-list article:nth-child(odd),
  .note-list article:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-right: none;
  }

  .segmented-control {
    grid-template-columns: 1fr;
    height: auto;
  }

  .footer { flex-direction: column; gap: 10px; }
}
