/* ==========================================================================
   avishigupta.com
   Broadsheet layout (after shivanshgupta.com) rendered in the palette and type
   scale from AvishiGupta_Website_Spec. Accessibility is a hard requirement:
   every text colour here clears WCAG AA on every surface in both themes.
   ========================================================================== */

:root {
  --indigo:      #1E2A4A;
  --cream:       #F5EFE4;
  --emerald:     #2C5F4E;
  --gold:        #B8955A;
  --slate:       #4A5568;

  --bg:          var(--cream);
  --bg-alt:      #EFE7D8;
  --card:        #FBF7EF;
  --card-border: #E0D5C0;
  --heading:     var(--indigo);
  --body:        var(--slate);
  --link:        var(--emerald);
  --link-hover:  #1F4437;
  --accent:      var(--gold);          /* decorative: rules, borders, marks */
  --accent-text: #7F6437;              /* gold darkened: 4.5:1+ on every light surface */
  --ink:         var(--indigo);        /* masthead rules and heavy strokes */
  --rule:        #DCD1BC;
  --shadow:      0 1px 2px rgba(30, 42, 74, .06), 0 10px 28px -16px rgba(30, 42, 74, .22);
  --focus:       #1E2A4A;

  --serif: "Fraunces", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 72rem;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1A2E; --bg-alt: #20203a; --card: #252540; --card-border: #343458;
    --heading: #E8E4DC; --body: #C8C3BA;
    --link: #459D7F; --link-hover: #58B695;
    --accent: #D4AD6A; --accent-text: #D4AD6A; --ink: #E8E4DC;
    --rule: #3A3A60;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.7);
    --focus: #D4AD6A;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1A2E; --bg-alt: #20203a; --card: #252540; --card-border: #343458;
  --heading: #E8E4DC; --body: #C8C3BA;
  --link: #459D7F; --link-hover: #58B695;
  --accent: #D4AD6A; --accent-text: #D4AD6A; --ink: #E8E4DC;
  --rule: #3A3A60;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.7);
  --focus: #D4AD6A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: var(--sans); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--heading); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 36px; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 500; }
p  { margin: 0 0 1.1em; max-width: 68ch; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
/* audit:keep - screen-reader-only utility, kept ready on purpose */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  background: var(--indigo); color: #fff; padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius) var(--radius); font-weight: 500; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Newspaper furniture ---------- */
.rule-double { border: 0; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); height: 4px; margin: 0; }
.rule-thin   { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-heavy  { border: 0; border-top: 2px solid var(--ink); margin: 0; }

.kicker {
  font-family: var(--sans); font-size: .7rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent-text);
  margin: 0 0 .75rem;
}
.label {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--body);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 56px; flex-wrap: wrap; }
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--heading); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--heading); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .2rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .3rem .05rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--body); text-decoration: none; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--link); border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--accent); }

.theme-toggle {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  background: transparent; color: var(--body);
  border: 1px solid var(--rule); border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover { color: var(--link); border-color: var(--link); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

main { display: block; padding-bottom: 4rem; }

/* ---------- Masthead ---------- */
.masthead { padding-top: 1.75rem; }
.dateline {
  display: grid; grid-template-columns: 1fr; gap: .1rem;
  padding: .5rem 0; text-align: center;
  font-family: var(--sans); font-size: .62rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--body);
}
.masthead-name {
  font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.6rem, 12.5vw, 8rem); line-height: .95;
  letter-spacing: -.02em; text-align: center;
  color: var(--heading); margin: .5rem 0 .35rem;
}
.masthead-roles {
  text-align: center; margin: 0; padding: .5rem 0;
  font-family: var(--sans); font-size: clamp(.6rem, 1.6vw, .78rem); font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--link);
}
/* --accent is the decorative gold (rules, borders). Text must use --accent-text,
   which is darkened to clear 4.5:1 on cream; these dots were the last holdout. */
.masthead-roles .dot { color: var(--accent-text); }

/* compact masthead on inner pages */
.page-head { padding: 2.5rem 0 1.25rem; }
.page-head h1 {
  margin-top: 1.1rem;
  font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: clamp(2rem, 6.5vw, 3.75rem); text-transform: uppercase;
  letter-spacing: -.015em; line-height: 1.02; margin-bottom: .5rem;
}
.page-head .standfirst {
  font-family: var(--serif); font-size: 1.15rem; line-height: 1.5;
  color: var(--heading); max-width: 54ch; margin: 0;
}

/* ---------- Lead story ---------- */
.lead { padding: 2rem 0 0; display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
.lead-headline {
  font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.08;
  letter-spacing: -.02em; margin: 0 0 1.25rem; color: var(--heading);
}
.lead-headline em { font-style: italic; color: var(--link); }
.lead-body { font-size: 1.02rem; }
.lead-body > p:first-of-type::first-letter {
  float: left; font-family: var(--serif); font-weight: 700;
  font-size: 3.4em; line-height: .82; padding: .06em .09em 0 0; color: var(--heading);
}
/* the four kinds of exclusion, called out without breaking the sentence rhythm */
.lead-body .term {
  font-variant: small-caps; letter-spacing: .05em;
  font-weight: 700; color: var(--link);
}
.lead-close {
  font-family: var(--serif); font-size: 1.15rem; line-height: 1.5;
  color: var(--heading); margin-top: 1.4rem;
}

.byline {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text);
  padding-bottom: .75rem; margin: 0 0 1rem; border-bottom: 1px solid var(--rule);
}

/* ---------- By the numbers ---------- */
.numbers { border-top: 3px solid var(--ink); padding-top: .85rem; }
.numbers h2 {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--body); margin: 0 0 .5rem;
}
.numbers ul { list-style: none; margin: 0; padding: 0; }
.numbers li { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.numbers li:last-child { border-bottom: 0; }
.numbers b {
  display: block; font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: 1.85rem; font-weight: 700; line-height: 1.05; color: var(--heading);
}
.numbers span {
  display: block; margin-top: .15rem;
  font-size: .68rem; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--body); line-height: 1.5;
}

/* a closing line under a research entry, set off by a hairline the way the
   citation list used to be */
.research-footer {
  margin: 1.1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: .85rem; color: var(--body); line-height: 1.6;
}

/* ---------- Now ----------
   Same furniture as .numbers - 3px rule, small uppercase label, hairline between
   rows - but laid out term-beside-description so each line reads as one line. */
.now { border-top: 3px solid var(--ink); padding-top: .85rem; margin-top: 3rem; }
.now h2 {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--body); margin: 0 0 .25rem;
}
.now ul { list-style: none; margin: 0; padding: 0; }
.now li {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: .15rem 1.75rem; align-items: baseline;
  padding: .85rem 0; border-bottom: 1px solid var(--rule);
}
.now li:last-child { border-bottom: 0; }
.now b {
  font-family: var(--serif); font-variation-settings: "opsz" 40;
  font-size: 1.1rem; font-weight: 700; line-height: 1.25; color: var(--heading);
}
.now span { font-size: .95rem; color: var(--body); line-height: 1.55; }
@media (max-width: 700px) {
  .now li { grid-template-columns: 1fr; gap: .2rem; }
}

/* ---------- Portrait ---------- */
.portrait { margin: 0; }
.portrait img {
  display: block; width: 100%; max-width: 320px; height: auto;
  border: 1px solid var(--card-border); filter: grayscale(.18) contrast(1.03);
}
.portrait figcaption {
  font-family: var(--sans); font-size: .64rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--body);
  padding-top: .45rem; margin-top: .45rem; border-top: 1px solid var(--rule); max-width: 320px;
}

/* ---------- Deployment panel ----------
   The partner record is the strongest claim on the site, so it gets structure
   rather than being typeset as a decorative pull quote. */
.deployment {
  background: var(--bg-alt);
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  padding: 2rem 1.5rem; margin-top: 3rem;
}
.deployment h2 {
  font-family: var(--serif); font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  line-height: 1.2; margin: 0 0 1.25rem;
}
.partners { margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.partners > div {
  /* The name column has a floor. It used to be a bare `1fr` against an `auto`
     status column, and because the status was `nowrap` the longest one (NAB's,
     a full sentence) ate the row and crushed the name to 43px - two lines for
     "NAB, Delhi". The floor plus a wrappable status fixes it at the cause. */
  display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(0, auto);
  gap: .15rem 1rem; align-items: baseline;
  padding: .7rem 0; border-bottom: 1px solid var(--rule);
}
.partners dt { font-family: var(--serif); font-size: 1.05rem; color: var(--heading); margin: 0; }
.partners dd {
  margin: 0; font-family: var(--sans); font-size: .66rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text);
  /* deliberately NOT nowrap - see the note on .partners > div above */
}
/* Below 540px two columns leave the status in a ~119px gutter, where NAB's
   sentence-length entry wrapped to NINE lines of letter-spaced caps. Stack
   instead: name, then status beneath it, each full width. */
@media (max-width: 539px) {
  .partners > div { grid-template-columns: 1fr; gap: .3rem; }
  .partners dd { letter-spacing: .08em; }
}
.reach { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin: 1.1rem 0 0; }
.reach b {
  font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--heading);
}
.reach span {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--body);
}
.deployment-more { margin: 1rem 0 0; }
.deployment-more a {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
/* the same panel, sitting inside a project entry rather than standing alone */
.deployment-inline { margin: 1.5rem 0; padding: 1.4rem 1.25rem; }
.deployment-inline .research-label { margin-bottom: .75rem; }
.deployment-inline .partners { border-top: 0; }

/* ---------- Section index (home) ---------- */
.sections { margin-top: 3rem; }
.sections > h2, .press > h2 {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--body);
  margin: 0 0 .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink);
}
.cards { display: grid; grid-template-columns: 1fr; gap: 0; list-style: none; margin: 0; padding: 0; }
.card {
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 1rem; align-items: start;
  padding: 1.15rem 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--body);
}
.card:hover { color: var(--body); background: var(--bg-alt); }
.card:hover h3 { color: var(--link); }
.card .mark {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 700;
  letter-spacing: .06em; color: var(--accent-text); line-height: 1.5;
}
.card h3 { font-size: 1.2rem; margin: 0 0 .1rem; }
.card p { font-size: .92rem; margin: 0; max-width: 60ch; }

/* ---------- Press ---------- */
.press { margin-top: 3rem; }
.press p { font-family: var(--serif); font-size: 1.15rem; color: var(--heading); margin: .5rem 0 0; }
/* fallback link under a press citation: present, but quieter than the article.
   Must out-specify .press p above, which would otherwise make it 1.15rem serif
   on the homepage and leave the same link at two sizes across two pages. */
.press p.clipping-archive, p.clipping-archive {
  margin: .6rem 0 0; font-family: var(--sans); font-size: .76rem; color: var(--body);
}

/* ---------- Press clipping ----------
   A typographic cutting rather than a borrowed image: the publication's own lead
   art is AI-generated stock, and is theirs besides. */
.clipping {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: center;
  margin-top: 1rem; padding: 1.4rem 1.5rem; text-decoration: none; color: var(--body);
  background: var(--card); border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
}
.clipping:hover { border-color: var(--link); border-left-color: var(--accent); color: var(--body); }
.clipping-pub {
  display: block; font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 700; line-height: 1;
  letter-spacing: -.01em; color: var(--heading);
}
.clipping-rule { border: 0; border-top: 2px solid var(--ink); margin: .55rem 0 .5rem; }
.clipping-meta {
  display: block; font-family: var(--sans); font-size: .64rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--body);
}
.clipping-body p { font-family: var(--serif); font-size: 1.05rem; color: var(--heading); margin: 0 0 .5rem; }
.clipping-cta {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--link);
}
.clipping:hover .clipping-cta { color: var(--link-hover); }

@media (min-width: 540px) {
  .clipping { grid-template-columns: minmax(0, 13rem) 1fr; gap: 1.75rem; }
  .clipping-mast { border-right: 1px solid var(--rule); padding-right: 1.75rem; }
}

/* ---------- Entries ---------- */
.entry { padding: 2.25rem 0; border-bottom: 1px solid var(--rule); }
.entry:first-of-type { border-top: 2px solid var(--ink); }
.entry-head { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; }
.entry-num {
  font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: 1.5rem; font-weight: 700; color: var(--accent-text); line-height: 1.1;
}
.entry h2 { font-size: clamp(1.4rem, 3.2vw, 1.9rem); margin: 0 0 .15rem; }
.meta {
  font-family: var(--sans); font-size: .7rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent-text);
  margin: 0 0 .9rem;
}
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.tags li {
  font-family: var(--sans); font-size: .62rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--body);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: .2rem .55rem;
}
.sub { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.sub h3 { font-size: 1.15rem; margin-bottom: .1rem; }
.role { margin: 0 0 1.5rem; }
.role h3 { font-size: 1.15rem; margin-bottom: .1rem; }

.btn {
  display: inline-block; padding: .55rem 1.1rem;
  background: var(--indigo); color: var(--cream);
  font-family: var(--sans); font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--indigo); border-radius: var(--radius);
}
.btn:hover { background: var(--emerald); border-color: var(--emerald); color: var(--cream); }
:root[data-theme="dark"] .btn { background: var(--link); border-color: var(--link); color: #14142a; }
:root[data-theme="dark"] .btn:hover { background: var(--link-hover); border-color: var(--link-hover); color: #14142a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { background: var(--link); border-color: var(--link); color: #14142a; }
  :root:not([data-theme="light"]) .btn:hover { background: var(--link-hover); border-color: var(--link-hover); color: #14142a; }
}

/* ---------- Research panel ----------
   Set apart from the project entries: research is a different kind of claim,
   with an external gatekeeper, and the panel states its status precisely
   rather than implying a publication that does not exist yet. */
.research {
  background: var(--bg-alt);
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  padding: 2.25rem 1.5rem;
}
.research-label {
  font-family: var(--sans); font-size: .66rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent-text);
  margin: 0 0 .35rem;
}
.citation {
  margin: 1.35rem 0 0; padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr; gap: .1rem .25rem;
  font-size: .9rem;
}
.citation dt {
  font-family: var(--sans); font-size: .64rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--body);
  padding-top: .5rem;
}
.citation dd { margin: 0 0 .35rem; color: var(--heading); font-family: var(--serif); font-size: 1.02rem; }
.citation dd .qualifier { font-family: var(--sans); font-size: .82rem; color: var(--body); display: block; }

@media (min-width: 540px) {
  .citation { grid-template-columns: 8.5rem 1fr; }
  .citation dt { padding-top: .18rem; }
}
@media (min-width: 900px) {
  .research { padding: 2.5rem 2.25rem; }
}

/* ---------- Endorsement ----------
   A line quoted from a letter of recommendation. The letters themselves are not
   published: they carry signatories' signatures, private phone numbers on one
   letterhead, and personal information. See ASSET_NOTES.md §31. */
.endorsement {
  margin: 1.4rem 0 0; padding: .1rem 0 .1rem 1.15rem;
  border-left: 3px solid var(--accent);
}
.endorsement blockquote {
  margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.5;
  color: var(--heading);
}
.endorsement cite {
  display: block; margin-top: .5rem;
  font-family: var(--sans); font-style: normal; font-size: .66rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent-text);
}

/* ---------- Figures ---------- */
.gallery { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin: 1.75rem 0 0; padding: 0; }
figure { margin: 0; }
/* Scoped to the tile link (a DIRECT child of <figure>). A bare `figure a`
   also matched the "Original PDF" link inside <figcaption>, turning it into a
   bordered, aspect-ratio-sized empty box under every certificate that has one. */
figure > a {
  display: block; position: relative;
  aspect-ratio: var(--tile, 1);   /* each gallery sets this from its own contents */
  border: 1px solid var(--card-border); background: var(--card); overflow: hidden;
}
/* <picture> must not become a box between the tile and the image */
figure picture { display: contents; }
figure > a:hover { border-color: var(--link); }
/* Absolutely positioned against the tile, which is the only way to get a
   definite box here: a percentage height on a grid/flow child resolves to auto
   when the container's height comes from aspect-ratio, so the image sized
   itself by its own intrinsic ratio and overflowed the tile. `inset` gives the
   inner gutter, so no padding is involved. */
/* Scoped to images inside a tile link. A bare `figure img` also matched the
   home-page .portrait headshot, which has no positioned ancestor, so it escaped
   to the initial containing block and landed on top of the masthead. */
figure > a img {
  position: absolute; inset: .5rem;
  width: calc(100% - 1rem); height: calc(100% - 1rem);
  object-fit: contain;
}
/* photographs may fill the tile edge to edge; the generator only applies this
   where the aspect ratio makes the crop safe */
figure > a.fig-fill img { inset: 0; width: 100%; height: 100%; object-fit: cover; }
figcaption {
  font-size: .78rem; line-height: 1.5; color: var(--body);
  margin-top: .5rem; padding-top: .4rem; border-top: 1px solid var(--rule);
}
figcaption .doc-link { font-weight: 500; white-space: nowrap; }

/* ---------- Awards register ---------- */
.awards { list-style: none; counter-reset: award; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.awards li {
  counter-increment: award;
  display: grid; grid-template-columns: 2.75rem 1fr; gap: .1rem 1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule);
}
.awards li::before {
  content: counter(award, decimal-leading-zero);
  font-family: var(--serif); font-variation-settings: "opsz" 144;
  font-size: 1.05rem; font-weight: 700; color: var(--accent-text); line-height: 1.6;
}
.awards h2 { font-size: 1.1rem; font-weight: 500; margin: 0 0 .1rem; }
.awards .issuer {
  grid-column: 2; margin: 0;
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--body);
}

/* ---------- Contact ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.contact-list li {
  display: grid; grid-template-columns: 1fr; gap: .1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule);
}
.contact-list .label { color: var(--accent-text); }
.contact-list a { font-size: 1.1rem; font-family: var(--serif); }

.note {
  font-size: .85rem; background: var(--bg-alt);
  border-left: 3px solid var(--accent); padding: .85rem 1.1rem; margin: 1.5rem 0 0;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 3px solid var(--ink); margin-top: 3rem; padding: 2rem 0 2.5rem; }
.site-footer .brand { display: block; margin-bottom: .6rem; font-size: 1.1rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; list-style: none; margin: 0 0 .9rem; padding: 0; }
.site-footer a { font-size: .72rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.site-footer p { margin: 0; font-size: .72rem; letter-spacing: .06em; color: var(--body); }

/* ---------- Lightbox ---------- */
dialog.lightbox {
  width: min(96vw, 1040px); max-width: 96vw; max-height: 94vh; padding: 0;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--body); box-shadow: var(--shadow);
}
dialog.lightbox::backdrop { background: rgba(10, 12, 24, .85); }
.lightbox-body { padding: .75rem; }
.lightbox img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.lightbox-bar { display: flex; gap: 1rem; align-items: flex-start; padding: .65rem .3rem .05rem; border-top: 1px solid var(--rule); margin-top: .6rem; }
.lightbox-cap { font-size: .82rem; margin: 0; flex: 1; }
.lightbox-close {
  flex: none; background: transparent; border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--body); font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; padding: .3rem .8rem; cursor: pointer;
}
.lightbox-close:hover { color: var(--link); border-color: var(--link); }

/* ---------- Breakpoints (mobile-first: 540px, 900px) ---------- */
@media (max-width: 539px) {
  .site-header .wrap { min-height: 0; gap: .35rem .75rem; padding-block: .5rem; }
  .theme-toggle { order: 2; margin-left: auto; }
  .site-nav { order: 3; flex: 1 0 100%; margin-left: 0; }
  .site-nav ul { gap: 0 .9rem; }
  .site-nav a { font-size: .66rem; letter-spacing: .1em; }
  .masthead { padding-top: 1.1rem; }
  .lead-body > p:first-of-type::first-letter { font-size: 2.8em; }
}

@media (min-width: 540px) {
  /* space-between, so the dateline reads correctly with any number of cells */
  .dateline { display: flex; justify-content: space-between; align-items: baseline;
              gap: 1rem; text-align: left; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .awards li { grid-template-columns: 3.25rem 1fr; }
  .entry-head { grid-template-columns: 2.75rem 1fr; }
  .contact-list li { grid-template-columns: 9rem 1fr; align-items: baseline; }
}

@media (min-width: 900px) {
  h1 { font-size: 40px; }
  .lead { grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr); gap: 3rem; }
  .lead-aside { display: grid; gap: 2rem; align-content: start; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery.gallery-2 { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr) ; column-gap: 3rem; }
  .page-head { padding-top: 3rem; }
}

@media print {
  .site-header, .site-footer, .theme-toggle, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   Media: video embeds, photo collage, logo strip, and "to come" placeholders
   ========================================================================== */

/* ---------- Video ---------- */
.media-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin: 1.75rem 0 0; }
.embed {
  position: relative; display: block; width: 100%;
  border: 1px solid var(--card-border); background: var(--card); overflow: hidden;
}
.embed-16x9 { aspect-ratio: 16 / 9; }
.embed-9x16 { aspect-ratio: 9 / 16; }
.embed iframe, .embed img, .embed video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.embed img { object-fit: cover; }
.embed video { object-fit: contain; background: #14142a; }
/* click-to-load facade: nothing is requested from YouTube until the viewer asks */
.embed-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(rgba(30,42,74,.12), rgba(30,42,74,.45));
  border: 0; cursor: pointer; padding: 0;
}
.embed-play::after {
  content: ""; width: 58px; height: 58px; border-radius: 50%;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231E2A4A'%3E%3Cpath d='M8 5.5v13l11-6.5z'/%3E%3C/svg%3E") center/26px no-repeat;
  box-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.embed-play:hover::after { background-color: #fff; }
.embed-play:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

/* ---------- Photo collage ---------- */
.collage { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.collage li { margin: 0; }
.collage a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--card-border); background: var(--card); }
.collage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.collage a:hover { border-color: var(--link); }

/* ---------- "To come" placeholders ---------- */
/* Deliberately unmistakable: these are empty slots awaiting supplied media,
   never styled to pass as finished content. */
.slot { margin: 0; min-width: 0; }
/* grid children must be allowed to shrink below their min-content width, or a
   long file path in .slot-note forces the whole row wider than the viewport */
.gallery > *, .media-row > *, .cards > *, .collage > * { min-width: 0; }
.slot-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; text-align: center; overflow: hidden;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--accent); border-radius: var(--radius);
  background: repeating-linear-gradient(
      45deg, transparent, transparent 11px,
      color-mix(in srgb, var(--accent) 9%, transparent) 11px,
      color-mix(in srgb, var(--accent) 9%, transparent) 22px);
}
.slot-photo .slot-box { aspect-ratio: 1 / 1; }
.slot-16x9 .slot-box { aspect-ratio: 16 / 9; }
.slot-9x16 .slot-box { aspect-ratio: 9 / 16; }
.slot-wide .slot-box { aspect-ratio: 21 / 9; }
.slot-kind {
  font-family: var(--sans); font-size: .6rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent-text);
}
.slot-label {
  font-family: var(--serif); font-size: 1rem; font-weight: 700;
  line-height: 1.3; color: var(--heading); max-width: 26ch; margin-inline: auto;
}
.slot-note {
  font-family: var(--sans); font-size: .7rem; line-height: 1.5;
  color: var(--body); max-width: 30ch; margin-inline: auto; overflow-wrap: anywhere;
}
.slot-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95em; background: var(--bg-alt); padding: .05rem .3rem; border-radius: 2px;
  overflow-wrap: anywhere;
}
/* inside a media row every slot shares the video ratio so the row lines up */
.media-row .slot-photo .slot-box { aspect-ratio: 16 / 9; }
.slot-label { overflow-wrap: anywhere; }

@media (min-width: 540px) {
  .media-row { grid-template-columns: repeat(2, 1fr); }
  .media-row.media-1 { grid-template-columns: 1fr; }
  .collage { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .media-row.media-3 { grid-template-columns: repeat(3, 1fr); }
  .collage { grid-template-columns: repeat(6, 1fr); }
}
