:root {
  color-scheme: light;
  --ink: #0d2b2a;
  --secondary: #40504c;
  --line: rgba(13, 43, 42, 0.18);
  --paper: #f7f6f1;
  --sidebar: #efeee8;
  --sidebar-width: 252px;
  --focus: #0d2b2a;
  --font-display: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --font-body: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: Menlo, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  cursor: pointer;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  touch-action: manipulation;
}

a:active {
  text-decoration-thickness: 2px;
}

::selection {
  background: var(--ink);
  color: white;
}

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

.skip-link {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
  font-weight: 600;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar-width);
  padding: 32px 18px 28px;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-decoration: none;
}

.menu {
  position: relative;
  display: grid;
  margin-top: 20px;
  border-left: 1px solid var(--line);
  gap: 0;
}

.menu a {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 12px 0 24px;
  color: var(--secondary);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  transition:
    color 180ms ease,
    padding-left 180ms ease,
    text-decoration-color 180ms ease;
}

.menu a::before {
  position: absolute;
  top: 50%;
  left: -1px;
  width: 12px;
  border-top: 1px solid var(--line);
  content: "";
  transition:
    width 180ms ease,
    border-color 180ms ease;
}

.menu a:hover,
.menu a[aria-current] {
  color: var(--ink);
  padding-left: 32px;
  text-decoration-color: currentColor;
}

.menu a[aria-current] {
  font-weight: 600;
}

.menu a:hover::before,
.menu a[aria-current]::before {
  width: 20px;
  border-color: var(--ink);
}

.sidebar-note {
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.sidebar-note span,
.sidebar-note time {
  display: block;
}

main {
  position: relative;
  z-index: 1;
  width: min(calc(100% - var(--sidebar-width)), 860px);
  margin-left: var(--sidebar-width);
  padding: 104px clamp(40px, 7vw, 88px) 52px;
  font-size: 17px;
  text-shadow: none;
}

article,
.page-footer {
  max-width: 610px;
}

.page-hero {
  padding: 24px 0 76px;
}

.eyebrow,
.status-line,
.section-label {
  margin: 0 0 10px;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

h1 {
  max-width: 590px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 6vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.lede {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--secondary);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
}

.content-section {
  padding: 54px 0;
  border-top: 1px solid var(--line);
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(1.75rem, 4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 500;
}

.content-section > p,
.content-section li p {
  max-width: 560px;
  color: var(--secondary);
}

.plain-list,
.project-index,
.evidence-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.plain-list li,
.project-index li,
.evidence-list li {
  padding: 20px 0 22px;
  border-top: 1px solid var(--line);
}

.project-index h2,
.project-index h3 {
  margin: 0 0 7px;
  font-size: 1.25rem;
}

.project-index p,
.evidence-list p {
  margin-bottom: 0;
}

.status-line {
  display: block;
  margin-bottom: 7px;
}

.scope-note,
.honesty-note {
  max-width: 560px;
  margin: 24px 0 0;
  padding-left: 18px;
  border-left: 2px solid var(--ink);
  color: var(--secondary);
}

.scope-note strong,
.honesty-note strong {
  color: var(--ink);
}

.page-links {
  display: flex;
  margin: 28px 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
}

.page-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.next-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 8px;
}

.page-footer {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  color: var(--secondary);
  font-size: 0.82rem;
}

.page-footer a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
}

@media (max-width: 760px), (max-height: 520px) {
  html {
    scroll-padding-top: calc(80px + env(safe-area-inset-top));
  }

  .sidebar {
    right: 0;
    bottom: auto;
    width: auto;
    padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--sidebar);
  }

  .brand {
    flex: 0 0 auto;
    padding: 0;
    border-bottom: 0;
    font-size: 1rem;
    letter-spacing: 0;
    line-height: 1;
  }

  .menu {
    display: flex;
    min-width: 0;
    margin: 0 0 0 auto;
    overflow-x: auto;
    border-left: 0;
    gap: 2px;
    scrollbar-width: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 3px;
    justify-content: center;
    font-size: 0.82rem;
    text-decoration: none;
  }

  .menu a:hover,
  .menu a[aria-current] {
    padding-left: 3px;
  }

  .menu a::before {
    top: auto;
    bottom: 2px;
    left: 50%;
    width: 16px;
    border-color: transparent;
    border-top-width: 2px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition:
      transform 180ms ease,
      border-color 180ms ease;
  }

  .menu a:hover::before,
  .menu a[aria-current]::before {
    width: 16px;
    border-color: var(--ink);
    transform: translateX(-50%) scaleX(1);
  }

  .sidebar-note {
    display: none;
  }

  main {
    width: min(calc(100% - 36px), 610px);
    margin: 0 auto;
    padding: calc(92px + env(safe-area-inset-top)) 0 40px;
  }

  .page-hero {
    padding: 48px 0 68px;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.25rem);
  }

  .content-section {
    padding: 48px 0;
  }
}

@media (max-width: 430px) {
  .menu a {
    font-size: 0.8rem;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }
}

@media (max-width: 350px) {
  .sidebar {
    padding-right: 10px;
    padding-left: 10px;
    gap: 6px;
  }

  .brand {
    font-size: 0.9rem;
  }

  .menu a {
    padding-right: 2px;
    padding-left: 2px;
    font-size: 0.78rem;
  }

  .menu a:hover,
  .menu a[aria-current] {
    padding-left: 2px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
