:root {
  color-scheme: dark;
  --ink: #f2f0ea;
  --muted: #aaa8a3;
  --line: rgba(242, 240, 234, 0.28);
  --panel: #353538;
  --paper: #e7e5df;
  --paper-ink: #242426;
  --accent: #ffb38a;
  --serif: Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 70ms ease-in both page-out;
}

::view-transition-new(root) {
  animation: 140ms cubic-bezier(0.22, 1, 0.36, 1) both page-in;
}

@keyframes page-out {
  to { opacity: 0; transform: translateY(-2px); }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-underline-offset: 0.18em; }
a:hover, a:focus-visible { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.shell {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 42px 0;
}

.brand, .nav a {
  text-decoration: none;
}

.brand { font-size: 1.3rem; }

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav .github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav svg { width: 18px; height: 18px; fill: currentColor; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 72px;
  align-items: end;
  padding: 92px 0 120px;
}

.eyebrow, .section-label, .meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow { color: var(--accent); margin: 0 0 28px; }

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

h1 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: clamp(3.1rem, 7.3vw, 7.4rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.93;
}

.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(100%);
  border-radius: 50%;
}

.intro {
  max-width: 940px;
  padding: 0 0 120px;
  font-size: clamp(1.6rem, 3.2vw, 3rem);
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.intro strong { font-weight: 700; }

.rows { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 68px;
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section-label {
  color: var(--muted);
  font-style: normal;
}

.section-label::after {
  content: "";
  display: block;
  width: 38px;
  margin-top: 25px;
  border-top: 1px solid var(--muted);
}

.statement {
  max-width: 760px;
  font-size: clamp(1.55rem, 2.7vw, 2.5rem);
  line-height: 1.3;
}

.statement p:last-child { margin-bottom: 0; }

.expertise-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.25;
}

.cta {
  background: var(--paper);
  color: var(--paper-ink);
  margin-top: 110px;
}

.cta-inner { padding: 90px 0 110px; }
.cta p { max-width: 900px; font-size: clamp(2.2rem, 5vw, 5rem); line-height: 1.05; letter-spacing: -0.04em; }
.cta a:hover, .cta a:focus-visible { color: #8d3f25; }
.contact-address { white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding-top: 50px;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: #66645f;
}

.footer-links { display: flex; gap: 20px; }

.page-header { padding: 80px 0 110px; }
.page-header h1 { max-width: 1050px; }
.lede { max-width: 790px; margin-top: 46px; font-size: clamp(1.35rem, 2.6vw, 2.25rem); line-height: 1.38; }
.back { display: inline-block; margin-top: 40px; font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }

.book-content { padding-bottom: 110px; }
.book-content h2 { margin: 75px 0 24px; font-size: clamp(2rem, 4vw, 3.8rem); font-weight: 400; line-height: 1; }
.book-content h1 { margin: 90px 0 28px; font-size: clamp(2.6rem, 5vw, 4.8rem); }
.book-content ul { columns: 2; column-gap: 72px; padding: 0; list-style: none; }
.book-content li { break-inside: avoid; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.book-content code { font-family: var(--sans); font-size: 0.85em; color: var(--accent); }

.book-intro {
  display: grid;
  grid-template-columns: minmax(0, 680px) auto;
  justify-content: space-between;
  gap: 48px;
  align-items: start;
}

.book-intro-copy p:last-child { margin-bottom: 0; }

.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.last-updated::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 179, 138, 0.14);
}

.last-updated time { color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .shell { width: min(100% - 36px, 1180px); }
  .site-header { padding: 28px 0; }
  .nav { gap: 14px; }
  .nav .nav-label { display: none; }
  .hero { grid-template-columns: 1fr; gap: 42px; padding: 64px 0 78px; }
  .portrait { width: 124px; grid-row: 1; }
  .hero-copy { grid-row: 2; }
  .intro { padding-bottom: 78px; }
  .row { grid-template-columns: 1fr; gap: 40px; padding: 56px 0; }
  .book-intro { grid-template-columns: 1fr; gap: 24px; }
  .book-content ul { columns: 1; }
  .cta { margin-top: 72px; }
  .cta-inner { padding: 65px 0 80px; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}
