:root {
  --ink: #17181a;
  --muted: #60656b;
  --line: #d9dde0;
  --soft: #f4f6f7;
  --accent: #00a7bd;
  --page: #ffffff;
  --max: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p,
li,
figcaption {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: clamp(16px, 2vw, 24px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.nav-shell {
  width: min(calc(100% - 40px), var(--max));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.hero {
  min-height: calc(100vh - 66px);
  border-bottom: 1px solid var(--line);
}

.hero-shell,
.section-shell,
.project-shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.hero-shell {
  min-height: calc(100vh - 66px);
  padding: clamp(54px, 8vw, 110px) 0 clamp(52px, 7vw, 90px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 36px;
}

.hero h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.5rem, 4.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 780;
}

.hero-art {
  width: min(100%, 1040px);
  max-height: 58vh;
  margin: auto;
  object-fit: contain;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-meta p {
  margin: 0;
  max-width: 650px;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.hero-meta a {
  white-space: nowrap;
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.linkedin-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  background: #0a66c2;
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1;
}

.content-section {
  padding: clamp(72px, 9vw, 132px) 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 76px;
}

.section-heading {
  margin: 0 0 clamp(36px, 5vw, 68px);
  font-size: clamp(2.1rem, 4.5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(62px, 7vw, 96px) clamp(34px, 5vw, 72px);
  background: transparent;
  border: 0;
}

.project-card {
  min-width: 0;
  background: transparent;
}

.project-image-wrap {
  min-height: 360px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
}

.project-image-wrap img {
  width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.project-card-copy {
  padding: 22px 0 0;
  border-top: 0;
  background: transparent;
  text-align: center;
}

.project-card h3 {
  width: 100%;
  margin: 0;
  font-size: clamp(1.2rem, 2.1vw, 1.75rem);
  line-height: 1.2;
  font-weight: 680;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.65;
}

.education-item h3 {
  margin: 0;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.education-item {
  padding: clamp(28px, 4vw, 48px);
  background: var(--page);
}

.education-item p {
  margin: 14px 0 0;
  font-size: 1.15rem;
  line-height: 1.65;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  font-size: clamp(1.05rem, 2.1vw, 1.5rem);
}

.site-footer {
  padding: 30px 0 42px;
}

.footer-shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-shell p {
  margin: 0;
}

/* Project pages */
.project-hero {
  padding: clamp(64px, 9vw, 126px) 0 clamp(56px, 8vw, 104px);
  border-bottom: 1px solid var(--line);
}

.project-kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-weight: 720;
}

.project-hero h1 {
  max-width: 1050px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.project-overview {
  max-width: 1040px;
  margin: 34px 0 0;
  font-size: clamp(1.35rem, 2.15vw, 1.72rem);
  line-height: 1.6;
}

.project-hero-image {
  max-height: 620px;
  margin: clamp(42px, 7vw, 82px) auto 0;
  object-fit: contain;
}

.project-hero-figure {
  margin: clamp(42px, 7vw, 82px) 0 0;
}

.project-hero-figure .project-hero-image {
  margin: 0 auto;
}

.project-hero-figure figcaption {
  margin-top: 16px;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}

.project-section {
  padding: clamp(62px, 8vw, 108px) 0;
  border-bottom: 1px solid var(--line);
}

.project-section h2 {
  max-width: 900px;
  margin: 0 0 28px;
  font-size: clamp(1.85rem, 3.5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.project-section h2.full-width-heading {
  max-width: none;
}

.project-section p,
.project-section li {
  font-size: clamp(1.16rem, 1.55vw, 1.38rem);
  line-height: 1.68;
}

.project-section .copy {
  max-width: 1040px;
}

.project-section .copy p {
  margin: 0 0 20px;
}

.requirements-image {
  width: 100%;
  margin: clamp(30px, 5vw, 58px) 0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 38px);
  margin-top: 42px;
  background: transparent;
  border: 0;
}

.media-grid figure {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

.media-grid figure.wide {
  grid-column: 1 / -1;
}

.media-grid img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: clamp(16px, 2vw, 24px);
  clip-path: inset(0 round clamp(16px, 2vw, 24px));
  overflow: hidden;
}

.media-grid figcaption {
  margin-top: 16px;
  color: var(--ink);
  font-size: clamp(1.15rem, 1.4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.media-grid .media-item-heading {
  max-width: none;
  margin: 0 0 clamp(18px, 2.5vw, 28px);
  font-size: clamp(1.65rem, 2.8vw, 2.55rem);
  line-height: 1.08;
  text-align: center;
}

@media (min-width: 761px) {
  .yoke-axis-pair figure:first-child img {
    transform: translateY(clamp(24px, 2.8vw, 34px));
  }
}

.gallery-image-clip {
  display: block;
  width: min(100%, var(--clip-max-width, 450px));
  aspect-ratio: var(--clip-ratio, 3 / 4);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 32px;
  clip-path: inset(0 round 32px);
  isolation: isolate;
  transform: translateZ(0);
}

.gallery-image-clip img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  clip-path: none;
}

.paired-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 38px);
  align-items: start;
}

.source-sequence {
  margin-top: 38px;
  border-top: 1px solid var(--line);
}

.source-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: clamp(34px, 6vw, 84px);
  align-items: center;
  padding: clamp(42px, 6vw, 74px) 0;
  border-bottom: 1px solid var(--line);
}

.results-finish-block {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(28px, 4vw, 52px);
}

.source-block:last-child {
  border-bottom: 0;
}

.source-block-copy-only {
  grid-template-columns: 1fr;
}

.source-block-copy-only .source-copy {
  max-width: 1040px;
}

.cross-section-layout {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 3.5vw, 46px);
}

.cross-section-media img {
  width: 100%;
  max-height: none;
}

.calculation-figure-block {
  padding: clamp(42px, 6vw, 74px) 0;
  border-bottom: 1px solid var(--line);
}

.calculation-figure-block:last-child {
  border-bottom: 0;
}

.calculation-figure {
  margin: 0;
}

.calculation-images {
  width: 100%;
  gap: clamp(22px, 3vw, 38px);
}

.source-media.calculation-images img {
  width: 100%;
  height: auto;
  max-height: none;
}

.calculation-images-single img {
  width: 100%;
}

.calculation-figure figcaption {
  width: 100%;
  margin-top: clamp(20px, 3vw, 32px);
  color: var(--ink);
  font-size: clamp(1.25rem, 1.9vw, 1.58rem);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.source-block.reverse .source-copy {
  order: 2;
}

.source-block.reverse .source-media {
  order: 1;
}

.source-copy > :first-child,
.source-media > :first-child {
  margin-top: 0;
}

.source-copy > :last-child,
.source-media > :last-child {
  margin-bottom: 0;
}

.source-copy h3 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.source-copy p {
  margin: 0 0 18px;
}

.source-copy .actuation-heading {
  margin-top: 30px;
}

.source-copy ul,
.source-copy ol {
  margin: 0;
  padding-left: 1.35rem;
}

.source-media {
  min-width: 0;
}

.source-media img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
}

.source-media figure {
  margin: 0;
}

.source-media figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
}

.source-pair-figure {
  min-width: 0;
  margin: 0;
}

.source-media figcaption.evidence-caption {
  width: 100%;
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(1.12rem, 1.45vw, 1.28rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.source-media figcaption.comparison-label {
  color: var(--ink);
  font-size: clamp(1.15rem, 1.4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.tooth-geometry-pair figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
}

.tooth-geometry-pair figure > img,
.tooth-geometry-pair figure > .gallery-image-clip {
  align-self: end;
}

.tooth-geometry-pair figure > img {
  width: 100%;
  height: auto;
}

.tooth-geometry-pair figcaption {
  align-self: start;
}

.source-media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.source-media-pair img {
  height: 100%;
  max-height: 480px;
}

.analysis-layout {
  grid-template-columns: minmax(250px, 0.6fr) minmax(0, 1.4fr);
  gap: clamp(24px, 3.2vw, 44px);
}

.analysis-copy p {
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.62;
}

.analysis-triangle {
  gap: clamp(18px, 2vw, 28px);
  align-items: start;
}

.analysis-triangle figure {
  min-width: 0;
}

.analysis-triangle img {
  width: 100%;
  height: auto;
  max-height: none;
}

.analysis-triangle figure:nth-child(3) {
  width: calc(50% - clamp(9px, 1vw, 14px));
  grid-column: 1 / -1;
  justify-self: center;
}

.analysis-triangle figcaption {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}

.tooth-analysis-layout {
  row-gap: clamp(26px, 4vw, 46px);
}

.source-block.reverse .tooth-analysis-wide {
  grid-column: 1 / -1;
  order: 3;
}

.tooth-analysis-wide img {
  width: 100%;
  max-height: none;
}

.quote-block {
  margin: 0;
  padding: clamp(28px, 5vw, 58px);
  border-left: 6px solid var(--accent);
  background: var(--soft);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1.35;
}

.result-list {
  margin: 0 0 36px;
  padding-left: 1.2rem;
}

@media (max-width: 760px) {
  .nav-shell {
    min-height: 58px;
  }

  .site-nav {
    gap: 14px;
    font-size: 0.82rem;
    overflow-x: auto;
  }

  .site-nav .optional-nav {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-shell {
    min-height: auto;
    padding-top: 52px;
  }

  .hero-meta,
  .footer-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-meta a {
    white-space: normal;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .project-grid,
  .education-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-grid figure.wide {
    grid-column: auto;
  }

  .project-image-wrap {
    min-height: 260px;
  }

  .source-block {
    grid-template-columns: 1fr;
  }

  .source-block.reverse .source-copy,
  .source-block.reverse .source-media {
    order: initial;
  }

  .source-media-pair {
    grid-template-columns: 1fr;
  }

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

  .project-section p,
  .project-section li {
    font-size: 1.18rem;
  }

  .analysis-copy p {
    font-size: 1.05rem;
  }
}

@media (min-width: 900px) {
  .hero h1 {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
