/* Home page styles (R1). Page-local only; tokens and components come from R0. */

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-xl) var(--space-2xl);
}

.hero__title {
  --span: 12;
  --span-md: 8;

  max-inline-size: var(--measure-h1);
  font-size: var(--step-6);
  font-weight: var(--fw-black);
  font-stretch: var(--wdth-xwide);
  line-height: 0.98;
  letter-spacing: var(--tracking-tight);
  overflow-wrap: break-word;
}

@supports (text-wrap: balance) {
  .hero__title {
    text-wrap: balance;
  }
}

.hero__copy {
  --span: 5;
  --span-md: 8;
}

.hero__cta {
  margin-block-start: var(--space-l);
}

.hero__cta .btn {
  flex: 1 1 100%;
}

@media (min-width: 640px) {
  .hero__cta .btn {
    flex: 0 0 auto;
  }
}

.hero__note {
  margin-block-start: var(--space-m);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.hero__board {
  --span: 7;
  --span-md: 8;

  align-self: start;
}

@media (min-width: 1024px) {
  .hero__board {
    padding: var(--space-l);
  }
}

/* Product outline: named areas replace R0's column count. The timeline still ends at 1000ms
   because six pieces at a 66ms step give the same seam start as four at 110ms. */
.hero__assembly {
  --snap-count: 6;
  --snap-step: 66ms;

  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "support support"
    "web mobile"
    "ai chatbot"
    "python python";
  gap: var(--space-2xs);
}

@media (min-width: 768px) {
  .hero__assembly {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "support support chatbot"
      "web mobile ai"
      "python python python";
    gap: var(--space-2xs);
  }
}

.hero__assembly .snap__slot {
  min-block-size: var(--module);
}

@media (min-width: 768px) {
  .hero__assembly .snap__slot {
    min-block-size: calc(var(--module) * 1.5);
  }
}

.hero__assembly .snap__piece {
  gap: var(--space-xs);
}

@media (max-width: 399px) {
  .hero__board {
    padding: var(--space-s);
  }

  .hero__assembly .snap__piece {
    font-size: var(--step-0);
    padding-inline: var(--space-xs);
  }
}

.hero__piece-icon {
  flex: none;
}

/* Smallest phones: the label alone must fit the half-width "Local AI" and "Chatbot" pieces. */
@media (max-width: 359px) {
  .hero__piece-icon {
    display: none;
  }
}

.hero__assembly .snap__seam {
  margin-block-start: var(--space-s);
}

.hero__slot--support {
  grid-area: support;
}

.hero__slot--web {
  grid-area: web;
}

.hero__slot--mobile {
  grid-area: mobile;
}

.hero__slot--ai {
  grid-area: ai;
}

.hero__slot--chatbot {
  grid-area: chatbot;
}

.hero__slot--python {
  grid-area: python;
}

/* Seat order: foundation first, interface last. */
.hero__slot--python .snap__piece {
  --i: 0;
  --from-x: 0;
  --from-y: 1.5rem;
  --from-r: 2deg;
}

.hero__slot--ai .snap__piece {
  --i: 1;
  --from-x: 1rem;
  --from-y: 1rem;
  --from-r: 3deg;
}

.hero__slot--chatbot .snap__piece {
  --i: 2;
  --from-x: 1.25rem;
  --from-y: 0;
  --from-r: -3deg;
}

.hero__slot--web .snap__piece {
  --i: 3;
  --from-x: -1.25rem;
  --from-y: 0.5rem;
  --from-r: -2deg;
}

.hero__slot--mobile .snap__piece {
  --i: 4;
  --from-x: 1rem;
  --from-y: -0.75rem;
  --from-r: 4deg;
}

.hero__slot--support .snap__piece {
  --i: 5;
  --from-x: 0;
  --from-y: -1.5rem;
  --from-r: -3deg;
}

/* ---------- Shared ---------- */
.home-more {
  display: flex;
  justify-content: flex-start;
}

/* Ghost links carry their own inline padding; pull it back so the text sits on the container line,
   but never past 0.5rem from the viewport edge so the 3px focus ring is not clipped on small screens. */
.home-more .btn--ghost,
.layout-aside__header .btn--ghost {
  margin-inline-start: max(
    calc(var(--space-m) * -1),
    calc((var(--gutter) - 0.5rem) * -1)
  );
}

.container > .home-more {
  margin-block-start: var(--space-l);
}

/* ---------- Services rail ---------- */
.services-rail > .service-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-s);
  row-gap: var(--space-xs);
  padding: var(--space-m);
}

.service-row .card__icon,
.service-row .card__title,
.service-row .card__text {
  margin: 0;
}

.service-row .card__icon .icon {
  inline-size: 1.5rem;
  block-size: 1.5rem;
  fill: none;
}

.service-row .card__text {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
  max-inline-size: var(--measure);
}

@media (min-width: 768px) {
  .services-rail > .service-row {
    grid-template-columns: 2.5rem minmax(9rem, 14rem) minmax(0, 1fr);
    column-gap: var(--space-m);
    padding-inline: var(--space-l);
  }

  .service-row .card__title {
    font-size: var(--step-2);
    font-stretch: var(--wdth-label);
  }

  .service-row .card__text {
    grid-column: auto;
  }
}

/* ---------- Featured work ---------- */
.work-feature {
  margin: 0;
}

/* One rail: lead and the two-project rail share the outer outline and a 1px Pegboard joint at >= 1024. */
.work-feature__lead > .project-card,
.project-rail {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.work-feature__lead > .project-card {
  padding: var(--space-m);
  block-size: 100%;
  background: transparent;
}

.work-feature__lead > .project-card:hover,
.work-feature__lead > .project-card:focus-within {
  transform: none;
  box-shadow: none;
}

.work-feature__rail {
  display: flex;
}

.project-rail {
  flex: 1 1 auto;
  inline-size: 100%;
}

.project-rail > .project-card {
  flex: 1 1 auto;
  padding: var(--space-m);
}

@media (min-width: 1024px) {
  .work-feature {
    flex-direction: row;
  }

  .work-feature__lead {
    flex: 7 1 0;
  }

  .work-feature__rail {
    flex: 5 1 0;
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-inline-size: 0;
}

.project-card__body > * {
  margin: 0;
}

.project-card__media {
  margin: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: var(--color-surface-raised);
  outline: 1px dashed var(--graphite);
  outline-offset: -1px;
  border-radius: var(--radius-s);
  color: var(--graphite);
  font-size: var(--step--1);
}

.project-card__media:has(> img) {
  outline: 0;
}

.project-card__media > img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.project-card--lead {
  gap: var(--space-m);
}

.project-card--lead .project-card__media {
  aspect-ratio: 16 / 10;
}

.project-card--lead .card__title {
  font-size: var(--step-3);
}

.project-rail .card__title {
  font-size: var(--step-2);
}

.project-card__category {
  display: flex;
}

@media (min-width: 640px) {
  .project-rail > .project-card {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-m);
  }

  .project-rail .project-card__media {
    flex: 0 0 40%;
  }

  .project-rail .project-card__body {
    flex: 1 1 0;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .project-rail > .project-card {
    flex-direction: column;
  }

  .project-rail .project-card__media {
    flex: none;
    inline-size: 100%;
  }
}

/* ---------- Promises: spec plate inside the page's one .card--signal ---------- */
.promises {
  --span: 12;
  --span-md: 8;

  padding: 0;
}

.promises .stats {
  flex-wrap: wrap;
}

/* Value above label at every width: "1 business day" does not fit a fixed value column. */
.stats > .stats__item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  flex: 1 1 11rem;
  gap: var(--space-xs);
  margin: 0;
  padding: var(--space-m);
}

.stats__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: var(--fw-black);
  font-stretch: var(--wdth-wide);
  line-height: var(--lh-tight);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stats__label {
  color: var(--color-text-muted);
}

@media (min-width: 768px) {
  .stats > .stats__item {
    padding: var(--space-l);
  }
}

/* ---------- Tech strip ---------- */
.tech-strip {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tech-strip__item {
  padding: var(--space-2xs) var(--space-s);
  font-size: var(--step-0);
}

/* ---------- Final CTA plate ---------- */
.cta-band__plate {
  padding-block: var(--space-2xl);
}

.cta-band__title {
  --span: 7;
  --span-md: 8;

  font-size: var(--step-4);
  font-stretch: var(--wdth-wide);
}

.cta-band__lead {
  --span: 6;
  --span-md: 8;
}

.cta-band__action {
  margin: 0;
}

@media (max-width: 639px) {
  .cta-band__action .btn {
    inline-size: 100%;
  }
}
