/* ============================================================
   Craft Boys — Figma homepage sections, group A (auto-loaded).
   Sections: cb-hero, cb-services, cb-feature-video, cb-banner.
   Shared primitives live in _base.css; tokens in craftboys.css.
   Desktop-first (1440 canvas / 1344 container); simple stacking
   at ≤1024px — full mobile polish comes in a later phase.
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   cb-hero — full-viewport dark hero + typewriter + trust bar
   ──────────────────────────────────────────────────────────── */
.cb-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(640px, 96vh, 960px);
  background: var(--cb-dark-2);
  overflow: hidden;
}

/* Background photo + gradient shade (dark-2 80% → 30%, left → right) */
.cb-hero__bg { position: absolute; inset: 0; }
.cb-hero__bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cb-hero__bg-ph { position: absolute; inset: 0; min-height: 0; border-radius: 0; }
.cb-hero__shade {
  position: absolute; inset: 0;
  /* Figma (Rectangle 12): a flat 50% black wash over the photo — no
     directional gradient. A light top scrim (well below the old .66) keeps the
     transparent header legible over bright parts of the image; the bottom
     trust band + H1 text-shadow carry the rest of the contrast. */
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, 0) 18%),
    rgba(0, 0, 0, .5);
}

.cb-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  /* Clears the fixed two-row header overlaying the hero. */
  padding-top: 168px;
  padding-bottom: 32px;
}
.cb-hero__content { max-width: 780px; }

/* Eyebrow row: two yellow uppercase items separated by a dot */
.cb-hero__eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* two-part kicker wraps on narrow screens instead of overflowing */
  gap: 6px 14px;
  margin: 0 0 22px;
}
.cb-hero__dot { font-size: 10px; line-height: 1; }

/* H1: white first line, yellow typewriter second line */
.cb-hero__title { margin: 0 0 24px; }
.cb-hero__prefix { display: block; color: var(--cb-white); }
.cb-hero__typeline {
  display: block;
  color: var(--cb-yellow);
  min-height: 1.08em; /* keeps the line box while the phrase is erased */
}
.cb-hero__cursor {
  display: inline-block;
  margin-left: 3px;
  font-weight: 500;
  animation: cb-hero-caret 1.1s steps(1) infinite;
}
@keyframes cb-hero-caret {
  0%, 55%   { opacity: 1; }
  56%, 100% { opacity: 0; }
}
/* Visually-hidden static phrase for assistive tech (added by JS) */
.cb-hero__sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .cb-hero__cursor { display: none; }
}

.cb-hero__sub {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .88);
  max-width: 640px;
  margin: 0 0 34px;
}
.cb-hero__cta { min-width: 260px; }

/* Trust bar — SOFT frosted band over the photo (Figma "Rectangle 13"):
   a strong blur that fades out at the top and bottom edges via a mask,
   so the band melts into the hero instead of cutting a hard line. */
.cb-hero__stats-wrap {
  position: relative;
  z-index: 1;
  padding-block: 32px 40px;
}
.cb-hero__stats-wrap::before {
  content: '';
  position: absolute;
  /* Figma "Rectangle 13": a ~196px frosted band pinned to the hero bottom. */
  inset: -24px 0 -40px;
  /* 0deg gradient — darker toward the bottom, fading up (rgba 21,20,16). */
  background: linear-gradient(0deg, rgba(21, 20, 16, .2) 0%, rgba(21, 20, 16, 0) 100%);
  pointer-events: none;
}
@supports ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .cb-hero__stats-wrap::before {
    /* Frosted glass: a light 4px blur keeps the numbers legible without a heavy,
       "rough" smear. Both edges are feathered so the blurred band melts into the
       photo with no hard line where it starts or ends. */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 82%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 82%, transparent 100%);
  }
}
.cb-hero__stats-wrap > * { position: relative; }
.cb-hero__stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.cb-hero__stat { position: relative; min-width: 0; padding-inline: 32px; }
.cb-hero__stat:first-child { padding-left: 0; }
/* Figma (Vector 4–7): a 120px vertical rule centered between cells, not a
   full-height border. */
.cb-hero__stat + .cb-hero__stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 120px;
  background: rgba(255, 255, 255, .2);
}

/* Big value bottom-aligned with the stars / reviews column (Figma flex-end). */
.cb-hero__stat-row { display: flex; align-items: flex-end; gap: 16px; }
.cb-hero__stat-big {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 3.3vw, 48px);
  line-height: 1;
  color: var(--cb-white);
}
.cb-hero__stat-side { display: flex; flex-direction: column; gap: 4px; }
.cb-hero__stars {
  color: var(--cb-yellow);
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1;
}
.cb-hero__stat-small {
  font-family: var(--font-ui);
  font-size: 16px;
  color: rgba(255, 255, 255, .9);
}
.cb-hero__stat-brand {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  color: var(--cb-white);
}
/* Brand logo image (e.g. the white Thumbtack wordmark) */
.cb-hero__stat-brandimg {
  display: block;
  height: 28px;
  width: auto;
}
/* Optional clickable brand (e.g. Thumbtack profile) — inherit look, subtle hover */
.cb-hero__stat-brandlink {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  transition: opacity .18s ease;
}
.cb-hero__stat-brandlink:hover { opacity: .8; }
.cb-hero__stat-label {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 16px;
  color: rgba(255, 255, 255, .85);
}

/* ────────────────────────────────────────────────────────────
   cb-services — light section, 3-col grid of 6 white cards
   ──────────────────────────────────────────────────────────── */
/* Tightened bottom padding: the dark 3D-visualization card follows closely
   in the approved design. */
.cb-section.cb-services { padding-bottom: clamp(20px, 2.6vw, 36px); }

.cb-services__heading { max-width: 680px; }
.cb-services__sub { margin-bottom: 0; }
.cb-services__grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.cb-services__card {
  display: flex;
  flex-direction: column;
  background: var(--cb-card);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 10px 28px rgba(20, 20, 20, .07);
  overflow: hidden; /* photo runs edge-to-edge, card radius clips it */
}
.cb-services__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.cb-services__img,
.cb-services__img-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 0;
}
.cb-services__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 24px 24px;
}
.cb-services__title {
  font-size: 28px; /* desktop per Figma; Oswald inherited from .cb-h3 */
  letter-spacing: .02em;
  margin: 0 0 10px;
}
.cb-services__desc {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cb-body);
  margin: 0;
}
.cb-services__link { margin-top: 20px; font-size: 18px; } /* desktop per Figma */

/* ────────────────────────────────────────────────────────────
   cb-feature-video — dark rounded card in a light section
   ──────────────────────────────────────────────────────────── */
.cb-feature-video { padding: clamp(16px, 2vw, 28px) 0 clamp(56px, 7vw, 104px); }

.cb-feature-video__card {
  display: grid;
  /* Figma: the video pane is squarer, roughly equal to the text column */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  background: var(--cb-dark);
  border-radius: 16px;
  padding: clamp(24px, 3.3vw, 48px);
}
.cb-feature-video__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}
.cb-feature-video__heading { max-width: 480px; }
.cb-feature-video__text { margin-bottom: 0; }
.cb-feature-video__divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--cb-line);
  margin: 30px 0 20px;
}
.cb-feature-video__note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
  margin: 0;
}
.cb-feature-video__cta {
  align-self: stretch;
  margin-top: 34px;
}

.cb-feature-video__media { min-width: 0; }
.cb-feature-video__frame {
  position: relative;
  height: auto;
  aspect-ratio: 4 / 3; /* squarer video pane per Figma */
  min-height: 340px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cb-dark-2);
}
.cb-feature-video__poster,
.cb-feature-video__poster-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 0;
}
.cb-feature-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -32px 0 0 -32px; /* keeps .cb-play's hover scale() intact */
}
.cb-feature-video__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* ────────────────────────────────────────────────────────────
   cb-banner — full-width warranty band, centered copy
   ──────────────────────────────────────────────────────────── */
.cb-banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--cb-dark-2);
  min-height: 640px; /* Figma desktop band height */
  display: flex;
  flex-direction: column;
  justify-content: center; /* centers the copy in the 640px band */
  padding-block: clamp(72px, 9vw, 116px);
}
.cb-banner__bg { position: absolute; inset: 0; }
.cb-banner__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-banner__bg-ph { position: absolute; inset: 0; min-height: 0; border-radius: 0; }
.cb-banner__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 28, 31, .72) 0%, rgba(23, 28, 31, .55) 100%);
}
.cb-banner__inner { position: relative; z-index: 1; }
.cb-banner__heading {
  max-width: 1000px;
  margin-inline: auto;
}
.cb-banner__sub {
  max-width: 760px;
  margin-inline: auto;
}

/* ────────────────────────────────────────────────────────────
   Responsive — simple stacking (mobile polish comes later)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cb-hero { min-height: 0; }
  .cb-banner { min-height: 0; } /* band uses padding-driven height below desktop */
  /* The mobile header is a solid sticky bar (not an overlay), so the hero
     no longer needs to clear a fixed header. */
  .cb-hero__inner { padding-block: 44px 48px; }
  .cb-hero__stats {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 28px;
  }
  .cb-hero__stat { padding-inline: 0; }
  .cb-hero__stat + .cb-hero__stat { border-left: 0; }

  .cb-services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .cb-feature-video__card { grid-template-columns: 1fr; }
  .cb-feature-video__media { order: -1; } /* mobile design: video on top */
  .cb-feature-video__frame {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 640px) {
  .cb-services__grid { grid-template-columns: 1fr; gap: 18px; }
  /* keep the approved mobile type scale — the 28px/18px are desktop targets */
  .cb-services__title { font-size: 21px; }
  .cb-services__link { font-size: 14px; }
  .cb-hero__cta { width: 100%; }

  /* Hero type scale per the 360px design */
  .cb-hero .cb-h1 { font-size: 34px; }
  .cb-hero__sub { font-size: 16px; margin-bottom: 28px; }
  .cb-hero__eyebrow { gap: 10px; margin-bottom: 18px; }
  .cb-hero__eyebrow .cb-eyebrow { font-size: 10.5px; letter-spacing: .12em; margin: 0; }

  /* Trust bar per the mobile Figma specs (Frame 90366): solid dark band,
     two big rating cells, a continuous divider, then the three plain stats
     ordered [10 years | 12 years | 240+]. */
  .cb-hero__stats-wrap { padding-block: 24px 48px; background: #1C272E; }
  .cb-hero__stats-wrap::before { content: none; } /* frosted blur band is desktop-only */
  .cb-hero__stat + .cb-hero__stat::before { content: none; } /* desktop rule off; mobile uses one continuous divider */
  .cb-hero__stats-wrap > .cb-container { padding-inline: 16px; }
  .cb-hero__stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 16px; }
  /* One CONTINUOUS divider line between the two rows: a full-width grid item
     placed (via order) between the rating cells and the plain stats. */
  .cb-hero__stats::before {
    content: '';
    order: 0;
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(255, 255, 255, .2);
  }
  .cb-hero__stat:nth-child(-n+2) { grid-column: span 3; order: -1; }
  .cb-hero__stat:nth-child(n+3) { grid-column: span 2; order: 2; }
  /* Figma order for the bottom row: 10 years · 12 years · 240+ */
  .cb-hero__stat:nth-child(3) { order: 3; }
  /* Ratings row: 40px value bottom-aligned with the stars/reviews column */
  .cb-hero__stat-row { align-items: flex-end; gap: 8px; }
  .cb-hero__stat-big { font-size: 40px; font-weight: 400; line-height: 1.05; }
  .cb-hero__stat:nth-child(n+3) .cb-hero__stat-big { font-size: 32px; font-weight: 400; white-space: nowrap; }
  .cb-hero__stars { font-size: 16px; letter-spacing: 3px; }
  .cb-hero__stat-side { gap: 4px; padding-bottom: 5px; }
  .cb-hero__stat-small { font-size: 14px; font-weight: 500; }
  .cb-hero__stat-label { margin-top: 8px; font-size: 14px; }
  .cb-hero__stat-brand { margin-top: 10px; }
  .cb-hero__stat-brandimg { height: 40px; }
  .cb-gg__shield { height: 30px; width: auto; }
  .cb-gg__wordmark { height: 30px; width: auto; }
  .cb-gg__text { font-size: 13.5px; }

  .cb-feature-video__card { padding: 20px 20px 28px; }
}
