/* =========================================================================
 * Hashbox V2 — Phase 5 Composed Components
 * Depends on: tokens.css, primitives.css, surface.css
 *
 * Application-level patterns:
 *   24. Hero (.hb-hero)
 *   25. Service Card (.hb-service)
 *   26. Case Study Card (.hb-case)
 *   27. Process Step List (.hb-steps)
 *   28. Testimonial Card (.hb-quote)
 *   29. Insights Card (.hb-insight)
 *   30. Logo Wall (.hb-logos)
 *   31. Pricing Tier (.hb-tier)
 * ========================================================================= */

/* -------------------------------------------------------------------------
 * 24. HERO
 * ----------------------------------------------------------------------- */

.hb-hero {
  position: relative;
  padding: clamp(6rem, 4rem + 8vw, 12rem) 0 clamp(4rem, 3rem + 5vw, 8rem);
  overflow: hidden;
  isolation: isolate;
}

.hb-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in oklch, var(--hb-accent-blue) 18%, transparent), transparent 50%),
    radial-gradient(circle at 85% 50%, color-mix(in oklch, var(--hb-accent-violet) 15%, transparent), transparent 50%),
    radial-gradient(circle at 50% 100%, color-mix(in oklch, var(--hb-accent-cyan) 10%, transparent), transparent 60%);
}

.hb-hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
  background-image:
    linear-gradient(to right, var(--hb-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hb-border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 70%);
}

.hb-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--hb-space-5);
  max-width: 56rem;
}

.hb-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-2);
  padding: var(--hb-space-1) var(--hb-space-3) var(--hb-space-1) var(--hb-space-2);
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border-strong);
  border-radius: var(--hb-radius-full);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
}

.hb-hero__pill-mark {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hb-grad-primary);
  border-radius: 50%;
  color: var(--hb-text-strong);
  font-size: 9px;
  font-weight: var(--hb-weight-black);
}

.hb-hero__title {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-6xl);
  font-weight: var(--hb-weight-bold);
  line-height: var(--hb-leading-tight);
  letter-spacing: var(--hb-tracking-tighter);
  color: var(--hb-text-strong);
  margin: 0;
}

.hb-hero__title em {
  font-style: normal;
  background: var(--hb-grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hb-hero__sub {
  font-size: var(--hb-text-lg);
  line-height: var(--hb-leading-relaxed);
  color: var(--hb-text);
  max-width: 52ch;
  margin: 0;
}

.hb-hero__cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  vertical-align: -0.15em;
  background: var(--hb-accent-cyan);
  margin-left: 4px;
  animation: hb-blink 1.1s ease-in-out infinite;
}
@keyframes hb-blink { 50% { opacity: 0; } }

.hb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hb-space-3);
  margin-top: var(--hb-space-3);
}

.hb-hero__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hb-space-3) var(--hb-space-6);
  margin-top: var(--hb-space-8);
  padding-top: var(--hb-space-6);
  border-top: 1px solid var(--hb-border);
}

.hb-hero__trust-item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--hb-space-2);
  font-size: var(--hb-text-sm);
  color: var(--hb-text-muted);
}

.hb-hero__trust-value {
  font-family: var(--hb-font-mono);
  font-feature-settings: 'tnum';
  font-weight: var(--hb-weight-semibold);
  color: var(--hb-text-strong);
  font-size: var(--hb-text-base);
}

/* -------------------------------------------------------------------------
 * 25. SERVICE CARD
 * ----------------------------------------------------------------------- */

.hb-service {
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-4);
  padding: var(--hb-space-6);
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-xl);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--hb-text);
  transition: border-color var(--hb-duration-normal) var(--hb-ease-out),
              transform var(--hb-duration-normal) var(--hb-ease-out-expo);
}

.hb-service:hover {
  border-color: var(--hb-border-strong);
  transform: translateY(-2px);
}

.hb-service__num {
  position: absolute;
  top: var(--hb-space-4);
  right: var(--hb-space-5);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-sm);
  color: var(--hb-text-muted);
  letter-spacing: var(--hb-tracking-wider);
}

.hb-service__icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--hb-radius-md);
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-accent-blue);
}
.hb-service[data-accent="violet"]   .hb-service__icon { color: var(--hb-accent-violet); }
.hb-service[data-accent="cyan"]     .hb-service__icon { color: var(--hb-accent-cyan); }
.hb-service[data-accent="emerald"]  .hb-service__icon { color: var(--hb-accent-emerald); }
.hb-service[data-accent="amber"]    .hb-service__icon { color: var(--hb-accent-amber); }

.hb-service__title {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-xl);
  font-weight: var(--hb-weight-semibold);
  color: var(--hb-text-strong);
  margin: 0;
}

.hb-service__desc {
  font-size: var(--hb-text-sm);
  line-height: var(--hb-leading-relaxed);
  color: var(--hb-text);
  margin: 0;
  flex: 1;
}

.hb-service__stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hb-space-1);
  padding-top: var(--hb-space-3);
  border-top: 1px solid var(--hb-border);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
}

.hb-service__link {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-1);
  font-size: var(--hb-text-sm);
  font-weight: var(--hb-weight-medium);
  color: var(--hb-accent-blue);
  text-decoration: none;
  margin-top: var(--hb-space-2);
}
.hb-service:hover .hb-service__link { gap: var(--hb-space-2); }

/* -------------------------------------------------------------------------
 * 26. CASE STUDY CARD
 * ----------------------------------------------------------------------- */

.hb-case {
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-3);
  padding: var(--hb-space-5);
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-xl);
  text-decoration: none;
  color: var(--hb-text);
  transition: border-color var(--hb-duration-normal) var(--hb-ease-out),
              transform var(--hb-duration-normal) var(--hb-ease-out-expo);
  position: relative;
  overflow: hidden;
}

.hb-case::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--case-bg, linear-gradient(135deg, oklch(40% 0.15 255), oklch(50% 0.15 280)));
  opacity: 0.1;
  transition: opacity var(--hb-duration-normal) var(--hb-ease-out);
  pointer-events: none;
}

.hb-case:hover::before { opacity: 0.18; }
.hb-case:hover { border-color: var(--hb-border-strong); transform: translateY(-2px); }

.hb-case__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--hb-space-3);
  z-index: 1;
}

.hb-case__industry {
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--hb-tracking-wider);
}

.hb-case__name {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-xl);
  font-weight: var(--hb-weight-semibold);
  color: var(--hb-text-strong);
  margin: var(--hb-space-1) 0 0;
  z-index: 1;
  position: relative;
}

.hb-case__metric {
  font-family: var(--hb-font-mono);
  font-feature-settings: 'tnum';
  font-size: var(--hb-text-3xl);
  font-weight: var(--hb-weight-semibold);
  background: var(--hb-grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: var(--hb-space-2) 0;
  line-height: var(--hb-leading-none);
  z-index: 1;
  position: relative;
}

.hb-case__desc {
  font-size: var(--hb-text-sm);
  line-height: var(--hb-leading-relaxed);
  color: var(--hb-text);
  margin: 0;
  z-index: 1;
  position: relative;
}

.hb-case__cta {
  margin-top: auto;
  padding-top: var(--hb-space-3);
  border-top: 1px solid var(--hb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--hb-text-sm);
  color: var(--hb-text-muted);
  z-index: 1;
  position: relative;
}

.hb-case__cta-arrow {
  transition: transform var(--hb-duration-normal) var(--hb-ease-out-expo);
}
.hb-case:hover .hb-case__cta-arrow { transform: translateX(4px); }

/* -------------------------------------------------------------------------
 * 27. PROCESS STEP LIST
 * ----------------------------------------------------------------------- */

.hb-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--hb-space-6);
  counter-reset: step;
}

.hb-step {
  position: relative;
  padding: var(--hb-space-5);
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  counter-increment: step;
  transition: border-color var(--hb-duration-normal);
}

.hb-step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: var(--hb-space-4);
  right: var(--hb-space-5);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xl);
  font-weight: var(--hb-weight-medium);
  color: var(--hb-text-faint);
  letter-spacing: var(--hb-tracking-tight);
}

.hb-step__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-md);
  color: var(--hb-accent-blue);
  margin-bottom: var(--hb-space-4);
}

.hb-step__title {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-base);
  font-weight: var(--hb-weight-semibold);
  color: var(--hb-text-strong);
  margin: 0 0 var(--hb-space-2);
}

.hb-step__desc {
  font-size: var(--hb-text-sm);
  line-height: var(--hb-leading-relaxed);
  color: var(--hb-text-muted);
  margin: 0;
}

/* -------------------------------------------------------------------------
 * 28. TESTIMONIAL CARD
 * ----------------------------------------------------------------------- */

.hb-quote {
  position: relative;
  padding: var(--hb-space-8);
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-xl);
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-5);
}

.hb-quote__mark {
  position: absolute;
  top: var(--hb-space-4);
  right: var(--hb-space-5);
  font-family: var(--hb-font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--hb-accent-blue);
  opacity: 0.18;
  font-weight: var(--hb-weight-bold);
}

.hb-quote__body {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-xl);
  line-height: var(--hb-leading-snug);
  color: var(--hb-text-strong);
  margin: 0;
  font-weight: var(--hb-weight-medium);
}

.hb-quote__attrib {
  display: flex;
  align-items: center;
  gap: var(--hb-space-3);
  padding-top: var(--hb-space-4);
  border-top: 1px solid var(--hb-border);
}

.hb-quote__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--hb-grad-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-text-strong);
  font-family: var(--hb-font-mono);
  font-weight: var(--hb-weight-bold);
  font-size: var(--hb-text-sm);
  flex-shrink: 0;
}

.hb-quote__name {
  font-size: var(--hb-text-sm);
  font-weight: var(--hb-weight-semibold);
  color: var(--hb-text-strong);
  margin: 0;
  line-height: 1.3;
}

.hb-quote__role {
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
  margin: 2px 0 0;
}

/* -------------------------------------------------------------------------
 * 29. INSIGHTS CARD (blog post preview)
 * ----------------------------------------------------------------------- */

.hb-insight {
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-3);
  padding: var(--hb-space-5);
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  text-decoration: none;
  color: var(--hb-text);
  height: 100%;
  transition: border-color var(--hb-duration-normal) var(--hb-ease-out),
              transform var(--hb-duration-normal) var(--hb-ease-out-expo);
}

.hb-insight:hover {
  border-color: var(--hb-border-strong);
  transform: translateY(-2px);
}

.hb-insight__meta {
  display: flex;
  align-items: center;
  gap: var(--hb-space-2);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--hb-tracking-wider);
}

.hb-insight__cat {
  /* Use soft indigo on dark for AA contrast (primary too dark on #15151E) */
  color: var(--hb-accent-blue-soft);
}

.hb-section--light .hb-insight__cat {
  /* On white, primary indigo has enough contrast */
  color: var(--hb-accent-blue-strong);
}

.hb-insight__title {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-lg);
  font-weight: var(--hb-weight-semibold);
  line-height: var(--hb-leading-snug);
  color: var(--hb-text-strong);
  margin: 0;
}

.hb-insight__excerpt {
  font-size: var(--hb-text-sm);
  line-height: var(--hb-leading-relaxed);
  color: var(--hb-text-muted);
  margin: 0;
  flex: 1;
}

.hb-insight__foot {
  display: flex;
  align-items: center;
  gap: var(--hb-space-2);
  padding-top: var(--hb-space-3);
  border-top: 1px solid var(--hb-border);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
}

.hb-insight__author {
  font-weight: var(--hb-weight-medium);
  color: var(--hb-text);
}

/* -------------------------------------------------------------------------
 * 30. LOGO WALL
 * ----------------------------------------------------------------------- */

.hb-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--hb-space-6) var(--hb-space-8);
  align-items: center;
  justify-items: center;
  padding-block: var(--hb-space-8);
  opacity: 0.7;
  transition: opacity var(--hb-duration-normal) var(--hb-ease-out);
}

.hb-logos:hover { opacity: 1; }

.hb-logo {
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-base);
  font-weight: var(--hb-weight-semibold);
  letter-spacing: var(--hb-tracking-tight);
  color: var(--hb-text-muted);
  filter: grayscale(1);
  opacity: 0.7;
  transition: opacity var(--hb-duration-normal) var(--hb-ease-out),
              filter var(--hb-duration-normal) var(--hb-ease-out),
              color var(--hb-duration-normal) var(--hb-ease-out);
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-1);
}

.hb-logos:hover .hb-logo,
.hb-logo:hover {
  filter: grayscale(0);
  opacity: 1;
  color: var(--hb-text-strong);
}

/* -------------------------------------------------------------------------
 * 31. PRICING TIER
 * ----------------------------------------------------------------------- */

.hb-tier {
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-4);
  padding: var(--hb-space-6);
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-xl);
  height: 100%;
  position: relative;
}

.hb-tier--featured {
  background: var(--hb-surface-2);
  border-color: var(--hb-accent-blue);
  box-shadow: var(--hb-glow-blue);
}

.hb-tier__ribbon {
  position: absolute;
  top: -1px;
  right: var(--hb-space-5);
  padding: var(--hb-space-1) var(--hb-space-3);
  background: var(--hb-accent-blue);
  color: var(--hb-text-strong);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  font-weight: var(--hb-weight-semibold);
  border-radius: 0 0 var(--hb-radius-xs) var(--hb-radius-xs);
  letter-spacing: var(--hb-tracking-wider);
  text-transform: uppercase;
}

.hb-tier__name {
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-sm);
  color: var(--hb-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--hb-tracking-wider);
}

.hb-tier__price {
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-4xl);
  font-weight: var(--hb-weight-semibold);
  color: var(--hb-text-strong);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hb-tier__price-unit {
  font-size: var(--hb-text-base);
  color: var(--hb-text-muted);
  font-weight: var(--hb-weight-medium);
}

.hb-tier__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-3);
}

.hb-tier__features li {
  display: flex;
  align-items: flex-start;
  gap: var(--hb-space-2);
  font-size: var(--hb-text-sm);
  color: var(--hb-text);
}

.hb-tier__features li::before {
  content: '✓';
  color: var(--hb-accent-emerald);
  font-weight: var(--hb-weight-bold);
  flex-shrink: 0;
}
