/* DeepPSI — styles */
:root {
  --paper: #F1F3F5;
  --surface: #FFFFFF;
  --ink: #13274A;  /* DeepPSI logo navy */
  --muted: #56636F;
  --line: #D6DCE2;

  /* one colour per field */
  --energy: #4A7C36; /* NoahCells green */
  --built-environment: #B06C0A;
  --life-sciences: #5A42C6;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1180px;
  --header: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 60px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1rem; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.05; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
:focus-visible { outline: 3px solid #2563EB; outline-offset: 3px; border-radius: 6px; }
#main:focus { outline: none; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; height: var(--header); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand-mark { width: auto; height: 38px; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; }
.nav a { display: block; padding: .5rem .8rem; border-radius: 8px; text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.nav a[data-dom]::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); margin-right: .45rem; vertical-align: .05em; }

.menu-btn { display: none; font: inherit; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .9rem; color: var(--ink); cursor: pointer; }
@media (max-width: 880px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: .5rem 1.25rem 1.25rem; }
  .nav a { padding: .75rem .5rem; }
}

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.35rem; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 85%, #fff); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface); }
.domain .btn { background: var(--c); border-color: var(--c); }
.domain .btn:hover { background: color-mix(in srgb, var(--c) 82%, #000); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.text-link { font-weight: 600; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
.text-link:hover { text-decoration-thickness: 3px; }

/* ---------- home hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); font-weight: 800; max-width: 15ch; letter-spacing: -0.035em; line-height: .98; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: var(--muted); max-width: 46ch; margin: 1.5rem 0 2rem; line-height: 1.55; }
.psi-wrap { margin: 0; }
.psi-wrap figcaption { text-align: center; color: var(--muted); font-size: .95rem; margin-top: 1rem; max-width: 30ch; margin-inline: auto; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .psi-wrap { max-width: 340px; width: 100%; margin-inline: auto; }
}

/* ---------- the Ψ ---------- */
.psi { width: 100%; height: auto; overflow: visible; }
.arm { transition: opacity .25s ease; }
.arm-line { fill: none; stroke: var(--c); stroke-width: 30; stroke-linecap: round; transition: stroke-width .25s ease; }
.arm-hit { fill: none; stroke: transparent; stroke-width: 80; stroke-linecap: round; }
.arm-label { font-family: var(--display); font-weight: 700; font-size: 19px; fill: var(--c); text-anchor: middle; }
.psi--live a { cursor: pointer; }
.psi--live a:focus-visible { outline: none; }
.psi--live a:focus-visible .arm-line { stroke-width: 38; }
.psi--live a.is-on .arm-line { stroke-width: 38; }
.psi--live a.is-dim .arm { opacity: .18; }
.arm[data-dim] { opacity: .14; }

.psi--draw .arm-line { stroke-dasharray: 1 2; stroke-dashoffset: 1; animation: draw 1s cubic-bezier(.6, 0, .2, 1) forwards; }
.psi--draw [data-arm="energy"] .arm-line,
.psi--draw [data-arm="built-environment"] .arm-line { animation-delay: .5s; }
.psi--draw .arm-label { opacity: 0; animation: fade .5s 1.3s forwards; }
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes fade { to { opacity: 1; } }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section--tight { padding-top: 1rem; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-head h2, .sec-title { font-size: clamp(2rem, 4vw, 3rem); }
.sec-title { margin-bottom: 2rem; }
.section-head .sec-title { margin-bottom: 0; }
.empty { color: var(--muted); padding: 1.5rem 0; }

/* field rows on home */
.d-list { border-top: 1px solid var(--line); }
.d-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .9fr);
  gap: 2rem; align-items: start;
  padding: 2.25rem 1.25rem 2.25rem 2rem; position: relative;
  border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background .2s, opacity .2s;
}
.d-row::before { content: ""; position: absolute; left: 0; top: 2.25rem; bottom: 2.25rem; width: 5px; border-radius: 5px; background: var(--c); }
.d-row:hover, .d-row.is-on { background: color-mix(in srgb, var(--c) 7%, transparent); }
.d-row h3 { font-size: clamp(2rem, 3.6vw, 2.8rem); color: var(--c); font-weight: 800; }
.d-row p { margin: .35rem 0 0; color: var(--muted); max-width: 40ch; font-size: 1.1rem; }
.d-prods { list-style: none; margin: .35rem 0 .9rem; padding: 0; font-weight: 600; }
.d-prods li { padding: .1rem 0; }
.d-go { color: var(--c); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 760px) {
  .d-row { grid-template-columns: 1fr; gap: .5rem; padding-left: 1.5rem; }
}

/* news */
.news-list { border-top: 1px solid var(--line); }
.news-item { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1.5rem 2.5rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.news-meta { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; color: var(--muted); font-size: .95rem; }
.tag { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.tag::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); }
.tag:hover { text-decoration: underline; }
.kind { font-size: .85rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; background: var(--paper); }
.news-body { max-width: 68ch; }
.news-body h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.news-body p { color: var(--muted); }
details { margin: .25rem 0 1rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--c); width: fit-content; }
details[open] summary { margin-bottom: .75rem; }
@media (max-width: 700px) { .news-item { grid-template-columns: 1fr; gap: .75rem; } .news-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem; } }

/* ---------- domain page ---------- */
.d-hero { background: color-mix(in srgb, var(--c) 9%, var(--paper)); border-bottom: 1px solid color-mix(in srgb, var(--c) 25%, var(--line)); }
.back { display: inline-block; margin-top: 2rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.back::before { content: "‹ "; }
.back:hover { color: var(--ink); }
.d-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 2rem; align-items: end; padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.d-hero h1 { font-size: clamp(3.2rem, 10vw, 7.5rem); font-weight: 800; color: var(--c); letter-spacing: -0.045em; line-height: .9; }
.d-hero .lead { margin-bottom: 0; color: var(--ink); }
.d-psi { width: 200px; }
@media (max-width: 700px) { .d-hero-grid { grid-template-columns: 1fr; } .d-psi { display: none; } }

.subnav { position: sticky; top: calc(var(--header) + env(safe-area-inset-top, 0px)); z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.subnav a { flex: none; padding: .9rem .9rem; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.subnav a:hover { color: var(--ink); }
.subnav a.is-current { color: var(--ink); border-bottom-color: var(--c); }

.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2.5rem 4rem; padding: 2.5rem 0; border-top: 1px solid var(--line); }
.product:first-of-type { border-top: 2px solid var(--c); }
.product h3 { font-size: clamp(2rem, 4vw, 3rem); }
.product .tagline { color: var(--c); font-weight: 600; font-size: 1.15rem; margin: .5rem 0 1rem; }
.product p { max-width: 60ch; }
.product .btn { margin-top: .5rem; }
.product h4 { font-family: var(--body); font-size: 1rem; letter-spacing: 0; color: var(--muted); font-weight: 600; margin-bottom: .5rem; }
.status { display: inline-block; margin-bottom: .9rem; font-size: .85rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.points { list-style: none; margin: 0; padding: 0; }
.points li { position: relative; padding: .7rem 0 .7rem 1.5rem; border-bottom: 1px solid var(--line); }
.points li::before { content: ""; position: absolute; left: 0; top: 1.25rem; width: .55rem; height: .55rem; border-radius: 2px; background: var(--c); }
@media (max-width: 800px) { .product { grid-template-columns: 1fr; } }

.table-scroll { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; min-width: 620px; }
.ledger th { text-align: left; font-weight: 600; font-size: .9rem; color: var(--muted); padding: .75rem 1rem .75rem 0; border-bottom: 2px solid var(--c); }
.ledger td { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger td:first-child { white-space: nowrap; color: var(--muted); }
.ledger .val { display: block; color: var(--muted); font-size: .95rem; margin-top: .2rem; }

.team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.person { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; }
.section--alt .person { background: var(--paper); }
.avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin-bottom: 1rem; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.person .role { font-weight: 600; color: var(--c); margin: 0 0 .35rem; }
.person .exp { color: var(--muted); font-size: .95rem; margin: 0; }

.others { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.other { display: block; padding: 1.5rem; border-radius: 16px; text-decoration: none; border: 1px solid var(--line); border-left: 5px solid var(--c); background: var(--surface); transition: background .2s; }
.other:hover { background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.other strong { display: block; font-family: var(--display); font-size: 1.6rem; color: var(--c); margin-bottom: .3rem; }
.other span { color: var(--muted); }

/* ---------- news & about pages ---------- */
.page-head { padding: clamp(3rem, 7vw, 5rem) 0 2rem; }
.page-head h1 { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.04em; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font: inherit; font-weight: 600; cursor: pointer; padding: .55rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.chip:hover { border-color: var(--c); }
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }

.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3rem; align-items: center; }
.about-grid p:not(.lead) { max-width: 64ch; }
.about-psi { width: 260px; }
.about-psi .arm[data-dim] { opacity: 1; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-psi { width: 180px; } }
.skills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.skills li { padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #DCE3EA; padding: 4rem 0 2rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.foot-brand { font-family: var(--display); font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: .25rem; }
.site-footer h2 { font-family: var(--body); font-size: 1rem; letter-spacing: 0; color: #9AA8B6; margin-bottom: .9rem; font-weight: 600; }
.site-footer p { margin-bottom: .45rem; }
.foot-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #2E3B48; font-size: .9rem; color: #9AA8B6; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .psi--draw .arm-line { stroke-dashoffset: 0; opacity: 1; }
  .psi--draw .arm-label { opacity: 1; }
}

/* ---------- logos ---------- */
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.logo { display: inline-flex; align-items: center; justify-content: center; height: 64px; padding: .7rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, transform .2s; }
a.logo:hover { border-color: var(--ink); transform: translateY(-1px); }
.logo img { height: 100%; width: auto; max-width: 170px; object-fit: contain; }
.logos--lg { gap: 1rem; }
.logos--lg .logo { height: 88px; padding: 1rem 1.4rem; }
.logos--lg .logo img { max-width: 220px; }
.logos--sm { gap: .4rem; margin-top: .35rem; }
.logos--sm .logo { height: 40px; padding: .4rem .6rem; border-radius: 8px; }
.logos--sm .logo img { max-width: 110px; }
.logo-label { font-family: var(--body); font-size: .85rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
.logo-row + .logo-row { margin-top: 1.4rem; }

.hero-logos { margin-top: 1.75rem; }

.product-logo { height: clamp(64px, 9vw, 96px); width: auto; margin-left: -6px; }
.product-logos { grid-column: 1 / -1; padding-top: 1.75rem; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 1.5rem 3.5rem; }
.product-logos .logo-row + .logo-row { margin-top: 0; }

.about-logo { width: 100%; max-width: 280px; justify-self: end; }
.about-logo img { width: 100%; height: auto; }
@media (max-width: 760px) { .about-logo { max-width: 200px; justify-self: start; } }
@media (max-width: 600px) {
  .logo { height: 54px; padding: .55rem .8rem; }
  .logo img { max-width: 130px; }
  .logos--lg .logo { height: 70px; }
  .logos--lg .logo img { max-width: 160px; }
}

/* ---------- awards on home ---------- */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.award { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 16px; padding: 1.5rem; }
.award-logos { min-height: 64px; margin-bottom: 1.25rem; }
.award-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; color: var(--muted); font-size: .95rem; margin-bottom: .6rem; }
.award h3 { font-size: 1.45rem; margin-bottom: .5rem; }
.award-for { color: var(--muted); margin-bottom: .35rem; }
.award .text-link { margin-top: auto; padding-top: .75rem; color: var(--c); }
.section--fields { padding-top: clamp(1rem, 3vw, 2rem); }

.award h3 a { text-decoration: none; }
.award h3 a:hover { text-decoration: underline; text-underline-offset: .15em; }
.news-item.is-target { background: color-mix(in srgb, var(--c) 7%, transparent); box-shadow: -1.25rem 0 0 color-mix(in srgb, var(--c) 7%, transparent), 1.25rem 0 0 color-mix(in srgb, var(--c) 7%, transparent); }
