/* ==========================================================================
   pages.css — Page-specific components and adjustments
   --------------------------------------------------------------------------
   Blocks that appear on only one page live here (still BEM-named) so
   components.css stays generic. Grouped by page.
     1. Home      — service tiles, "why" points, FAQ grid
     2. Services  — jump nav band, service sections
     3. Security  — layer card meta, coverage card
     4. About     — shield figure, commitments
     5. Contact   — form card, sidebar
     6. Status pages — thanks + 404
   ========================================================================== */

@layer pages {
  /* ------------------------------------------------------------------------
     1. Home
     ------------------------------------------------------------------------ */
  /* Compact service tiles: icon + name + one line, whole tile clickable */
  /* Fixed column counts (1 → 2 → 3) so six tiles always form full rows */
  .service-tiles {
    --grid-gap: var(--space-s);
    grid-template-columns: 1fr;
  }

  @media (min-width: 40em) {
    .service-tiles {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 60em) {
    .service-tiles {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .service-tile {
    flex-direction: row;
    align-items: center;
    gap: var(--space-s);
    padding: var(--space-m);
  }

  .service-tile__title {
    font-size: var(--step-0);
    line-height: var(--leading-snug);
  }

  .service-tile__text {
    margin-top: 0.15em;
    font-size: var(--step--1);
    color: var(--color-text-muted);
  }

  /* Three short "why" points, separated by a brand accent rule */
  .why-list {
    --grid-gap: var(--space-l) var(--space-xl);
    grid-template-columns: 1fr;
  }

  @media (min-width: 48em) {
    .why-list {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .why-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding-top: var(--space-m);
    border-top: 2px solid var(--color-border);
    position: relative;
  }

  .why-item::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 3rem;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-600), var(--sky-500));
  }

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

  .why-item .text-link {
    margin-top: auto;
  }

  /* FAQ — always-visible grid of question/answer pairs (1 → 2 → 3 columns) */
  .faq {
    display: grid;
    gap: var(--space-l) var(--space-xl);
  }

  @media (min-width: 40em) {
    .faq {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 64em) {
    .faq {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .faq__item {
    padding-top: var(--space-m);
    border-top: 1px solid var(--color-border);
  }

  .faq__question {
    margin-bottom: var(--space-2xs);
    font-size: var(--step-0);
    line-height: var(--leading-snug);
  }

  .faq__answer {
    font-size: var(--step--1);
    line-height: 1.6;
    color: var(--color-text-muted);
  }

  /* ------------------------------------------------------------------------
     2. Services
     ------------------------------------------------------------------------ */
  .jump-nav {
    border-bottom: 1px solid var(--color-border);
  }

  .service__intro > * + * {
    margin-top: var(--space-s);
  }

  .service__intro > .eyebrow {
    display: flex;
    margin-top: var(--space-m);
  }

  .service__lead {
    font-size: var(--step-1);
    font-weight: var(--weight-medium);
    line-height: 1.5;
    color: var(--color-heading);
  }

  .service__card-title {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  /* ------------------------------------------------------------------------
     3. Security
     ------------------------------------------------------------------------ */
  .layer-card__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2xs);
  }

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

  .coverage-card__title {
    font-size: var(--step-1);
  }

  .coverage-card__note {
    font-size: var(--step--1);
    color: var(--color-text-muted);
  }

  /* ------------------------------------------------------------------------
     4. About
     ------------------------------------------------------------------------ */
  .about-figure {
    justify-self: center;
    width: min(100%, 22rem);
  }

  /* Soft glow behind the shield so it sits well on light and dark pages */
  .about-figure__img {
    width: 100%;
    filter: drop-shadow(0 24px 40px rgb(32 89 160 / 0.28));
  }

  .about-commitments {
    gap: var(--space-m);
    font-size: var(--step-1);
    line-height: 1.5;
  }

  /* ------------------------------------------------------------------------
     5. Contact
     ------------------------------------------------------------------------ */
  .contact-form-card {
    gap: var(--space-2xs);
    padding: clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  }

  .contact-form-card__title {
    font-size: var(--step-2);
  }

  .contact-aside {
    display: grid;
    gap: var(--space-l);
  }

  @media (min-width: 56em) {
    .contact-aside {
      position: sticky;
      top: calc(var(--header-height) + var(--space-l));
    }
  }

  .contact-aside__title {
    font-size: var(--step-2);
  }

  .contact-aside__area {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding-top: var(--space-m);
    border-top: 1px solid var(--color-border);
    font-weight: var(--weight-semibold);
    color: var(--color-heading);
  }

  .contact-aside__area .icon {
    color: var(--color-icon);
  }

  /* Compact, single-column variant of the numbered steps */
  .steps--compact {
    grid-template-columns: 1fr;
    gap: var(--space-m);
  }

  .steps--compact .steps__item {
    padding-top: var(--space-l);
  }

  .steps--compact .steps__title {
    font-size: var(--step-0);
  }

  /* ------------------------------------------------------------------------
     6. Status pages (thanks, 404)
     ------------------------------------------------------------------------ */
  .status-page {
    display: grid;
    align-items: center;
    padding-block: clamp(4rem, 3rem + 8vw, 9rem);
  }

  .status-page .eyebrow {
    justify-content: center;
  }

  .status-page__icon {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    margin-inline: auto;
    border-radius: 50%;
    background-color: var(--color-icon-bg);
    color: var(--color-success);
  }

  .status-page__icon .icon {
    width: 2.25rem;
    height: 2.25rem;
    stroke-width: 2.25;
  }

  /* Big outlined "404" in the brand gradient — decorative (aria-hidden) */
  .status-page__code {
    font-family: var(--font-mono);
    font-size: clamp(4.5rem, 3rem + 10vw, 9rem);
    font-weight: var(--weight-bold);
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--sky-500), var(--blue-600) 50%, var(--navy-700));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .status-page__actions,
  .status-page__links {
    justify-content: center;
  }
}
