@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500&display=swap");

:root {
  --bg: #f5f4f2;
  --bg-alt: #eceff1;
  --surface: #ffffff;
  --text: #153742;
  --muted: #49616a;
  --border: #d7dde2;
  --primary: #0f4c5c;
  --primary-strong: #0b3e4b;
  --focus: #1c6a7f;
  --maxw: 72rem;
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #eef3f5 0%, rgba(238, 243, 245, 0) 38%),
    radial-gradient(circle at 100% 0%, #edf1f3 0%, rgba(237, 241, 243, 0) 30%),
    var(--bg);
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--primary-strong);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.5rem;
  z-index: 1000;
}

.container {
  width: min(100% - 2rem, var(--maxw));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(245, 244, 242, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
}

.brand {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary-strong);
  background: #e7f0f2;
}

.nav-cv {
  text-decoration: none;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.nav-cv:hover,
.nav-cv:focus-visible {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #ffffff;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hero h1 {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin: 0;
}

.hero-portrait {
  width: clamp(7rem, 16vw, 10rem);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 12px 24px -18px rgba(16, 24, 40, 0.55);
}

.hero-portrait-fallback {
  display: grid;
  place-items: center;
  background: #e8eff1;
  color: var(--primary);
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
}

.eyebrow {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-strong);
  color: #ffffff;
}

.btn-secondary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-small {
  border-color: var(--primary);
  color: var(--primary);
  white-space: nowrap;
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface);
  box-shadow: 0 10px 24px -18px rgba(16, 24, 40, 0.45);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -18px rgba(16, 24, 40, 0.55);
}

.project-list {
  display: grid;
  gap: 0.75rem;
}

.project-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 8px 20px -18px rgba(16, 24, 40, 0.6);
}

.cols-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.media-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.video-placeholder {
  min-height: 12rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
}

.media-video {
  width: 100%;
  min-height: 12rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
}

.prose {
  max-width: 68ch;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.2;
  margin-top: 1.6em;
  margin-bottom: 0.45em;
}

.prose h1 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 2.5rem);
}

.prose p,
.prose li {
  color: var(--text);
}

.post-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 18px 30px -24px rgba(16, 24, 40, 0.5);
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.post-meta {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.03em;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Discussion section styling */
.post-discussion-header {
  margin: 1.5rem 0 1rem 0;
  padding: 0.75rem 1rem;
  background: #f0f6f9;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
}

.post-discussion-header a {
  text-decoration: none;
  font-weight: 600;
}

.post-discussion-header a:hover {
  text-decoration: underline;
}

.post-discussion {
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.post-discussion h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.1rem;
}

.post-discussion a {
  text-decoration: none;
}

.post-discussion a:hover {
  text-decoration: underline;
}

.post-discussion hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 1rem 0;
}

@media (max-width: 48rem) {
  .media-grid {
    grid-template-columns: 1fr;
  }

  .hero-head {
    align-items: center;
  }

  .nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .hero-portrait {
    width: clamp(5.5rem, 26vw, 7rem);
  }

  .project-row {
    flex-direction: column;
  }
}

/* ── Footnotes ── */
.footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}

.footnotes ol {
  padding-left: 1.4rem;
}

.footnotes li {
  margin-bottom: 0.5rem;
}

.footnotes li p {
  margin: 0;
}

sup {
  font-size: 0.75em;
  line-height: 0;
  vertical-align: super;
}

a.reversefootnote {
  text-decoration: none;
  margin-left: 0.2em;
}
