/* Vertex internal pages — final editorial refinement.
   This layer adds page-specific composition and working-state affordances
   without changing the written content or the shared logo geometry. */

:root {
  --v6-wash: rgba(207, 194, 234, 0.16);
  --v6-wash-strong: rgba(207, 194, 234, 0.28);
  --v6-focus: #70598f;
  --v6-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-rebuilt="true"] .v4-main :is(h1, h2, h3) {
  text-wrap: balance;
}

body[data-rebuilt="true"] .v4-main :is(p, li) {
  text-wrap: pretty;
}

body[data-rebuilt="true"] .v4-section,
body[data-rebuilt="true"] .v4-section-inner,
body[data-rebuilt="true"] [id] {
  scroll-margin-top: 92px;
}

/* The technical plate now echoes the landing-page instrument rather than
   reading as an empty grid rectangle. */
body[data-rebuilt="true"] .v4-hero-visual {
  background-image:
    radial-gradient(
      circle at 50% 50%,
      transparent 0 19%,
      rgba(20, 20, 20, 0.16) 19.2% 19.7%,
      transparent 20% 35%,
      rgba(20, 20, 20, 0.11) 35.2% 35.7%,
      transparent 36%
    ),
    linear-gradient(rgba(20, 20, 20, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.09) 1px, transparent 1px);
  background-size: 100% 100%, 68px 68px, 68px 68px;
  opacity: 0.62;
}

body[data-rebuilt="true"][data-category="research"] .v4-hero-visual,
body[data-rebuilt="true"][data-category="operators"] .v4-hero-visual,
body[data-rebuilt="true"][data-category="reference"] .v4-hero-visual {
  background-image:
    radial-gradient(
      circle at 50% 50%,
      transparent 0 19%,
      rgba(244, 240, 232, 0.22) 19.2% 19.7%,
      transparent 20% 35%,
      rgba(244, 240, 232, 0.13) 35.2% 35.7%,
      transparent 36%
    ),
    linear-gradient(rgba(244, 240, 232, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 240, 232, 0.09) 1px, transparent 1px);
}

body[data-rebuilt="true"] .v4-hero-visual::before,
body[data-rebuilt="true"] .v4-hero-visual::after {
  opacity: 0.7;
}

/* Calm, consistent feedback: color and rule changes, never layout jumps. */
body[data-rebuilt="true"] .v4-main :is(a, button, summary) {
  transition-timing-function: var(--v6-ease);
}

body[data-rebuilt="true"] .v4-main :is(a, button, summary):focus-visible {
  outline-color: var(--v6-focus);
  outline-offset: 4px;
}

/* Manifesto: remove the non-functional audio ornament and make its pull
   statements feel authored instead of falling into the paragraph stack. */
body[data-page="manifesto"] #mListen {
  display: none !important;
}

body[data-page="manifesto"] .v4-section-inner > section > div {
  max-width: 820px;
  margin: 34px 0 4px;
  padding: clamp(24px, 3vw, 38px);
  border-left: 3px solid var(--v5-lavender-ink);
  background: var(--v6-wash);
  font-family: var(--serif);
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.28;
}

body[data-page="manifesto"] .v4-section:nth-child(10) .v4-section-inner > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  padding-top: 28px;
  border-top: 1px solid var(--v5-rule);
}

/* About: a thin thesis rule gives the three compact sections a common
   reading axis without turning them into cards. */
body[data-page="about"] .v4-section-inner > div > div > div:last-child {
  padding-left: clamp(22px, 3vw, 38px);
  border-left: 1px solid rgba(112, 89, 143, 0.42);
}

/* Privacy: policy pages work better as a stable question/answer spine than
   seven oversized headings stacked above similarly sized paragraphs. */
body[data-page="privacy"] .v4-section {
  padding-top: clamp(48px, 5vw, 70px);
  padding-bottom: clamp(48px, 5vw, 70px);
}

body[data-page="privacy"] .v4-section-inner {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(42px, 7vw, 104px);
  align-items: start;
}

body[data-page="privacy"] .v4-section-inner > h2 {
  position: sticky;
  top: 112px;
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
}

body[data-page="privacy"] .v4-section-inner > :not(h2) {
  grid-column: 2;
}

body[data-page="privacy"] .v4-section-inner > ul {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

body[data-page="privacy"] .v4-section-inner > ul li {
  padding: 13px 0 13px 22px;
  border-top: 1px solid var(--v5-rule);
}

body[data-page="privacy"] .v4-section-inner > ul li::before {
  content: "·";
  float: left;
  margin-left: -20px;
  color: var(--v5-lavender-ink);
}

/* Field notes: metadata becomes a quiet left rail while the actual dispatch
   remains a readable long-form column. */
body[data-page="field-notes"] .v4-section {
  padding-top: clamp(52px, 6vw, 82px);
  padding-bottom: clamp(52px, 6vw, 82px);
}

body[data-page="field-notes"] .v4-section-inner article {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 0 clamp(42px, 7vw, 100px);
  padding: 34px 0 0;
}

body[data-page="field-notes"] .v4-section-inner article > div:first-child {
  position: sticky;
  top: 112px;
  grid-column: 1;
  grid-row: 1 / span 4;
  display: grid;
  height: max-content;
  gap: 8px;
  align-content: start;
  color: var(--v5-lavender-ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

body[data-page="field-notes"] .v4-section-inner article > div:first-child span {
  display: block;
  margin: 0;
}

body[data-page="field-notes"] .v4-section-inner article > :not(div:first-child) {
  grid-column: 2;
}

body[data-page="field-notes"] .v4-section-inner article h2 {
  max-width: 900px;
  margin: 0 0 28px;
  font-size: clamp(40px, 5vw, 70px);
}

body[data-page="field-notes"] .v4-section-inner article p + p {
  margin-top: 20px;
}

/* The single publication should feel like a deliberate research record,
   not an undersized list item stranded above the footer. */
body[data-page="publications"] .v4-section:first-child {
  min-height: 520px;
}

body[data-page="publications"] .v4-section-inner > div > div > div {
  grid-template-columns: 86px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px);
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid var(--v5-rule);
  background:
    linear-gradient(135deg, var(--v6-wash) 0 26%, transparent 26% 100%);
}

body[data-page="publications"] .v4-section-inner > div > div > div > div:last-child > div:first-child {
  max-width: 960px;
  font-size: clamp(31px, 4vw, 54px);
}

body[data-page="publications"] .v4-section-inner a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-top: 10px;
  padding: 0 18px;
  border: 1px solid var(--v5-ink);
  transition:
    color 380ms var(--v6-ease),
    background-color 380ms var(--v6-ease);
}

body[data-page="publications"] .v4-section-inner a:hover {
  background: var(--v5-ink);
  color: var(--v5-ground);
}

/* Open-source records gain a stable left edge and alternating paper wash;
   all information stays in place on hover. */
body[data-page="open-source"] .v4-section:nth-child(3) .v4-section-inner > div > div {
  margin-top: -1px;
  padding: clamp(26px, 3vw, 38px);
  border: 1px solid var(--v5-rule);
  border-left: 3px solid rgba(112, 89, 143, 0.5);
}

body[data-page="open-source"] .v4-section:nth-child(3) .v4-section-inner > div > div:nth-child(even) {
  background: rgba(236, 230, 220, 0.55);
}

body[data-page="open-source"] .v4-section:nth-child(3) .v4-section-inner > div > div > div:nth-child(2) {
  font-family: var(--serif);
  font-size: clamp(23px, 2.5vw, 34px);
  line-height: 1.1;
}

/* FAQ, glossary, and sitemap rows receive a very light reading cursor.
   Padding is present in the resting state, so hover never shifts content. */
body[data-page="faq"] .v4-section-inner > div > div > div,
body[data-page="glossary"] .v4-section-inner > div > div,
body[data-page="sitemap"] .v4-section-inner > section > div:last-child > a {
  margin-right: -16px;
  margin-left: -16px;
  padding-right: 16px;
  padding-left: 16px;
  transition:
    background-color 420ms var(--v6-ease),
    border-color 420ms var(--v6-ease);
}

body[data-page="faq"] .v4-section-inner > div > div > div:hover,
body[data-page="glossary"] .v4-section-inner > div > div:hover,
body[data-page="sitemap"] .v4-section-inner > section > div:last-child > a:hover {
  background: var(--v6-wash);
}

/* Hiring: the stage number stays visible while each substantial stage is
   read, and the active stage changes by color only. */
body[data-page="hiring"] #timeline > div > div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 28px;
}

body[data-page="hiring"] #timeline > div > div:first-child > div:first-child {
  grid-column: 1 / -1;
  color: var(--v5-lavender-ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
}

body[data-page="hiring"] #timeline > div > div:first-child > h2 {
  margin: 0;
}

body[data-page="hiring"] #timeline > div > div:first-child > div:last-child {
  color: var(--v5-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

body[data-page="hiring"] #tl-track > article {
  position: relative;
  grid-template-columns: 150px minmax(0, 1fr);
  padding: clamp(34px, 4vw, 54px) 0 clamp(34px, 4vw, 54px) 22px;
  border-left: 2px solid transparent;
  transition:
    border-color 420ms var(--v6-ease),
    background-color 420ms var(--v6-ease);
}

body[data-page="hiring"] #tl-track > article.is-current {
  border-left-color: var(--v5-lavender-ink);
  background: linear-gradient(90deg, var(--v6-wash) 0, transparent 62%);
}

body[data-page="hiring"] #tl-track > article > div:first-child {
  position: sticky;
  top: 112px;
  height: max-content;
}

body[data-page="hiring"] #tl-track > article > div:last-child > div:first-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--v5-muted);
  font-family: var(--mono);
  font-size: 9px;
}

body[data-page="hiring"] #tl-track > article > div:last-child > div:nth-of-type(2) {
  margin-top: 28px;
  color: var(--v5-lavender-ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* The most data-dense pages need stable table chrome on narrow screens. */
body[data-page="benchmark"] .v4-main table,
body[data-page="doctrine"] .v4-main table,
body[data-page="verticals"] .v4-main table {
  border-collapse: separate;
  border-spacing: 0;
}

body[data-page="benchmark"] .v4-main thead th,
body[data-page="doctrine"] .v4-main thead th,
body[data-page="verticals"] .v4-main thead th {
  background: var(--v5-paper);
}

@media (max-width: 900px) {
  body[data-rebuilt="true"] .v4-hero-visual {
    opacity: 0.3;
  }
}

@media (max-width: 660px) {
  body[data-page="manifesto"] .v4-section:nth-child(10) .v4-section-inner > div,
  body[data-page="privacy"] .v4-section-inner,
  body[data-page="field-notes"] .v4-section-inner article,
  body[data-page="hiring"] #timeline > div > div:first-child {
    grid-template-columns: 1fr;
  }

  body[data-page="privacy"] .v4-section-inner > h2,
  body[data-page="field-notes"] .v4-section-inner article > div:first-child,
  body[data-page="hiring"] #tl-track > article > div:first-child {
    position: static;
  }

  body[data-page="privacy"] .v4-section-inner > :not(h2),
  body[data-page="field-notes"] .v4-section-inner article > :not(div:first-child) {
    grid-column: 1;
  }

  body[data-page="privacy"] .v4-section-inner {
    gap: 24px;
  }

  body[data-page="field-notes"] .v4-section-inner article {
    gap: 24px;
  }

  body[data-page="field-notes"] .v4-section-inner article > div:first-child {
    grid-row: auto;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 8px 14px;
  }

  body[data-page="field-notes"] .v4-section-inner article h2 {
    font-size: clamp(35px, 11vw, 50px);
  }

  body[data-page="publications"] .v4-section:first-child {
    min-height: 0;
  }

  body[data-page="publications"] .v4-section-inner > div > div > div {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 16px;
    padding: 24px 20px;
  }

  body[data-page="publications"] .v4-section-inner > div > div > div > div:last-child > div:first-child {
    font-size: clamp(25px, 8vw, 36px);
  }

  body[data-page="hiring"] #timeline > div > div:first-child > div:first-child {
    grid-column: 1;
  }

  body[data-page="hiring"] #tl-track > article {
    grid-template-columns: 1fr;
    padding-left: 16px;
  }
}
