@layer reset, base, components, utilities;

@layer reset {
  * { box-sizing: border-box; }
  img { max-width: 100%; height: auto; display: block; }
  picture { display: block; }
  p,ul,ol { margin: 0; }
  ul,ol { padding: 0; list-style: none; }
}

@layer base {
  @font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("/fonts/outfit-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 500 600;
    font-display: swap;
    src: url("/fonts/fraunces-roman-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Fraunces";
    font-style: italic;
    font-weight: 500 600;
    font-display: swap;
    src: url("/fonts/fraunces-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "Audiowide";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/audiowide-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }

  :root {
    --bg: #f3f6f4; --surface: #fff; --ink: #16352e; --muted: #3f5c54;
    --line: #d5e3dc; --coral: #c43222; --lagoon: #0a6b64;
    --sans: Outfit, ui-sans-serif, system-ui, sans-serif;
    --display: Fraunces, Georgia, serif;
    --brand: Audiowide, ui-sans-serif, system-ui, sans-serif;
    --wrap: 72rem;
  }
  html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
  body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; }
  a { color: inherit; }
  button { cursor: pointer; font: inherit; }
  h1,h2,h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
  :focus-visible { outline: 2px solid var(--lagoon); outline-offset: 3px; }
  h1 { margin-top: 1.1rem; font-size: clamp(2.5rem, 6vw, 3.7rem); }
  h1 em { color: var(--lagoon); font-style: italic; }
  label { display: block; font-size: .875rem; font-weight: 600; }
}

@layer components {
  .wrap { width: min(var(--wrap), calc(100% - 2.5rem)); margin-inline: auto; }
  .kicker { color: var(--lagoon); font-size: .875rem; font-weight: 600; }
  .muted { color: var(--muted); }
  .skip { position: absolute; left: 1rem; top: 1rem; z-index: 30; transform: translateY(-160%); background: #fff; padding: .5rem 1rem; border-radius: 999px; }
  .skip:focus { transform: none; }
  .header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .header-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; height: 4rem; }
  .brand-link { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; }
  .brand-link img { height: 3.25rem; width: auto; }
  .brand-link > span { margin-top: 12px; }
  .brand-name { display: block; line-height: 1; font-family: var(--brand); font-size: 1.4rem; letter-spacing: .04em; }
  .brand-sub { display: block; line-height: 1.1; font-family: var(--brand); font-size: .62rem; letter-spacing: .16em; text-transform: lowercase; color: var(--lagoon); }
  .nav { display: none; gap: .15rem; }
  .nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; border-radius: 999px; text-decoration: none; font-size: .875rem; font-weight: 500; }
  .nav a:hover { color: var(--lagoon); }
  .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.2rem; border-radius: 999px; border: 0; text-decoration: none; font-size: .875rem; font-weight: 600; }
  .btn-coral { background: var(--coral); color: #fff; }
  .btn-ink { background: var(--ink); color: var(--bg); }
  .btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
  .btn-block { width: 100%; }
  .icon-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
  .desktop-only { display: none; }
  .menu { display: none; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 1rem 1.25rem 1.5rem; background: var(--bg); }
  .menu[open] { display: flex; flex-direction: column; }
  .menu nav { display: flex; flex-direction: column; margin-top: 1.5rem; }
  .menu nav a { border-bottom: 1px solid var(--line); padding: 1rem 0; font-family: var(--brand); font-size: 2rem; text-decoration: none; }
  .menu .btn { margin-top: clamp(1.5rem, 8vh, 3rem); }
  .hero { padding: 3rem 0 2rem; }
  .hero-grid, .split, .feature, .about-grid, .contact-grid { display: grid; gap: 2rem; }
  .pill { display: inline-flex; border-radius: 999px; background: color-mix(in srgb, var(--lagoon) 10%, transparent); color: var(--lagoon); font-size: .875rem; font-weight: 600; padding: .25rem .75rem; }
  .lede { margin-top: 1.1rem; max-width: 36rem; font-size: 1.125rem; color: var(--muted); }
  .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
  .card { border: 1px solid var(--line); background: #fff; border-radius: 1.5rem; padding: 1.25rem; box-shadow: 0 18px 40px -28px rgb(22 53 46 / .45); }
  .row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
  .tag { border-radius: 999px; background: color-mix(in srgb, var(--coral) 10%, #fff); color: var(--coral); font-size: .75rem; font-weight: 600; padding: .25rem .65rem; }
  .fixes li { padding: 1rem 0; border-top: 1px solid var(--line); }
  .fixes li:first-child { border-top: 0; }
  /* ── Hero "Recently resolved" card — check + dim animation ─────────────────
     On load each item plays: check strokes in, problem text dims to muted,
     fix line fades up. All hidden-until-animated rules live inside
     no-preference so reduced-motion users see the fully-resolved final state.
     Contrast: dimmed problem text (#3f5c54) on white card (#fff) ≈ 6.5:1.    */

  /* Problem row: check icon + text side by side; text never wraps under icon */
  .problem-row {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
  }

  /* Check icon: space reserved from the start so no layout shift */
  .fix-check {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--coral);
    margin-top: 0.15em;   /* optical alignment with text cap-height */
  }
  .fix-check path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 18;
    stroke-dashoffset: 0;   /* fully drawn = final state and fallback */
  }

  /* Problem text: muted (#3f5c54) on white (#fff) = final state + reduce fallback */
  .fixes .problem { color: var(--muted); }

  @media (prefers-reduced-motion: no-preference) {
    @keyframes fix-check-draw {
      from { stroke-dashoffset: 18; }
      to   { stroke-dashoffset: 0; }
    }
    @keyframes fix-dim {
      from { color: #16352e; }   /* --ink  */
      to   { color: #3f5c54; }   /* --muted */
    }
    @keyframes fix-in {
      from { opacity: 0; transform: translateY(4px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* Hidden until animated in; opacity only — layout space reserved */
    .fixes .fix-text { opacity: 0; }

    /* Item 1 */
    .fixes li:nth-child(1) .fix-check path { animation: fix-check-draw 0.4s ease-in-out  0.3s both; }
    .fixes li:nth-child(1) .problem        { animation: fix-dim        0.4s ease-in-out  0.3s both; }
    .fixes li:nth-child(1) .fix-text        { animation: fix-in         0.3s ease-out     0.9s both; }

    /* Item 2 */
    .fixes li:nth-child(2) .fix-check path { animation: fix-check-draw 0.4s ease-in-out  1.3s both; }
    .fixes li:nth-child(2) .problem        { animation: fix-dim        0.4s ease-in-out  1.3s both; }
    .fixes li:nth-child(2) .fix-text        { animation: fix-in         0.3s ease-out     1.9s both; }

    /* Item 3 */
    .fixes li:nth-child(3) .fix-check path { animation: fix-check-draw 0.4s ease-in-out  2.3s both; }
    .fixes li:nth-child(3) .problem        { animation: fix-dim        0.4s ease-in-out  2.3s both; }
    .fixes li:nth-child(3) .fix-text        { animation: fix-in         0.3s ease-out     2.9s both; }
  }
  .text-link { display: inline-flex; align-items: center; gap: .25rem; min-height: 2.75rem; color: var(--lagoon); font-size: .875rem; font-weight: 600; background: none; border: 0; padding: 0; text-decoration: none; }
  .section { padding: 4rem 0; }
  .section h2 { margin-top: .7rem; font-size: clamp(2rem, 4vw, 3rem); max-width: 40rem; }
  .service { display: flex; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid var(--line); }
  .services { border-bottom: 1px solid var(--line); }
  .mark { flex: none; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 1rem; background: color-mix(in srgb, var(--lagoon) 10%, transparent); color: var(--lagoon); font-weight: 600; }
  .service h3 { font-size: 1.45rem; }
  .service p { margin-top: .45rem; color: var(--muted); }
  .chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
  .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .25rem .75rem; font-size: .875rem; }
  .band { background: #fff; }

  /* ── Steps (connected timeline) ──────────────────────────────────────────
     Mobile  (<700px): vertical timeline; number + title on one row,
     description indented to align under the title text. A vertical connector
     line runs from each marker to the next.
     Desktop (≥700px): four equal columns with a horizontal connector behind
     the markers.
     Scroll-driven animation lives in @supports + prefers-reduced-motion so
     Firefox and older browsers see a fully-drawn, static fallback.           */
  .steps {
    list-style: none;
    padding: 0;
    margin: 2.4rem 0 0;
  }

  .step {
    position: relative;
    padding-bottom: 2rem;
    container: step / inline-size;
  }
  .step:last-child { padding-bottom: 0; }

  .step-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  /* Default: cream fill, 2px ink ring, ink number */
  .step-no {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--ink);
    font-family: var(--display);
    font-size: 0.875rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }

  .step h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.15;
  }

  /* Description sits below the row, indented past the marker */
  .step-desc {
    margin-top: 0.5rem;
    padding-left: calc(2rem + 0.75rem);
    font-size: 0.875rem;
    color: var(--muted);
  }

  /* Mobile vertical connector (decorative ::after, not interactive) */
  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(1rem - 1px);
    top: 2rem;
    bottom: 0;
    width: 2px;
    background: var(--line);
    transform-origin: top center;
  }

  /* Hover / focus-within: coral marker */
  .step:hover .step-no,
  .step:focus-within .step-no {
    background: var(--coral);
    color: var(--surface);
    border-color: var(--coral);
  }
  @media (prefers-reduced-motion: no-preference) {
    .step { transition: transform 0.15s ease; }
    .step:hover,
    .step:focus-within { transform: translateY(-2px); }
  }

  /* Desktop (≥700px): horizontal timeline */
  @media (min-width: 700px) {
    .steps {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 2rem;
      position: relative;
    }

    /* Horizontal connector behind all four markers */
    .steps::before {
      content: "";
      position: absolute;
      top: 1.25rem;
      left: 0;
      right: 0;
      height: 2px;
      background: var(--line);
      z-index: 0;
      transform-origin: left center;
    }

    .step {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      padding-bottom: 0;
    }

    .step:not(:last-child)::after { display: none; }

    .step-head {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.65rem;
    }
    .step h3 { font-size: 1.3rem; }
    .step-no { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
    .step-desc { padding-left: 0; margin-top: 0.65rem; }
  }

  /* Container query: slightly larger title at wider column widths */
  @container step (min-width: 180px) {
    .step h3 { font-size: 1.35rem; }
  }

  /* ── Scroll-driven animation (progressive enhancement) ───────────────────
     @supports guard ensures Firefox (flag-gated) and older browsers keep the
     fully-drawn static fallback. animation-fill-mode: both holds each marker
     in its reached (coral) state after the section has scrolled through.     */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      @keyframes steps-draw-h {
        from { transform: scaleX(0); }
        to   { transform: scaleX(1); }
      }
      @keyframes steps-draw-v {
        from { transform: scaleY(0); }
        to   { transform: scaleY(1); }
      }
      @keyframes step-reach {
        to {
          background: var(--coral);
          color: var(--surface);
          border-color: var(--coral);
        }
      }

      .steps {
        view-timeline-name: --steps-tl;
        view-timeline-axis: block;
      }

      @media (min-width: 700px) {
        .steps::before {
          animation: steps-draw-h linear both;
          animation-timeline: --steps-tl;
          animation-range: entry 10% cover 55%;
        }
      }

      @media (max-width: 699px) {
        .step:not(:last-child)::after {
          animation: steps-draw-v linear both;
          animation-timeline: view();
          animation-range: entry 0% cover 30%;
        }
      }

      .step-no {
        animation: step-reach linear both;
        animation-timeline: --steps-tl;
      }
      .step:nth-child(1) .step-no { animation-range: entry  8% cover 22%; }
      .step:nth-child(2) .step-no { animation-range: entry 22% cover 36%; }
      .step:nth-child(3) .step-no { animation-range: entry 36% cover 50%; }
      .step:nth-child(4) .step-no { animation-range: entry 50% cover 60%; }
    }
  }

  .plans { display: grid; gap: 1rem; margin-top: 2rem; }
  .plan { display: flex; flex-direction: column; border: 1px solid var(--line); background: #fff; border-radius: 1.5rem; padding: 1.4rem; }
  .plan.recommended { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .plan.recommended :focus-visible { outline-color: var(--bg); }
  .plan h3 { margin-top: .9rem; font-family: var(--brand); font-size: 1.55rem; font-weight: 400; }
  .plan .blurb { margin-top: .5rem; font-size: .875rem; color: var(--muted); min-height: 2.8rem; }
  .plan.recommended .quiet, .plan.recommended .blurb { color: color-mix(in srgb, var(--bg) 78%, transparent); }
  .price { display: flex; align-items: flex-end; gap: .5rem; margin-top: 1.2rem; }
  .price strong { font-family: var(--display); font-size: 2.8rem; line-height: 1; }
  .price span, .note { font-size: .875rem; }
  .note { margin-top: .4rem; }
  .plan li { display: flex; gap: .5rem; font-size: .875rem; margin-top: .7rem; }
  .check { color: var(--coral); }
  .plan .col { margin-top: auto; padding-top: 1.6rem; display: flex; flex-direction: column; gap: .4rem; }
  .recommend { border-radius: 999px; background: var(--coral); color: #fff; font-size: .75rem; font-weight: 600; padding: .25rem .7rem; }
  .includes { margin-top: 1.6rem; border: 1px solid var(--line); background: #fff; border-radius: 1.5rem; padding: 1.2rem; }
  .includes .chip { background: color-mix(in srgb, var(--lagoon) 10%, transparent); color: var(--lagoon); border: 0; }
  .sheet { width: min(36rem, calc(100% - 2rem)); margin: auto; border: 1px solid var(--line); border-radius: 1.25rem; padding: 0; background: #fff; }
  .sheet::backdrop { background: rgb(22 53 46 / .46); }
  .sheet-body { padding: 1.5rem; max-height: 85dvh; overflow: auto; }
  .sheet h3 { margin-top: .25rem; font-family: var(--brand); font-size: 1.7rem; font-weight: 400; }
  .shot { display: block; width: 100%; aspect-ratio: 8/5; object-fit: cover; }
  .shot-link { display: block; overflow: hidden; border-radius: 1.5rem; border: 1px solid var(--line); }
  .project-copy h3 { margin-top: .6rem; font-size: clamp(1.8rem, 4vw, 2.4rem); }
  .kind { margin-top: .2rem; color: var(--lagoon); font-size: .875rem; }
  .cards { display: grid; gap: 1.2rem; margin-top: 1.8rem; }
  .project-card { overflow: hidden; border: 1px solid var(--line); border-radius: 1.5rem; background: var(--bg); container: card / inline-size; }
  .pad { padding: 1.2rem; }
  .about-photo { position: relative; max-width: 28rem; }
  .about-photo::before { content: ""; position: absolute; inset: 1.4rem 0 -.7rem .7rem; background: color-mix(in srgb, var(--lagoon) 15%, transparent); border-radius: 1.5rem; }
  .about-photo img { position: relative; border-radius: 1.5rem; border: 1px solid var(--line); }
  .empty { margin-top: 2rem; border: 1px dashed var(--line); background: #fff; border-radius: 1.5rem; padding: 1.4rem; }
  .empty p { margin-top: .7rem; color: var(--muted); }
  .contact-list a, .contact-list li { display: block; text-decoration: none; margin-top: 1rem; font-size: .875rem; }
  .form { border: 1px solid var(--line); background: #fff; border-radius: 1.25rem; padding: 1.25rem; }
  .fields { display: grid; gap: 1rem; margin-top: 1.1rem; }
  .field { width: 100%; min-height: 3rem; margin-top: .35rem; border-radius: .85rem; border: 1px solid var(--line); background: var(--bg); padding: .7rem .95rem; font: inherit; }
  textarea.field { min-height: 8rem; }
  .error { color: var(--coral); font-size: .875rem; }
  .hp { position: absolute; left: -9999px; }
  .footer { background: var(--ink); color: var(--bg); }
  .footer :focus-visible { outline-color: var(--bg); }
  .footer-grid { display: grid; gap: 2rem; padding: 3rem 0; }
  .footer img { width: 11rem; height: auto; max-width: 100%; }
  .footer .word { margin: .25rem 0 0 30px; line-height: 1; font-family: var(--brand); font-size: 1.4rem; }
  .footer .web { margin: 0 0 0 30px; line-height: 1.1; font-family: var(--brand); font-size: .75rem; letter-spacing: .18em; text-transform: lowercase; color: color-mix(in srgb, var(--bg) 80%, transparent); }
  .footer a, .footer p { color: color-mix(in srgb, var(--bg) 80%, transparent); font-size: .875rem; text-decoration: none; }
  .footer h2 { color: #fff; font-family: var(--sans); font-size: .875rem; margin-bottom: .7rem; }
  .footer li { margin-top: 0; }
  .footer-grid a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .legal { border-top: 1px solid color-mix(in srgb, var(--bg) 15%, transparent); display: flex; flex-direction: column; gap: .7rem; padding: 1.2rem 0 1.4rem; font-size: .875rem; color: color-mix(in srgb, var(--bg) 70%, transparent); }
  .legal a { color: #fff; }
  @media (min-width: 640px) {
    .desktop-only { display: inline-flex; }
    .fields.two { grid-template-columns: 1fr 1fr; }
    .legal { flex-direction: row; align-items: center; justify-content: space-between; }
  }
  @media (min-width: 768px) {
    .nav { display: flex; }
    .menu-btn { display: none; }
    .cards { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
    .wrap { width: min(var(--wrap), calc(100% - 4rem)); }
  }
  @media (min-width: 1024px) {
    .hero-grid { grid-template-columns: 7fr 5fr; align-items: end; }
    .split { grid-template-columns: 4fr 8fr; }
    .feature, .about-grid, .contact-grid { grid-template-columns: 1fr 1fr; align-items: center; }
    .plans { grid-template-columns: repeat(3,1fr); }
  }

  /* ── 1. Container queries: work card internals ─────────────────────────────
     Breakpoint 400px: at this width a card has enough horizontal room (wide
     phone in portrait, or either column in the 768px+ two-up grid) for the
     more generous 1.4rem padding. Below 400px (narrow phones, or any future
     three-column grid) the compact 1.2rem default is kept.                  */
  @container card (min-width: 400px) {
    .pad { padding: 1.4rem; }
  }

  /* ── 2. Auto-growing textarea ──────────────────────────────────────────────
     field-sizing: content is Baseline June 2026; older browsers keep the
     fixed min-height already set on textarea.field.                         */
  @supports (field-sizing: content) {
    #inquiry textarea { field-sizing: content; min-height: 8rem; max-height: 22rem; }
  }

  /* ── 3. Scroll-driven section reveals ─────────────────────────────────────
     Sections are fully visible by default; the animation only applies where
     both the API and the motion preference are supported. The hero uses class
     .hero (not .section) so it is never targeted.                           */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      @keyframes section-reveal {
        from { opacity: 0.001; transform: translateY(12px); }
        to   { opacity: 1;     transform: none; }
      }
      .section {
        animation-name: section-reveal;
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: view();
        animation-range: entry 0% cover 30%;
      }
    }
  }

  /* ── 4. Work section header ────────────────────────────────────────────────
     Full-width row above the work grid. Mobile: stacked. Desktop (≥900px):
     heading left, supporting text + link right, both aligned to the bottom
     of the heading block so the row feels balanced.                         */
  .work-header h2 { max-width: none; text-wrap: balance; }

  @media (min-width: 900px) {
    .work-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 3rem;
    }
    .work-header__meta {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 0.25rem;
      text-align: right;
      padding-bottom: 0.7rem;
    }
  }

  /* ── 5. Services bento grid ────────────────────────────────────────────────
     Section header is full-width. Mobile: stacked. Desktop (≥900px): heading
     left, supporting text + link right, aligned to the bottom of the heading.
     The grid is 1-col mobile → 2-col tablet (primaries span both) →
     6-col desktop (primaries span 3, secondaries span 2).
     Container queries on each <li> adjust internal padding and title size
     because the two card widths differ.                                     */
  .services-header h2 { max-width: none; text-wrap: balance; }
  .services-header__meta { margin-top: 1rem; }

  @media (min-width: 900px) {
    .services-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 3rem;
    }
    .services-header__meta {
      margin-top: 0;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 0.25rem;
      text-align: right;
      padding-bottom: 0.7rem;
    }
  }

  .bento {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
  }

  .bento > li {
    display: flex;
    container: bento-card / inline-size;
  }

  .bento-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.25rem;
    border-radius: 1.25rem;
    text-decoration: none;
    width: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }

  .bento-card--primary {
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
  }

  .bento-card--secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-top: 3px solid var(--coral);
  }

  .bento-card h3 {
    font-size: 1.3rem;
    color: inherit;
  }

  .bento-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    flex: 1;
    margin: 0;
  }

  .bento-card--primary .bento-desc {
    color: color-mix(in srgb, var(--bg) 72%, transparent);
  }

  .bento-card--secondary .bento-desc { color: var(--muted); }

  /* Hover and focus lift */
  .bento-card:hover,
  .bento-card:focus-visible {
    transform: translateY(-2px);
  }

  .bento-card--primary:hover,
  .bento-card--primary:focus-visible {
    box-shadow: 0 10px 32px -10px rgb(0 0 0 / .4);
    border-color: color-mix(in srgb, var(--bg) 18%, var(--ink));
  }

  .bento-card--secondary:hover,
  .bento-card--secondary:focus-visible {
    border-color: var(--lagoon);
    border-top-color: var(--coral);
    box-shadow: 0 10px 32px -10px rgb(22 53 46 / .16);
  }

  /* Focus ring on the whole card */
  .bento-card:focus-visible {
    outline: 2px solid var(--lagoon);
    outline-offset: 3px;
  }
  /* Primary (dark) cards: inset cream ring keeps both edges against ink */
  .bento-card--primary:focus-visible {
    outline-color: var(--bg);
    outline-offset: -3px;
  }

  /* Capabilities: hidden by default, revealed on hover/focus via grid row trick.
     Text remains in the DOM at all times for assistive technology.           */
  .bento-caps {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
  }

  .bento-caps-inner {
    min-height: 0;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 500;
    padding-top: 0.55rem;
  }

  .bento-card--primary .bento-caps-inner {
    color: color-mix(in srgb, var(--bg) 60%, transparent);
  }

  .bento-card--secondary .bento-caps-inner { color: var(--muted); }

  .bento-card:hover .bento-caps,
  .bento-card:focus .bento-caps {
    grid-template-rows: 1fr;
  }

  /* Touch devices: always show capabilities */
  @media (pointer: coarse) {
    .bento-caps { grid-template-rows: 1fr; }
  }

  /* Reduced motion: instant state change, no transition */
  @media (prefers-reduced-motion: reduce) {
    .bento-card { transition: none; }
    .bento-caps { transition: none; }
  }

  /* Tablet: 2 columns; first two cards (primaries) span both */
  @media (min-width: 600px) {
    .bento { grid-template-columns: 1fr 1fr; }
    .bento > li:nth-child(-n+2) { grid-column: span 2; }
  }

  /* Desktop: 6-column asymmetric bento */
  @media (min-width: 900px) {
    .bento { grid-template-columns: repeat(6, 1fr); }
    .bento > li:nth-child(-n+2) { grid-column: span 3; }
    .bento > li:nth-child(n+3) { grid-column: span 2; }
  }

  /* Container queries: adjust padding and title size based on card width */
  @container bento-card (min-width: 300px) {
    .bento-card { padding: 1.5rem; }
    .bento-card h3 { font-size: 1.45rem; }
  }

  @container bento-card (min-width: 420px) {
    .bento-card--primary { padding: 1.9rem; }
    .bento-card--primary h3 { font-size: 1.75rem; }
  }
}

@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
}
