/* jia — site styles
   Palette: paper, stone, graphite + one signal violet, used sparingly. */

@font-face { font-family: "Inter Tight"; font-weight: 400; font-display: swap; src: url("../assets/fonts/inter-tight-400.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 600; font-display: swap; src: url("../assets/fonts/inter-tight-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); }

/* fallbacks sized to match the web fonts (measured), so text doesn't shift when they load */
@font-face { font-family: "Inter Tight Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 96.58%; ascent-override: 100.3%; descent-override: 24.97%; line-gap-override: 0%; }
@font-face { font-family: "IBM Plex Mono Fallback"; src: local("Courier New"), local("Courier"); size-adjust: 99.98%; ascent-override: 102.52%; descent-override: 27.5%; line-gap-override: 0%; }

:root {
  --paper: #F1EEE8;
  --stone: #E2DDD4;
  --graphite: #161514;
  --muted: #5E5A55;
  --signal: #4F1DF0;   /* forensic UV */

  --sans: "Inter Tight", "Inter Tight Fallback", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 38rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--graphite);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection { background: var(--signal); color: var(--paper); }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem var(--gutter);
}

.site-header .logo img { display: block; height: 2rem; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--graphite); }
.site-nav a[aria-current="page"]::after {
  content: "";
  display: inline-block;
  width: 0.3em; height: 0.3em;
  margin-left: 0.25em;
  border-radius: 50%;
  background: var(--signal);
}

/* email icon link */
.email-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--stone);
  border-radius: 50%;
  color: var(--graphite);
  transition: border-color .2s, color .2s;
}
.email-link:hover { border-color: var(--signal); color: var(--signal); }
.email-link svg { width: 1rem; height: 1rem; }

/* ---------- main ---------- */

main {
  flex: 1;
  padding: 0 var(--gutter);
}

/* inner pages */
.page { max-width: 64rem; padding: 4rem var(--gutter) 6rem; } /* keep the side gutter from main */

.eyebrow {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

h1 {
  margin: 0 0 2.5rem;
  max-width: 18ch;
  font-weight: 600;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.25em; }

/* numbered list of items (areas of work, method) */
.items {
  list-style: none;
  margin: 4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2.5rem 3rem;
}
.items li { border-top: 1px solid var(--stone); padding-top: 1.25rem; }
.items .num {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.items p { margin: 0; color: var(--muted); }

.note {
  margin-top: 4rem;
  max-width: var(--measure);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem var(--gutter);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--signal); }

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  .site-header { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .site-header .logo img { height: 1.6rem; }
  .site-nav { gap: 1rem; font-size: 0.75rem; }
}

/* accessible, visually hidden text */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =========================================================
   HOME
   ========================================================= */

.is-home main { padding: 0; }

/* ---------- opening screen: paper, with the violet "energy focus" halo ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 82vh;
  min-height: 82svh;
  display: flex;
  flex-direction: column;
}
.hero > :not(.halo) { position: relative; z-index: 1; }
.hero .site-header .logo { visibility: hidden; } /* the large mark carries the logo here */

/* blurred violet glow, half off the bottom-right corner, with a thin offset circle */
.halo {
  position: absolute;
  right: calc(var(--halo) * -0.38);
  bottom: calc(var(--halo) * -0.42);
  width: var(--halo);
  aspect-ratio: 1;
  --halo: clamp(22rem, 52vw, 46rem);
  pointer-events: none;
}
.halo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, #5B2EFF 0%, rgb(79 29 240 / .82) 30%, rgb(107 69 255 / .5) 55%, rgb(139 107 255 / .18) 80%, rgb(139 107 255 / 0) 100%);
}
.halo::after {
  content: "";
  position: absolute;
  width: 46%;
  aspect-ratio: 1;
  left: 4%;
  top: 8%;
  border: 1px solid rgb(22 21 20 / .45);
  border-radius: 50%;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem var(--gutter) 2rem;
}

.hero .mark { display: block; width: clamp(7rem, 15vw, 10.5rem); height: auto; }

.hero .tagline {
  margin: 1.5rem 0 2.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.lede {
  max-width: 40rem;
  margin: 0 auto;
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.scroll-cue {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  margin: 0 auto 1.25rem;
  border: 1px solid var(--stone);
  border-radius: 50%;
  color: var(--graphite);
  transition: border-color .2s, color .2s;
}
.scroll-cue:hover { border-color: var(--signal); color: var(--signal); }
.scroll-cue svg { width: 1rem; height: 1rem; animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 50% { transform: translateY(3px); } }

/* on phones the halo would sit under the text, so it shrinks further into the corner */
@media (max-width: 40rem) {
  .halo { --halo: 20rem; right: -9rem; bottom: -10rem; }
}

/* ---------- bands below the fold: paper ---------- */
html { scroll-behavior: smooth; }

.band {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--gutter);
  text-align: center;
}
.band + .band { border-top: 1px solid var(--stone); }

.section-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.section-lede {
  max-width: 36rem;
  margin: 0 auto;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- how jia works: clickable wheel ---------- */
.wheel-wrap { max-width: 42rem; margin: 1.75rem auto 0; }
.wheel { display: block; width: 100%; height: auto; overflow: visible; }
.wheel-hint { margin-top: 1rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

.wheel .node { cursor: pointer; outline: none; }
.wheel .node circle {
  fill: rgb(79 29 240 / 0);            /* transparent but clickable */
  stroke: var(--graphite);
  stroke-width: 1.6;
}
.wheel .node text { font: 600 25px var(--sans); letter-spacing: .04em; text-anchor: middle; fill: var(--graphite); }
.wheel .node:hover circle { fill: rgb(79 29 240 / .04); }
.wheel .node[aria-selected="true"] circle { fill: rgb(79 29 240 / .07); stroke: var(--signal); }
.wheel .node[aria-selected="true"] text { fill: var(--signal); }
.wheel .node:focus-visible circle { stroke: var(--signal); stroke-width: 3.5; }
.wheel .wh-dot { fill: var(--signal); pointer-events: none; }
.wheel .wh-glow { pointer-events: none; }

.wheel-panels { max-width: 34rem; min-height: 8.5rem; margin: 1.25rem auto 0; } /* tall enough for the longest text, so the page doesn't jump */
.wheel-panel h3 { margin: 0 0 0.4rem; font-weight: 600; font-size: 1.25rem; letter-spacing: -0.015em; }
.wheel-panel p { margin: 0; color: var(--muted); }
.wheel-panel + .wheel-panel { margin-top: 1.5rem; }   /* no-JS: all four stacked */
.js .wheel-panel + .wheel-panel { margin-top: 0; }

@media (max-width: 40rem) {
  .wheel .node circle { stroke-width: 2.6; }
}

/* ---------- motion (only when JS runs; quick, and off for reduced motion) ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

.js .wheel .node circle {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s cubic-bezier(.3, 0, .2, 1) calc(.1s + var(--i) * .08s), fill .25s, stroke .25s;
}
.js .is-in .wheel .node circle { stroke-dashoffset: 0; }
.js .wheel .wh-dot, .js .wheel .wh-glow { opacity: 0; transition: opacity .5s ease .6s; }
.js .is-in .wheel .wh-dot, .js .is-in .wheel .wh-glow { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue svg { animation: none; }
  .js .reveal, .js .wheel .node circle, .js .wheel .wh-dot, .js .wheel .wh-glow { transition: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
}

/* header fit with four nav items on very narrow phones (~360px) */
@media (max-width: 25rem) {
  .site-header { gap: 0.75rem; }
  .site-nav { flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem 0.75rem; font-size: 0.6875rem; letter-spacing: 0; }
  .site-nav .email-link { width: 2rem; height: 2rem; }
}

/* =========================================================
   ABOUT: who we are (icon tabs) + disclaimer
   ========================================================= */
.about-intro { max-width: var(--measure); margin-bottom: 3.5rem; }
.about-intro p { margin: 0 0 1.25em; color: var(--muted); }
.about-intro .about-lead {
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--graphite);
}

.disclaimer {
  max-width: var(--measure);
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--stone);
}
.disclaimer .eyebrow { font-weight: 400; margin-bottom: 0.75rem; }
.disclaimer p { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: var(--muted); }


/* returning via Back: show the final state without replaying animations */
.instant *, .instant *::before, .instant *::after { transition: none !important; }

/* smooth page-to-page cross-fade once hosted (same-origin http/https; ignored over file://) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* =========================================================
   HOME: events
   ========================================================= */
.events { list-style: none; margin: 1rem auto 0; padding: 0; max-width: 52rem; text-align: left; }
.event-card {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.25rem 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
}
.event-card + .event-card { border-top: 0; }

.event-date { margin: 0; }
.event-date time { display: block; }
.event-day {
  display: block;
  font-weight: 600;
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.event-month { display: block; margin-top: 0.5rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--signal);
}
.event-badge::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--signal); }

.event-meta { margin: 0 0 0.75rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.event-body h3 {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.event-synopsis { margin: 0; max-width: 34rem; color: var(--muted); }

.event-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--graphite);
  color: var(--graphite);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { border-color: var(--signal); color: var(--signal); }
.btn-primary { background: var(--graphite); color: var(--paper); }
.btn-primary:hover { background: var(--signal); border-color: var(--signal); color: var(--paper); }

@media (max-width: 40rem) {
  .event-card { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .event-date { display: flex; align-items: baseline; justify-content: space-between; }
  .event-date time { display: flex; align-items: baseline; gap: 0.75rem; }
  .event-month { margin-top: 0; }
  .event-badge { margin-top: 0; }
  .btn { flex: 1; justify-content: center; }
}

/* "Read more" is a button: reset browser button styling to match .btn links */
button.btn { font: inherit; font-weight: 600; font-size: 0.9375rem; background: none; cursor: pointer; }
button.btn[aria-expanded="true"] { border-color: var(--signal); color: var(--signal); }

.event-more { max-width: 36rem; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--stone); }
.event-more p { margin: 0 0 1em; color: var(--graphite); }
.event-more p:last-child { margin-bottom: 0; }

/* two lede paragraphs in a row: small gap between them */
.section-lede + .section-lede { margin-top: 0.75rem; }

/* no dividing lines above or below the events section */
#events,
#events + .band { border-top: 0; }
.event-card { border-top: 0; border-bottom: 0; }

/* =========================================================
   ABOUT: team + where we've worked before
   ========================================================= */
.about-block { margin-top: 5rem; }
.about-block .eyebrow { font-weight: 400; }

.team {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* side by side: Mona left, Yaas right */
  gap: 2.5rem 3rem;
  max-width: 64rem;
}
@media (max-width: 48rem) { .team { grid-template-columns: minmax(0, 1fr); } }
.person {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--stone);
}
.person-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  aspect-ratio: 1;
  border: 1px solid var(--stone);
  color: var(--signal);
}
.person-icon svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.person h3 { margin: 0; font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; }
.person-role { margin: 0.25rem 0 1rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.person p:last-child { margin: 0; color: var(--muted); }

/* logos: greyscale and blended into the paper */
.logo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
  max-width: 48rem;
}
.logo-grid li {
  display: grid;
  place-items: center;
  min-height: 6rem;
  padding: 1rem;
  border: 1px solid var(--stone);
}
.logo-grid img { max-width: 80%; max-height: 3.5rem; width: auto; height: auto; } /* greyscale is baked into the files */

.about-intro + .about-block { margin-top: 0; }  /* team follows the intro directly */
@media (max-width: 30rem) {
  .person { grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0 1rem; }
  .person-icon { width: 2.75rem; }
  .person-icon svg { width: 1.4rem; height: 1.4rem; }
}

/* "investigation for litigation" in the How jia works intro */
.goal { font-weight: 600; color: var(--signal); }

/* =========================================================
   SMOOTHNESS
   ========================================================= */
/* gentle colour changes on every link */
.site-nav a, .site-footer a { transition: color .2s ease; }

/* content revealed by a click (wheel descriptions, Read more) fades in instead of popping */
.js .wheel-panel:not([hidden]),
.js .event-more:not([hidden]) { animation: fade-up .35s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } }

/* page changes (once hosted): header and footer stay put while the content cross-fades */
.site-header { view-transition-name: site-header; }
.site-footer { view-transition-name: site-footer; }

@media (prefers-reduced-motion: reduce) {
  .js .wheel-panel:not([hidden]), .js .event-more:not([hidden]) { animation: none; }
  .site-nav a, .site-footer a { transition: none; }
}

/* =========================================================
   WHEEL: description beside the selected circle (wide screens)
   ========================================================= */
@media (min-width: 72rem) {
  .wheel-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(26rem, 40vw, 36rem) minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    column-gap: 2.5rem;
    align-items: center;
    max-width: 84rem;
    margin: 1.75rem auto 0;
  }
  #how { max-width: 90rem; }   /* room for the bigger wheel plus the side texts */
  .wheel-stage .wheel-wrap { grid-column: 2; grid-row: 1 / 3; max-width: none; margin: 0; }
  .wheel-stage .wheel-panels { display: contents; }   /* panels sit directly in the grid */

  .wheel-panel { max-width: 17rem; margin: 0 !important; padding: 0.25rem 0; }
  .wheel-panel p { font-size: 0.9375rem; line-height: 1.55; }

  /* left side: text aligned toward the wheel, violet line on the wheel side */
  #panel-field, #panel-tech { grid-column: 1; justify-self: end; text-align: right; padding-right: 1.25rem; border-right: 2px solid var(--signal); }
  /* right side */
  #panel-multi, #panel-standards { grid-column: 3; justify-self: start; text-align: left; padding-left: 1.25rem; border-left: 2px solid var(--signal); }
  #panel-field, #panel-multi { grid-row: 1; align-self: start; margin-top: 3rem !important; }
  #panel-tech, #panel-standards { grid-row: 2; align-self: end; margin-bottom: 3rem !important; }

  /* slide in from the wheel's side */
  .js #panel-field:not([hidden]), .js #panel-tech:not([hidden]) { animation: from-right .35s ease both; }
  .js #panel-multi:not([hidden]), .js #panel-standards:not([hidden]) { animation: from-left .35s ease both; }
}
@keyframes from-right { from { opacity: 0; transform: translateX(8px); } }
@keyframes from-left  { from { opacity: 0; transform: translateX(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .js #panel-field:not([hidden]), .js #panel-tech:not([hidden]),
  .js #panel-multi:not([hidden]), .js #panel-standards:not([hidden]) { animation: none; }
}
