/* =============================================================
   Drouin CTB + ti360 case study — conversion layout on NC tokens
   Loaded after styles.css; consumes the page-local token block set
   on #top (--ink, --paper, --accent, --accent-ink, …).

   Page colour comes from the portal itself: the royal blue of its
   buttons, its selected months and its section headings, and the green
   of a completed questionnaire section. Two stops:
     --accent      the blue, for dots, rules, tinted fills, and any
                   accent text sitting on the dark panels
     --accent-ink  a deeper mix of it, for accent text on the paper
                   background, where the bright blue is too light
   Dark blocks are --ink (true black), same as every other case study;
   the blue/green only shows up as glow gradients and tinted accents.
   Namespace: .dr-*
   ============================================================= */

/* ---------- Scroll reveal (progressive enhancement, js/reveal.js)
   Only applies once <html> gets .nc-reveal, so with JS off,
   reduced motion, or no IntersectionObserver everything shows. */
html.nc-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
html.nc-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Layout primitives ---------- */
.dr-section { padding: clamp(60px, 7.5vw, 116px) var(--gutter); }
.dr-section--tight { padding-top: clamp(20px, 3vw, 40px); }
.dr-section--flush { padding-bottom: clamp(24px, 3vw, 44px); }
/* Separators use the shared .nc-rule, which insets itself by the gutter and
   caps at --container-inner, so the line never reaches the viewport edge. */
.dr-prose { max-width: 62ch; }
.dr-prose--centre { margin-inline: auto; text-align: center; }

/* ---------- Shared type ---------- */
.dr-eyebrow {
  font-family: var(--ff-title); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-45);
  margin: 0 0 18px;
}
.dr-eyebrow--dark { color: var(--on-dark-muted); }

.dr-h2 {
  font-family: var(--ff-title); font-weight: 700;
  font-size: clamp(1.95rem, 4.1vw, 2.95rem);
  line-height: 1.03; letter-spacing: -0.035em;
  color: var(--ink); margin: 0; text-wrap: balance;
}
.dr-h2--dark { color: #fff; }
.dr-h3 {
  font-family: var(--ff-title); font-weight: 700; font-size: 20px;
  line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px;
}
.dr-lead {
  font-family: var(--ff-body); font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6; color: var(--ink-60); margin: 22px 0 0;
}
.dr-body { font-family: var(--ff-body); font-size: 16.5px; line-height: 1.65; color: var(--ink-60); margin: 0; }
.dr-body + .dr-body { margin-top: 16px; }

/* ---------- Buttons ---------- */
.dr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--ff-title); font-size: 15px; font-weight: 600;
  padding: 15px 28px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, background-color 0.3s, border-color 0.3s, color 0.3s;
  white-space: nowrap;
}
.dr-btn__arrow { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.dr-btn:hover .dr-btn__arrow { transform: translateX(3px); }

/* Black primary, neutral shadow. On dark panels use .dr-btn--light instead. */
.dr-btn--primary { background: var(--ink); color: #fff; box-shadow: 0 14px 30px -16px rgba(10, 10, 8, 0.7); }
.dr-btn--primary:hover { background: var(--ink-elevated); transform: translateY(-2px); box-shadow: 0 20px 38px -16px rgba(10, 10, 8, 0.8); }

.dr-btn--ghost { border-color: var(--border-ink-strong); color: var(--ink); }
.dr-btn--ghost:hover { border-color: var(--ink); background: rgba(10, 10, 8, 0.05); transform: translateY(-2px); }

.dr-btn--light { background: #fff; color: var(--ink); }
.dr-btn--light:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -18px rgba(0, 0, 0, 0.6); }

.dr-btn--ghost-dark { border-color: rgba(255, 255, 255, 0.3); color: var(--on-dark); }
.dr-btn--ghost-dark:hover { border-color: rgba(255, 255, 255, 0.72); color: #fff; transform: translateY(-2px); }

/* ---------- Status badges ---------- */
.dr-badges { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 24px; padding: 0; list-style: none; }
.dr-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--ink-60); background: var(--surface-light);
  border: 1px solid var(--border-ink); padding: 8px 14px; border-radius: 999px;
}
.dr-badge--live { color: var(--ink); border-color: rgba(47, 85, 245, 0.34); background: rgba(47, 85, 245, 0.1); }
.dr-badge--live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto;
}

/* ---------- Outcome band (dark facts) ---------- */
.dr-band {
  position: relative; overflow: hidden;
  background: var(--ink); border-radius: 28px;
  padding: clamp(26px, 2.8vw, 38px) clamp(24px, 3.6vw, 48px);
}
.dr-band::before,
.dr-band::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  pointer-events: none;
}
.dr-band::before { top: -46%; left: -6%; background: radial-gradient(circle, rgba(47, 85, 245, 0.34), transparent 68%); }
.dr-band::after { bottom: -50%; right: -6%; background: radial-gradient(circle, rgba(34, 197, 94, 0.16), transparent 68%); }

.dr-metrics {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
.dr-metric { position: relative; padding-left: clamp(20px, 2.4vw, 34px); }
.dr-metric:first-child { padding-left: 0; }
.dr-metric::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px;
  background: rgba(255, 255, 255, 0.16);
}
.dr-metric:first-child::before { display: none; }
/* Label above, value below: these hold short facts, not numerals. */
.dr-metric__label {
  display: block; margin: 0 0 9px;
  font-family: var(--ff-title); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--on-dark-muted);
}
.dr-metric__value {
  font-family: var(--ff-title); font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.65rem); line-height: 1.2; letter-spacing: -0.022em;
  color: #fff; display: block;
}

/* ---------- Two-column intro ---------- */
.dr-split {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.dr-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.dr-chip {
  display: inline-flex; align-items: center;
  font-family: var(--ff-title); font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--surface-light); border: 1px solid var(--border-ink);
  padding: 9px 16px; border-radius: 999px;
}

.dr-quotepanel {
  position: relative; background: var(--surface-light);
  border: 1px solid var(--border-ink); border-radius: 24px;
  padding: clamp(26px, 3vw, 38px);
}
.dr-quotepanel__kicker {
  font-family: var(--ff-title); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-45); margin: 0;
}
.dr-quotepanel__mark {
  font-family: var(--ff-title); font-size: 56px; font-weight: 800; line-height: 0.7;
  color: var(--accent-ink);
}
.dr-quotepanel__text {
  font-family: var(--ff-title); font-weight: 600;
  font-size: clamp(18px, 2vw, 22px); line-height: 1.4; letter-spacing: -0.02em;
  color: var(--ink); margin: 14px 0 0;
}
.dr-quotepanel__meta {
  font-family: var(--ff-body); font-size: 14px; line-height: 1.5; color: var(--ink-45);
  margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--border-ink);
}

/* ---------- Lists ---------- */
.dr-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.dr-list--two { grid-template-columns: 1fr 1fr; column-gap: 26px; }
.dr-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-family: var(--ff-body); font-size: 15px; line-height: 1.5; color: var(--ink-60);
}
.dr-list li::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-top: 8px;
  border-radius: 50%; background: var(--accent-ink);
}

/* ---------- Browser frame (the portal) ---------- */
.dr-browser {
  border-radius: 20px; overflow: hidden;
  background: #fff;
  box-shadow: 0 50px 90px -40px rgba(10, 10, 8, 0.32);
}
.dr-browser__bar {
  height: 42px; display: flex; align-items: center; gap: 7px;
  padding: 0 18px; background: var(--ink);
}
.dr-browser__dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); flex: 0 0 auto; }
.dr-browser__url {
  margin-left: 10px; font-family: var(--ff-mono); font-size: 12px; color: var(--on-dark-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Cropped to a less widescreen frame and centered, same treatment as
   .pf-browser__shot on the portfolio page — the screenshots are wider
   than the mockup should be, so cover + top-center crop keeps the
   content centered instead of running the full letterboxed width. */
.dr-browser__shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-light); }
.dr-browser__shot img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
}

/* ---------- Screenshot walkthrough: shot beside its explanation ---------- */
.dr-walk { display: grid; gap: 0; margin-top: clamp(40px, 5vw, 70px); }
.dr-walk__row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: clamp(28px, 4vw, 56px); align-items: center;
}
.dr-walk__row--flip { grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr); }
.dr-walk__row--flip .dr-walk__media { order: 2; }
.dr-walk__row + .dr-walk__row {
  border-top: 1px solid var(--border-ink);
  padding-top: clamp(38px, 4.6vw, 64px);
  margin-top: clamp(38px, 4.6vw, 64px);
}
.dr-walk__copy .dr-h3 { font-size: clamp(22px, 2vw, 26px); line-height: 1.12; }
.dr-walk__copy .dr-list { margin-top: 20px; }

/* ---------- Cards ---------- */
.dr-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 2.2vw, 24px); margin-top: clamp(34px, 4vw, 52px); }
.dr-card {
  background: var(--ink); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 22px;
  padding: clamp(24px, 2.6vw, 32px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.35s;
}
.dr-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 22px 40px -26px rgba(10, 10, 8, 0.4); }
.dr-card__icon {
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: 1px solid transparent; color: #fff;
  margin-bottom: 18px;
}
.dr-card .dr-h3 { color: #fff; }
.dr-card .dr-body { color: var(--on-dark); }

/* ---------- Shared-platform panel ---------- */
.dr-shared {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 40px); align-items: start;
  background: var(--surface-light); border: 1px solid var(--border-ink);
  border-radius: 26px; padding: clamp(26px, 3.4vw, 44px);
  margin-top: clamp(34px, 4vw, 52px);
}
.dr-shared__label {
  font-family: var(--ff-title); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-45); margin: 0 0 12px;
}

/* ---------- Result panel ---------- */
.dr-result { position: relative; overflow: hidden; background: var(--ink); border-radius: 32px; padding: clamp(30px, 4.4vw, 60px); }
.dr-result::before {
  content: ""; position: absolute; top: -34%; right: -8%; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 85, 245, 0.36), rgba(34, 197, 94, 0.12) 42%, transparent 70%);
  pointer-events: none;
}
.dr-result__inner { position: relative; z-index: 1; }
.dr-result__statement {
  font-family: var(--ff-title); font-weight: 600;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem); line-height: 1.28; letter-spacing: -0.03em;
  color: #fff; margin: 0; max-width: 34ch; text-wrap: balance;
}
.dr-result__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 32px); margin-top: clamp(30px, 3.6vw, 46px);
  padding-top: clamp(26px, 3vw, 38px); border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.dr-result__label { font-family: var(--ff-title); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark-muted); margin: 0 0 10px; }
.dr-result__text { font-family: var(--ff-body); font-size: 15px; line-height: 1.6; color: var(--on-dark); margin: 0; }

/* ---------- Closing CTA ---------- */
.dr-cta {
  position: relative; overflow: hidden; background: var(--ink);
  border-radius: 36px; padding: clamp(38px, 5.6vw, 84px) clamp(26px, 4vw, 72px);
  text-align: center;
}
.dr-cta::before, .dr-cta::after {
  content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; pointer-events: none;
}
.dr-cta::before { top: -30%; left: -8%; background: radial-gradient(circle, rgba(47, 85, 245, 0.3), transparent 70%); }
.dr-cta::after { bottom: -34%; right: -6%; background: radial-gradient(circle, rgba(34, 197, 94, 0.16), transparent 70%); }
.dr-cta__inner { position: relative; z-index: 1; }
.dr-cta__lead { font-family: var(--ff-body); font-size: clamp(16.5px, 1.8vw, 19px); line-height: 1.6; color: var(--on-dark-muted); max-width: 58ch; margin: 22px auto 0; }
.dr-cta__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

/* ---------- Next case study ---------- */
.dr-next {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: var(--surface-light); border: 1px solid var(--border-ink); border-radius: 24px;
  padding: clamp(24px, 3vw, 34px) clamp(24px, 3vw, 38px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
}
.dr-next:hover { transform: translateY(-3px); border-color: var(--border-ink-strong); }
.dr-next__label { font-family: var(--ff-title); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-45); margin: 0 0 8px; }
.dr-next__title { font-family: var(--ff-title); font-weight: 700; font-size: clamp(1.25rem, 2.4vw, 1.7rem); letter-spacing: -0.03em; color: var(--ink); margin: 0; }
.dr-next__go { display: inline-flex; align-items: center; gap: 10px; font-family: var(--ff-title); font-size: 15px; font-weight: 600; color: var(--ink); }
.dr-next:hover .dr-next__go span { transform: translateX(4px); }
.dr-next__go span { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---------- Sticky mobile CTA ---------- */
.dr-sticky {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  display: none; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(10, 10, 8, 0.94); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 18px;
  padding: 12px 12px 12px 18px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateY(140%); opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}
.dr-sticky.is-in { transform: none; opacity: 1; }
.dr-sticky__text { font-family: var(--ff-title); font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; }
.dr-sticky__text span { display: block; font-family: var(--ff-body); font-size: 12.5px; font-weight: 400; color: var(--on-dark-muted); margin-top: 2px; }
.dr-sticky .dr-btn { padding: 12px 20px; font-size: 14px; }

/* ---------- Editorial caveat ----------
   Separated by space and a lighter colour, not by a rule on one edge. */
.dr-note {
  font-family: var(--ff-body); font-size: 14.5px; line-height: 1.6; color: var(--ink-45);
  max-width: 68ch; margin: clamp(30px, 3.4vw, 44px) 0 0;
}

/* =============================================================
   Hero
   ============================================================= */
.dr-hero { position: relative; padding: clamp(120px, 14vw, 168px) var(--gutter) clamp(48px, 6vw, 88px); }
.dr-hero__glow { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(20px); }
.dr-hero__glow--a {
  top: -14%; right: -8%; width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(47, 85, 245, 0.26), rgba(34, 197, 94, 0.12) 42%, transparent 70%);
  animation: ncGlowB 16s ease-in-out infinite;
}
.dr-hero__glow--b {
  bottom: -20%; left: -10%; width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(47, 85, 245, 0.18), transparent 68%);
  animation: ncGlowA 19s ease-in-out infinite;
}
.dr-hero__inner { position: relative; z-index: 1; max-width: var(--container-inner); margin-inline: auto; }
.dr-hero__grid {
  display: grid; grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: clamp(32px, 4.6vw, 72px); align-items: center;
}
.dr-h1 {
  font-family: var(--ff-title); font-weight: 700;
  font-size: clamp(2.15rem, 3.5vw, 3.15rem); line-height: 1.04; letter-spacing: -0.036em;
  color: var(--ink); margin: 0; text-wrap: balance;
}
.dr-hero__meta .dr-badges { margin: clamp(24px, 2.6vw, 32px) 0 0; }
.dr-hero__lead {
  font-family: var(--ff-body); font-size: clamp(16.5px, 1.6vw, 18px);
  line-height: 1.55; color: var(--ink-60); margin: 18px 0 0; max-width: 52ch;
}
.dr-hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 1040px) {
  .dr-metrics { grid-template-columns: repeat(2, 1fr); gap: clamp(22px, 4vw, 34px); }
  .dr-metric:nth-child(3) { padding-left: 0; }
  .dr-metric:nth-child(3)::before { display: none; }
  .dr-result__grid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 900px) {
  .dr-hero__grid { grid-template-columns: 1fr; gap: clamp(30px, 5vw, 44px); }
  .dr-split { grid-template-columns: 1fr; }
  .dr-walk__row, .dr-walk__row--flip { grid-template-columns: 1fr; }
  .dr-walk__row--flip .dr-walk__media { order: 0; }
  .dr-shared { grid-template-columns: 1fr; }
  .dr-sticky { display: flex; }
}
@media (max-width: 640px) {
  .dr-metrics { gap: 20px 22px; }
  .dr-cards { grid-template-columns: 1fr; }
  .dr-list--two { grid-template-columns: 1fr; }
  .dr-btn { width: 100%; }
  .dr-sticky .dr-btn { width: auto; }
}
@media (max-width: 460px) {
  .dr-metrics { grid-template-columns: 1fr; }
  .dr-metric { padding-left: 0; padding-top: 16px; }
  /* Stacked, every divider is a horizontal rule above the item, so the
     ones hidden for the two-column layout have to come back. */
  .dr-metric::before,
  .dr-metric:nth-child(3)::before { display: block; left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; }
  .dr-metric:first-child::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dr-card, .dr-next, .dr-btn, .dr-sticky { transition: none; }
  .dr-card:hover, .dr-next:hover, .dr-btn:hover { transform: none; }
}
