/* ==========================================================================
   EmpowerZ portfolio
   Design read: research-project portfolio for evaluators and recruiters,
   technical-editorial language, native CSS. One accent (violet #9d4edd).
   Radius rule: panels 20px, nested cards 14px, small tiles 10px,
   interactive controls (buttons, chips, filters, nav) full pill.
   Z-index scale: nav 50, mobile menu 40, grain 60.
   ========================================================================== */

/* ---------- Fonts (self-hosted in fonts/, no internet needed) ---------- */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  /* Light mode uses very light purples instead of plain white. */
  --bg: #f6f2fd;
  --bg-tint: #ede6fa;
  --surface: #fcfaff;
  --surface-2: #ebe3f8;
  --ink: #141318;
  --ink-2: #3a3843;
  --muted: #605d6b;
  --line: rgb(20 19 24 / 0.1);
  --line-strong: rgb(20 19 24 / 0.2);
  --accent: #9d4edd;
  --accent-display: #9d4edd;
  --accent-text: #7b2cbf;
  --accent-on-ink: #c99bf2;
  --accent-soft: rgb(157 78 221 / 0.09);
  --accent-line: rgb(157 78 221 / 0.3);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(40 24 60 / 0.04), 0 18px 44px -28px rgb(40 24 60 / 0.3);
  --grain-opacity: 0.05;

  /* Self-hosted, see @font-face above */
  --font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-panel: 20px;
  --r-card: 14px;
  --r-tile: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0c10;
    --bg-tint: #141319;
    --surface: #17161c;
    --surface-2: #1f1e26;
    --ink: #edecf2;
    --ink-2: #c7c5d0;
    --muted: #9c99a8;
    --line: rgb(237 236 242 / 0.09);
    --line-strong: rgb(237 236 242 / 0.18);
    --accent: #9d4edd;
    --accent-display: #b57bee;
    --accent-text: #c99bf2;
    --accent-on-ink: #7b2cbf;
    --accent-soft: rgb(157 78 221 / 0.14);
    --accent-line: rgb(181 123 238 / 0.38);
    --on-accent: #ffffff;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 24px 50px -30px rgb(0 0 0 / 0.7);
    --grain-opacity: 0.06;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0c10;
  --bg-tint: #141319;
  --surface: #17161c;
  --surface-2: #1f1e26;
  --ink: #edecf2;
  --ink-2: #c7c5d0;
  --muted: #9c99a8;
  --line: rgb(237 236 242 / 0.09);
  --line-strong: rgb(237 236 242 / 0.18);
  --accent: #9d4edd;
  --accent-display: #b57bee;
  --accent-text: #c99bf2;
  --accent-on-ink: #7b2cbf;
  --accent-soft: rgb(157 78 221 / 0.14);
  --accent-line: rgb(181 123 238 / 0.38);
  --on-accent: #ffffff;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 24px 50px -30px rgb(0 0 0 / 0.7);
  --grain-opacity: 0.06;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Entrance animations start blocks offset to the right; never let that widen the page on phones. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Film grain on a fixed, non-scrolling layer. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

h4 {
  font-weight: 600;
  line-height: 1.35;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

section[id] {
  scroll-margin-top: 72px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  --section-bg: var(--bg);
  padding-block: clamp(88px, 11vw, 148px);
  background: var(--section-bg);
}

/* Sections alternate plain / tinted so neighbours stay distinct. */
.section-tinted {
  --section-bg: var(--bg-tint);
  border-block: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.accent {
  color: var(--accent-display);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  /* No transform transition: GSAP drives these buttons' transforms (intro, magnetic pull). */
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn svg {
  transition: transform 0.35s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background-color 0.25s ease, transform 0.25s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ---------- Navbar ---------- */

.navbar {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}

.navbar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - var(--gutter) * 2 + 24px);
  max-width: calc(var(--container) + 24px);
  height: var(--nav-h);
  margin-inline: auto;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.navbar.is-scrolled .navbar-inner,
.navbar.is-open .navbar-inner {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-color: var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* backdrop-filter would become the containing block of the fixed mobile menu. */
.navbar.is-open .navbar-inner {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (prefers-reduced-transparency: reduce) {
  .navbar.is-scrolled .navbar-inner,
  .navbar.is-open .navbar-inner {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-tile);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 800;
}

/* Light tile in both themes: the logo's dark bars would disappear on the dark navbar. */
.brand-logo {
  width: 36px;
  height: 36px;
  padding: 4px;
  border-radius: var(--r-tile);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line);
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.is-active {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-toggle {
  display: none;
}

@media (max-width: 1140px) {
  .nav-toggle {
    display: inline-grid;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    padding: 96px var(--gutter) 40px;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
  }

  .navbar.is-open .nav-links {
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 10px 0;
    border-radius: 0;
    font-family: var(--font-display);
    font-size: clamp(28px, 7vw, 40px);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ink);
  }

  .nav-links a.is-active {
    background: none;
    color: var(--accent);
  }
}

.scroll-progress {
  display: none;
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-progress {
    display: block;
  }
}

/* SplitText masks: give descenders and accents room so the clip does not cut them. */
.split-line-mask,
.split-word-mask,
.split-char-mask {
  padding-block: 0.06em 0.16em;
  margin-block: -0.06em -0.16em;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 12px + clamp(28px, 5vw, 64px));
  padding-bottom: clamp(88px, 11vw, 148px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  min-height: min(calc(100dvh - 150px), 760px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.6rem, 5.1vw, 4.6rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero-sub {
  margin-top: 26px;
  max-width: 50ch;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-visual {
  width: 100%;
  max-width: 480px;
  justify-self: end;
}

.hero-stage {
  perspective: 1100px;
}

.hero-canvas {
  will-change: transform;
}

.hero-canvas,
.hero-image {
  position: relative;
  aspect-ratio: 5 / 6;
  width: 100%;
  border-radius: var(--r-panel);
  border: 1px solid var(--line);
  overflow: hidden;
  object-fit: cover;
}

.hero-canvas {
  background:
    radial-gradient(60% 50% at 50% 46%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg-tint));
}

.hero-visual figcaption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Face field (SVG) */
.face-field {
  display: block;
  width: 100%;
  height: 100%;
}

.ff-brackets {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.45;
  stroke-width: 1.5;
}

.ff-contour {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.1;
  stroke-width: 1;
}

.ff-edge {
  stroke: var(--ink);
  stroke-opacity: 0.13;
  stroke-width: 0.7;
}

.ff-dot {
  fill: var(--ink);
  opacity: 0.62;
}

.ff-iris {
  fill: var(--accent);
}

.ff-scan {
  opacity: 0.9;
}

@media (prefers-reduced-motion: no-preference) {
  .ff-dot {
    animation: ff-twinkle 4.8s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.2s);
  }

  .ff-scan {
    animation: ff-scan 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }

}

@keyframes ff-twinkle {
  0%,
  100% {
    opacity: 0.62;
  }
  50% {
    opacity: 0.18;
  }
}

@keyframes ff-scan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(500px);
  }
}


.hero-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  margin-top: clamp(48px, 6vw, 80px);
}

.hero-facts > * {
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}

.hero-title {
  display: flex;
  gap: 16px;
}

.hero-title-icon {
  flex: none;
  color: var(--accent);
  stroke-width: 1.5;
}

.hero-title p {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-title span {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.stat dd {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.3vw, 2.15rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.stat dt {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
}

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

.section-header {
  max-width: 780px;
  margin-bottom: clamp(44px, 5vw, 64px);
}

.section-header .eyebrow {
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
}

.section-sub {
  margin-top: 18px;
  max-width: 60ch;
  font-size: 1.075rem;
  color: var(--muted);
}

/* ---------- Domain ---------- */

.domain {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.domain-nav {
  isolation: isolate;
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.domain-nav button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-card);
  background: transparent;
  text-align: left;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.domain-nav button:hover {
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

.domain-nav button.is-active,
.domain-nav button.is-active:hover {
  background: transparent;
}

.domain-nav .label {
  display: flex;
  flex-direction: column;
}

.domain-nav strong {
  font-size: 15.5px;
  font-weight: 600;
}

.domain-nav small {
  font-size: 13px;
  color: var(--muted);
}

.domain-nav .chev {
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.3s var(--ease);
}

.domain-nav button.is-active .chev {
  color: var(--accent);
  opacity: 1;
  transform: none;
}

.domain-panel {
  min-height: 560px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-title {
  margin-bottom: 20px;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  letter-spacing: -0.03em;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
}

.panel-card h4 {
  font-size: 16px;
}

.panel-card p {
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: var(--r-tile);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.card-icon svg {
  stroke-width: 1.75;
}

.numbered li {
  display: grid;
  grid-template-columns: 52px 1fr;
  padding: 18px 0;
  font-size: 15.5px;
  color: var(--ink-2);
}

.numbered li + li {
  border-top: 1px solid var(--line);
}

.numbered span {
  font-family: var(--font-mono);
  font-size: 13px;
  padding-top: 3px;
  color: var(--accent-text);
}

.table-wrap {
  margin-top: 32px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.compare {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.compare th,
.compare td {
  padding: 14px 16px;
  text-align: center;
}

.compare thead th {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  background: var(--bg);
  vertical-align: bottom;
}

.compare th:first-child {
  text-align: left;
}

.compare tbody th {
  font-weight: 500;
}

.compare tbody tr {
  border-top: 1px solid var(--line);
}

.compare tr.highlight {
  background: var(--accent-soft);
}

.compare tr.highlight th {
  font-weight: 700;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  vertical-align: middle;
}

.mark.yes {
  background: var(--accent);
  color: var(--on-accent);
}

.mark.partial {
  background: var(--surface-2);
  color: var(--ink-2);
}

.mark.no {
  color: var(--muted);
  opacity: 0.6;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.legend .mark {
  width: 22px;
  height: 22px;
}

.legend .mark + .mark,
.legend .mark:not(:first-child) {
  margin-left: 10px;
}

/* Opening statement of every Domain tab, so all six tabs read the same way. */
.statement {
  max-width: 62ch;
  margin-bottom: 32px;
  padding-left: 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.card-numbered {
  display: grid;
  grid-template-columns: 40px 1fr;
}

.card-numbered .num {
  font-family: var(--font-mono);
  font-size: 13px;
  padding-top: 1px;
  color: var(--accent-text);
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  padding-bottom: 26px;
}

.steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: 4px;
  width: 1px;
  background: var(--line-strong);
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.steps h4 {
  padding-top: 8px;
  font-size: 16px;
}

.steps p {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--muted);
}

.figure {
  margin-top: 28px;
}

.figure img {
  width: 100%;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
}

.figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.panel-card .chips {
  margin-top: 14px;
}

/* ---------- Research components ---------- */

.component-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.component-index a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.25s ease;
}

.component-index a:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
}

.component-index svg {
  color: var(--accent);
  stroke-width: 1.75;
}

.component-index strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.component-index span {
  grid-column: 1 / -1;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
}

.loop-band {
  margin: clamp(4px, 1vw, 16px) 0 clamp(48px, 6vw, 80px);
  padding-block: clamp(14px, 2vw, 26px);
  border-block: 1px solid var(--line);
  overflow: hidden;
}

.loop-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.loop-track span {
  display: inline-flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 40px);
  padding-right: clamp(18px, 2.4vw, 40px);
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 7.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  color: var(--ink);
}

/* Stroke painted under a background-coloured fill hides the variable font's overlapping contours. */
.loop-track span.is-outline {
  color: var(--section-bg, var(--bg));
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}

.loop-arrow {
  width: 0.55em;
  height: 0.55em;
  color: var(--accent);
  stroke-width: 2.25;
}

.component {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  padding-block: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--line-strong);
  scroll-margin-top: 80px;
}

.component-aside {
  position: sticky;
  top: 100px;
  align-self: start;
}

.component-code {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 10vw, 9rem);
  font-weight: 700;
  font-stretch: 75%;
  line-height: 0.82;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.component-aside h3 {
  margin-top: 26px;
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  letter-spacing: -0.03em;
}

.component-tagline {
  margin-top: 10px;
  font-size: 1.05rem;
  color: var(--accent-text);
}

.component-image {
  margin-top: 24px;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
}

.owner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 6px 18px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.owner strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.owner span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.component-desc {
  font-size: clamp(1.05rem, 1.3vw, 1.18rem);
  line-height: 1.7;
  color: var(--ink-2);
}

.novelty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin: 30px 0 34px;
  padding: 20px 22px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-card);
  background: var(--accent-soft);
}

.novelty > svg {
  margin-top: 2px;
  color: var(--accent-text);
  stroke-width: 1.75;
}

.novelty h4 {
  font-size: 14px;
  color: var(--accent-text);
}

.novelty p {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.6;
}

.mini-title {
  margin-bottom: 14px;
  font-size: 15px;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin-bottom: 28px;
}

.features li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- Avatars ---------- */

.avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  background: linear-gradient(150deg, var(--surface-2), var(--bg-tint));
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-2);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

/* Circles zoom toward the face: owner badges (half-body shots) tighter, supervisor headshots lighter. */
.avatar-sm img {
  object-position: 50% 18%;
  transform: scale(1.9);
  transform-origin: 50% 22%;
}

.avatar-md img {
  transform: scale(1.2);
  transform-origin: 50% 20%;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 13px;
}

.avatar-md {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 18px;
}

.avatar-portrait {
  width: 100%;
  aspect-ratio: 4 / 4.4;
  font-size: clamp(3.2rem, 6vw, 5rem);
  font-weight: 700;
  font-stretch: 75%;
  color: var(--ink);
  background:
    radial-gradient(80% 60% at 30% 100%, var(--accent-soft), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--bg-tint));
}

/* ---------- Milestones ---------- */

.milestones {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}

.milestones-aside {
  position: sticky;
  top: 100px;
}

.milestones-aside .section-header {
  margin-bottom: 32px;
}

.progress {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-count {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.progress-count strong {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.progress-count span {
  font-size: 15px;
  color: var(--muted);
}

.progress-segments {
  display: flex;
  gap: 4px;
  margin-top: 20px;
}

.progress-segments i {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-segments i.completed {
  background: var(--accent);
}

.progress-next {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.progress-next span {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.progress-next strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.progress-next em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 14px;
  color: var(--accent-text);
}

.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 22px;
  padding-bottom: 14px;
}

.timeline-line {
  position: absolute;
  left: 14.5px;
  top: 52px;
  bottom: -18px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-item.completed .timeline-line {
  background: var(--accent);
}

.timeline-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--section-bg, var(--bg));
}

.timeline-item.completed .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.timeline-item.is-next .timeline-dot {
  border-color: var(--accent);
}

.timeline-item.is-next .timeline-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .timeline-item.is-next .timeline-dot::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    animation: pulse 2.4s var(--ease) infinite;
  }
}

@keyframes pulse {
  from {
    opacity: 0.8;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

.timeline-body {
  padding: 18px 22px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-card);
  transition: background-color 0.3s ease;
}

.timeline-item.is-next .timeline-body {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.timeline-meta time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge.completed {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge.upcoming {
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.timeline-item.is-next .badge {
  border-color: transparent;
  background: var(--ink);
  color: var(--bg);
}

.timeline-body h3 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.timeline-body .timeline-meta {
  font-weight: 400;
  letter-spacing: 0;
}

.timeline-title {
  display: block;
  margin-top: 8px;
}

.timeline-body p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}

.timeline-body .marks {
  color: var(--ink-2);
}

/* Drop-down: the header toggles the details below it. */
.timeline-item:not(.is-next) .timeline-body:hover {
  background: var(--surface);
}

.timeline-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.timeline-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 6px;
}

.timeline-toggle .chev {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  transition: transform 0.4s var(--ease), background-color 0.3s ease;
}

.timeline-toggle:hover .chev {
  background: var(--accent-soft);
}

.timeline-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.timeline-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}

.timeline-panel > div {
  overflow: hidden;
}

.timeline-item.is-open .timeline-panel {
  grid-template-rows: 1fr;
}

.timeline-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.timeline-details span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.timeline-details strong {
  color: var(--accent-text);
  font-weight: 600;
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* Main milestone drop-down: pick one to open it and scroll to it. */
.milestone-select {
  position: relative;
  flex: 1 1 240px;
  max-width: 360px;
}

.milestone-select select {
  width: 100%;
  padding: 9px 40px 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
}

.milestone-select select:hover {
  border-color: var(--accent);
}

.milestone-select select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.milestone-select-chev {
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  color: var(--ink-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.timeline-actions button {
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.timeline-actions button:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-panel,
  .timeline-toggle .chev {
    transition: none;
  }
}

/* ---------- Documents ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.filters button {
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease);
}

.filters button:hover {
  border-color: var(--ink);
}

.filters button:active {
  transform: scale(0.97);
}

.filters button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.doc-group {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  padding-block: 28px;
  border-top: 1px solid var(--line-strong);
}

.doc-group-title {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.doc-group-title span {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  vertical-align: super;
}

.doc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.doc {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  /* Flip animates these cards, so only colour transitions here. */
  transition: border-color 0.25s ease;
}

.doc.is-available:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
}

.doc-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-tile);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.doc-icon svg {
  stroke-width: 1.75;
}

.doc.is-pending .doc-icon {
  background: var(--surface-2);
  color: var(--muted);
}

.doc-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.doc-info span {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.doc-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  color: var(--muted);
}

.doc.is-available .doc-action {
  color: var(--accent-text);
}

/* ---------- Presentations ---------- */

/* Decks sit in rows: four across on desktop, two on tablets, one on phones. */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 28px 20px;
}

.deck-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
}

a.deck-thumb {
  display: block;
}

a.deck-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.deck-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 22px 24px;
  background:
    radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
    #17161c;
  color: #edecf2;
  transition: transform 0.6s var(--ease);
}

.deck:hover .deck-cover,
.deck:hover .deck-thumb img {
  transform: scale(1.03);
}

.deck-thumb img {
  transition: transform 0.6s var(--ease);
}

.deck-cover span {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.7;
}

.deck-cover strong {
  max-width: 13ch;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.deck-body {
  padding: 18px 4px 0;
}

.deck-body time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.deck-body h3 {
  margin-top: 6px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.deck-body p {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent-text);
}

.text-link svg {
  transition: transform 0.3s var(--ease);
}

a.text-link:hover svg {
  transform: translate(2px, -2px);
}

.text-link.is-disabled {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- Team ---------- */

.members {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.members {
  position: relative;
}

.member {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
}

/* Light that follows the pointer (position set from GSAP on hover). */
.member::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / 0.16), transparent 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
  .member:hover::after {
    opacity: 1;
  }
}

.member-body {
  padding: 18px 20px 22px;
}

.member-body h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.member-role {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
}

.member-id {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.socials {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.socials a:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Sit above the full-card profile button so the links stay clickable. */
.member .socials {
  position: relative;
  z-index: 3;
  width: fit-content;
}

.member .socials a {
  background: var(--surface);
}

.supervision-title {
  margin: clamp(48px, 6vw, 72px) 0 18px;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

/* Same card as the team members, sized to match a member column and centred. */
.supervisors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, calc((100% - 48px) / 4)));
  justify-content: center;
  gap: 16px;
}

/* Cards stretch to the tallest in the row; social icons sit on the bottom edge. */
.member {
  display: flex;
  flex-direction: column;
}

.member .avatar {
  flex-shrink: 0;
}

.member .member-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.member .socials {
  margin-top: auto;
  padding-top: 14px;
}

.supervisor h4 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

/* Whole card opens the profile; the "+" badge is the visual cue. */
.member {
  cursor: pointer;
}

.member.supervisor {
  cursor: default;
}

.member-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.member-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-panel);
}

.member-plus {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  pointer-events: none;
  transition: transform 0.45s var(--ease), background-color 0.3s ease, color 0.3s ease;
}

.member:hover .member-plus,
.member:has(.member-open:focus-visible) .member-plus {
  transform: rotate(90deg);
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- Profile dialog ---------- */

html.has-dialog {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.profile-dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.profile-dialog[open] {
  display: grid;
  place-items: center;
}

.profile-dialog::backdrop {
  background: transparent;
}

.profile-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(20 19 24 / 0.38);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

:root[data-theme="dark"] .profile-backdrop {
  background: rgb(4 3 8 / 0.62);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .profile-backdrop {
    background: rgb(4 3 8 / 0.62);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .profile-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.profile-panel {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 0 40px 120px -40px rgb(10 6 20 / 0.55);
  will-change: transform;
}

.profile-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 460px;
}

.profile-photo {
  margin: 12px;
  overflow: hidden;
  border-radius: var(--r-card);
}

.profile-photo .avatar-portrait {
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  font-size: clamp(4rem, 9vw, 6.5rem);
}

.profile-info {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 44px) clamp(24px, 3.5vw, 40px) clamp(24px, 3.5vw, 36px);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-right: 44px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.profile-code {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 500;
}

.profile-name {
  margin-top: 18px;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

/* Wrap long names between words only, never mid-word. */
.profile-name .split-word {
  white-space: nowrap;
}

.profile-role {
  margin-top: 12px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-2);
}

.profile-tagline {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

.profile-links {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 32px;
}

.profile-link {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

a.profile-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.profile-link-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-tile);
  background: var(--ink);
  color: var(--bg);
}

.profile-link-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.profile-link-text small {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-link-arrow {
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.25s ease;
}

a.profile-link:hover .profile-link-arrow {
  color: var(--accent-text);
  transform: translate(2px, -2px);
}

.profile-empty {
  display: block;
  padding: 16px 18px;
  border-style: dashed;
  border-color: var(--line-strong);
  font-size: 14px;
  color: var(--muted);
}

.profile-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  transition: background-color 0.25s ease;
}

.profile-close svg {
  transition: transform 0.4s var(--ease);
}

.profile-close:hover {
  background: var(--surface-2);
}

.profile-close:hover svg {
  transform: rotate(90deg);
}

@media (max-width: 720px) {
  .profile-dialog {
    padding: 12px;
  }

  .profile-inner {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .profile-photo {
    margin: 10px 10px 0;
  }

  .profile-photo .avatar-portrait {
    height: min(46dvh, 340px);
  }

  .profile-info {
    padding: 22px 20px 20px;
  }

  .profile-meta {
    padding-right: 0;
  }

  .profile-close {
    top: 20px;
    right: 20px;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.contact.contact-single {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
}

.contact-single .contact-rows {
  margin-top: 0;
}

.contact-intro h2 {
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.contact-intro > p {
  max-width: 54ch;
  margin-top: 24px;
  font-size: 1.125rem;
  color: var(--muted);
}

.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 680px;
  margin-top: 40px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-panel);
  font-size: 15.5px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.contact-row > svg:first-child {
  flex: none;
  color: var(--accent);
  stroke-width: 1.75;
}

.contact-row span {
  flex: 1;
}

.contact-row-arrow {
  flex: none;
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.25s ease;
}

.contact-row:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.contact-row:hover .contact-row-arrow {
  color: var(--accent-text);
  transform: translate(2px, -2px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-tile);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-line);
  outline-offset: 1px;
}

.field small {
  font-size: 13px;
  color: var(--muted);
}

.contact-form .btn {
  align-self: flex-end;
}

/* ---------- Footer ---------- */

.footer {
  padding: clamp(64px, 8vw, 96px) 0 28px;
  background: var(--bg);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 48px;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}

.footer-brand p {
  max-width: 38ch;
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-cols h4 {
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--ink);
}

.footer-cols p,
.footer-cols a {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.footer-cols a:hover {
  color: var(--ink);
}

.footer-bottom {
  position: relative;
  margin-top: 56px;
  padding-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

.footer-bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-visual {
    justify-self: start;
    max-width: 440px;
  }

  .hero-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .hero-facts > .stats {
    border-top: 0;
  }

  .domain {
    grid-template-columns: minmax(0, 1fr);
  }

  .domain-nav {
    position: static;
    flex-direction: row;
    gap: 6px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 2px var(--gutter) 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .domain-nav::-webkit-scrollbar {
    display: none;
  }

  .domain-nav button {
    flex: none;
    grid-template-columns: auto;
    padding: 10px 16px;
    border-color: var(--line-strong);
    border-radius: 999px;
    scroll-snap-align: start;
  }

  .domain-nav button.is-active {
    border-color: transparent;
    color: var(--bg);
  }

  .tab-indicator {
    border-color: var(--ink);
    border-radius: 999px;
    background: var(--ink);
    box-shadow: none;
  }

  .domain-nav strong {
    font-size: 14px;
    font-weight: 500;
  }

  .domain-nav small,
  .domain-nav .chev {
    display: none;
  }

  .domain-panel {
    min-height: 0;
  }

  .component,
  .milestones {
    grid-template-columns: minmax(0, 1fr);
  }

  .component-aside,
  .milestones-aside {
    position: static;
  }

  .component-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .members,
  .supervisors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact,
  .contact.contact-single,
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-single .contact-rows {
    margin-top: 8px;
  }
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }

  .panel-grid,
  .features,
  .doc-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
  }

  .doc-action {
    grid-column: 2;
    margin-top: -8px;
  }

  .filters {
    flex-wrap: nowrap;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-cols nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  .footer-cols nav h4 {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .component-index {
    display: none;
  }

  .members,
  .supervisors {
    gap: 12px;
  }

  .member-body {
    padding: 14px 14px 18px;
  }
}
