:root {
    --paper: #f5f8fa;
    --ink: #13202b;
    --muted: #4a5b6a;
    --blue: #0072bc;
    --blue-deep: #004f83;
    --tint: #e2edf6;
    --line: #d3dde6;
    --serif: "Literata", Georgia, "Times New Roman", serif;
    --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --measure: 62ch;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--blue-deep); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .75rem 1rem; z-index: 20; }
.skip:focus { left: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.25rem, 5.2vw, 4rem); max-width: 16ch; }
h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.005em; }
p { margin: 0 0 1em; max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.logo-mark { display: block; height: 2.75rem; aspect-ratio: 220 / 182; mix-blend-mode: multiply; background: url("/index_files/jdv.png") no-repeat left center / auto 100%; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.tagline { font-size: .8rem; color: var(--muted); letter-spacing: .01em; }
.wordmark { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.site-nav ul { list-style: none; display: flex; gap: clamp(1rem, 2.4vw, 2rem); margin: 0; padding: 0; flex-wrap: wrap; align-items: center; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.975rem; padding: .35rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { border-bottom-color: var(--blue); }

.btn {
    display: inline-block; background: var(--blue); color: #fff; text-decoration: none;
    padding: .8rem 1.4rem; border-radius: 3px; font-weight: 600; font-size: 1rem; line-height: 1.2;
    transition: background-color .15s;
}
.btn:hover { background: var(--blue-deep); color: #fff; }
.site-nav .btn { color: #fff; padding: .55rem 1rem; font-size: .95rem; border-bottom: 0; }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 5rem); align-items: end; }
.hero-lede { font-size: 1.25rem; color: var(--muted); margin-top: 1.75rem; max-width: 40ch; }
.incision { display: block; height: 2px; background: var(--blue); width: 7rem; margin-top: 2rem; transform-origin: left; animation: draw 1.1s .25s cubic-bezier(.2,.7,.2,1) both; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-actions { display: flex; gap: 1.5rem; align-items: center; margin-top: 2.25rem; flex-wrap: wrap; }
.hero-actions .phone { font-weight: 600; color: var(--ink); text-decoration: none; }
.hero-actions .phone:hover { text-decoration: underline; }
.portrait { margin: 0; }
.portrait img { width: 100%; height: auto; mix-blend-mode: multiply; }
.portrait figcaption { font-size: .9rem; color: var(--muted); padding-top: .75rem; border-top: 1px solid var(--line); }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(1.5rem, 5vw, 4rem); }
.section-head > h2 { align-self: start; }
.section-head + .section-head { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* Surgery */
.surgery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(1.5rem, 5vw, 4rem); }
.surgery figure { margin: 2rem 0 0; }
.surgery img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 60% 40%; border-radius: 3px; }
.procedures { list-style: none; margin: 0; padding: 0; }
.procedures li { padding: 0 0 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.procedures li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.procedures h3 { margin-bottom: .5rem; }
.procedures p { margin-bottom: 0; color: var(--muted); }

/* Background */
.facts { margin: 0; padding: 0; }
.facts > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.facts > div:first-child { padding-top: 0; }
.facts dt { font-variant-numeric: tabular-nums; color: var(--muted); }
.facts dd { margin: 0; }
.facts dd strong { font-weight: 600; display: block; }
.facts dd span { color: var(--muted); }
.sub { font-size: 1.125rem; margin: 2.5rem 0 1rem; }
.sub:first-child { margin-top: 0; }

.plain { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.plain li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.plain li:first-child { padding-top: 0; }

/* Links list (research / patients) */
.linklist { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.linklist li { border-bottom: 1px solid var(--line); }
.linklist a { display: flex; justify-content: space-between; gap: 1rem; padding: .95rem 0; text-decoration: none; color: var(--ink); }
.linklist a:hover { color: var(--blue-deep); }
.linklist a:hover .go { text-decoration: underline; }
.linklist .go { color: var(--blue-deep); white-space: nowrap; }

/* Contact */
.contact { background: var(--blue-deep); color: #e6f0f8; border-top: 0; }
.contact h2 { color: #fff; }
.contact a { color: #fff; }
.contact a:hover { color: #cfe4f5; }
.contact address { font-style: normal; font-size: 1.125rem; }
.contact .tel { font-family: var(--serif); font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 500; letter-spacing: -0.01em; display: block; margin: 1.25rem 0 .25rem; text-decoration: none; }
.contact .tel:hover { text-decoration: underline; }
.contact .btn { background: #fff; color: var(--blue-deep); margin-top: 1.75rem; }
.contact .btn:hover { background: var(--tint); color: var(--ink); }
.contact small { display: block; color: #b9d2e6; margin-top: .25rem; font-size: .95rem; }

.more { margin-top: 2rem; }

/* Footer */
.site-footer { padding: 2rem 0 2.5rem; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.site-footer ul { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer ul.sitemap { flex-basis: 100%; flex-wrap: wrap; gap: .4rem 1.5rem; padding-bottom: 1.25rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line); }

@media (max-width: 860px) {
    .hero .wrap, .section-head, .surgery { grid-template-columns: minmax(0, 1fr); }
    .portrait { max-width: 22rem; }
    .surgery figure { max-width: 24rem; }
    .facts > div { grid-template-columns: 1fr; gap: .15rem; }
    .site-header { position: static; }
}

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

/* Inner pages */
.banner { margin: 0 0 clamp(2rem, 4vw, 3rem); }
.banner img { width: 100%; height: auto; min-height: 8rem; object-fit: cover; border-radius: 3px; }
.page-head:has(+ .wrap .banner) { padding-bottom: clamp(1.5rem, 3vw, 2rem); }
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); max-width: 22ch; }
.page-head .incision { margin-top: 1.5rem; }
.page-head .hero-lede { margin-top: 1.5rem; }
.page-head + .section { border-top: 1px solid var(--line); }

.prose h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { max-width: var(--measure); }
.prose ul { max-width: var(--measure); padding-left: 1.2rem; }
.prose ul.plain { padding-left: 0; }
.prose li { margin-bottom: .5rem; }
.prose figure, .figure { margin: 2rem 0; }
.figure img, .prose figure img { max-width: 100%; height: auto; border-radius: 3px; }
.figure figcaption, .prose figcaption { font-size: .9rem; color: var(--muted); padding-top: .6rem; }
.figure.narrow { max-width: 24rem; }

.proc { display: grid; grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 3rem); padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); align-items: start; }
.proc:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.proc img { width: 100%; height: auto; border-radius: 3px; }
.proc h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.proc p:last-child { margin-bottom: 0; }

.news { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.news:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.news h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.news img { max-width: 22rem; width: 100%; height: auto; margin-top: 1rem; border-radius: 3px; }

.pubs + .pubs { margin-top: clamp(2.5rem, 5vw, 4rem); }
.pubs .linklist { max-width: none; }
.pubs .linklist a { font-size: .975rem; line-height: 1.55; }
.pubs .go { align-self: flex-start; }

.locations { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem 3rem; margin: 0; }
.locations h3 { font-size: 1.125rem; margin-bottom: .5rem; }
.locations address { font-style: normal; color: var(--muted); }
.locations a { color: var(--blue-deep); }

.form { max-width: 40rem; display: grid; gap: 1.25rem; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.25rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.form input, .form textarea { font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #9db0c0; border-radius: 3px; padding: .7rem .8rem; width: 100%; }
.form textarea { min-height: 10rem; resize: vertical; }
.form button { justify-self: start; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.notice { max-width: 40rem; padding: 1rem 1.25rem; border-left: 3px solid var(--blue); background: var(--tint); }
.notice.error { border-left-color: #9a3412; background: #f6e9e1; }
.notice p { margin: 0; }
.split { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); }

@media (max-width: 860px) {
    .proc { grid-template-columns: minmax(0, 1fr); }
    .proc img { max-width: 25rem; }
}

/* Dates */
.date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.linklist .date { flex: none; min-width: 6.5rem; }
.pubs .linklist .date { padding-top: .1rem; }
.news .date { margin: -.25rem 0 .75rem; }
.linklist > li > a > span:not(.date):not(.go) { flex: 1; min-width: 0; }
.prose ul.linklist { padding-left: 0; max-width: none; }
.prose .pubs { margin-top: 1.25rem; }

/* Mobile navigation */
.nav-toggle { display: none; }
@media (max-width: 1180px) {
    .site-header { position: sticky; }
    .site-header .wrap { flex-wrap: wrap; row-gap: 0; padding-top: .35rem; padding-bottom: .35rem; }
    .js .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; margin-right: -.5rem; background: none; border: 0; border-radius: 3px; cursor: pointer; color: var(--ink); }
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 1.5rem; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, background-color .2s; }
    .nav-toggle-bars { position: relative; }
    .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -7px; }
    .nav-toggle-bars::after { top: 7px; }
    .site-header.open .nav-toggle-bars { background: transparent; }
    .site-header.open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
    .site-header.open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }
    .site-nav { flex-basis: 100%; }
    .js .site-nav { display: none; }
    .js .site-header.open .site-nav { display: block; max-height: calc(100vh - 5rem); overflow-y: auto; }
    .site-nav ul { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; padding: 0 0 1rem; }
    .site-nav li a { display: block; padding: .9rem 0; font-size: 1.0625rem; border-bottom: 1px solid var(--line); }
    .site-nav li a[aria-current] { border-bottom-color: var(--blue); }
    .site-nav .btn { margin-top: .85rem; padding: .9rem 1rem; text-align: center; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}

/* Narrow screens: long citations and DOIs */
.linklist > li > a > span { overflow-wrap: anywhere; }
@media (max-width: 560px) {
    .linklist > li > a { flex-wrap: wrap; row-gap: .15rem; }
    .linklist .date, .pubs .linklist .date { flex-basis: 100%; min-width: 0; padding-top: 0; }
    .linklist > li > a > span:not(.date):not(.go) { flex: 1 1 0; }
    .facts > div { grid-template-columns: minmax(0, 1fr); }
}

/* Compact desktop nav (longer EN/CA/PT labels + language switcher) */
@media (min-width: 1181px) {
    .site-nav ul { gap: clamp(.8rem, 1.4vw, 1.15rem); }
    .site-nav a { font-size: .9rem; }
    .site-nav .btn { font-size: .9rem; padding: .5rem .9rem; white-space: nowrap; }
    .site-nav { gap: clamp(.9rem, 1.6vw, 1.4rem); }
    .site-nav li a { white-space: nowrap; }
}

@media (max-width: 380px) {
    .logo-mark { height: 2.4rem; }
    .wordmark { font-size: 1.1rem; }
    .tagline { font-size: .72rem; }
    .brand { gap: .55rem; }
}

/* Language dropdown */
.site-nav { display: flex; align-items: center; gap: clamp(.9rem, 1.6vw, 1.4rem); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .6rem; font-size: .875rem; letter-spacing: .04em; color: var(--ink); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: var(--blue); }
.lang-caret { width: .45rem; height: .45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-.1rem) rotate(45deg); transition: transform .15s; }
.lang-menu[open] .lang-caret { transform: translateY(.1rem) rotate(-135deg); }
.lang-list { list-style: none; margin: 0; padding: .35rem; position: absolute; right: 0; top: calc(100% + .35rem); min-width: 9.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 6px 18px rgba(19, 32, 43, .12); z-index: 20; }
.site-nav .lang-list { display: block; }
.site-nav .lang-list a { display: block; padding: .5rem .7rem; font-size: .9375rem; color: var(--ink); text-decoration: none; border-radius: 2px; border-bottom: 0; white-space: nowrap; }
.site-nav .lang-list a:hover { background: var(--tint); }
.site-nav .lang-list a[aria-current] { font-weight: 600; color: var(--blue-deep); }
@media (max-width: 1180px) {
    .site-nav { display: block; }
    .lang-menu { padding: .85rem 0 1.1rem; }
    .lang-menu summary { padding: .65rem .9rem; font-size: .9375rem; }
    .lang-list { position: static; margin-top: .5rem; box-shadow: none; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .lang-caret { transition: none; } }
