/* =====================================================================
   wijayatilake.com · shared stylesheet (v4.1 · "Deep-navy editorial")
   Dark, authoritative, editorial. Serif display headings + clean sans body.
   Single accent (blue). Built to WCAG 2.1 AA contrast.
   To restyle: edit the palette in :root below. To roll back to the warm
   light theme, restore styles.css from backups/2026-07-08_v3-pre-navy-redesign/.
   ===================================================================== */

:root {
  /* ---- Palette (deep-navy editorial) ---- */
  --ink:        #EAF1F7;   /* primary text / headings (near-white on navy) */
  --ink-soft:   #A9BCC9;   /* secondary text, AA on navy & panels */
  --paper:      #081B2C;   /* page background (deep navy) */
  --paper-2:    #0B2133;   /* subtly lighter band (section--tint) */
  --panel:      #102A42;   /* raised surfaces: cards, stats, quote, contact */
  --panel-2:    #163654;   /* card hover / nested */
  --band:       #0A2A44;   /* accent band (section--teal) */

  /* Accent (blue), used for links, labels, emphasis, numbers, buttons */
  --teal:       #6FB2F2;   /* accent (name kept for backward-compat) */
  --teal-deep:  #8AC2F6;   /* accent hover (lighter, for dark bg) */
  --teal-tint:  #0A2A44;   /* deep accent band */
  --accent-ink: #06243F;   /* dark text placed on the light-blue accent */

  --line:       rgba(255,255,255,0.10);  /* hairline borders */
  --line-soft:  rgba(255,255,255,0.07);
  --white:      #102A42;   /* legacy var → maps to panel */

  /* ---- Type ---- */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Layout ---- */
  --maxw: 1100px;
  --radius: 12px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); text-decoration: underline; }
::selection { background: rgba(111,178,242,0.28); color: #fff; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; color: var(--ink); margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1.06; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.28rem; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
.lead { font-size: 1.22rem; color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 600; }
/* Italic accent emphasis word (usvc-style headline highlight) */
.em, em.accent { font-style: italic; color: var(--teal); }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--tint { background: var(--paper-2); }
.section--teal { background: var(--band); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.eyebrow { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .2em; font-size: .76rem; color: var(--teal); margin-bottom: 1em; }
.center { text-align: center; }
.measure { max-width: 64ch; }
.measure-narrow { max-width: 52ch; }

/* ---------- Skip link (accessibility) ---------- */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--teal); color: var(--accent-ink); padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; font-weight: 600; }
.skip-link:focus { left: 0; }

/* Screen-reader-only text (e.g. "opens in a new tab" notices) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Visible keyboard focus everywhere */
a:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 27, 44, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 70px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand span { color: var(--teal); }
.nav-links { display: flex; gap: 26px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-family: var(--sans); font-size: .96rem; color: var(--ink-soft); font-weight: 500; padding: 8px 6px; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--teal); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .25s; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem; padding: 13px 26px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; transition: .2s; }
.btn-primary { background: var(--teal); color: var(--accent-ink); }
.btn-primary:hover { background: var(--teal-deep); color: var(--accent-ink); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(255,255,255,0.45); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }

/* ---------- Hero ---------- */
.hero { padding: 78px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr .85fr; gap: 52px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .creds { font-family: var(--sans); font-size: .82rem; letter-spacing: .18em; color: var(--teal); text-transform: uppercase; font-weight: 600; margin-bottom: 1.6em; }
.hero-photo { justify-self: center; }
.portrait {
  width: 310px; height: 310px; border-radius: 50%; object-fit: cover;
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,0.14);
  background: var(--band);
}
.portrait-fallback {
  width: 310px; height: 310px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3E86D0 0%, #1E5FA5 100%);
  color: #fff; font-family: var(--serif); font-size: 5rem; font-weight: 600;
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,0.14);
}

/* ---------- Institution strip ---------- */
.orgstrip { border-top: 1px solid var(--line); margin-top: 2.4em; padding-top: 1.3em; display: flex; flex-wrap: wrap; gap: .6em 1.8em; align-items: baseline; }
.orgstrip .orglabel { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.orgstrip .org { font-family: var(--serif); font-size: 1rem; color: #C6D6E2; }

/* ---------- Positioning toggle (legacy, unused) ---------- */
.toggle-wrap { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 0 0 8px; flex-wrap: wrap; }
.toggle-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); font-weight: 700; }
.toggle { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.toggle button { font-family: var(--sans); font-size: .9rem; font-weight: 600; border: 0; background: transparent; color: var(--ink-soft); padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: .2s; }
.toggle button[aria-pressed="true"] { background: var(--teal); color: var(--accent-ink); }
.variant[hidden] { display: none; }

/* ---------- Stats / proof points ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-soft); }
.stat .num { font-family: var(--serif); font-size: 2.3rem; color: var(--teal); line-height: 1; margin-bottom: 10px; }
.stat .lbl { font-size: .95rem; color: var(--ink-soft); }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-soft); transition: .2s; }
a.card:hover { transform: translateY(-3px); background: var(--panel-2); border-color: rgba(111,178,242,0.45); box-shadow: var(--shadow); text-decoration: none; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--ink-soft); margin-bottom: .6em; }
.card .more { font-weight: 600; color: var(--teal); font-size: .95rem; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 26px 28px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--teal); border: 3px solid var(--paper); }
.timeline .when { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.timeline .role { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin: 2px 0 4px; }
.timeline .role-meta { color: var(--ink-soft); }

.taglist { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.taglist li { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: .92rem; color: var(--ink); }

/* ---------- Quote / testimonial ---------- */
.quote { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; padding: 34px 38px; box-shadow: var(--shadow-soft); }
.quote p { font-family: var(--serif); font-size: 1.34rem; line-height: 1.5; color: var(--ink); font-style: italic; }
.quote cite { font-family: var(--sans); font-style: normal; font-weight: 600; color: var(--ink); font-size: .98rem; }
.quote cite span { display: block; font-weight: 400; color: var(--ink-soft); font-size: .9rem; }

/* ---------- Award banner ---------- */
.award { display: flex; gap: 22px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; padding: 28px 32px; }
.award .medal { color: var(--teal); line-height: 1; }
.award h3 { margin: 0 0 .2em; }
.award p { margin: 0; color: var(--ink-soft); }

/* ---------- Publications ---------- */
.pub-list { list-style: none; counter-reset: pub; margin: 0; padding: 0; }
.pub-list li { counter-increment: pub; padding: 18px 0 18px 52px; border-bottom: 1px solid var(--line); position: relative; }
.pub-list li::before { content: counter(pub); position: absolute; left: 0; top: 18px; width: 34px; height: 34px; background: var(--panel); border: 1px solid var(--line); color: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; font-family: var(--sans); }
.pub-list .title { color: var(--ink); font-weight: 600; }
.pub-list .meta { color: var(--ink-soft); font-size: .95rem; }
.pub-feature { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; padding: 26px 30px; box-shadow: var(--shadow-soft); margin-bottom: 14px; }
.pub-feature .title { color: var(--ink); }
.pub-feature .meta { color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.contact-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-soft); }
.contact-card .label { font-size: .76rem; text-transform: uppercase; letter-spacing: .16em; color: var(--teal); font-weight: 700; }
.contact-card .value { font-size: 1.15rem; margin-top: 6px; }
.note { background: rgba(111,178,242,0.08); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: #050F1A; color: var(--ink-soft); padding: 48px 0; font-size: .95rem; border-top: 1px solid var(--line); }
.site-footer a { color: #fff; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: var(--ink-soft); display: inline-block; padding: 8px 4px; }
.footer-nav a:hover { color: #fff; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
/* Kicker label (replaces the old filled "pill" chip). Sits as its own line
   above a heading with clear spacing, so labels never crowd the title. */
.pill { display: inline-block; background: transparent; border: 0; padding: 0; margin: 0 0 14px; color: var(--teal); font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.card .pill + h3 { margin-top: 0; }
.pub-feature .pill { margin-bottom: 10px; }

/* Five Questions: large faded serif numeral as an editorial flourish */
.qcard { position: relative; }
.qnum { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1; color: rgba(111,178,242,0.32); margin-bottom: 12px; }
.qcard .pill { margin-bottom: 10px; }
.qcard--note { display: flex; flex-direction: column; justify-content: center; }
.qcard--note .pill { color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { order: -1; }
  .portrait, .portrait-fallback { width: 220px; height: 220px; }
  .btn-row { justify-content: center; }
  .toggle-wrap { justify-content: center; }
  .orgstrip { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2, .contact-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--line); padding: 8px 24px 18px;
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; }
  .nav-links a:hover { border-bottom-color: var(--line); }
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  .section { padding: 60px 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- v4.1 additions (26 Sep 2026) ---------- */
/* "Now" strip: dated proof of current roles, under the institution strip */
.now-strip { margin-top: 1.1em; display: flex; flex-wrap: wrap; gap: .5em 1.6em; align-items: baseline; }
.now-strip .orglabel { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.now-strip .now-item { font-size: .95rem; color: var(--ink); }
.now-strip .now-item::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); margin-right: .6em; vertical-align: middle; }
/* Current-role card gets an accent edge so it reads first */
.card--now { border-left: 3px solid var(--teal); }
/* Simple tick list (expert witness page) */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 0 0 12px 28px; color: var(--ink-soft); }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }
/* "Updated <month>" line under a time-sensitive heading */
.dated { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-top: -.4em; }
@media (max-width: 860px) { .now-strip { justify-content: center; text-align: center; } }
/* v4.1 fix: at 320px the two-column stats row overflowed by 9px (sideways scroll, WCAG 1.4.10 Reflow) */
@media (max-width: 480px) { .stats { gap: 12px; } .stat { padding: 18px 16px; min-width: 0; } .stat .num { font-size: 1.9rem; } }

/* v4.1 proof stat (D-18): five across on desktop; proof stat full width below 1100px */
.stats { grid-template-columns: repeat(5, 1fr); }
.stat .lbl a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat--proof { grid-column: 1 / -1; } }
/* v4.1: let contact cards shrink on 320 px phones (long email address) */
.contact-grid > * { min-width: 0; }
.contact-card .value { overflow-wrap: anywhere; }
@media (max-width: 480px) { .contact-card { padding: 22px 18px; } }
