/* Project Obsidian Lab. Colours, type and layout follow Website Plan v1 (18 Oct 2026). */
:root {
  --black: #111214;
  --paper: #FAF8F3;
  --ink: #1C1C1E;
  --slate: #5F6368;
  --blue: #2F5D8C;
  --blue-dark: #244a70;
  --rule: #d8d4cc;
  --draft: #6b3a16;
  --draft-bg: #f3e6d8;
  --essay: #2F5D8C;
  --essay-bg: #e6eef6;
  --header-h: 4rem;
  --max: 68rem;
  --read: 40rem;
  --font-display: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; }
@media (min-width: 800px) { html { font-size: 18px; } }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Forced view (Desktop / Mobile footer switch). Works without JS via ?view=. */
html[data-view="mobile"] body { max-width: 26.5rem; margin: 0 auto; }
html[data-view="mobile"] { font-size: 17px; }
html[data-view="desktop"] { font-size: 18px; }
html[data-view="desktop"] .wrap { max-width: var(--max); }
html[data-view="desktop"] .site-header .nav { display: flex !important; }
html[data-view="desktop"] .nav-toggle-label { display: none !important; }
html[data-view="mobile"] .site-header .nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--black);
  flex-direction: column;
  padding: 0.5rem 5vw 1rem;
  gap: 0;
}
html[data-view="mobile"] #nav-toggle:checked ~ .nav { display: flex; }
html[data-view="mobile"] .nav-toggle-label { display: inline-flex; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.15em; }
a:hover { color: var(--blue-dark); }
a:focus-visible, button:focus-visible, .nav-toggle-label:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--black);
  color: #fff;
  padding: 0.5rem 0.8rem;
  z-index: 100;
}
.skip:focus { top: 0.5rem; }


.site-header {
  background: var(--black);
  color: #f4f4f2;
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
}
.site-header a { color: #f4f4f2; text-decoration: none; }
.site-header a:hover { color: #fff; }
.header-inner, .wrap, .footer-inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
}
.brand svg {
  width: 2rem;
  height: 2rem;
  color: #f4f4f2;
  flex: 0 0 auto;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
}
@media (max-width: 799px) {
  .wordmark { font-size: 0.78rem; letter-spacing: 0.1em; }
}

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f4f4f2;
}
.site-header .nav {
  display: flex;
  gap: 0.25rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.site-header .nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.15rem;
}
.site-header .nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 #f4f4f2;
}

@media (max-width: 799px) {
  .nav-toggle-label { display: inline-flex; }
  .site-header { position: sticky; }
  .site-header .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--black);
    flex-direction: column;
    padding: 0.5rem 5vw 1rem;
    border-top: 1px solid #2a2b2e;
  }
  #nav-toggle:checked ~ .nav { display: flex; }
  .site-header .nav a { min-height: 44px; }
  html[data-view="mobile"] .mobile-view-copy { display: block; }
}

.mobile-view-copy { display: none; }
@media (max-width: 799px) { .mobile-view-copy { display: block; margin: 0.25rem 0 0.5rem; } }

main { flex: 1 0 auto; padding: 2.25rem 0 3.5rem; }
.wrap h1, .wrap h2, .wrap h3 { font-family: var(--font-sans); font-weight: 600; line-height: 1.25; }
.wrap h1 { font-size: 1.85rem; margin: 0 0 0.6rem; letter-spacing: -0.02em; }
.wrap h2 { font-size: 1.2rem; margin: 2.25rem 0 0.75rem; }
.wrap h3 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
.lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 36rem;
  margin: 0 0 2rem;
}
.contact-line {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  margin: 0 0 2rem;
  max-width: 44rem;
}
.contact-details { margin: 1.2rem 0 1.4rem; }
.contact-details dt {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 0.8rem;
}
.contact-details dd { margin: 0.15rem 0 0; font-size: 1.15rem; }
.contact-details a { text-decoration: none; }
.contact-details a:hover { text-decoration: underline; }

.muted, .meta, .credit, .date { color: var(--slate); font-family: var(--font-sans); }
.meta { font-size: 0.9rem; }
.credit { font-size: 0.8rem; margin-top: 0.4rem; }

.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 2px;
  vertical-align: 0.05em;
}
.tag-draft { background: var(--draft-bg); color: var(--draft); }
.tag-essay { background: var(--essay-bg); color: var(--essay); }
.tag-wip { background: #ececec; color: #333; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 1rem;
  background: var(--blue);
  color: #fff !important;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: 0;
  border-radius: 2px;
}
.btn:hover { background: var(--blue-dark); color: #fff !important; }
.btn-secondary {
  background: transparent;
  color: var(--blue) !important;
  box-shadow: inset 0 0 0 1px var(--blue);
}
.btn-secondary:hover { background: var(--essay-bg); color: var(--blue-dark) !important; }

/* Home featured */
.featured {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 2.75rem;
  align-items: start;
}
@media (min-width: 800px) {
  .featured { grid-template-columns: 1.15fr 1fr; gap: 2rem; }
}
.featured figure { margin: 0; }
.featured img {
  width: 100%;
  background: #000;
}
.kicker {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 0.4rem;
}
.featured h2 { margin: 0.3rem 0 0.5rem; font-size: 1.45rem; }
.featured h2 a { color: inherit; text-decoration: none; }
.featured h2 a:hover { color: var(--blue); }

.card-list { display: grid; gap: 1rem; padding: 0; margin: 0 0 1.5rem; list-style: none; }
@media (min-width: 800px) {
  .card-list.thirds { grid-template-columns: repeat(3, 1fr); }
}
.card {
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0 0.3rem;
}
.card h3 { margin: 0.25rem 0 0.35rem; font-size: 1.05rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
.card p { margin: 0.3rem 0 0; }

.about-teaser {
  margin-top: 2.5rem;
  max-width: var(--read);
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
}

/* Papers library */
.paper-row {
  border-top: 1px solid var(--rule);
  padding: 1.15rem 0 1rem;
}
.paper-row:last-child { border-bottom: 1px solid var(--rule); }
.paper-row h2 { margin: 0.25rem 0 0.4rem; font-size: 1.25rem; }
.paper-row h2 a { color: inherit; text-decoration: none; }
.paper-row h2 a:hover { color: var(--blue); }
.section-intro { max-width: var(--read); margin: 0 0 1.5rem; }

/* Paper / method pages */
.split {
  display: grid;
  gap: 2rem;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 16.5rem; align-items: start; }
  .facts { position: sticky; top: calc(var(--header-h) + 1rem); }
}
.facts {
  background: #f3f0ea;
  padding: 1rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
}
.facts h2 { margin: 0 0 0.7rem; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); font-weight: 600; }
.facts dl { margin: 0 0 1rem; }
.facts dt { color: var(--slate); font-size: 0.78rem; margin-top: 0.55rem; }
.facts dd { margin: 0.1rem 0 0; }
.facts .btn { width: 100%; margin-top: 0.45rem; }
.prose { max-width: var(--read); }
.prose p { margin: 0 0 1rem; }
.prose blockquote {
  margin: 1.2rem 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--rule);
}
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose li { margin: 0.3rem 0; }
.figure { margin: 1.4rem 0; }
.figure img { background: #111; }

.note {
  background: #f3f0ea;
  padding: 0.8rem 1rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.site-footer {
  background: var(--black);
  color: #c8c8c4;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 1.4rem 0 1.6rem;
  margin-top: auto;
}
.site-footer a { color: #f4f4f2; }
.footer-inner { display: grid; gap: 0.6rem; }
@media (min-width: 800px) {
  .footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
  }
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.view-switch { margin: 0; }
.view-switch a { text-decoration: none; }
.view-switch [aria-current="true"] { text-decoration: underline; }
.pending { color: #9a9a96; }

@media print {
  .site-header, .site-footer, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: inherit; }
}

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