/* ═══════════════════════════════════════════
   Puget Sound AI — modern.css v1.0
   2026 interaction layer: view transitions,
   scroll-driven motion, marquee, bento,
   micro-interactions. Progressive enhancement
   only; every rule degrades to the v4.0 base.
   Palette: existing tokens only. No new color.
═══════════════════════════════════════════ */

/* ── 1. Cross-page view transitions ──
   Native, zero-JS page fade between same-origin navigations.
   Browsers without support ignore the at-rule entirely. */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation-duration: .18s; }
  ::view-transition-new(root) { animation-duration: .26s; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ── 2. Hero typography accent ──
   (Entrance stagger already lives in main.css heroRise; not duplicated here.)
   Solid brass. A background-clip gradient was tried here and cut: across a
   multi-line headline each line samples a different gradient slice, which
   reads as mottled/dirty gold over the photo. */

/* Hero eyebrow: dark glass backing so the chip text stays legible where the
   photo backdrop turns bright (the token chip-bg is nearly transparent). */
.hero .hero-eyebrow {
  background: rgba(14, 30, 25, .52);
  border-color: rgba(196, 147, 63, .45);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* ── 3. Scroll-driven depth (native, compositor-only) ──
   Hero backdrop drifts as the page scrolls. Zero JS; browsers
   without animation-timeline simply keep the static image. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-photo-bg {
      animation: psaiHeroDrift linear both;
      animation-timeline: scroll(root);
      animation-range: 0 120vh;
      will-change: transform;
    }
  }
}
@keyframes psaiHeroDrift {
  from { transform: translateY(0) scale(1.02); }
  to   { transform: translateY(6%) scale(1.08); }
}

/* Section eyebrow tags draw a brass rule as they enter the viewport. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section-tag::after {
      content: "";
      display: block;
      height: 2px;
      margin-top: .5rem;
      background: var(--accent);
      transform-origin: left center;
      animation: psaiRuleGrow linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    .section-dark .section-tag::after { background: var(--hero-accent); }
  }
}
@keyframes psaiRuleGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── 4. Platform marquee ──
   Thin continuous strip of the M365 stack the firm engineers on.
   Track is duplicated in markup (second copy aria-hidden) for the loop.
   Reduced motion or no hover-capable device: static wrapped row. */
.tech-marquee {
  border-block: 1px solid var(--edge);
  background: var(--surface-2);
  padding: 14px 0;
  overflow: hidden;
  position: relative;
}
.tech-marquee::before,
.tech-marquee::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 72px;
  z-index: 2;
  pointer-events: none;
}
.tech-marquee::before { left: 0;  background: linear-gradient(90deg, var(--surface-2), transparent); }
.tech-marquee::after  { right: 0; background: linear-gradient(-90deg, var(--surface-2), transparent); }

.tech-marquee-inner {
  display: flex;
  width: max-content;
}
.tech-marquee-track {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  padding-right: 2.75rem;
  animation: psaiMarquee 42s linear infinite;
}
.tech-marquee:hover .tech-marquee-track { animation-play-state: paused; }
@keyframes psaiMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
.tech-marquee-item {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.tech-marquee-item::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}
@media (prefers-reduced-motion: reduce) {
  .tech-marquee-inner { width: auto; }
  .tech-marquee-track { animation: none; flex-wrap: wrap; justify-content: center; padding-right: 0; }
  .tech-marquee-track[aria-hidden="true"] { display: none; }
  .tech-marquee::before, .tech-marquee::after { display: none; }
}

/* ── 5. Industries bento ──
   Mobile-first: single column. Tablet: 2-up. Desktop: 12-col bento
   with the lead card spanning wider. */
.industry-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
.industry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface-1);
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-card);
  padding: var(--space-8);
  overflow: hidden;
  transition: transform var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
}
.industry-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease-out);
}
.industry-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.industry-card:hover::after { transform: scaleX(1); }
.industry-card-eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}
.industry-card-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
}
.industry-card-desc {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ink-dim);
}
.industry-card--lead {
  background: var(--primary);
  border-color: transparent;
}
.industry-card--lead .industry-card-title { color: var(--hero-ink); }
.industry-card--lead .industry-card-desc  { color: var(--hero-ink-dim); }
/* --hero-accent is AA-Large only (4.28:1 on --primary); eyebrow text is small,
   so it uses --hero-ink-dim (6.79:1). The brass accent stays on the ::after rule,
   which is non-text (3:1 requirement, passes). */
.industry-card--lead .industry-card-eyebrow { color: var(--hero-ink-dim); }
.industry-card--lead::after { background: var(--hero-accent); }

@media (min-width: 768px) {
  .industry-grid { grid-template-columns: repeat(2, 1fr); }
  .industry-card--lead { grid-column: span 2; }
}
@media (min-width: 1024px) {
  .industry-grid { grid-template-columns: repeat(12, 1fr); }
  .industry-card { grid-column: span 4; }
  .industry-card--lead { grid-column: span 8; flex-direction: column; justify-content: center; }
  .industry-card--wide { grid-column: span 6; }
}

/* Contractor plate footnote: ties the federal record to commercial buyers. */
.psa-plate-note {
  margin-top: var(--space-4);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--hero-ink-dim);
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: var(--space-3);
}

/* ── 6. Card micro-interactions (existing grids) ──
   Grounded lift + shadow. Transform/opacity/box-shadow only. */
@media (prefers-reduced-motion: no-preference) {
  .case-card, .service-card, .router-card, .audience-card, .service-bento-featured {
    transition: transform var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease);
  }
  .case-card:hover, .service-card:hover, .router-card:hover, .service-bento-featured:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }
  .audience-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .case-card:hover .case-stack-tag { border-color: var(--border-strong); }
}

/* In dark sections the why-card body stays visible: the hover-collapse reveal
   (main.css) has no focusable children here, and hiding the proof copy leaves
   the section reading as empty rows. */
.section-dark .why-desc {
  max-height: none;
  opacity: 1;
  overflow: visible;
  padding-top: .6rem;
}

/* Dark-section cards get a quiet glass treatment. */
.section-dark .why-card {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-card);
  padding: var(--space-6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color var(--dur-ui) var(--ease), background-color var(--dur-ui) var(--ease);
}
.section-dark .why-card:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
}

/* ── 7. Button + link micro-interactions ── */
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform var(--dur-ui) var(--ease), background-color var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease); }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0) scale(.985); }
  .btn-primary:hover { box-shadow: var(--shadow-md); }

  .link-arrow { transition: color var(--dur-ui) var(--ease); }
  .link-arrow::after { display: inline-block; transition: transform var(--dur-ui) var(--ease); }
  .link-arrow:hover::after { transform: translateX(4px); }
}

/* ── 8. FAQ: native smooth expand (2026 interpolate-size) ── */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .faq-details::details-content {
      height: 0;
      overflow: clip;
      transition: height var(--dur) var(--ease-out), content-visibility var(--dur) allow-discrete;
      interpolate-size: allow-keywords;
    }
    .faq-details[open]::details-content { height: auto; }
  }
}
.faq-question { transition: color var(--dur-ui) var(--ease); }
.faq-details[open] .faq-question { color: var(--primary); }

/* ── 9. Stat row hover ── */
@media (prefers-reduced-motion: no-preference) {
  .stat { transition: background-color var(--dur-ui) var(--ease); }
  .stat:hover { background: var(--surface-2); }
  .section-dark .stat:hover { background: rgba(255, 255, 255, .08); }
}

/* ── 10. Homepage polish ── */

/* Industries: the only front-page section without its own vertical rhythm
   rule; without this the card grid sits flush on the section boundary. */
.industries-section { padding: 5rem 0; }

/* Compliance pills: center the wrap so a pill that breaks to a second
   line reads as a balanced row, not a straggler. */
.compliance-list { justify-content: center; }

/* Cream-on-dark serif renders optically heavier than dark-on-light at the
   same weight; step dark-section titles down one weight to match. */
.section-dark .section-title { font-weight: 600; }

/* Flagship Jumpstart card: dark forest so it pops from the paper page.
   Gold accents use #D9AE62 (4.67:1 on --primary, AA normal text);
   --accent-bright and --hero-accent both fail 4.5:1 at these sizes. */
.service-bento-featured {
  background: var(--primary);
  border-color: var(--primary);
  border-top-color: var(--hero-accent);
}
.service-bento-featured:hover { border-color: rgba(196, 147, 63, .55); }
.service-bento-featured .service-bento-eyebrow { color: #D9AE62; }
.service-bento-featured .service-icon { background: rgba(196, 147, 63, .16); }
.service-bento-featured .service-icon svg { stroke: #D9AE62; }
.service-bento-featured .service-card-title a { color: var(--hero-ink); }
.service-bento-featured .service-card-title a:hover { color: #D9AE62; }
.service-bento-featured .service-card-desc { color: var(--hero-ink-dim); }
.service-bento-featured .service-card-commercial {
  color: var(--hero-ink-dim);
  border-top-color: rgba(255, 255, 255, .14);
}
.service-bento-featured .service-bento-footer { border-top-color: rgba(255, 255, 255, .14); }
.service-bento-featured .service-bento-price { color: #D9AE62; }
.service-bento-featured .service-bento-price-label { color: var(--hero-ink-dim); }
.service-bento-featured .btn-primary {
  background: var(--hero-ink);
  color: var(--primary);
  border-color: var(--hero-ink);
}
.service-bento-featured .btn-primary:hover {
  background: #fff;
  border-color: #fff;
  color: var(--primary);
}

/* ── 11. Reduced-motion safety net for this file ── */
@media (prefers-reduced-motion: reduce) {
  .hero-photo-bg,
  .section-tag::after,
  .industry-card,
  .industry-card::after,
  .case-card, .service-card, .router-card, .audience-card, .service-bento-featured,
  .btn, .link-arrow::after {
    animation: none !important;
    transition-duration: .01ms !important;
    transform: none !important;
  }
}
