/* ============================================================
   Craft Boys — shared primitives for the Figma homepage sections.
   Loaded before the per-section files (alphabetical: _base first).
   Tokens live in craftboys.css (:root --cb-*).
   ============================================================ */

.cb-container {
  max-width: var(--cb-container, 1344px);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Eyebrow kicker — yellow on dark, slate on light */
.cb-eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cb-yellow);
  margin: 0 0 14px;
}
.cb-on-light .cb-eyebrow, .cb-eyebrow--dark { color: #5A6A72; }

/* Display headings (Oswald condensed, uppercase) */
.cb-h1, .cb-h2, .cb-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.08;
  letter-spacing: .01em;
  margin: 0 0 18px;
}
.cb-h1 { font-size: clamp(40px, 4.6vw, 64px); color: var(--cb-white); }
.cb-h2 { font-size: clamp(30px, 3.2vw, 44px); color: var(--cb-ink); }
.cb-h3 { font-size: clamp(20px, 1.8vw, 26px); color: var(--cb-ink); }
.cb-on-dark .cb-h2, .cb-on-dark .cb-h3, .cb-h2--light { color: var(--cb-white); }

.cb-sub {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--cb-body);
  max-width: 720px;
  margin: 0 0 8px;
}
.cb-on-dark .cb-sub, .cb-sub--light { color: rgba(255, 255, 255, .82); }

/* Section rhythm */
.cb-section { padding-block: clamp(56px, 7vw, 104px); }
.cb-section--light { background: var(--cb-light); }
.cb-section--dark  { background: var(--cb-dark); }

/* Buttons */
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 17px 30px;
  border-radius: 4px; /* design: 4px radius across all buttons */
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  border: 0;
}
.cb-btn--yellow { background: var(--cb-yellow); color: var(--cb-ink); }
.cb-btn--yellow:hover { background: var(--cb-yellow-2); }
.cb-btn--outline {
  background: transparent;
  color: var(--cb-white);
  border: 1.5px solid rgba(255, 255, 255, .35);
}
.cb-btn--outline:hover { border-color: var(--cb-yellow); color: var(--cb-yellow); }

/* Arrow link (EXPLORE ↗) */
.cb-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cb-ink);
  text-decoration: none;
}
.cb-link-arrow svg { transition: transform .18s ease; }
.cb-link-arrow:hover svg { transform: translate(2px, -2px); }
.cb-link-arrow--yellow { color: var(--cb-yellow); }

/* Image placeholder (photo not uploaded yet) */
.cb-imgph {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #2A363E, #1D282E);
  min-height: 220px;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-imgph::after {
  content: 'Photo — upload in Admin';
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
}

/* Round yellow play button (video/audio) */
.cb-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cb-yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
  flex: 0 0 auto;
}
.cb-play:hover { transform: scale(1.06); background: var(--cb-yellow-2); }
.cb-play svg { display: block; margin-left: 3px; }

/* Google Guaranteed lockup: green check disc + two-line label (Figma) */
.cb-gg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
/* PNG lockup: green check-disc badge + white "Google Guaranteed" wordmark.
   Both <img>s are height-driven so they stay aligned; .cb-gg__text is kept as a
   fallback for any legacy text-only use. */
.cb-gg__shield { flex: 0 0 auto; display: block; height: 30px; width: auto; }
.cb-gg__wordmark { flex: 0 0 auto; display: block; height: 30px; width: auto; }
.cb-gg__text {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--cb-white);
  text-align: left;
  /* Wrap two-word trust labels (e.g. "Google Guaranteed") onto two lines while
     the text stays fully editable from admin. ch is font-relative, so the --lg
     variant wraps the same way; whole words never break (overflow-wrap:normal). */
  max-width: 11ch;
}
.cb-gg--lg .cb-gg__shield { height: 44px; }
.cb-gg--lg .cb-gg__wordmark { height: 44px; }
.cb-gg--lg .cb-gg__text { font-size: 17px; }

/* Horizontal swipe-carousel progress bar (projects / blog / reviews on
   mobile). Hidden on desktop; the fill is a scroll-driven "thumb". */
.cb-hscroll-bar { display: none; }

@media (max-width: 1024px) {
  .cb-container { padding-inline: 18px; }
}

@media (max-width: 640px) {
  /* Mobile design (360 canvas): 24px side margins, tighter section rhythm. */
  .cb-container { padding-inline: 24px; }
  .cb-h2 { font-size: 28px; }
  .cb-section { padding-block: 56px; }

  .cb-hscroll-bar {
    display: block;
    position: relative;
    height: 3px;
    margin-top: 20px;
    background: var(--cb-line);
    overflow: hidden;
  }
  .cb-hscroll-bar--onlight { background: rgba(20, 20, 20, .12); }
  .cb-hscroll-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: var(--cb-yellow);
  }
}

/* ── Scroll reveal: cb-* blocks rise + fade in as they enter the viewport ────
   assets/js/animations.js sets html.js-reveal and marks each below-the-fold
   .cb-section with .cb-reveal, then .cb-in once it scrolls into view. Gating on
   html.js-reveal keeps content fully visible for no-JS visitors; only opacity +
   transform animate (compositor-friendly). Above-the-fold blocks are shown
   immediately (no flash) and reduced-motion opts out entirely. Subtle by design:
   a 20px rise with a gentle decelerating ease, no bounce. */
html.js-reveal .cb-reveal {
  opacity: 0;
  transform: translate3d(0, 46px, 0);
  transition: opacity 1.5s cubic-bezier(.33, 1, .68, 1),
              transform 1.6s cubic-bezier(.33, 1, .68, 1);
  will-change: opacity, transform;
}
html.js-reveal .cb-reveal.cb-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .cb-reveal,
  html.js-reveal .cb-reveal.cb-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
