:root {
  --paper: #F7F5F1;
  --ink: #1C1B19;
  --ink-soft: #4A4844;
  --oxide: #4F5F52;
  --bronze: #8A7A5C;
  --stone: #D8D3C7;
  --stone-light: #E9E6DE;
  --max-width: 840px;
  --wide: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--oxide); text-decoration-color: var(--stone); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--oxide); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--oxide);
  outline-offset: 3px;
}

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

@media (max-width: 560px) {
  .wrap, .wrap-narrow { padding: 0 24px; }
}

.rule { border: none; border-top: 1px solid var(--stone); margin: 0; }

/* ---- Top nav ---- */

nav.site-nav { padding: 24px 0; }

nav.site-nav .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  position: relative;
}

nav.site-nav .home-link {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

nav.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.site-nav .nav-links a {
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

nav.site-nav .nav-links a:hover { color: var(--ink); }

nav.site-nav .nav-links a.active {
  color: var(--oxide);
  font-weight: 600;
}

nav.site-nav .nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--stone);
  border-radius: 3px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
}

nav.site-nav .crumbs {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
nav.site-nav .crumbs a { color: var(--ink-soft); }

@media (max-width: 700px) {
  nav.site-nav .nav-toggle { display: block; }

  nav.site-nav .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--paper);
    border: 1px solid var(--stone);
    border-radius: 4px;
    padding: 12px 20px;
    z-index: 30;
  }

  nav.site-nav .nav-links.open { display: flex; }

  nav.site-nav .nav-links a {
    display: block;
    padding: 10px 0;
    width: 100%;
  }
}

/* ---- Page head (Writing / Interviews / Contact / About intro) ---- */

.page-head {
  padding: 12px 0 48px;
}
.page-head .section-label {
  font-size: 0.8rem;
  color: var(--bronze);
  display: block;
  margin-bottom: 10px;
}
.page-head h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  max-width: 14ch;
}
.page-head p {
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0;
  font-size: 1.05rem;
}

/* ---- Hero (Home / About) ---- */

.hero {
  padding: 80px 0 56px;
  position: relative;
}

.hero-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.hero-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--stone);
}

@media (max-width: 520px) {
  .hero-photo { width: 72px; height: 72px; }
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.28em;
}

.hero h1 .social-icon {
  display: inline-flex;
  line-height: 0;
}

.hero h1 .social-icon svg {
  width: 0.55em;
  height: 0.55em;
}

.hero .role {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--oxide);
  margin: 0 0 28px;
}

.hero p.bio {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 58ch;
  margin: 0 0 32px;
  text-align: justify;
  hyphens: auto;
}

/* ---- Sections (Home) ---- */

section {
  padding: 52px 0;
  border-bottom: 1px solid var(--stone);
}

section:last-of-type { border-bottom: none; }

.section-head {
  margin-bottom: 20px;
}

.section-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--bronze);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.section-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.entries { display: flex; flex-direction: column; gap: 22px; }

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}

.entry .name { font-weight: 600; color: var(--ink); }
.entry .detail { color: var(--ink-soft); font-size: 0.95rem; display: block; margin-top: 2px; }
.entry .when { color: var(--bronze); font-size: 0.85rem; white-space: nowrap; }

.lede {
  color: var(--ink-soft);
  margin: 0 0 20px;
  max-width: 58ch;
  text-align: justify;
  hyphens: auto;
}

.timeline { display: flex; flex-direction: column; gap: 26px; }

.tl-item .tl-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.tl-item .org { font-weight: 600; }
.tl-item .period { color: var(--bronze); font-size: 0.85rem; white-space: nowrap; }
.tl-item .role { color: var(--oxide); font-size: 0.95rem; margin-bottom: 6px; }
.tl-item p { color: var(--ink-soft); margin: 0; font-size: 0.98rem; }

.patents { color: var(--ink-soft); font-size: 0.95rem; }
.patents li { margin-bottom: 8px; }
.patents ul { padding-left: 20px; margin: 0; }

/* ---- Contact ---- */

#contact input,
#contact textarea {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--stone);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 14px;
}

#contact textarea { min-height: 120px; resize: vertical; }

#contact label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

#contact button {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#contact button:hover { background: var(--oxide); }

#contact .status {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--oxide);
  min-height: 1.4em;
}

/* ---- Featured post (Writing) ---- */

.featured {
  padding: 8px 0 56px;
}
.featured a.featured-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.featured .img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stone-light);
  border: 1px solid var(--stone);
  background-size: cover;
  background-position: center;
  margin-bottom: 24px;
}
.featured .tag {
  font-size: 0.85rem;
  color: var(--bronze);
  display: block;
  margin-bottom: 10px;
}
.featured h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  max-width: 20ch;
}
.featured .deck {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0 0 10px;
}
.featured .meta {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---- Post list (Writing) ---- */

.post-list {
  padding: 40px 0 64px;
}
.post-list .section-label {
  font-size: 0.8rem;
  color: var(--bronze);
  display: block;
  margin-bottom: 24px;
}
.post-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-list li {
  border-top: 1px solid var(--stone);
  padding: 26px 0;
}
.post-list li:last-child { border-bottom: 1px solid var(--stone); }

.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
  text-decoration: none;
  color: inherit;
}
@media (max-width: 560px) {
  .post-row { grid-template-columns: 1fr; gap: 4px; }
}
.post-row .title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.post-row .date {
  font-size: 0.85rem;
  color: var(--bronze);
  white-space: nowrap;
}
.post-row .deck {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.97rem;
  margin-top: 6px;
  max-width: 62ch;
}

/* ---- Quick nav (Interviews & Talks) ---- */

.quick-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 0 48px;
}
@media (max-width: 700px) {
  .quick-nav { grid-template-columns: 1fr; }
}
.quick-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--stone);
  border-radius: 6px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  background: var(--stone-light);
  transition: border-color 0.15s ease;
}
.quick-nav-item:hover { border-color: var(--oxide); }
.quick-nav-item .qn-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.98rem;
}
.quick-nav-item .qn-count {
  font-size: 0.85rem;
  color: var(--bronze);
  white-space: nowrap;
}

/* ---- Elsewhere (Interviews & Talks) ---- */

#speaking, #interviews, #writing {
  scroll-margin-top: 24px;
}

.elsewhere {
  padding: 8px 0 64px;
}
.elsewhere > h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.elsewhere > p.intro {
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 58ch;
  margin: 0 0 24px;
}
.elsewhere ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.elsewhere li {
  border-top: 1px solid var(--stone);
  padding: 14px 0;
}
.elsewhere li:last-child { border-bottom: 1px solid var(--stone); }

.ext-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
@media (max-width: 560px) {
  .ext-row { grid-template-columns: 1fr; gap: 6px; align-items: start; }
}
.ext-row .tag {
  grid-column: 1 / -1;
  display: inline-block;
  width: fit-content;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--oxide);
  background: var(--stone-light);
  border: 1px solid var(--stone);
  border-radius: 999px;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.ext-row .title {
  font-weight: 600;
  color: var(--ink);
}
.ext-row .title::after {
  content: "\2197";
  font-size: 0.8em;
  color: var(--bronze);
  margin-left: 6px;
}
.ext-row.is-static { cursor: default; }
.ext-row.is-static .title::after { content: none; }
.ext-row .source {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 4px;
  padding: 3px 9px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .ext-row .source { justify-self: start; }
}
.ext-row .deck {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 2px;
}

/* ---- Post header / body (individual post pages) ---- */

.post-head {
  padding: 20px 0 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.post-head .tag {
  font-size: 0.85rem;
  color: var(--bronze);
  display: block;
  margin-bottom: 14px;
}
.post-head h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.post-head .meta {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.post-hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stone-light);
  border-top: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
  background-size: cover;
  background-position: center;
  margin: 8px 0 48px;
}

.post-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 56px;
}
.post-body p {
  margin: 0 0 22px;
  font-size: 1.08rem;
}
.post-body h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 44px 0 16px;
  letter-spacing: -0.005em;
}
.post-body blockquote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.4;
  color: var(--oxide);
  border-left: 2px solid var(--bronze);
  margin: 36px 0;
  padding: 4px 0 4px 24px;
}
.post-body blockquote p { margin: 0; }
.post-body ul, .post-body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.post-body li { margin-bottom: 8px; font-size: 1.05rem; }

.post-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 0 64px;
  border-top: 1px solid var(--stone);
}
.post-footer a { font-size: 0.95rem; }

/* ---- Footer ---- */

footer {
  padding: 40px 0 64px;
  color: var(--bronze);
  font-size: 0.85rem;
}
