/* The Book On Software Testing. Site-wide tokens, nav and buttons live in site.css. */

/* ── Hero ────────────────────────────────────────────── */
.bk-hero { padding: clamp(40px, 6vw, 88px) 0 clamp(64px, 9vw, 120px); }
.bk-hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.bk-hero .page-title { font-size: clamp(42px, 5.6vw, 80px); }
.bk-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.bk-book-wrap { position: relative; justify-self: center; width: min(330px, 78vw); perspective: 1400px; }
.bk-book {
  position: relative; aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transform: rotateY(-18deg) rotateX(4deg);
  transition: transform .8s var(--ease);
}
.bk-book-wrap:hover .bk-book { transform: rotateY(-6deg) rotateX(2deg); }
.bk-cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background: #fff;
  border-radius: 3px 10px 10px 3px;
  box-shadow: 30px 40px 60px -30px rgba(23, 22, 26, .55), inset 0 0 0 1px rgba(23, 22, 26, .08);
  outline: 1px solid rgba(23, 22, 26, .1); outline-offset: -1px;
}
.bk-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 30px;
  background: #3a4ea0; border-radius: 3px 0 0 3px;
  transform: rotateY(-90deg); transform-origin: left;
}
.bk-sticky {
  position: absolute; right: -34px; bottom: -22px; z-index: 1;
  background: #f6e27a; color: var(--ink);
  font-family: var(--hand); font-weight: 700; font-size: 19px; line-height: 1.1;
  width: 112px; padding: 12px 12px 16px;
  transform: rotate(6deg);
  box-shadow: 0 10px 18px -10px rgba(23,22,26,.5);
}

@media (max-width: 860px) {
  .bk-hero-grid { grid-template-columns: 1fr; }
  .bk-book-wrap { width: min(260px, 70vw); margin-top: 8px; }
  .bk-sticky { right: -14px; bottom: -18px; width: 96px; font-size: 16px; }
}

/* ── Problem: jargon with red-pen glosses ────────────── */
.bk-problem-body { max-width: 860px; }
.bk-problem-body p { color: var(--ink-2); font-size: 19px; margin-top: 20px; max-width: 40em; }
.bk-problem-body .bk-lead {
  color: var(--ink); margin-top: 0;
  font-size: clamp(26px, 3.4vw, 42px); font-weight: 700; letter-spacing: -.03em; line-height: 1.5;
}
.jg { position: relative; white-space: nowrap; }
.jg::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: .08em; height: .14em;
  background: var(--red); border-radius: 2px; opacity: .85;
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.jg::before {
  content: attr(data-gloss);
  position: absolute; left: 0; bottom: 88%;
  font-family: var(--hand); font-weight: 700; font-size: .46em; letter-spacing: 0; line-height: 1;
  color: var(--red); white-space: nowrap;
  transform: rotate(-3deg) translateY(6px); opacity: 0;
  transition: opacity .4s, transform .5s var(--ease);
}
.bk-problem-body.is-in .jg::after { transform: none; }
.bk-problem-body.is-in .jg::before { opacity: 1; transform: rotate(-3deg); }
.jg:nth-child(2)::after, .jg:nth-child(2)::before { transition-delay: .7s; }
.jg:nth-child(3)::after, .jg:nth-child(3)::before { transition-delay: 1.4s; }
/* Narrow screens: no room above the line, so the gloss follows the term inline */
@media (max-width: 600px) {
  .jg {
    white-space: normal;
    text-decoration: underline 3px transparent; text-underline-offset: 4px;
    transition: text-decoration-color .5s;
  }
  .bk-problem-body.is-in .jg { text-decoration-color: var(--red); }
  .jg::before { display: none; }
  .jg::after {
    content: "(" attr(data-gloss) ")";
    position: static; display: inline-block; height: auto; background: none; border-radius: 0;
    margin-left: .3em;
    font-family: var(--hand); font-weight: 700; font-size: .62em; letter-spacing: 0; line-height: 1;
    color: var(--red); opacity: 0; transform: none;
    transition: opacity .4s;
  }
  .bk-problem-body.is-in .jg::after { opacity: 1; }
}

/* ── Benefits ────────────────────────────────────────── */
.bk-benefits { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bk-benefits li {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(24px, 3vw, 36px);
}
.bk-num { font-family: var(--mono); font-size: 12px; color: var(--red-ink); }
.bk-benefits h3 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 10px; }
.bk-benefits p { color: var(--ink-2); }
@media (max-width: 760px) { .bk-benefits { grid-template-columns: 1fr; } }

/* ── Who it's for: a checklist that ticks itself ─────── */
.bk-roles { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 24px; }
.bk-roles li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line);
  font-weight: 700; font-size: 17px;
}
.bk-roles li::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line); background: center / 12px no-repeat;
  transition: background-color .25s, border-color .25s;
  transition-delay: var(--d, 0s);
}
.bk-roles.is-in li::before, html:not(.js) .bk-roles li::before {
  background-color: var(--green); border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.4l2.4 2.4 5.2-5.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (max-width: 960px) { .bk-roles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .bk-roles li { font-size: 15px; } }

/* ── Review ──────────────────────────────────────────── */
.bk-review { padding: 0 0 clamp(72px, 10vw, 140px); }
.bk-review-card {
  border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  padding: clamp(40px, 6vw, 72px) 0; text-align: center;
}
.bk-review-title { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 12px; }
.bk-review-card blockquote {
  font-size: clamp(26px, 3.6vw, 44px); font-weight: 500; font-style: italic; letter-spacing: -.025em; line-height: 1.15;
  margin: 14px auto 18px; max-width: 22em; text-wrap: balance;
}
.bk-review-card figcaption { font-size: 15px; color: var(--ink-2); }

/* ── Author ──────────────────────────────────────────── */
.bk-author { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.bk-author-mark {
  width: clamp(140px, 18vw, 220px); aspect-ratio: 1; border-radius: 50%;
  background: var(--red); color: #fff; display: grid; place-items: center;
  font-size: clamp(52px, 7vw, 84px); font-weight: 900; letter-spacing: -.05em;
}
.bk-author p:not(.eyebrow) { color: var(--ink-2); font-size: 18px; margin-top: 18px; max-width: 36em; }
.bk-author p a { font-weight: 700; color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.bk-author .text-link { display: inline-block; margin-top: 24px; }
@media (max-width: 700px) { .bk-author { grid-template-columns: 1fr; } }

/* ── Final CTA ───────────────────────────────────────── */
.bk-final { background: var(--night); color: var(--night-text); padding: clamp(88px, 12vw, 160px) 0; }
.bk-final-title { font-size: clamp(44px, 7.4vw, 104px); line-height: .98; letter-spacing: -.05em; font-weight: 900; }
.bk-final p { color: var(--night-muted); font-size: 19px; max-width: 30em; margin: 22px 0 32px; }

@media (prefers-reduced-motion: reduce) {
  .bk-book { transform: rotateY(-18deg) rotateX(4deg); }
}
