/* ==========================================================================
   Ungated "The Ultimate Guide to Hiring AI Engineers" ebook at
   /resources/the-ultimate-guide-to-hiring-ai-engineers/.
   Loaded only by that page (metadata "page_stylesheet"); every class is ae- prefixed.
   Ported from the approved single-file design. Same system as the 3 risks ebook:
   Satoshi display, Geist Mono eyebrows/labels/CTAs, black/white/brand-red bands.
   Side navigation, reading progress and anchors use setupEbook() in site.js.
   ========================================================================== */

/* Tokens and resets, scoped to the page root. */
.ae-ebook {
  --red: var(--color-red-500, #d91629);
  --orange: var(--color-orange-400, #fb5e38);
  --ink: var(--color-black-950, #121112);
  --paper: #ffffff;
  --soft: #efefef;
  --muted: #5b5b5b;
  --display: "Satoshi", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.ae-ebook *,
.ae-ebook *::before,
.ae-ebook *::after {
  box-sizing: border-box;
}
.ae-ebook :where(img, svg) {
  max-width: 100%;
  display: block;
}
.ae-ebook :where(a) {
  color: inherit;
}
.ae-ebook :is(a, button, summary):focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}
.ae-ebook :where(h1, h2, h3, h4, p, ul, ol, figure, blockquote) {
  margin: 0;
}
.ae-ebook :where(h1, h2) {
  text-wrap: balance;
}
.ae-ebook :where([id]) {
  scroll-margin-top: calc(var(--ebook-header-h, 80px) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html:has(.ae-ebook) {
    scroll-behavior: smooth;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ae-ebook *,
  .ae-ebook *::before,
  .ae-ebook *::after {
    transition: none !important;
  }
}
.ae-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ae-wrap {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4.5vw, 52px);
}
.ae-eyebrow {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
}
.ae-page {
  padding-block: clamp(24px, 3vw, 40px);
}
.ae-page.ae-flush-top {
  padding-top: 0;
}
.ae-h2 {
  font-weight: 500;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
  margin-top: 16px;
}

/* Reading progress: a thin bar along the bottom of the sticky site header. */
.ae-progress {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--ebook-progress-top, 0px);
  z-index: 55;
  height: 3px;
  background: linear-gradient(90deg, var(--color-red-500, #d91629), var(--color-orange-400, #fb5e38));
  transform: scaleX(var(--ebook-progress, 0));
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Side navigation: fixed and collapsed to section codes; expands on hover or focus. */
.ae-sidenav {
  position: fixed;
  left: 14px;
  top: calc(50% + 40px);
  transform: translateY(-50%);
  z-index: 40;
  width: 52px;
  max-height: calc(100vh - 126px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
  padding: 8px;
  transition: width .18s ease;
}
.ae-sidenav:hover,
.ae-sidenav:focus-within {
  width: 250px;
}
.ae-sidenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.ae-sidenav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 12px;
  color: #3a3a3a;
  padding: 7px 4px;
}
.ae-sidenav a:hover {
  background: #f3f3f3;
}
.ae-sidenav .ae-k {
  flex: none;
  width: 34px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1px;
  color: #6b6b6b;
}
.ae-sidenav .ae-t {
  font-weight: 500;
  font-size: 14.5px;
}
.ae-sidenav li[data-active] > a {
  background: var(--soft);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--red);
}
.ae-sidenav li[data-active] > a .ae-k {
  color: var(--ink);
}
@media (min-width: 1620px) {
  .ae-sidenav {
    width: 250px;
  }
}
@media (max-width: 1000px) {
  .ae-sidenav {
    display: none;
  }
}
.ae-jump {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 11px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.ae-jump:hover {
  background: var(--red);
}
/* Keep text clear of the fixed side navigation. */
@media (min-width: 1001px) {
  .ae-jump {
    display: none;
  }
  .ae-ebook {
    --navclear: 96px;
  }
  .ae-wrap {
    padding-left: max(clamp(20px, 4.5vw, 52px), calc(var(--navclear) - max(0px, (100vw - 1100px) / 2)));
  }
}
@media (min-width: 1620px) {
  .ae-ebook {
    --navclear: 290px;
  }
}

/* Cover */
.ae-cover {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ae-redblock {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(96px, 15vw, 220px);
  aspect-ratio: 1;
  background: var(--red);
  border-bottom-right-radius: clamp(20px, 2.4vw, 32px);
}
.ae-gridblock {
  position: absolute;
  right: 0;
  top: 0;
  width: clamp(200px, 28vw, 420px);
  height: min(82%, 500px);
  border-bottom-left-radius: clamp(20px, 2.4vw, 32px);
  background-image:
    linear-gradient(rgba(255, 255, 255, .45) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(255, 255, 255, .45) 1.5px, transparent 1.5px),
    linear-gradient(160deg, var(--red) 0%, var(--orange) 100%);
  background-size: 25% 20%, 25% 20%, 100% 100%;
  background-position: -1px -1px, -1px -1px, 0 0;
  pointer-events: none;
}
.ae-cover-in {
  position: relative;
  padding-block: calc(clamp(96px, 15vw, 220px) + clamp(20px, 2.4vw, 32px)) clamp(36px, 4.4vw, 56px);
}
.ae-cover h1 {
  font-weight: 400;
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
  max-width: min(760px, 62%);
  color: #fff;
}
.ae-paren {
  display: block;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.2;
  margin-top: clamp(14px, 1.8vw, 24px);
}
.ae-cover-sub {
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.5;
  color: #d6d6d6;
  max-width: min(720px, 62%);
  margin-top: clamp(20px, 2.6vw, 32px);
}

/* Intro */
.ae-illo {
  border-radius: 32px;
  overflow: hidden;
  background: #fde9e8;
}
.ae-illo img {
  width: 100%;
  height: auto;
}
.ae-wild {
  border: 12px solid #f4f4f4;
  border-radius: 32px;
  padding: clamp(24px, 5vw, 64px);
  margin-top: clamp(20px, 2.6vw, 32px);
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
}
.ae-wild h2 {
  color: var(--red);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
}
.ae-wild .ae-body {
  display: grid;
  gap: 18px;
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.65;
}

/* Contents */
.ae-toc {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  border-top: 1px solid #8c8c8c;
}
.ae-toc li {
  border-bottom: 1px solid #c9c9c9;
}
.ae-toc a {
  display: grid;
  grid-template-columns: clamp(56px, 9vw, 110px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  text-decoration: none;
}
.ae-n {
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1;
  color: var(--red);
}
.ae-toc-t {
  font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px);
}
.ae-toc a:hover .ae-toc-t {
  color: var(--red);
}

/* Chapter header */
.ae-chap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 10px;
}
.ae-chap h2 {
  color: var(--red);
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.1;
  max-width: 760px;
}
.ae-ghost {
  font-weight: 700;
  font-size: clamp(90px, 15vw, 200px);
  line-height: .8;
  color: #f1f1f1;
}
.ae-lead {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  margin-top: clamp(12px, 1.8vw, 20px);
  max-width: 900px;
}
.ae-label {
  font-size: clamp(18px, 1.9vw, 21px);
  margin-top: clamp(18px, 2.4vw, 28px);
}
.ae-label.ae-strong {
  font-weight: 700;
}

/* 01 types */
.ae-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.ae-type {
  border-radius: 20px;
  padding: clamp(22px, 3vw, 34px);
  display: grid;
  gap: 14px;
  align-content: start;
  font-size: 17px;
  line-height: 1.55;
}
.ae-type h3 {
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.2;
  color: inherit;
}
.ae-t1 {
  background: var(--ink);
  color: #fff;
}
.ae-t2 {
  background: var(--soft);
  color: var(--ink);
}
.ae-t2 h3 {
  color: var(--red);
}
.ae-t3 {
  background: var(--red);
  color: #fff;
  grid-column: 1 / -1;
}
.ae-pain {
  background: #f7f7f7;
  border-radius: 20px;
  padding: clamp(22px, 3.4vw, 40px);
  margin-top: clamp(20px, 2.6vw, 30px);
}
.ae-pain-k {
  font-weight: 700;
  font-size: 18px;
}
.ae-pain p + p {
  font-size: 17.5px;
  margin-top: 4px;
}
.ae-pain .ae-btn {
  margin-top: 20px;
}

/* Buttons: pill, Geist Mono uppercase. */
.ae-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  padding: 15px 24px;
  line-height: 1.3;
}
.ae-btn.ae-dark {
  background: var(--ink);
  color: #fff;
}
.ae-btn.ae-red {
  background: var(--red);
  color: #fff;
}
.ae-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 02 red flags */
.ae-flags {
  margin-top: clamp(20px, 2.6vw, 30px);
  display: grid;
  gap: 16px;
}
.ae-flags-hd,
.ae-flags-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ae-flags-hd p {
  font-weight: 700;
  font-size: clamp(18px, 1.9vw, 21px);
}
.ae-flag {
  border-radius: 12px;
  padding: clamp(20px, 2.6vw, 28px);
  color: #fff;
  font-size: 17px;
  line-height: 1.55;
}
.ae-flag h3 {
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 10px;
  color: #fff;
}
.ae-bad {
  background: var(--red);
}
.ae-flag a {
  text-underline-offset: 3px;
}
.ae-flag a:focus-visible {
  outline-color: #fff;
}
.ae-good {
  background: var(--ink);
}
/* Row labels repeat on each card for screen readers and on narrow screens. */
.ae-tag {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 03 skills */
.ae-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.ae-skill {
  background: #f7f7f7;
  border-radius: 12px;
  padding: clamp(20px, 2.8vw, 32px);
}
.ae-skill.ae-wide {
  grid-column: 1 / -1;
}
.ae-skill h3 {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 12px;
}
.ae-skill h3 svg {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: -1px;
}
.ae-skill p {
  font-size: 17px;
  line-height: 1.6;
}
.ae-rule {
  margin-top: clamp(24px, 3.4vw, 40px);
  border-left: 4px solid var(--red);
  padding-left: clamp(16px, 2.4vw, 28px);
  font-weight: 500;
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.3;
  max-width: 980px;
}

/* 04 how to hire */
.ae-stages {
  margin-top: clamp(20px, 2.6vw, 30px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #e2e2e2;
}
.ae-stages table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: 17px;
  line-height: 1.45;
}
.ae-stages thead th {
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  padding: 16px 22px;
}
.ae-stages td,
.ae-stages tbody th {
  padding: 20px 22px;
  border: 0;
  border-bottom: 1px solid #e2e2e2;
  text-align: left;
  vertical-align: middle;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: #fff;
}
.ae-stages tbody tr:last-child :is(td, th) {
  border-bottom: 0;
}
.ae-stages tbody th,
.ae-stages td:nth-child(2) {
  width: 26%;
}
.ae-consult {
  display: inline-block;
  margin-top: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.45;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  max-width: 900px;
}
.ae-consult:hover {
  color: var(--red);
}

/* Recruiters + conclusion (dark band) */
.ae-darkpage {
  background: var(--ink);
  color: #fff;
  margin-top: clamp(24px, 3vw, 40px);
}
.ae-darkpage :is(a, summary):focus-visible {
  outline-color: #fff;
}
.ae-boss {
  background: #222;
  border-radius: 20px;
  padding: clamp(24px, 3.6vw, 44px);
}
.ae-boss :is(h2, h3) {
  color: var(--red);
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 30px);
  line-height: 1.25;
}
.ae-boss h3 {
  margin-top: clamp(28px, 3.6vw, 40px);
}
.ae-listen {
  font-size: 18px;
  margin-top: 12px;
  color: #eee;
}
.ae-boss ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 16px;
  font-size: 18px;
  line-height: 1.5;
  color: #eee;
}
.ae-boss li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}
.ae-boss li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  margin-top: .6em;
}
.ae-boss .ae-btn {
  margin-top: 30px;
}
.ae-concl {
  padding-bottom: clamp(24px, 3vw, 40px);
}
.ae-concl h2 {
  font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  color: #fff;
}
.ae-concl .ae-body {
  display: grid;
  gap: 20px;
  margin-top: clamp(20px, 3vw, 32px);
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.6;
  color: #e2e2e2;
  max-width: 960px;
}
.ae-ready {
  font-size: 20px;
  color: #fff;
}
.ae-ready a {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ae-ready a:hover {
  color: #fff;
}

/* FAQ */
.ae-faq {
  margin-top: 22px;
  border-top: 1px solid #c9c9c9;
}
.ae-faq details {
  border-bottom: 1px solid #c9c9c9;
}
.ae-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-weight: 700;
  font-size: clamp(17px, 2vw, 20px);
}
.ae-faq summary::-webkit-details-marker {
  display: none;
}
.ae-faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--red);
  font-size: 22px;
  line-height: 1;
}
.ae-faq details[open] summary::after {
  content: "–";
}
.ae-faq details p {
  padding: 0 0 18px;
  font-size: 16.5px;
  max-width: 820px;
}

/* Responsive */
@media (max-width: 860px) {
  .ae-cover h1,
  .ae-cover-sub {
    max-width: none;
  }
  .ae-gridblock {
    width: 38%;
    height: clamp(110px, 24vw, 180px);
  }
  .ae-wild,
  .ae-types,
  .ae-skills {
    grid-template-columns: 1fr;
  }
  .ae-t3,
  .ae-skill.ae-wide {
    grid-column: auto;
  }
  .ae-flags-hd {
    display: none;
  }
  .ae-flags-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 10px;
  }
  .ae-tag {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    display: block;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: .85;
  }
  .ae-ghost {
    font-size: clamp(70px, 18vw, 120px);
  }
}
@media (max-width: 620px) {
  .ae-ebook {
    font-size: 16px;
  }
  .ae-wild {
    border-width: 8px;
  }
  .ae-stages thead {
    display: none;
  }
  .ae-stages :is(table, tbody, tr, td, tbody th) {
    display: block;
    width: auto;
  }
  .ae-stages tbody tr {
    padding: 16px 18px;
    border-bottom: 1px solid #e2e2e2;
  }
  .ae-stages tbody tr:last-child {
    border-bottom: 0;
  }
  .ae-stages :is(td, tbody th) {
    border: 0;
    padding: 3px 0;
  }
  .ae-stages tbody th,
  .ae-stages td:nth-child(2) {
    width: auto;
  }
  .ae-stages tbody th {
    font-weight: 700;
    font-size: 18px;
    padding-bottom: 6px;
  }
  .ae-stages td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--red);
    margin-top: 6px;
  }
  .ae-toc a {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  .ae-chap {
    grid-template-columns: 1fr;
  }
  .ae-ghost {
    display: none;
  }
}
