/* The personal site is always light; the chat at /ai follows the system theme. */
:root {
  color-scheme: light;
  --bg: #fffdf9;
  --band: #f6f1e9;
  --fg: #22201c;
  --muted: #6b665e;
  --card: #ffffff;
  --border: #e8e1d5;
  --accent: #2f5d50;
  --accent-hover: #244a3f;
  --accent-soft: #e6efe9;
  --warm: #c8693a;
  --shadow: 0 1px 2px rgb(60 40 20 / 0.05), 0 8px 24px rgb(60 40 20 / 0.07);
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 14px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(255 253 249 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 12px 28px;
  padding-block: 14px;
}
.site-nav .brand { color: var(--fg); font-family: var(--display); font-weight: 600; font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.site-nav nav { margin-left: auto; min-width: 0; }
.site-nav ul { display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; list-style: none; font-size: 15px; font-weight: 500; }
.site-nav ul a { position: relative; display: block; padding: 6px 0; color: var(--fg); text-decoration: none; white-space: nowrap; }
.site-nav ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform 0.2s; }
.site-nav ul a:hover, .site-nav ul a[aria-current] { color: var(--accent); }
.site-nav ul a:hover::after, .site-nav ul a[aria-current]::after { transform: scaleX(1); }
/* A pill, so it reads as a separate page next to the links that jump down the home page. */
.site-nav ul a.nav-page { padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; transition: background 0.15s; }
.site-nav ul a.nav-page::after { display: none; }
.site-nav ul a.nav-page:hover { background: #d5e4db; }
.site-nav ul a.nav-page[aria-current] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.site-nav .nav-cta { padding: 8px 18px; font-size: 15px; white-space: nowrap; }
section[id] { scroll-margin-top: 72px; }

/* Sections */
section { padding: 88px 0; }
section.band { background: var(--band); }
.eyebrow { margin: 0 0 10px; color: var(--warm); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.lead { font-size: 1.2rem; line-height: 1.6; }
.muted { color: var(--muted); }
.section-head { max-width: 680px; margin-bottom: 40px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split > *, .book > *, .grid-2 > *, .cards > * { min-width: 0; }

.button {
  display: inline-block;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.button.secondary { background: var(--card); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.button.secondary:hover { background: var(--accent-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards h3 { font-size: 1.2rem; }
.cards p { margin: 0; font-size: 16px; color: var(--muted); }
.cards p + p { margin-top: 10px; }
.project-cards { margin-top: 88px; }
.project-cards .card { display: flex; flex-direction: column; align-items: flex-start; }
.project-cards p.eyebrow { margin: 0 0 6px; color: var(--warm); font-size: 13px; }
.project-cards .product-logo { width: 48px; }
.project-cards .actions { width: 100%; margin-top: auto; padding-top: 20px; }
.project-cards .button { padding: 10px 18px; font-size: 14px; }

/* Hero */
.hero { padding: 72px 0 88px; }
.hero .eyebrow { text-wrap: balance; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin-bottom: 4px; }
.hero .creds { margin: 0 0 20px; color: var(--muted); font-weight: 500; }
.hero-photo img { border-radius: 24px; box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; object-position: 70% center; }

/* Quotes */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.quotes blockquote { margin: 0 0 14px; font-family: var(--display); font-size: 1.2rem; line-height: 1.45; }
.quotes blockquote::before { content: "\201C"; display: block; height: 0.6em; color: var(--warm); font-size: 3rem; line-height: 1; }
.quotes cite { color: var(--muted); font-size: 14px; font-style: normal; }

/* Ask my AI */
.ai-card { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.ai-card img { width: 56px; height: 56px; border-radius: 50%; }
.ai-card p { margin: 0; font-weight: 600; }
.prompts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.prompts a {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.prompts a:hover { border-color: var(--accent); background: var(--accent-soft); }
.prompts a::after { content: " \2192"; color: var(--accent); }

/* Embeds */
.embed { display: block; width: 100%; border: 0; border-radius: 12px; }
.embed.video { aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.embed.spotify { height: 152px; }
.embed.apple { height: 175px; }

/* LitReview */
.product-logo { width: 64px; margin-bottom: 16px; }
.screenshot { border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.features { display: grid; gap: 14px; margin: 20px 0 0; padding: 0; list-style: none; }
.features li { padding-left: 28px; position: relative; }
.features li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.features strong { display: block; }
.features span { color: var(--muted); font-size: 16px; }

/* Books */
.book-shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 64px; }
.book-shelf a { color: var(--fg); text-decoration: none; }
.book-shelf img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: var(--shadow); transition: transform 0.2s; }
.book-shelf a:hover img { transform: translateY(-4px); }
.book-shelf span { display: block; margin-top: 12px; font-weight: 600; font-size: 15px; }

.book { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 48px 0; border-top: 1px solid var(--border); }
.book img { border-radius: 4px 8px 8px 4px; box-shadow: var(--shadow); }
.book blockquote { margin: 0 0 18px; padding-left: 16px; border-left: 3px solid var(--warm); font-family: var(--display); font-size: 1.15rem; font-style: italic; }
.book blockquote cite { display: block; margin-top: 6px; color: var(--muted); font-family: "Inter", sans-serif; font-size: 13px; font-style: normal; letter-spacing: 0.02em; }
.book .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 20px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Contact */
.contact .card { display: flex; flex-direction: column; align-items: flex-start; }
.contact .card .button { margin-top: auto; }
.contact ul { margin: 0 0 20px; padding-left: 20px; color: var(--muted); }

/* Blog */
.recent-posts { padding-top: 0; }
.carousel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.carousel-head h2 { margin: 0; }
.carousel-controls { display: flex; gap: 8px; }
.carousel-controls[hidden] { display: none; }
.carousel-controls button { width: 44px; height: 44px; border: 1.5px solid var(--accent); border-radius: 50%; background: var(--card); color: var(--accent); font-size: 18px; cursor: pointer; transition: background 0.15s; }
.carousel-controls button:hover:not(:disabled) { background: var(--accent-soft); }
.carousel-controls button:disabled { border-color: var(--border); color: var(--muted); cursor: default; }
.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  margin: 0 -20px -16px;
  padding: 8px 20px 36px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  scrollbar-width: none;
  list-style: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 16px; }
.carousel li { display: flex; min-width: 0; scroll-snap-align: start; }
.more-link { display: inline-block; margin-top: 8px; font-weight: 600; }

.post-card { position: relative; display: flex; flex-direction: column; width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); transition: transform 0.15s; }
.post-card:hover { transform: translateY(-3px); }
.post-card img, .post-cover-blank { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-cover-blank { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--display); font-size: 2.5rem; }
.post-card-body { padding: 18px 20px 22px; }
.post-card h2, .post-card h3 { margin-bottom: 8px; font-size: 1.2rem; line-height: 1.25; }
.post-card h2 a, .post-card h3 a { color: var(--fg); text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover h2 a, .post-card:hover h3 a { color: var(--accent); }
.post-excerpt { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 15px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.post-meta { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.page-title { font-size: clamp(2.2rem, 5vw, 3rem); }

.post { padding: 48px 0 72px; }
.post-wrap { max-width: 760px; }
.post h1 { font-size: clamp(2.1rem, 5vw, 3rem); }
.breadcrumbs { margin-bottom: 20px; color: var(--muted); font-size: 14px; }
.post-cover { width: 100%; margin-top: 24px; border-radius: 14px; box-shadow: var(--shadow); }
.post-body { margin-top: 32px; font-size: 18px; line-height: 1.7; overflow-wrap: break-word; }
.post-body h2 { margin: 40px 0 12px; font-size: 1.65rem; }
.post-body h3 { margin: 32px 0 10px; }
.post-body p { margin-bottom: 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 24px; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote { margin: 0 0 18px; padding-left: 16px; border-left: 3px solid var(--warm); color: var(--muted); }
.post-body figure { margin: 28px 0; }
.post-body figure img { margin: 0 auto; border-radius: 10px; }
.post-body figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; text-align: center; }
.author-card { display: flex; gap: 16px; align-items: flex-start; margin-top: 48px; }
.author-card img { flex: none; width: 64px; height: 64px; border-radius: 50%; }
.author-card h2 { margin-bottom: 4px; font-size: 1.2rem; }
.author-card p { margin: 0; font-size: 15px; }

/* About */
.prose { max-width: 680px; }
.prose h3 { margin-top: 40px; }
.prose ul { padding-left: 20px; }
.about-head { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; }
.about-head img { width: 96px; height: 96px; border-radius: 50%; }
.about-head h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3rem); }

footer { padding: 48px 0; background: var(--fg); color: #d8d2c7; font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
footer .brand { color: #fff; font-family: var(--display); font-size: 1.2rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer a { color: #d8d2c7; text-decoration: none; }
footer a:hover { color: #fff; }

@media (max-width: 860px) {
  .site-nav { flex-wrap: wrap; justify-content: space-between; padding-block: 12px 0; }
  .site-nav nav { order: 3; flex-basis: 100%; margin: 0 -20px; overflow-x: auto; scrollbar-width: none; }
  .site-nav nav::-webkit-scrollbar { display: none; }
  .site-nav ul { gap: 22px; padding: 0 20px 8px; }
  section[id] { scroll-margin-top: 104px; }
  section { padding: 64px 0; }
  .hero { padding: 40px 0 64px; }
  .split, .grid-2, .quotes, .cards { grid-template-columns: 1fr; gap: 32px; }
  .hero .split { display: flex; flex-direction: column-reverse; }
  .hero-photo img { aspect-ratio: 4 / 3; }
  .carousel { grid-auto-columns: 82%; }
  .post-grid { grid-template-columns: 1fr; }
  .book-shelf { grid-template-columns: repeat(2, 1fr); }
  .book { grid-template-columns: 1fr; gap: 20px; }
  .book img { max-width: 160px; }
}
