/* ========================================
   Hidden /thb welcome page (IC-184)
   Every rule is scoped under a .thb- class. Colours come from the :root tokens only; the
   bright accent appears as text on navy only (7.90:1), never on white (2.02:1).
   ======================================== */

.thb-page {
  overflow-wrap: anywhere;
}

/* Full-bleed bands with the content held in the shared column, as on the home page. */
.thb-page > section {
  padding-block: var(--space-16);
  padding-inline: max(var(--container-padding), calc(50% - var(--container-inner) / 2));
}

.thb-page .thb-heading {
  margin-bottom: var(--space-8);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: var(--tracking-tight);
}

.thb-page .thb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ---- Hero ---- */

.thb-page .thb-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--color-primary);
  color: var(--color-white);
  padding-block: var(--space-20);
}

.thb-hero .thb-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 48rem;
}

.thb-hero .thb-eyebrow {
  margin-bottom: var(--space-4);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.thb-hero .thb-title {
  margin-bottom: var(--space-6);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: var(--font-bold);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
}

.thb-hero .thb-lede {
  max-width: 60ch;
  margin-bottom: var(--space-8);
  color: oklch(from var(--color-white) l c h / 0.88);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

/* Decorative, CSS-only shapes. They sit behind the copy and are clipped by the hero. */
.thb-hero .thb-shape {
  position: absolute;
  z-index: 0;
  max-width: 100%;
  pointer-events: none;
}

.thb-hero .thb-shape--ring {
  top: -6rem;
  right: -6rem;
  width: 22rem;
  height: 22rem;
  border: 3rem solid oklch(from var(--color-accent) l c h / 0.14);
  border-radius: var(--radius-full);
}

.thb-hero .thb-shape--bar {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.375rem;
  background: var(--color-accent);
}

/* ---- What I built ---- */

.thb-page .thb-built {
  background: var(--color-background);
}

.thb-built .thb-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.thb-built .thb-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.thb-card .thb-card-title {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

.thb-card .thb-card-text {
  flex: 1;
  color: var(--color-text-secondary);
}

.thb-card .thb-card-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--touch-target);
  color: var(--color-link);
  font-weight: var(--font-semibold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);

  &:hover {
    color: var(--color-link-hover);
  }

  &:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }
}

.thb-built .thb-note {
  max-width: 60ch;
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

/* ---- Featured crates ---- */

.thb-page .thb-featured {
  background: var(--color-background);
  padding-top: 0;
}

/* ---- How I build it ---- */

.thb-page .thb-process {
  background: var(--color-background-alt);
}

.thb-process .thb-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.thb-steps .thb-step {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

/* Bright amber numerals sit on a navy chip, the only background where they pass contrast. */
.thb-step .thb-step-number {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-4);
  background: var(--color-primary);
  color: var(--color-accent);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: 1;
}

.thb-step .thb-step-title {
  margin-bottom: var(--space-2);
}

.thb-step .thb-step-text {
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

/* ---- Stats band ---- */

.thb-page .thb-stats {
  background: var(--color-primary);
  padding-block: var(--space-12);
}

.thb-stats .thb-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  text-align: center;
}

.thb-stats .thb-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.thb-stat .thb-stat-value {
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: var(--font-bold);
  line-height: 1.1;
}

.thb-stat .thb-stat-label {
  color: oklch(from var(--color-white) l c h / 0.8);
  font-size: var(--text-sm);
}

/* ---- Closing ---- */

.thb-page .thb-closing {
  background: var(--color-accent-50);
  text-align: center;
}

.thb-closing .thb-closing-text {
  max-width: 60ch;
  margin: 0 auto var(--space-8);
  font-size: var(--text-lg);
}

.thb-closing .thb-actions {
  justify-content: center;
  margin-bottom: var(--space-8);
}

.thb-closing .thb-signoff {
  margin-bottom: 0;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

/* ---- Breakpoints ---- */

@media (min-width: 640px) {
  .thb-process .thb-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .thb-built .thb-cards,
  .thb-featured .thb-crate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .thb-process .thb-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .thb-page > section {
    padding-block: var(--space-10);
  }

  .thb-page .thb-hero {
    padding-block: var(--space-12);
  }

  .thb-hero .thb-shape--ring {
    width: 12rem;
    height: 12rem;
    border-width: 2rem;
  }

  /* Three crates in the shared two-column phone grid would leave one alone. */
  .thb-featured .thb-crate-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 26rem;
  }

  .thb-page .thb-actions > .btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thb-card .thb-card-link,
  .thb-page .thb-actions > .btn {
    transition: none;
  }

  .thb-page .thb-actions > .btn:hover {
    transform: none;
  }
}
