/* anuragbharadwaj.net — shared stylesheet (identity: paper, ink, pine) */

:root {
  --paper: #FBF9F4;
  --paper-2: #F2EEE5;
  --ink: #14211C;
  --ink-2: #34433D;
  --ink-3: #586760;
  --line: #DFD9CC;
  --line-2: #C8C1B0;
  --accent: #1F4D3F;
  --accent-dk: #163A2F;
  --footer: #11261F;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --nav-h: 61px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) var(--paper); accent-color: var(--accent); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; -webkit-tap-highlight-color: transparent; }
summary, button { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; text-wrap: balance; font-optical-sizing: auto; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ── Navigation ── */
.site-nav { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-nav-in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0 var(--gutter); min-height: 60px; }
.brand { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 3px; background: var(--accent); color: var(--paper); font: 600 12px/30px var(--sans); letter-spacing: .06em; text-align: center; }
.brand-name { font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.nav-links { display: flex; gap: clamp(1.1rem, 2.4vw, 2.2rem); overflow-x: auto; scrollbar-width: none; }
.nav-links a { font-size: 14.5px; color: var(--ink-2); white-space: nowrap; padding: .5rem 0; transition: color .2s ease; }
.nav-links a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 8px; text-decoration-color: var(--accent); }

.sub-nav { position: sticky; top: var(--nav-h); z-index: 40; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sub-nav-in { display: flex; gap: clamp(1.4rem, 3vw, 2.4rem); padding: 0 var(--gutter); }
.sub-nav a { font-size: 14.5px; color: var(--ink-3); padding: .8rem 0 .7rem; border-bottom: 2px solid transparent; transition: color .2s ease, border-color .2s ease; }
.sub-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
#about, #expertise, #publications { scroll-margin-top: calc(var(--nav-h) + 48px); }

/* ── Buttons and links ── */
.btn { display: inline-block; font: 500 15px/1 var(--sans); padding: .95rem 1.5rem; border-radius: 4px; border: 1px solid transparent; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform 140ms var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--accent); color: var(--paper); }
.btn-line { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-paper { background: var(--paper); color: var(--accent-dk); }
.text-link { font-weight: 500; color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line-2); transition: text-decoration-color .2s ease; }

/* ── Home: hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 25vw, 330px); gap: clamp(2rem, 6vw, 6rem); align-items: end; padding: clamp(3rem, 7vw, 6.5rem) var(--gutter) clamp(2.5rem, 5vw, 4.5rem); }
.hero h1 { font-size: clamp(46px, 7.2vw, 96px); line-height: .98; letter-spacing: -.025em; }
.hero-quals { font-size: 14.5px; color: var(--ink-3); letter-spacing: .03em; margin-top: 1.2rem; }
.hero-lead { font-family: var(--serif); font-size: clamp(21px, 2.1vw, 29px); line-height: 1.3; color: var(--ink-2); max-width: 32ch; margin-top: clamp(1.4rem, 2.6vw, 2.2rem); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: clamp(1.6rem, 2.8vw, 2.4rem); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border-radius: 3px; box-shadow: 0 1px 2px rgba(20,33,28,.08), 0 18px 40px -22px rgba(20,33,28,.35); }

/* ── Sections ── */
.section { padding: clamp(3.5rem, 7vw, 6.5rem) var(--gutter); }
.section-band { background: var(--paper-2); }
.sh { font-size: clamp(32px, 3.6vw, 50px); line-height: 1.05; letter-spacing: -.015em; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 7rem); margin-top: clamp(1.8rem, 3vw, 2.8rem); align-items: start; }
.about-lead { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.32; color: var(--ink); max-width: 34ch; }
.about-text p:not(.about-lead) { max-width: 62ch; color: var(--ink-2); font-size: 16.5px; line-height: 1.75; margin-top: 1.1rem; }
.about-text .about-lead + p { margin-top: 1.6rem; }
.roles h3 { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-bottom: .9rem; }
.tl { position: relative; margin-left: 5px; padding-left: 1.6rem; border-left: 1px solid var(--line-2); }
.tl + h3 { margin-top: 1.4rem; }
.tl li { position: relative; padding-bottom: 1.2rem; }
.tl li:last-child { padding-bottom: .2rem; }
.tl li::before { content: ""; position: absolute; left: calc(-1.6rem - 5.5px); top: .45em; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--line-2); }
.tl-now li::before { background: var(--accent); border-color: var(--accent); }
.tl strong { display: block; font-weight: 500; font-size: 16px; line-height: 1.35; }
.tl span { display: block; font-size: 14px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

/* Expertise */
.exp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.exp-wrap .sh { position: sticky; top: calc(var(--nav-h) + 80px); }
.exp-list { border-top: 1px solid var(--line-2); }
.exp-row { display: grid; grid-template-columns: clamp(92px, 11vw, 150px) minmax(0, 1fr); gap: clamp(1.1rem, 2.5vw, 2.2rem); align-items: center; padding: clamp(1.2rem, 2vw, 1.8rem) 0; border-bottom: 1px solid var(--line-2); }
.exp-row img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.exp-row h3 { font-size: clamp(23px, 2.2vw, 31px); line-height: 1.15; }
.exp-row p { font-size: 15.5px; color: var(--ink-2); margin-top: .45rem; max-width: 52ch; }

/* Research */
.pubs-intro { max-width: 56ch; color: var(--ink-2); font-size: 16.5px; margin-top: 1rem; }
.feat-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); margin-top: clamp(2rem, 3.5vw, 3rem); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-2); }
.feat { padding: clamp(1.6rem, 3vw, 2.6rem) clamp(1.5rem, 4vw, 3.5rem) clamp(1.6rem, 3vw, 2.6rem) 0; border-right: 1px solid var(--line-2); }
.pub-meta { font-size: 14px; color: var(--ink-3); }
.feat-title { display: block; font-family: var(--serif); font-size: clamp(27px, 3.1vw, 44px); line-height: 1.1; letter-spacing: -.012em; margin-top: .8rem; transition: color .2s ease; }
.feat-note { font-size: 15.5px; color: var(--ink-2); margin-top: 1.1rem; max-width: 50ch; }
.side { padding-left: clamp(1.5rem, 4vw, 3.5rem); }
.side article { padding: clamp(1.4rem, 2.4vw, 2rem) 0; }
.side article + article { border-top: 1px solid var(--line-2); }
.side-title { display: block; font-family: var(--serif); font-size: clamp(20px, 1.7vw, 24px); line-height: 1.22; margin-top: .5rem; transition: color .2s ease; }
.auth { font-size: 14px; color: var(--ink-3); margin-top: .7rem; }

.bib { margin-top: 1.8rem; }
.bib summary { list-style: none; }
.bib summary::-webkit-details-marker { display: none; }
.bib .bib-close, .bib[open] .bib-open { display: none; }
.bib[open] .bib-close { display: inline; }
.bib-body { margin-top: 2.2rem; }
.bib[open] .bib-body { transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(6px); } }
.bib-dec + .bib-dec { margin-top: 2.4rem; }
.bib-dec h3 { font-size: 24px; font-style: italic; color: var(--accent); padding-bottom: .5rem; border-bottom: 1px solid var(--line-2); }
.bib-dec ol { column-count: 2; column-gap: 3.5rem; }
.bib-dec li { break-inside: avoid; display: grid; grid-template-columns: 48px 1fr; gap: .75rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.bib-yr { font-size: 13.5px; color: var(--ink-3); padding-top: 3px; font-variant-numeric: tabular-nums; }
.bib-t { font-family: var(--serif); font-size: 18.5px; line-height: 1.3; transition: color .2s ease; }
.bib-m { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; margin-top: .25rem; }
.bib-note { font-size: 13.5px; color: var(--ink-3); margin-top: 1.4rem; }

/* Closing call to action */
.cta { background: var(--accent); color: var(--paper); padding: clamp(3rem, 6vw, 5rem) var(--gutter); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 2rem; }
.cta h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.05; letter-spacing: -.015em; }
.cta p { color: rgba(251,249,244,.84); margin-top: .9rem; max-width: 46ch; font-size: 16.5px; }
.cta :focus-visible { outline-color: var(--paper); }

/* ── Inner pages ── */
.page-head { padding: clamp(2.8rem, 6vw, 5rem) var(--gutter) clamp(1.8rem, 3vw, 2.6rem); }
.page-head h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1; letter-spacing: -.02em; }
.page-head p { font-size: 17.5px; color: var(--ink-2); max-width: 58ch; margin-top: 1.1rem; }
.page-body { padding: 0 var(--gutter) clamp(3.5rem, 7vw, 6rem); }

/* Contact */
.clinics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-2); }
.clinic { padding: 1.6rem 1.5rem 1.8rem 0; }
.clinic + .clinic { padding-left: clamp(1.2rem, 2.5vw, 2.2rem); border-left: 1px solid var(--line-2); }
.num { display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--paper); font: 600 13px/26px var(--sans); text-align: center; }
.clinic h2 { font-size: clamp(23px, 2.1vw, 29px); line-height: 1.15; margin-top: .9rem; }
.clinic-meta { font-size: 14.5px; color: var(--ink-3); margin-top: .3rem; }
.clinic-tel { display: inline-block; font-size: 18px; margin-top: 1rem; font-variant-numeric: tabular-nums; transition: color .2s ease; }
.clinic-links { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; margin-top: .8rem; font-size: 15px; }
.map { margin-top: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--line-2); border-radius: 3px; overflow-x: auto; }
.map-in { position: relative; min-width: 680px; }
.map img { width: 100%; aspect-ratio: 1680 / 640; object-fit: cover; }
.map-pin { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--paper); font: 600 13.5px/28px var(--sans); text-align: center; box-shadow: 0 0 0 4px rgba(251,249,244,.9), 0 4px 10px rgba(20,33,28,.28); transition: transform 160ms var(--ease-out); }
.map-credit { font-size: 12.5px; color: var(--ink-3); margin-top: .5rem; }
.map-credit a { text-decoration: underline; text-decoration-color: var(--line-2); }
.assist { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; margin-top: clamp(2.5rem, 5vw, 4rem); padding: clamp(1.5rem, 3vw, 2.2rem) clamp(1.3rem, 3vw, 2.4rem); background: var(--paper-2); border-radius: 4px; }
.assist h2 { font-size: clamp(23px, 2.2vw, 30px); line-height: 1.15; }
.assist p { color: var(--ink-2); margin-top: .35rem; max-width: 52ch; }
.assist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.5rem; }
.prep { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); margin-top: clamp(3rem, 6vw, 5rem); }
.prep h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; padding-bottom: .8rem; border-bottom: 1px solid var(--ink); }
.prep li { padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.nhs-note { margin-top: clamp(2rem, 4vw, 3rem); font-size: 15px; color: var(--ink-3); }

/* Resource lists (patient resources, clinicians) */
.res-label { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: .45rem; }
.res-search { display: block; width: min(100%, 460px); font: 400 16px var(--sans); padding: .85rem 1rem; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; color: var(--ink); transition: border-color .2s ease; }
.res-search::placeholder { color: var(--ink-3); }
.res-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,77,63,.15); }
.res-hint { font-size: 14px; color: var(--ink-3); margin-top: .7rem; }
.res-empty { margin-top: 2rem; color: var(--ink-2); }
.res-cols { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); margin-top: clamp(1.8rem, 3vw, 2.6rem); align-items: start; }
.clin-cols { grid-template-columns: 2fr 1fr; margin-top: 0; }
.res-col h2 { font-size: 26px; line-height: 1.15; padding-bottom: .65rem; border-bottom: 1px solid var(--ink); }
.res-wide ul { column-count: 2; column-gap: 2.5rem; }
.res-col li { break-inside: avoid; padding: .55rem 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.res-col li > a { transition: color .2s ease; }
.res-col .alt, .res-col .alt a { color: var(--ink-3); font-size: 14px; }
.res-col .alt a { text-decoration: underline; text-decoration-color: var(--line-2); }
.res-note { margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.3rem; border-top: 1px solid var(--line-2); color: var(--ink-2); max-width: 75ch; }
.res-note a { color: var(--accent); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line-2); }
[hidden] { display: none !important; }

/* ── Footer ── */
footer { background: var(--footer); color: rgba(251,249,244,.8); padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) 2rem; font-size: 14.5px; }
footer :focus-visible { outline-color: var(--paper); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 5rem); }
.foot-name { font-family: var(--serif); font-size: 25px; color: var(--paper); line-height: 1.15; }
.foot-sub { margin-top: .5rem; line-height: 1.6; }
.foot-h { font-size: 13.5px; font-weight: 600; color: rgba(251,249,244,.62); margin-bottom: .6rem; }
.foot-list li { padding: .22rem 0; }
footer a { transition: color .2s ease; }
.foot-sub a, .foot-credit a { text-decoration: underline; text-decoration-color: rgba(251,249,244,.35); }
.foot-credit { margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.2rem; border-top: 1px solid rgba(251,249,244,.14); font-size: 12.5px; color: rgba(251,249,244,.64); line-height: 1.6; padding-right: max(0px, calc(100% - 95ch)); }

/* ── Hover, only where a real pointer can hover ── */
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover, .sub-nav a:hover { color: var(--ink); }
  .btn-solid:hover { background: var(--accent-dk); }
  .btn-line:hover { border-color: var(--ink); }
  .btn-paper:hover { background: #fff; }
  .text-link:hover, .res-note a:hover { text-decoration-color: var(--accent); }
  .feat-title:hover, .side-title:hover, .bib-t:hover, .clinic-tel:hover, .res-col li > a:hover { color: var(--accent); }
  .res-col .alt a:hover, .map-credit a:hover { color: var(--ink); }
  .map-pin:hover { transform: translate(-50%, -50%) scale(1.12); }
  footer a:hover { color: #fff; }
}

/* ── Entrance: once, on load ── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero h1, .hero-quals, .hero-lead, .hero-ctas, .hero-photo, .page-head h1, .page-head p { animation: rise 560ms var(--ease-out) both; }
.hero-quals, .page-head p { animation-delay: 60ms; }
.hero-lead { animation-delay: 120ms; }
.hero-ctas { animation-delay: 180ms; }
.hero-photo { animation-delay: 120ms; animation-duration: 720ms; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .about-grid, .exp-wrap, .feat-grid, .prep, .res-cols, .clin-cols { grid-template-columns: 1fr; }
  .exp-wrap .sh { position: static; }
  .feat { padding-right: 0; border-right: none; border-bottom: 1px solid var(--line-2); }
  .side { padding-left: 0; }
  .bib-dec ol { column-count: 1; }
  .clinics { grid-template-columns: 1fr; }
  .clinic, .clinic + .clinic { padding: 1.5rem 0 1.6rem; border-left: none; }
  .clinic + .clinic { border-top: 1px solid var(--line-2); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-photo { order: -1; width: 148px; }
}
@media (max-width: 600px) {
  .brand-name, .nav-opt { display: none; }
  .site-nav-in { gap: 1rem; }
  .nav-links { flex: 1; justify-content: space-between; gap: .9rem; }
  .nav-links a { font-size: 14px; }
  .res-wide ul { column-count: 1; }
}
@media (max-width: 350px) {
  .nav-links { gap: .6rem; }
  .nav-links a { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @keyframes rise { from { opacity: 0; } }
  .bib[open] .bib-body { @starting-style { transform: none; } }
  .btn:active { transform: none; }
  .map-pin { transition: none; }
}
