/* ============================================================
   PP Neue Montreal — Font Faces
   ============================================================ */
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PP Neue Montreal Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PP Neue Montreal Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PP Neue Montreal Regular.otf') format('opentype');
  font-weight: 450;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PP Neue Montreal Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  --color-bg: #FFFBF1;
  --color-text: #0A2633;
  --color-secondary: #6D6D6D;
  --color-highlight: #FFEBBA;
  --color-kg-inactive: #C7C7C7;
  --color-kg-active: #0A2633;
  --color-kg-node-active: #546770;
  --color-btn-border: #E5E5E5;
  --color-cream: #FFFBF1;

  --font-family: 'PP Neue Montreal', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ============================================================
   Header
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background-color: var(--color-cream);
  z-index: 1000;
}

.header__logo img {
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 102px;
  height: 40px;
  border-radius: 48px;
  font-family: var(--font-family);
  font-weight: 450;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.btn:hover {
  opacity: 0.8;
}

.btn--outline {
  border: 1px solid var(--color-btn-border);
  background: transparent;
  color: var(--color-text);
}

.btn--solid {
  border: 1px solid var(--color-text);
  background: var(--color-text);
  color: var(--color-cream);
}

/* ============================================================
   Main — KG column + content column
   ============================================================ */
.main {
  display: flex;
  align-items: flex-start;
  flex: 1 0 auto;
}

/* ============================================================
   Knowledge Graph (KG) — Sticky Aside
   Sticky instead of fixed: pins at the same spot while the text
   scrolls, but stays inside .main so it can never reach the footer.
   ============================================================ */
.kg {
  position: sticky;
  top: 285px;
  margin-left: 108px;
  margin-top: 285px;
  width: 289px;
  height: 293px;
  flex-shrink: 0;
  z-index: 10;
}

/* ============================================================
   KG Animation — Cumulative step selectors
   Elements transition from inactive (#C7C7C7) to active
   (lines #0A2633, node fills #546770)
   ============================================================ */
.kg-el {
  transition: stroke 400ms ease, fill 400ms ease;
}

/* Step 1+ */
[data-kg-step="1"] .kg-el[data-step="1"],
[data-kg-step="2"] .kg-el[data-step="1"],
[data-kg-step="3"] .kg-el[data-step="1"],
[data-kg-step="4"] .kg-el[data-step="1"],
[data-kg-step="5"] .kg-el[data-step="1"] {
  stroke: var(--color-kg-active);
  fill: var(--color-kg-active);
}

/* Step 2+ */
[data-kg-step="2"] .kg-el[data-step="2"],
[data-kg-step="3"] .kg-el[data-step="2"],
[data-kg-step="4"] .kg-el[data-step="2"],
[data-kg-step="5"] .kg-el[data-step="2"] {
  stroke: var(--color-kg-active);
  fill: var(--color-kg-active);
}

/* Step 3+ */
[data-kg-step="3"] .kg-el[data-step="3"],
[data-kg-step="4"] .kg-el[data-step="3"],
[data-kg-step="5"] .kg-el[data-step="3"] {
  stroke: var(--color-kg-active);
  fill: var(--color-kg-active);
}

/* Step 4+ */
[data-kg-step="4"] .kg-el[data-step="4"],
[data-kg-step="5"] .kg-el[data-step="4"] {
  stroke: var(--color-kg-active);
  fill: var(--color-kg-active);
}

/* Step 5 */
[data-kg-step="5"] .kg-el[data-step="5"] {
  stroke: var(--color-kg-active);
  fill: var(--color-kg-active);
}

/* Activated node fills are softer than activated lines */
:is([data-kg-step="1"], [data-kg-step="2"], [data-kg-step="3"], [data-kg-step="4"], [data-kg-step="5"]) circle.kg-el[data-step="1"],
:is([data-kg-step="2"], [data-kg-step="3"], [data-kg-step="4"], [data-kg-step="5"]) circle.kg-el[data-step="2"],
:is([data-kg-step="3"], [data-kg-step="4"], [data-kg-step="5"]) circle.kg-el[data-step="3"],
:is([data-kg-step="4"], [data-kg-step="5"]) circle.kg-el[data-step="4"],
[data-kg-step="5"] circle.kg-el[data-step="5"] {
  fill: var(--color-kg-node-active);
}

/* Nodes are pure fills — the shared step rules above set stroke for
   lines, which would render as an outline on circles */
[data-kg-step] circle.kg-el[data-step] {
  stroke: none;
}

/* Lines have no fill area — prevent coloring */
[data-kg-step] line.kg-el,
[data-kg-step] path.kg-el {
  fill: none;
}

/* ============================================================
   Content Article
   ============================================================ */
.content {
  margin-left: 104px; /* KG column is 108 + 289 = 397px; 397 + 104 = 501px from page left */
  max-width: 727px;
  padding-top: 300px;
  padding-bottom: 120px;
  padding-right: 40px;
}

/* Hero */
.hero {
  font-weight: 400;
  font-size: 48px;
  line-height: 64px;
  margin-bottom: 80px;
}

.hero__primary {
  color: var(--color-text);
}

.hero__secondary {
  color: var(--color-secondary);
}

/* Body Text */
.body-text {
  font-weight: 400;
  font-size: 20px;
  line-height: 34px;
  letter-spacing: 0.12px;
  color: var(--color-text);
}

.body-text p {
  margin-bottom: 34px;
}

.body-text p:last-child {
  margin-bottom: 0;
}

.body-text strong {
  font-weight: 500;
}

/* Highlights — interactive spans */
.highlight {
  background-color: var(--color-highlight);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  cursor: pointer;
}

.highlight--team {
  font-weight: 400;
  background-color: transparent;
  text-decoration: underline;
  cursor: default;
}

.highlight--link {
  cursor: pointer;
}

/* ============================================================
   Popups
   ============================================================ */
.popup {
  position: absolute;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 250ms ease-out, transform 250ms ease-out;
  pointer-events: none;
  z-index: 900;
  max-width: 400px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.popup.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.popup img {
  width: 100%;
  height: auto;
}

.popup--team img {
  width: auto;
  height: auto;
}

.popup--team {
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
}

.team-row {
  display: flex;
}

.popup--team .team-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: -12px;
}

.popup--team .team-avatar:first-child {
  margin-left: 0;
}

.popup--team .team-avatar--bordered {
  border: 1px solid var(--color-text);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  display: flex;
  align-items: center;
  padding: 24px 116px 40px;
  font-size: 12px;
  font-weight: 450;
  opacity: 0.5;
  color: var(--color-text);
  margin-top: auto;
}

/* ============================================================
   Mobile — max-width 899px
   ============================================================ */
@media (max-width: 899px) {
  .kg {
    display: none;
  }

  .header__nav .btn--outline {
    display: none;
  }

  .header {
    padding: 0 16px;
  }

  .content {
    margin-left: 0;
    max-width: 100%;
    padding: 110px 16px 80px;
  }

  .hero {
    font-size: 32px;
    line-height: 40px;
    margin-bottom: 32px;
  }

  .body-text {
    font-size: 18px;
    line-height: 32px;
  }

  .popup {
    display: none !important;
  }

  .footer {
    padding: 24px 16px;
  }
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .kg-el {
    transition: none;
  }

  .popup {
    transition: none;
    transform: none;
  }

  .popup.is-visible {
    transform: none;
  }
}
