/* Vertex rebuilt content pages
   Every footer destination uses clean semantic markup. No legacy page
   component classes or inline presentation survive inside the main content. */

body[data-rebuilt="true"] {
  --page-accent: #c8b7e8;
  --page-accent-deep: #6c548d;
  --page-ground: #f3efe6;
  --page-paper: #e8e1d5;
  --page-ink: #141414;
  --page-muted: #68625a;
  --page-rule: rgba(20, 20, 20, 0.2);
  background: var(--page-ground) !important;
  counter-reset: vertex-section;
}

body[data-rebuilt="true"] .v4-main {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: clip;
  color: var(--page-ink);
  font-family: var(--sans);
}

body[data-rebuilt="true"] .v4-main *,
body[data-rebuilt="true"] .v4-main *::before,
body[data-rebuilt="true"] .v4-main *::after {
  box-sizing: border-box;
}

body[data-rebuilt="true"] .v4-main :is(script, style, canvas, noscript) {
  display: none !important;
}

body[data-rebuilt="true"] .v4-main :empty:not(input, textarea, select, img, video, source, br, hr) {
  display: none;
}

/* Rebuilt hero */
.v4-hero {
  position: relative;
  min-height: min(860px, 88svh);
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(290px, 0.48fr);
  padding: clamp(148px, 18vh, 220px) var(--v3-page) clamp(74px, 8vw, 128px);
  border-bottom: 1px solid var(--page-rule);
  background: var(--page-ground);
  overflow: hidden;
}

.v4-hero-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
  align-self: end;
  max-width: 1080px;
}

.v4-hero-visual {
  position: absolute;
  top: 74px;
  right: 0;
  bottom: 0;
  width: min(39vw, 600px);
  border-left: 1px solid var(--page-rule);
  background-color: var(--page-accent);
  background-image:
    linear-gradient(rgba(20, 20, 20, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.1) 1px, transparent 1px);
  background-size: 54px 54px;
}

.v4-hero-visual::before,
.v4-hero-visual::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54%;
  height: 1px;
  background: rgba(20, 20, 20, 0.55);
  transform: translate(-50%, -50%) rotate(-35deg);
}

.v4-hero-visual::after {
  width: 1px;
  height: 54%;
  transform: translate(-50%, -50%) rotate(35deg);
}

.v4-hero-copy h1 {
  max-width: 1050px;
  margin: clamp(52px, 10vh, 138px) 0 0;
  color: var(--page-ink);
  font-family: var(--sans);
  font-size: clamp(60px, 8.5vw, 136px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.86;
}

.v4-hero-copy h1 :is(em, i) {
  color: var(--page-accent-deep);
  font-family: var(--serif);
  font-weight: 400;
}

.v4-hero-copy > div > :first-child:not(h1):not(:has(h1)),
.v4-hero-copy > div > div:first-child > :first-child:not(h1),
.v4-hero-copy > :is(span, small):first-child,
.v4-hero-copy small {
  color: var(--page-accent-deep);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.v4-hero-copy :is(p, .lead) {
  max-width: 760px;
  margin-top: clamp(24px, 3vw, 44px);
  color: var(--page-muted);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.48;
}

.v4-hero-copy :is(a, button) {
  position: relative;
  z-index: 2;
}

.v4-hero-copy > div,
.v4-hero-copy > section {
  max-width: 100%;
}

/* Any secondary hero apparatus becomes a quiet evidence strip. */
.v4-hero-copy > div:has(div + div) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-top: 34px;
  border: 1px solid var(--page-rule);
  background: var(--page-rule);
}

.v4-hero-copy > div:has(div + div) > div {
  padding: 18px;
  background: var(--page-ground);
}

/* Rebuilt content stream */
.v4-stream {
  width: 100%;
}

.v4-section {
  position: relative;
  counter-increment: vertex-section;
  min-height: 240px;
  padding: clamp(72px, 8vw, 128px) var(--v3-page);
  border-bottom: 1px solid var(--page-rule);
  background: var(--page-ground);
}

.v4-section:nth-child(even) {
  background: var(--page-paper);
}

.v4-section::before {
  content: counter(vertex-section, decimal-leading-zero);
  position: absolute;
  top: clamp(28px, 3vw, 46px);
  left: var(--v3-page);
  color: var(--page-accent-deep);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.v4-section-inner {
  width: min(100%, var(--v3-max));
  margin: 0 auto;
}

.v4-section-inner > :first-child {
  margin-top: 0;
}

.v4-main :is(h2, h3, h4, h5, h6) {
  margin: 0;
  color: var(--page-ink);
  font-family: var(--sans);
  font-weight: 500;
}

.v4-main h2 {
  max-width: 1050px;
  margin-bottom: clamp(30px, 5vw, 72px);
  font-size: clamp(42px, 6.5vw, 94px);
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.v4-main h3 {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 44px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.v4-main h4 {
  margin-bottom: 10px;
  font-size: 18px;
  letter-spacing: -0.015em;
}

.v4-main :is(p, li, dd, td) {
  color: var(--page-muted);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.68;
}

.v4-main p {
  max-width: 880px;
  margin: 0;
}

.v4-main p + p {
  margin-top: 20px;
}

.v4-main :is(strong, b) {
  color: var(--page-ink);
  font-weight: 500;
}

.v4-main :is(em, i) {
  font-family: var(--serif);
}

.v4-main a {
  color: inherit;
}

.v4-main hr {
  height: 1px;
  margin: 50px 0;
  border: 0;
  background: var(--page-rule);
}

/* Repeating content becomes border-based editorial cards. */
.v4-section div:has(> h3),
.v4-section article,
.v4-section li:has(> h3) {
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--page-rule);
  background: rgba(243, 239, 230, 0.58);
  transition: background-color 480ms var(--v3-ease);
}

.v4-section div:has(> h3):hover,
.v4-section article:hover,
.v4-section li:has(> h3):hover {
  background: var(--page-accent);
}

.v4-section div:has(> h3) + div:has(> h3),
.v4-section article + article {
  margin-top: -1px;
}

.v4-section div:has(> div + div):not(:has(h2)):not(:has(form)) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
}

.v4-section div:has(> div + div):not(:has(h2)):not(:has(form)) > div {
  min-width: 0;
}

.v4-section-inner > div:has(> a + a) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--page-rule);
  border-left: 1px solid var(--page-rule);
}

.v4-section-inner > div:has(> a + a) > a {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 220px;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 3vw, 40px);
  overflow: hidden;
  border-right: 1px solid var(--page-rule);
  border-bottom: 1px solid var(--page-rule);
  background: rgba(243, 239, 230, 0.55);
  color: var(--page-ink);
  transition: background-color 480ms var(--v3-ease);
}

.v4-section-inner > div:has(> a + a) > a:hover {
  background: var(--page-accent);
}

.v4-section-inner > div:has(> a + a) > a img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: cover;
  opacity: 0.35;
  transition: opacity 480ms var(--v3-ease), transform 700ms var(--v3-ease);
}

.v4-section-inner > div:has(> a + a) > a:hover img {
  opacity: 0.18;
  transform: scale(1.025);
}

.v4-section-inner > div:has(> a + a) > a > *:not(img) {
  position: relative;
  z-index: 1;
}

.v4-section-inner > div:only-child:not(:has(*)) {
  color: var(--page-accent-deep);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Lists */
.v4-main :is(ul, ol) {
  display: grid;
  gap: 0;
  max-width: 1040px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--page-rule);
}

.v4-main :is(ul, ol) > li {
  position: relative;
  padding: 20px 0 20px 34px;
  border-bottom: 1px solid var(--page-rule);
}

.v4-main ul > li::before {
  content: "";
  position: absolute;
  top: 29px;
  left: 2px;
  width: 9px;
  height: 9px;
  background: var(--page-accent-deep);
}

.v4-main ol {
  counter-reset: ordered-item;
}

.v4-main ol > li {
  counter-increment: ordered-item;
}

.v4-main ol > li::before {
  content: counter(ordered-item, decimal-leading-zero);
  position: absolute;
  top: 21px;
  left: 0;
  color: var(--page-accent-deep);
  font-family: var(--mono);
  font-size: 9px;
}

/* Tables */
.v4-main table {
  width: 100%;
  margin-top: 38px;
  border-collapse: collapse;
  border-top: 1px solid var(--page-ink);
  background: transparent;
}

.v4-main :is(th, td) {
  padding: 18px 16px;
  border-right: 1px solid var(--page-rule);
  border-bottom: 1px solid var(--page-rule);
  text-align: left;
  vertical-align: top;
}

.v4-main th {
  color: var(--page-ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.v4-main tr {
  transition: background-color 360ms ease;
}

.v4-main tbody tr:hover {
  background: rgba(200, 183, 232, 0.48);
}

/* Media */
.v4-main :is(img, video, picture) {
  max-width: 100%;
}

.v4-main img,
.v4-main video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 760px;
  margin: 38px 0;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.05);
}

.v4-main figure {
  margin: 38px 0;
}

.v4-main figcaption {
  padding-top: 10px;
  color: var(--page-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Quotes and technical material */
.v4-main blockquote {
  max-width: 1120px;
  margin: 46px 0;
  padding: clamp(30px, 5vw, 72px);
  border: 0;
  border-left: 4px solid var(--page-accent-deep);
  background: var(--page-accent);
  color: var(--page-ink);
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 62px);
  line-height: 1.02;
}

.v4-main :is(pre, code, kbd, samp) {
  font-family: var(--mono);
}

.v4-main pre {
  max-width: 100%;
  margin: 34px 0;
  padding: clamp(22px, 3vw, 38px);
  overflow: auto;
  border: 1px solid rgba(243, 239, 230, 0.18);
  background: var(--page-ink);
  color: var(--page-ground);
  font-size: 12px;
  line-height: 1.65;
}

.v4-main code:not(pre code) {
  padding: 2px 5px;
  background: rgba(20, 20, 20, 0.08);
  color: var(--page-ink);
  font-size: 0.86em;
}

.v4-main details {
  max-width: 1040px;
  border-top: 1px solid var(--page-rule);
}

.v4-main details:last-of-type {
  border-bottom: 1px solid var(--page-rule);
}

.v4-main summary {
  padding: 22px 0;
  color: var(--page-ink);
  cursor: pointer;
  font-size: 19px;
  font-weight: 500;
}

/* Forms and controls */
.v4-main form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  max-width: 1040px;
}

.v4-main form > :has(textarea),
.v4-main form > textarea,
.v4-main form > button {
  grid-column: 1 / -1;
}

.v4-main label {
  display: grid;
  gap: 10px;
  color: var(--page-ink) !important;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.v4-main :is(input, textarea, select) {
  width: 100%;
  min-height: 54px;
  padding: 14px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(20, 20, 20, 0.45) !important;
  background: transparent !important;
  color: var(--page-ink) !important;
  font-family: var(--sans) !important;
  font-size: 17px !important;
  text-transform: none;
}

.v4-main textarea {
  min-height: 160px;
  resize: vertical;
}

.v4-main button,
.v4-main a[role="button"],
.v4-main a[href^="mailto:"]:not(p a):not(span a) {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: fit-content;
  min-height: 50px;
  margin-top: 24px;
  padding: 13px 18px;
  border: 1px solid var(--page-ink);
  border-radius: 0;
  background: var(--page-ink);
  color: var(--page-ground);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 420ms var(--v3-ease), color 420ms var(--v3-ease);
}

.v4-main button:hover,
.v4-main a[role="button"]:hover,
.v4-main a[href^="mailto:"]:not(p a):not(span a):hover {
  background: var(--page-accent);
  color: var(--page-ink);
}

.v4-main :is(p, li, dd) > a {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size 380ms var(--v3-ease), color 380ms var(--v3-ease);
}

.v4-main :is(p, li, dd) > a:hover {
  color: var(--page-accent-deep);
  background-size: 0 1px;
}

/* Category identities */
body[data-rebuilt="true"][data-category="research"] .v4-hero {
  background: var(--page-ink);
}

body[data-rebuilt="true"][data-category="research"] .v4-hero-copy :is(h1, h2, h3, h4, p, li, strong) {
  color: var(--page-ground);
}

body[data-rebuilt="true"][data-category="research"] .v4-hero-copy h1 :is(em, i) {
  color: var(--page-accent);
}

body[data-rebuilt="true"][data-category="research"] .v4-hero-visual {
  border-left-color: rgba(243, 239, 230, 0.18);
}

body[data-rebuilt="true"][data-category="operators"] .v4-hero {
  background: var(--page-accent);
}

body[data-rebuilt="true"][data-category="operators"] .v4-hero-visual {
  background-color: var(--page-ink);
  background-image:
    linear-gradient(rgba(243, 239, 230, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 239, 230, 0.09) 1px, transparent 1px);
}

body[data-rebuilt="true"][data-category="operators"] .v4-hero-visual::before,
body[data-rebuilt="true"][data-category="operators"] .v4-hero-visual::after {
  background: var(--page-accent);
}

body[data-rebuilt="true"][data-category="company"] .v4-hero-visual {
  background-color: var(--page-paper);
}

body[data-rebuilt="true"][data-category="careers"] .v4-hero {
  background: var(--page-accent);
}

body[data-rebuilt="true"][data-category="careers"] .v4-hero-visual {
  background-color: var(--page-ground);
}

body[data-rebuilt="true"][data-category="reference"] .v4-hero-visual {
  background-color: var(--page-ink);
  background-image:
    linear-gradient(rgba(243, 239, 230, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 239, 230, 0.08) 1px, transparent 1px);
}

body[data-rebuilt="true"][data-category="reference"] .v4-hero-visual::before,
body[data-rebuilt="true"][data-category="reference"] .v4-hero-visual::after {
  background: var(--page-accent);
}

@media (max-width: 900px) {
  .v4-hero {
    min-height: 720px;
    grid-template-columns: 1fr;
    padding-top: 132px;
  }

  .v4-hero-visual {
    top: 66px;
    width: 34vw;
    opacity: 0.65;
  }

  .v4-hero-copy {
    max-width: 84vw;
  }

  .v4-section div:has(> div + div):not(:has(h2)):not(:has(form)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .v4-hero {
    min-height: 620px;
    padding: 118px 20px 66px;
  }

  .v4-hero-visual {
    width: 42vw;
    opacity: 0.42;
  }

  .v4-hero-copy {
    max-width: 100%;
  }

  .v4-hero-copy h1 {
    font-size: clamp(48px, 15vw, 76px);
  }

  .v4-section {
    padding: 70px 20px;
  }

  .v4-section::before {
    left: 20px;
  }

  .v4-main h2 {
    font-size: clamp(38px, 12vw, 62px);
  }

  .v4-section div:has(> div + div):not(:has(h2)):not(:has(form)),
  .v4-main form {
    grid-template-columns: 1fr;
  }

  .v4-main table {
    min-width: 680px;
  }

  .v4-section-inner:has(table) {
    overflow-x: auto;
  }
}
