/* Subsurface Risk Analytics, shared stylesheet, v2.
   Dark navy ground with full-bleed bands, one accent (ochre, from the SRA mark).
   Light theme keeps the navy bands and lifts the reading sections to off-white. */

:root {
  --navy: #0D1B2A;
  --navy-2: #13263A;
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #131E2B;
  --ink-2: #4B5967;
  --line: #D3DAE1;
  --on-navy: #EEF2F6;
  --on-navy-2: #A9B7C6;
  --navy-line: #27405A;
  --accent: #C9963A;
  --accent-deep: #9A6E22;
  --sans: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Archivo", "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 62ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1B2A;
    --surface: #13263A;
    --ink: #EEF2F6;
    --ink-2: #A9B7C6;
    --line: #27405A;
    --accent-deep: #D9AA55;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1B2A;
  --surface: #13263A;
  --ink: #EEF2F6;
  --ink-2: #A9B7C6;
  --line: #27405A;
  --accent-deep: #D9AA55;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--ink); padding: .5rem .75rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; }

.wrap { max-width: 76rem; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
.measure { max-width: var(--measure); }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; margin: 0 0 1rem; }
h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }
.eyebrow { font-family: var(--sans); font-size: .8125rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }
.lede { font-size: clamp(1.2rem, 1.05rem + .5vw, 1.4rem); line-height: 1.5; }
.muted { color: var(--ink-2); }

/* Buttons */
.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem; letter-spacing: .01em; text-decoration: none; padding: .85rem 1.4rem; border: 1.5px solid currentColor; border-radius: 2px; transition: background-color .15s ease, color .15s ease; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #14202C; }
.btn-accent:hover { background: #D9AA55; border-color: #D9AA55; }
.btn-ghost { color: var(--on-navy); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(13,27,42,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--navy-line); color: var(--on-navy); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: .9rem; padding-bottom: .9rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--on-navy); }
.brand img { width: 42px; height: auto; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--sans); font-weight: 400; font-size: .78rem; color: var(--on-navy-2); letter-spacing: .04em; margin-top: .15rem; }
.nav { display: flex; gap: 1.6rem; flex-wrap: wrap; font-size: .95rem; font-weight: 600; letter-spacing: .01em; }
.nav a { color: var(--on-navy-2); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--on-navy); }
.nav a[aria-current="page"] { color: var(--on-navy); border-bottom-color: var(--accent); }
@media (max-width: 720px) { .site-header .wrap { flex-direction: column; align-items: flex-start; gap: .6rem; } .brand-name { font-size: 1rem; white-space: nowrap; } .brand-name small { display: none; } .nav { gap: 1.1rem; font-size: .9rem; } }

/* Bands */
.band { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.band-navy { background: var(--navy); color: var(--on-navy); }
.band-navy .muted { color: var(--on-navy-2); }
.band-navy-2 { background: var(--navy-2); color: var(--on-navy); }
.band-navy-2 .muted { color: var(--on-navy-2); }
.band-light { background: var(--bg); color: var(--ink); }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--navy); color: var(--on-navy); min-height: min(88vh, 60rem); display: flex; flex-direction: column; }
.hero > .wrap { flex: 1 1 auto; display: flex; align-items: center; width: 100%; }
.hero .wrap { position: relative; z-index: 2; padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(4rem, 9vw, 7rem); }
.hero-copy { max-width: 42rem; }
.hero .eyebrow { color: var(--accent); }
.hero p { color: var(--on-navy-2); max-width: 40rem; }
.hero-art { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-art svg { position: absolute; right: -2vw; top: 0; height: 100%; width: auto; max-width: 62%; opacity: .95; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 34%, rgba(13,27,42,0) 62%); }
@media (max-width: 900px) { .hero-art svg { opacity: .5; right: -25vw; max-width: none; } .hero-art::after { background: linear-gradient(90deg, var(--navy) 0%, rgba(13,27,42,.75) 60%, rgba(13,27,42,.3) 100%); } }
.hero-foot { position: relative; z-index: 2; border-top: 1px solid var(--navy-line); }
.hero-foot .wrap { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; padding-top: 1rem; padding-bottom: 1rem; font-size: .9rem; color: var(--on-navy-2); }

/* Split section */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split-sticky { position: sticky; top: 6rem; }

/* Capability grid */
.grid-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { background: var(--surface); padding: 1.6rem 1.5rem 1.7rem; }
.tile h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.tile p { font-size: 1rem; color: var(--ink-2); }
.tile .n { font-family: var(--mono); font-size: .8rem; color: var(--accent-deep); letter-spacing: .08em; display: block; margin-bottom: .9rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; background: var(--navy-line); border-top: 1px solid var(--navy-line); border-bottom: 1px solid var(--navy-line); margin: 2.5rem 0 0; }
.stat { background: var(--navy); padding: 1.75rem 1.5rem 1.6rem; }
.stat .v { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem); letter-spacing: -.03em; line-height: 1; color: var(--on-navy); font-variant-numeric: tabular-nums; }
.stat .l { margin: .6rem 0 0; font-size: .95rem; color: var(--on-navy-2); line-height: 1.4; }
.stat .s { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--accent); margin-top: .7rem; display: block; }

/* Feature cards on navy */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; margin-top: 2.5rem; }
.card { background: var(--navy-2); border: 1px solid var(--navy-line); padding: 1.75rem 1.6rem 1.9rem; display: flex; flex-direction: column; gap: .75rem; }
.card .eyebrow { margin-bottom: .25rem; }
.card h3 { margin: 0; font-size: 1.3rem; }
.card p { color: var(--on-navy-2); font-size: 1rem; }
.card a.more { margin-top: auto; color: var(--on-navy); font-weight: 600; text-decoration: none; font-size: .95rem; }
.card a.more::after { content: " \2192"; }
.card a.more:hover { text-decoration: underline; }

/* Statement band */
.statement { border-left: 3px solid var(--accent); padding-left: clamp(1.25rem, 3vw, 2.5rem); max-width: 60rem; }
.statement p { font-family: var(--display); font-weight: 500; font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); line-height: 1.3; letter-spacing: -.015em; }

/* Contact band */
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
@media (max-width: 720px) { .contact-row { grid-template-columns: 1fr; } }
.contact-row a.email { font-family: var(--display); font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); font-weight: 600; letter-spacing: -.01em; color: var(--on-navy); text-decoration: none; border-bottom: 2px solid var(--accent); }
.contact-row a.email:hover { color: var(--accent); }

/* Footer */
.site-footer { background: var(--navy); color: var(--on-navy-2); border-top: 1px solid var(--navy-line); padding: 2.5rem 0 3rem; font-size: .9375rem; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer p { margin: 0 0 .6rem; max-width: 62ch; }
.site-footer a { color: var(--on-navy); }
.site-footer .memberships { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; line-height: 1.8; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .7s ease both; }
  .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .hero-art .front { stroke-dasharray: 6 8; animation: drift 14s linear infinite; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes drift { to { stroke-dashoffset: -140; } }
}
@media print { .site-header { position: static; } .hero-art { display: none; } }

/* ---------- v2 additions: inner pages, articles, interactivity ---------- */

/* Mobile nav toggle */
.nav-toggle { display: none; font-family: var(--sans); font-weight: 600; font-size: .9rem; background: none; color: var(--on-navy); border: 1px solid var(--navy-line); border-radius: 2px; padding: .45rem .8rem; cursor: pointer; }
@media (max-width: 720px) {
  .site-header .wrap { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-top: .5rem; }
  .nav.is-open { display: flex; }
  .nav a { padding: .6rem 0; border-bottom: 1px solid var(--navy-line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
}

/* Page hero for inner pages */
.page-hero { position: relative; background: var(--navy); color: var(--on-navy); padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.page-hero .lede { color: var(--on-navy-2); max-width: 46rem; }
.page-hero.has-image::before { content: ""; position: absolute; inset: 0; background: var(--cover) center / cover no-repeat; opacity: .28; }
.page-hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 0%, rgba(13,27,42,.85) 45%, rgba(13,27,42,.35) 100%); }
.page-hero .wrap { position: relative; z-index: 1; }
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: end; }
@media (max-width: 720px) { .about-hero { grid-template-columns: 1fr; } }
.portrait { width: clamp(9rem, 18vw, 14rem); border-radius: 2px; border: 1px solid var(--navy-line); }

/* Reading prose */
.prose { max-width: var(--measure); font-size: 1.125rem; }
.prose h2 { margin-top: 2.75rem; scroll-margin-top: 5.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h2 .n { font-family: var(--mono); font-size: .8rem; color: var(--accent-deep); letter-spacing: .08em; display: block; margin-bottom: .5rem; }
.prose a { color: var(--accent-deep); }
.prose.on-navy a { color: var(--accent); }
.prose.on-navy { color: var(--on-navy); }
.prose.on-navy p { color: var(--on-navy); }
.prose .note { font-size: 1rem; color: var(--ink-2); border-left: 3px solid var(--accent); padding-left: 1rem; }
.prose .cite { font-family: var(--mono); font-size: .85rem; line-height: 1.55; padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: rgba(255,255,255,.04); }

/* On-page table of contents */
.toc { display: flex; flex-direction: column; gap: .2rem; font-family: var(--sans); font-size: .95rem; }
.toc a { color: var(--ink-2); text-decoration: none; padding: .35rem 0 .35rem .9rem; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent-deep); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 860px) { .toc.split-sticky { position: static; margin-bottom: 1.5rem; } }

/* Section head with intro */
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: end; margin-bottom: 2rem; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

/* Topic chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem; }
.chip { font-family: var(--sans); font-size: .875rem; font-weight: 600; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #14202C; }
.chip.is-on .muted { color: #14202C; opacity: .7; }

/* Article cards */
.acards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.5rem; }
.acard { background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
.acard:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.acard[hidden] { display: none; }
.acard a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); }
.acard img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.acard-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.2rem 1.3rem; }
.acard .eyebrow { margin: 0; font-size: .72rem; }
.acard-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 1.2; letter-spacing: -.01em; }
.acard-topic { font-size: .95rem; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .05em; color: var(--accent-deep); border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 2px; }

/* Stats, compact variant on inner pages */
.stats.compact { margin-top: 2rem; }
.stats.compact .stat { background: transparent; padding: 1.25rem 1.2rem; }
.stats.compact .v { font-size: 1.8rem; }

/* Contact card */
.contact-card { background: var(--surface); border: 1px solid var(--line); padding: 1.75rem 1.6rem; align-self: start; }
.contact-card .label { margin-top: 1.1rem; }
.contact-card .label:first-child { margin-top: 0; }
.contact-card p { margin: 0 0 .25rem; }
.contact-card a { color: var(--accent-deep); }
.contact-card a.email { font-family: var(--display); font-size: 1.15rem; font-weight: 600; border-bottom: 2px solid var(--accent); text-decoration: none; }

/* Article page */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.article-hero { position: relative; background: var(--navy); color: var(--on-navy); padding: clamp(4rem, 10vw, 8rem) 0 clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.article-hero::before { content: ""; position: absolute; inset: 0; background: var(--cover) center / cover no-repeat; opacity: .38; }
.article-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,27,42,.35) 0%, rgba(13,27,42,.92) 100%); }
.article-hero .wrap { position: relative; z-index: 1; }
.article-hero h1 { max-width: 20ch; font-size: clamp(2rem, 1.4rem + 2.8vw, 3.6rem); }
.article-hero .byline { color: var(--on-navy-2); font-size: 1rem; }
.article { background: var(--bg); padding: clamp(2.5rem, 6vw, 5rem) 0 3rem; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 900px) { .article-grid { grid-template-columns: 1fr; } }
.article-body { max-width: 68ch; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.65; }
.article-body h2, .article-body h3 { font-family: var(--display); margin-top: 2.5rem; scroll-margin-top: 5rem; }
.article-body h2 { font-size: 1.6rem; }
.article-body h3 { font-size: 1.25rem; }
.article-body p, .article-body li { margin-bottom: 1.2rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-bottom: .5rem; }
.article-body a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: .15em; }
.article-body strong { font-weight: 600; }
.article-body blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.article-body figure { margin: 2rem 0; }
.article-body figure img { width: 100%; border: 1px solid var(--line); }
.article-body figcaption { font-family: var(--sans); font-size: .9rem; color: var(--ink-2); margin-top: .6rem; }
.article-body .note { font-family: var(--sans); font-size: .95rem; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: 1rem; }
.tablewrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); }
.article-body table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .95rem; }
.article-body th, .article-body td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.article-body th { background: var(--surface); font-weight: 600; }
.article-side { position: sticky; top: 5.5rem; display: flex; flex-direction: column; gap: 1.5rem; font-family: var(--sans); font-size: .95rem; }
.side-block { border-top: 2px solid var(--accent); padding-top: .8rem; }
.side-block p { margin: 0 0 .5rem; color: var(--ink-2); }
.side-block a { color: var(--accent-deep); }
.article-foot { max-width: 68ch; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .95rem; color: var(--ink-2); }
.article-foot strong { color: var(--ink); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2.5rem; }
@media (max-width: 720px) { .prevnext { grid-template-columns: 1fr; } }
.pn { display: block; background: var(--surface); border: 1px solid var(--line); padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; line-height: 1.25; }
.pn .label { display: block; margin-bottom: .35rem; }
.pn.next { text-align: right; }
a.pn:hover { border-color: var(--ink-2); }
span.pn { visibility: hidden; }

/* Article additions */
.article-body figure.cover { margin: 0 0 2.5rem; }
.article-body figure.cover img { width: 100%; border: 0; }
.article-side .toc { border-top: 2px solid var(--accent); padding-top: .8rem; }
.article-side .toc a { display: block; padding: .3rem 0 .3rem .8rem; font-size: .9rem; color: var(--ink-2); }
.article-side .toc a.d1 { padding-left: 1.6rem; font-size: .85rem; }
.article-side .toc a.is-active { color: var(--accent-deep); border-left-color: var(--accent); font-weight: 600; }
.article-body .comments { margin: 2.5rem 0 0; padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-family: var(--sans); font-size: 1rem; }
.article-body .comments p { margin: 0; }
.article-body .comments .label { margin-bottom: .35rem; }
@media (max-width: 900px) { .article-side { position: static; } .article-side .toc { display: none; } }

/* Plain list in prose */
.prose ul.plain-list { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.prose ul.plain-list li { margin-bottom: .5rem; }

/* Competency facets on the About page */
.facets { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 1.5rem 0 2rem; }
@media (max-width: 720px) { .facets { grid-template-columns: 1fr; } }
.facet { background: var(--surface); padding: 1.4rem 1.4rem 1.5rem; }
.facet .label { margin-bottom: .6rem; }
.facet p { font-size: 1rem; margin: 0; }

/* Small uppercase labels (sidebars, cards, contents rails) */
.label { font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 .5rem; }
.band-navy .label, .band-navy-2 .label { color: var(--on-navy-2); }
