/* Core layout */
:root {
  --ink: #17212b;
  --muted: #5f6b76;
  --line: #d9dee2;
  --surface: #ffffff;
  --surface-alt: #f5f7f2;
  --accent: #243142;
  --accent-dark: #243142;
  --accent-warm: #b45309;
  --accent-blue: #243142;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.08);
}

body {
  color: var(--ink);
  background: #fbfbf8;
  font-size: 17px;
  line-height: 1.7;
}

html,
body {
  overflow-x: hidden;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-blue);
}

.content p,
.content li,
.content td,
.work-card,
.coursework-group {
  overflow-wrap: break-word;
}

.content a {
  overflow-wrap: anywhere;
}

.navbar {
  border-bottom: 1px solid rgba(23, 33, 43, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.navbar-title,
.nav-link {
  letter-spacing: 0;
}

.navbar .nav-link.active,
.navbar .nav-link:hover,
.navbar .navbar-title:hover {
  color: var(--accent) !important;
}

.quarto-title-block {
  display: none;
}

main.content {
  padding-top: 0;
}

body.nav-fixed main.content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.section-block {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) clamp(1.1rem, 4vw, 2rem);
}

.section-block > h2,
.section-block > h3 {
  margin-top: 0;
}

.section-block > h2::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: var(--accent-warm);
}

.section-band {
  background: var(--surface-alt);
  border-top: 1px solid rgba(23, 33, 43, 0.06);
  border-bottom: 1px solid rgba(23, 33, 43, 0.06);
}

.intro-block {
  max-width: 900px;
  color: #35424f;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.eyebrow,
.card-kicker {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hero sections */
.home-hero {
  box-sizing: border-box;
  width: 100vw;
  min-height: clamp(480px, 58vh, 620px);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  align-items: flex-end;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f7f4 100%);
  border-bottom: 1px solid rgba(23, 33, 43, 0.08);
  padding: clamp(4rem, 8vw, 6rem) clamp(1.2rem, 6vw, 6rem) clamp(2rem, 5vw, 3.5rem);
}

.home-hero__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 340px);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.home-hero__content {
  max-width: 760px;
}

.home-hero .eyebrow {
  color: var(--accent);
}

.home-hero h1 {
  max-width: 900px;
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.45rem, 6.1vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-name {
  color: var(--accent-blue);
}

.home-hero__media {
  justify-self: end;
}

.home-portrait {
  width: min(100%, 320px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(23, 33, 43, 0.12);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  max-width: 900px;
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.home-hero p {
  max-width: 690px;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
}

.page-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) clamp(1.1rem, 4vw, 2rem) clamp(2rem, 4vw, 3rem);
}

.page-hero--compact {
  padding-bottom: 1.25rem;
}

.page-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-top: 1.4rem;
}

.button-row > p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin: 0;
}

.button-row--center {
  justify-content: center;
}

.btn {
  border-radius: 8px;
  border-width: 1px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.68rem 1rem;
  text-decoration: none !important;
}

.btn-primary {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  background-color: var(--accent) !important;
  color: #ffffff !important;
}

.btn-primary:hover {
  border-color: var(--accent-dark) !important;
  background: var(--accent-dark) !important;
  background-color: var(--accent-dark) !important;
  opacity: 0.92;
}

.btn-secondary {
  border-color: rgba(36, 49, 66, 0.18) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: var(--accent-dark) !important;
}

.btn-secondary:hover {
  border-color: var(--accent-dark) !important;
  background: var(--surface-alt) !important;
  background-color: var(--surface-alt) !important;
  color: var(--accent-dark) !important;
}

.btn-outline {
  border: 1px solid currentColor;
  color: inherit !important;
  background: transparent;
}

.btn-link {
  color: var(--accent-dark) !important;
  text-decoration: none;
}

/* Cards and grids */
.card-grid,
.feature-grid,
.highlight-grid,
.coursework-grid,
.focus-grid {
  display: grid;
  gap: 1rem;
}

.cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-card,
.category-card,
.highlight-card,
.coursework-group,
.timeline-item,
.feature-card {
  border: 1px solid rgba(23, 33, 43, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.03);
}

.work-card,
.category-card,
.highlight-card,
.coursework-group,
.timeline-item {
  padding: 1.25rem;
}

.work-card,
.category-card,
.feature-card {
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.work-card:hover,
.category-card:hover,
.feature-card:hover {
  border-color: rgba(23, 33, 43, 0.16);
  box-shadow: 0 10px 26px rgba(23, 33, 43, 0.08);
  transform: translateY(-1px);
}

.work-card h3,
.category-card h3,
.highlight-card h3,
.coursework-group h3,
.timeline-item h3,
.feature-card h3,
.card-title {
  margin-top: 0.45rem;
  margin-bottom: 0.55rem;
  font-size: 1.15rem;
  line-height: 1.25;
}

.card-title {
  font-weight: 700;
}

.work-card h3 a,
.category-card h3 a,
.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.work-card h3 a:hover,
.category-card h3 a:hover,
.card-title a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.card-kicker p {
  margin-bottom: 0;
  color: inherit;
}

.category-card h3,
.category-card .card-title {
  position: static;
}

.category-card h3 a:not(.anchorjs-link)::after,
.category-card .card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.category-card h3 a:focus-visible,
.category-card .card-title a:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 4px;
}

.work-card p,
.category-card p,
.highlight-card p,
.coursework-group p,
.feature-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.work-card ul {
  padding-left: 1.1rem;
}

.work-card > section > p,
.work-card > p {
  color: var(--muted);
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card {
  display: flex;
  min-height: 100%;
  overflow: hidden;
}

.feature-card__body {
  padding: 1.35rem;
}

.category-card {
  min-height: 210px;
}

.highlight-grid,
.coursework-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
}

.focus-copy p {
  color: var(--muted);
}

.focus-list {
  border-left: 4px solid var(--accent-warm);
  padding-left: 1.25rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.tag-row code {
  border: 1px solid rgba(36, 49, 66, 0.18);
  border-radius: 999px;
  background: rgba(36, 49, 66, 0.07);
  color: var(--accent-dark);
  font-size: 0.76rem;
  padding: 0.18rem 0.48rem;
}

/* Profile and work item pages */
.profile-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.profile-hero-copy {
  min-width: 0;
}

.profile-portrait {
  width: min(100%, 320px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px !important;
  border: 1px solid rgba(23, 33, 43, 0.12);
  box-shadow: var(--shadow);
}

.timeline {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.content img {
  border-radius: 8px;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.6rem;
}

.work-meta span {
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
}

/* Project detail pages */
.project-hero,
.project-summary,
.project-highlights,
.project-snapshot,
.project-links,
.skill-tags {
  max-width: 900px;
}

.project-hero {
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.5rem);
}

.project-hero .eyebrow {
  margin-bottom: 0.7rem;
}

.project-hero h1,
.project-hero h2 {
  max-width: 840px;
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.project-hero h2 .anchorjs-link {
  font-size: 0.45em;
}

.project-hero p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1.35rem 0 0;
}

.project-links > p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
}

.project-summary,
.project-snapshot,
.project-highlights,
.skill-tags {
  margin-left: auto;
  margin-right: auto;
}

.project-summary {
  color: #35424f;
  font-size: 1.05rem;
}

.project-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 43, 0.1);
  border-radius: 8px;
  background: var(--surface);
}

.project-snapshot div {
  padding: 0.85rem 1rem;
  border-right: 1px solid rgba(23, 33, 43, 0.08);
}

.project-snapshot div:last-child {
  border-right: 0;
}

.project-snapshot dt {
  margin-bottom: 0.18rem;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-snapshot dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.45;
}

.project-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-highlights > *,
.deliverable-card {
  border: 1px solid rgba(23, 33, 43, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.03);
}

.project-highlights > * {
  padding: 1rem;
}

.project-highlights h3,
.deliverable-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.project-highlights p,
.deliverable-card p {
  color: var(--muted);
}

.project-highlights p {
  margin-bottom: 0;
}

.deliverable-card p {
  margin-bottom: 0;
}

.deliverable-card p + p {
  margin-top: 0.85rem;
}

.deliverable-card .btn {
  display: inline-block;
  margin-top: 0;
  margin-bottom: 0;
}

.deliverable-card {
  padding: 1.1rem;
  margin: 1rem 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.skill-tags p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.skill-tags span,
.skill-tags code {
  border: 1px solid rgba(36, 49, 66, 0.16);
  border-radius: 999px;
  background: rgba(36, 49, 66, 0.06);
  color: var(--accent-dark);
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.26rem 0.58rem;
}

.callout-note,
.callout-tip {
  border-radius: 8px;
}

footer.footer {
  border-top: 1px solid rgba(23, 33, 43, 0.08);
}

footer.footer .nav-footer {
  gap: 1rem;
}

footer.footer .nav-footer-left {
  color: var(--muted);
  line-height: 1.5;
}

footer.footer .nav-footer-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: flex-end;
}

footer.footer a {
  color: var(--muted) !important;
  font-weight: 600;
  text-decoration: none;
}

footer.footer a:hover {
  color: var(--accent) !important;
  text-decoration: underline;
}

@media (max-width: 980px) {
  .cards-4,
  .cards-3,
  .feature-grid,
  .highlight-grid,
  .coursework-grid,
  .focus-grid,
  .project-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-snapshot div:nth-child(2) {
    border-right: 0;
  }

  .project-snapshot div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(23, 33, 43, 0.08);
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero__inner {
    grid-template-columns: 1fr;
  }

  .home-hero__media {
    justify-self: start;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .cards-4,
  .cards-3,
  .feature-grid,
  .highlight-grid,
  .coursework-grid,
  .focus-grid,
  .project-highlights,
  .project-snapshot {
    grid-template-columns: 1fr;
  }

  .project-hero {
    padding-top: 3rem;
  }

  .project-snapshot div,
  .project-snapshot div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid rgba(23, 33, 43, 0.08);
  }

  .project-snapshot div:last-child {
    border-bottom: 0;
  }

  .home-hero {
    min-height: auto;
    padding: 3.25rem 1rem 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6f7f4 100%);
  }

  .home-hero h1 {
    font-size: clamp(2.1rem, 10vw, 2.55rem);
    line-height: 1.05;
  }

  .page-hero h1 {
    line-height: 1.04;
  }

  .home-hero p {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 1rem;
  }

  .button-row {
    align-items: stretch;
  }

  .home-hero .button-row {
    gap: 0.45rem;
    margin-top: 1rem;
  }

  .button-row .btn {
    width: 100%;
    text-align: center;
  }

  .home-hero .button-row .btn {
    padding: 0.55rem 0.8rem;
  }

  .home-hero .button-row .btn-link {
    width: auto;
    align-self: center;
    padding: 0.35rem 0.75rem;
  }

  .home-portrait,
  .profile-portrait {
    width: min(100%, 240px);
    border-radius: 14px !important;
  }

  .profile-hero-grid {
    grid-template-columns: 1fr;
  }

  footer.footer .nav-footer-right {
    justify-content: flex-start;
  }
}
