/* ---- palette sampled from the banner: navy #102040, accent cyan #80f0f0 ---- */
:root {
  --content-width: 46rem;
  --hero-width: 62rem;
  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, Cambria, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --accent: #1f6a72;
  --accent-soft: rgba(31, 106, 114, .3);
  --bs-link-color-rgb: 31, 106, 114;
  --bs-link-hover-color-rgb: 17, 72, 78;
}
:root[data-bs-theme="dark"] {
  --accent: #7fd4dc;
  --accent-soft: rgba(127, 212, 220, .34);
  --bs-link-color-rgb: 127, 212, 220;
  --bs-link-hover-color-rgb: 173, 233, 239;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1.01rem + 0.22vw, 1.15rem);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.navbar, .meta, .btn, .badge, footer, .cat-chip, .fn-ref,
h1, h2, h3, h4, h5, h6 { font-family: var(--font-ui); }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.019em; text-wrap: balance; }

/* ---- reading column ---- */
.content { max-width: var(--content-width); }
.content p { text-wrap: pretty; }
.content p, .content ul, .content ol, .content blockquote { margin-bottom: 1.3rem; }
.content li { margin-bottom: .35rem; }
.content li::marker { color: var(--accent); }
.content h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.3rem); line-height: 1.18; }
.content h2 { margin-top: 2.6rem; margin-bottom: .85rem; font-size: 1.4rem; line-height: 1.3; }
.content h3 { margin-top: 2rem; margin-bottom: .6rem; font-size: 1.12rem; line-height: 1.35; }
.content img { display: block; max-width: 100%; height: auto; border-radius: .5rem; }
.content figure, .content video, .content audio { max-width: 100%; }
.content pre {
  white-space: pre-wrap; word-wrap: break-word;
  background: var(--bs-tertiary-bg); font-size: .9rem;
  border-color: var(--bs-border-color) !important;
}
.content table { font-family: var(--font-ui); font-size: .92rem; }
.content blockquote {
  font-style: italic; color: var(--bs-secondary-color);
  border-left: 3px solid var(--accent-soft) !important; margin-left: 0;
}
.content .pull-quote {
  margin: 2.5rem 0;
  padding: 0 0 0 clamp(1.25rem, 4vw, 2rem);
  border-left: 1px solid currentColor !important;
  color: var(--bs-emphasis-color);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: clamp(1.4rem, 1.05rem + 1.3vw, 1.85rem);
  font-weight: 400;
  line-height: 1.5;
}
.pull-quote-mark {
  display: block;
  height: .8em;
  margin-bottom: .15em;
  font-family: Arial, sans-serif;
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
}
.content .pull-quote > :last-child { margin-bottom: 0; }
.content hr { margin: 2.5rem 0; opacity: .18; }

/* ---- links: muted accent with a hairline underline, not browser blue ---- */
a { color: rgb(var(--bs-link-color-rgb)); }
.content a, .post-list-item h2 a, footer a, .meta a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: .17em;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.content a:hover, .post-list-item h2 a:hover, footer a:hover {
  color: rgb(var(--bs-link-hover-color-rgb));
  text-decoration-color: currentColor;
}
::selection { background: var(--accent-soft); }

/* ---- footnotes ---- */
.fn-ref { font-size: .72em; font-weight: 600; }
.fn-ref a { text-decoration: none; padding: 0 .12em; }
.footnotes { font-size: .9rem; color: var(--bs-secondary-color); }
.footnotes ol { padding-left: 1.1rem; }
.footnotes li { margin-bottom: .5rem; }
.fn-back { text-decoration: none; }

/* ---- CV: year / entry rows, hairline separated ---- */
.cv-list {
  display: grid; grid-template-columns: 6.5rem 1fr; column-gap: 1.5rem;
  font-family: var(--font-ui); margin: 0 0 .5rem;
}
.cv-list dt {
  font-size: .82rem; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  color: var(--bs-secondary-color); white-space: nowrap;
}
.cv-list dd { margin: 0; font-size: .95rem; line-height: 1.5; }
.cv-list dt, .cv-list dd {
  border-top: 1px solid var(--bs-border-color); padding: .6rem 0;
}
.cv-list dt:first-of-type, .cv-list dd:first-of-type { border-top: 0; padding-top: 0; }
.content .cv-note { font-size: .92rem; color: var(--bs-secondary-color); margin-top: 2.6rem; }
@media (max-width: 34rem) {
  .cv-list { grid-template-columns: 1fr; column-gap: 0; }
  .cv-list dt { padding: .75rem 0 0; }
  .cv-list dd { border-top: 0; padding: .1rem 0 0; }
  .cv-list dt:first-of-type { padding-top: 0; }
}

/* ---- talks: title + muted meta line, hairline separated ---- */
.content .talk-year {
  font-family: var(--font-ui); font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--bs-secondary-color);
  margin-top: 2.2rem; margin-bottom: .7rem;
}
.content .talk-list { list-style: none; padding: 0; margin: 0 0 .5rem; }
.content .talk-list li { margin: 0; padding: .7rem 0; border-top: 1px solid var(--bs-border-color); }
.content .talk-list li:first-child { border-top: 0; padding-top: 0; }
.content h3.talk-year + ul:not(.talk-list) { list-style: none; padding: 0; margin: 0 0 .5rem; }
.content h3.talk-year + ul:not(.talk-list) li { margin: 0; padding: .7rem 0; border-top: 1px solid var(--bs-border-color); }
.content h3.talk-year + ul:not(.talk-list) li:first-child { border-top: 0; padding-top: 0; }
.talk-title { display: block; line-height: 1.45; }
.talk-meta {
  display: block; font-family: var(--font-ui); font-size: .8rem; line-height: 1.5;
  color: var(--bs-secondary-color); margin-top: .15rem;
}

/* ---- chrome ---- */
.navbar { font-size: 1.05rem; }
.navbar-brand { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.8rem); font-weight: 700; letter-spacing: -.022em; }
.navbar .nav-link { color: var(--bs-body-color); font-weight: 600; opacity: .9; }
.navbar .nav-link:hover, .navbar .nav-link.active { opacity: 1; color: var(--accent); }
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: rgb(var(--bs-link-hover-color-rgb));
  --bs-btn-hover-border-color: rgb(var(--bs-link-hover-color-rgb));
}
:root[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0d1b2a; --bs-btn-hover-color: #0d1b2a; }

/* ---- home portrait layout ---- */
.home-main { margin-top: .75rem; margin-bottom: 3rem; }
.home-layout { display: grid; gap: 2rem; }
.hero-portrait { width: 100%; max-width: 30rem; margin: 0 auto; overflow: hidden; }
.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center bottom;
}
.home-lead {
  position: relative;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0;
  border: 0;
  color: var(--bs-emphasis-color);
  font: inherit;
  letter-spacing: normal;
}
.home-lead-reserve {
  display: block;
  visibility: hidden;
}
.home-lead-typing {
  position: absolute;
  inset: 0;
}
.home-lead-cursor {
  display: inline-block;
  width: .08em;
  height: .95em;
  margin-left: .12em;
  color: var(--accent);
  background: currentColor;
  vertical-align: -.08em;
  animation: home-cursor-blink 500ms steps(1, end) infinite;
}
@keyframes home-cursor-blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .home-lead-cursor { animation: none; }
}
.home-content { max-width: 42rem; margin: 0 auto; }
.home-recent { width: 100%; margin-top: 4rem; }
.home-recent-inner { max-width: 60rem; margin-inline: auto; }
.recent-post-title {
  display: block;
  margin-bottom: .3rem;
  font-size: 1.15em;
  font-weight: 600;
  line-height: 1.35;
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 1.6rem 0 0;
}
.profile-links .btn { white-space: nowrap; }
@media (max-width: 991.98px) {
  .home-copy { display: contents; }
  .home-layout {
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    column-gap: clamp(.75rem, 3vw, 1rem);
    row-gap: 1.5rem;
    align-items: start;
  }
  .hero-portrait {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: none;
    height: clamp(8rem, 38vw, 18rem);
    margin: 0;
  }
  .hero-portrait img { height: 100%; aspect-ratio: auto; }
  .home-lead {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding-left: 0;
    border-left: 0;
    font-size: clamp(1.05rem, 3.3vw, 1.1rem);
    line-height: 1.45;
  }
  .home-content { grid-column: 1 / -1; grid-row: 2; width: 100%; }
}
@media (min-width: 992px) {
  .home-main { max-width: 82rem; margin-top: .75rem; }
  .home-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: clamp(2rem, 5vw, 5rem);
  }
  .hero-portrait { grid-column: 1; grid-row: 1; max-width: none; margin: 0; }
  .home-copy { grid-column: 2; grid-row: 1; max-width: 42rem; margin-top: 2.5rem; }
  .home-lead { max-width: none; margin: 0; }
  .home-content { max-width: none; margin: 1.3rem 0 0; }
}
@media (max-width: 575.98px) {
  .home-layout {
    grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
    column-gap: .65rem;
    row-gap: .5rem;
  }
  .hero-portrait {
    width: calc(100% + .75rem);
    height: clamp(13rem, 64vw, 18rem);
    margin-left: -.75rem;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 90%, transparent 100%);
  }
  .hero-portrait img {
    width: 155%;
    max-width: none;
    height: 100%;
    object-position: center 70%;
    transform: translateX(-18%);
  }
  .profile-links {
    gap: 0;
    margin-top: 1.35rem;
    font-family: var(--font-ui);
    font-size: .95rem;
  }
  .profile-links .btn {
    --bs-btn-padding-x: 0;
    --bs-btn-padding-y: .15rem;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: transparent;
    --bs-btn-color: rgb(var(--bs-link-color-rgb));
    --bs-btn-hover-color: rgb(var(--bs-link-hover-color-rgb));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: .95rem;
    line-height: 1.5;
    text-decoration: underline;
    text-decoration-color: var(--accent-soft);
    text-decoration-thickness: 1px;
    text-underline-offset: .17em;
  }
  .profile-links .btn:not(:last-child)::after {
    content: "/";
    display: inline-block;
    margin: 0 .55rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
  }
  :root[data-bs-theme="dark"] .profile-links .btn {
    --bs-btn-color: rgb(var(--bs-link-color-rgb));
    --bs-btn-hover-color: rgb(var(--bs-link-hover-color-rgb));
  }
}

/* ---- post list ---- */
.post-list-item { display: grid; padding: 1.6rem 0; border-bottom: 1px solid var(--bs-border-color); }
.post-list-item.has-thumbnail { grid-template-columns: clamp(5.5rem, 20vw, 10rem) minmax(0, 1fr); gap: clamp(.85rem, 2.5vw, 1.5rem); }
.post-list-item[hidden] { display: none; }
.post-list-thumbnail { display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: .5rem; }
.post-list-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
.post-list-copy { min-width: 0; }
@media (max-width: 1199.98px), (hover: none) and (pointer: coarse) {
  .post-list-thumbnail { display: none; }
  .post-list-item.has-thumbnail { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.post-list-item:first-of-type { padding-top: .5rem; }
.post-list-item h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: .3rem; line-height: 1.35; }
.post-list-item h2 a { color: var(--bs-body-color); text-decoration-color: transparent; }
.post-list-item h2 a:hover { color: var(--accent); }
.post-list-item p { margin-bottom: 0; }

.meta {
  font-size: .74rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.meta .badge { text-transform: none; letter-spacing: 0; font-weight: 500; }
.badge.text-bg-light { background: var(--bs-tertiary-bg) !important; color: var(--bs-secondary-color) !important; }
.cat-chip { font-size: .8rem; }
.cat-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-bs-theme="dark"] .cat-chip.active { color: #0d1b2a; }
footer { font-size: .88rem; }
