/* Home page sections — values copied from the POC index.html style block,
   adapted to the --pk-* tokens. */
@layer pages {
  /* ----- Hero — full-bleed photo background ----- */
  /* webp listed first so the resolved format matches the imagesrcset preload
     in the home view (avif is the same size here, so nothing is lost); the
     plain url() declaration above is the fallback for browsers without
     image-set(). Mobile gets the 768w variant via the media query below. */
  .pk-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 520px;
    background-size: cover;
    background-position: 60% 55%;
    background-color: var(--pk-ink); /* fallback while the photo loads */
    background-image: url("/img/hero-steel-bars.jpg");
    background-image: image-set(
      url("/img/hero-steel-bars-1920.webp") type("image/webp"),
      url("/img/hero-steel-bars-1920.avif") type("image/avif"),
      url("/img/hero-steel-bars.jpg") type("image/jpeg")
    );
    color: var(--pk-white);
    padding-block: var(--pk-space-8);
    display: flex;
    align-items: center;
  }

  @media (max-width: 768px) {
    .pk-hero {
      background-image: url("/img/hero-steel-bars.jpg");
      background-image: image-set(
        url("/img/hero-steel-bars-768.webp") type("image/webp"),
        url("/img/hero-steel-bars-768.avif") type("image/avif"),
        url("/img/hero-steel-bars.jpg") type("image/jpeg")
      );
    }
  }

  /* Gradient overlay for text legibility. Mobile: darken vertically since
     text is full-width. Desktop: darken from the left so text reads and the
     bright doorway/bars stay revealed on the right. */
  .pk-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(20, 24, 28, 0.78) 0%,
      rgba(20, 24, 28, 0.58) 55%,
      rgba(20, 24, 28, 0.72) 100%
    );
    z-index: -1;
  }

  .pk-hero-inner {
    position: relative;
    width: 100%;
    max-width: var(--pk-container-max);
    margin-inline: auto;
    padding-inline: 16px;
  }

  .pk-hero-content {
    max-width: 640px;
  }

  .pk-hero-eyebrow {
    font-family: var(--pk-font-mono);
    font-size: var(--pk-text-eyebrow);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pk-marine-soft);
    margin-bottom: var(--pk-space-4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .pk-hero-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--pk-marine-soft);
    display: inline-block;
  }

  /* Hero brand mark, overlaid on the steel-bars photo. Source SVGs are
     dark-on-white; invert to pure white for the dark gradient overlay. */
  .pk-hero-logo {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-bottom: var(--pk-space-5);
    filter: brightness(0) invert(1);
  }

  .pk-hero-title {
    font-size: var(--pk-text-display);
    font-weight: 600;
    color: var(--pk-white);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 var(--pk-space-5);
    text-wrap: balance;
  }

  .pk-hero-lead {
    font-size: var(--pk-text-body-lg);
    color: rgba(255, 255, 255, 0.85);
    max-width: 52ch;
    margin: 0 0 var(--pk-space-6);
    line-height: 1.55;
  }

  /* Button variants for the dark hero background. */
  .pk-hero .btn-secondary {
    background: transparent;
    color: var(--pk-white);
    border-color: rgba(255, 255, 255, 0.6);
  }

  .pk-hero .btn-secondary:hover {
    background: var(--pk-white);
    color: var(--pk-marine);
    border-color: var(--pk-white);
  }

  .pk-hero :focus-visible {
    outline-color: var(--pk-white);
  }

  /* Technical metadata stamp — bottom-right, CAD-drawing-title-block vibe.
     Hidden on mobile where the CTA buttons need the full width. */
  .pk-hero-stamp {
    display: none;
    position: absolute;
    right: 32px;
    bottom: 24px;
    font-family: var(--pk-font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
    line-height: 1.6;
    pointer-events: none;
  }

  .pk-hero-stamp span:first-child {
    color: rgba(255, 255, 255, 0.75);
  }

  /* Staggered reveal on load — one orchestrated moment of delight. */
  @keyframes pk-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .pk-hero-eyebrow,
  .pk-hero-title,
  .pk-hero-lead,
  .pk-hero .btn-group,
  .pk-hero-stamp {
    animation: pk-fade-up 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .pk-hero-eyebrow    { animation-delay: 80ms; }
  .pk-hero-title      { animation-delay: 180ms; }
  .pk-hero-lead       { animation-delay: 320ms; }
  .pk-hero .btn-group { animation-delay: 460ms; }
  .pk-hero-stamp      { animation-delay: 800ms; animation-duration: 900ms; }

  @media (min-width: 720px) {
    .pk-hero {
      min-height: 600px;
      padding-block: var(--pk-space-9);
      background-position: 55% 60%;
    }

    .pk-hero::before {
      background: linear-gradient(
        100deg,
        rgba(20, 24, 28, 0.92) 0%,
        rgba(20, 24, 28, 0.78) 30%,
        rgba(20, 24, 28, 0.42) 65%,
        rgba(20, 24, 28, 0.12) 100%
      );
    }

    .pk-hero-inner {
      padding-inline: 32px;
    }

    .pk-hero-logo {
      max-width: 380px;
      margin-bottom: var(--pk-space-6);
    }

    .pk-hero-stamp {
      display: block;
    }
  }

  @media (min-width: 1024px) {
    .pk-hero {
      min-height: 680px;
      padding-block: var(--pk-space-10);
      background-position: center 60%;
    }

    .pk-hero-inner {
      padding-inline: 48px;
    }

    .pk-hero-logo {
      max-width: 440px;
    }

    .pk-hero-stamp {
      right: 48px;
      bottom: 32px;
    }
  }

  /* ----- Capabilities ----- */
  .pk-capabilities {
    background: var(--pk-white);
    border-top: 1px solid var(--pk-mist);
    border-bottom: 1px solid var(--pk-mist);
  }

  /* ----- Industries strip ----- */
  .pk-industries {
    background: var(--pk-paper);
  }

  .pk-industries-grid {
    display: grid;
    gap: var(--pk-space-3);
    grid-template-columns: 1fr;
    margin-top: var(--pk-space-5);
  }

  .pk-industry {
    background: var(--pk-white);
    border: 1px solid var(--pk-mist);
    border-radius: var(--pk-radius-md);
    padding: var(--pk-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--pk-space-3);
  }

  .pk-industry-icon {
    width: 32px;
    height: 32px;
    color: var(--pk-marine);
  }

  .pk-industry-name {
    font-size: var(--pk-text-h4);
    font-weight: 600;
    color: var(--pk-steel);
    margin: 0;
  }

  .pk-industry-detail {
    font-size: var(--pk-text-small);
    color: var(--pk-slate);
    margin: 0;
  }

  @media (min-width: 720px) {
    .pk-industries-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 1024px) {
    .pk-industries-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  /* ----- Numbers (proof strip) — marine budget spend ----- */
  .pk-numbers {
    background: var(--pk-marine);
    color: var(--pk-white);
  }

  .pk-numbers h2 {
    color: var(--pk-white);
  }

  .pk-numbers .pk-section-eyebrow {
    color: var(--pk-marine-soft);
  }

  .pk-numbers-grid {
    display: grid;
    gap: var(--pk-space-5);
    grid-template-columns: 1fr;
    margin-top: var(--pk-space-6);
  }

  .pk-number-block {
    padding: var(--pk-space-5) 0;
    border-top: 1px solid var(--pk-steel);
  }

  .pk-number-value {
    font-family: var(--pk-font-mono);
    font-size: clamp(32px, 3vw + 1rem, 44px);
    color: var(--pk-white);
    line-height: 1;
    margin-bottom: var(--pk-space-3);
    letter-spacing: -0.02em;
  }

  /* marine-soft, not stone: stone on the marine background is 2.5:1,
     below WCAG AA; marine-soft reaches 6.5:1. */
  .pk-number-unit {
    font-size: 0.6em;
    color: var(--pk-marine-soft);
  }

  .pk-number-label {
    font-size: var(--pk-text-small);
    color: var(--pk-marine-soft);
    line-height: 1.5;
    margin: 0;
  }

  @media (min-width: 720px) {
    .pk-numbers-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 1024px) {
    .pk-numbers-grid {
      grid-template-columns: repeat(4, 1fr);
      gap: var(--pk-space-6);
    }

    .pk-number-block {
      padding: 0;
      border-top: 0;
      border-left: 1px solid var(--pk-steel);
      padding-left: var(--pk-space-5);
    }

    .pk-number-block:first-child {
      border-left: 0;
      padding-left: 0;
    }
  }

  /* ----- Heritage teaser ----- */
  .pk-heritage {
    background: var(--pk-white);
  }

  .pk-heritage-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--pk-space-6);
    align-items: center;
  }

  .pk-heritage-figure {
    background: var(--pk-paper);
    border-radius: var(--pk-radius-lg);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
  }

  .pk-heritage-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .pk-heritage-figure figcaption {
    position: absolute;
    left: var(--pk-space-4);
    bottom: var(--pk-space-4);
    right: var(--pk-space-4);
    font-family: var(--pk-font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    background: linear-gradient(180deg, transparent, rgba(20, 24, 28, 0.6));
    padding: var(--pk-space-6) 0 0;
  }

  @media (min-width: 1024px) {
    .pk-heritage-inner {
      grid-template-columns: 1fr 1fr;
      gap: var(--pk-space-8);
    }
  }

  /* ----- CTA banner ----- */
  .pk-cta {
    background: var(--pk-marine);
    color: var(--pk-white);
  }

  .pk-cta-inner {
    text-align: left;
  }

  .pk-cta h2 {
    color: var(--pk-white);
    margin: 0 0 var(--pk-space-3);
  }

  .pk-cta p {
    color: var(--pk-marine-soft);
    margin: 0;
    max-width: 52ch;
    line-height: 1.5;
  }

  .pk-cta-actions {
    margin-top: var(--pk-space-5);
    flex-shrink: 0;
  }

  .pk-cta .btn-primary {
    background: var(--pk-white);
    color: var(--pk-marine);
    border-color: var(--pk-white);
  }

  .pk-cta .btn-primary:hover {
    background: var(--pk-marine-soft);
    color: var(--pk-marine);
  }

  .pk-cta .btn-secondary {
    background: transparent;
    color: var(--pk-white);
    border-color: var(--pk-white);
  }

  .pk-cta .btn-secondary:hover {
    background: var(--pk-white);
    color: var(--pk-marine);
  }

  @media (min-width: 720px) {
    .pk-cta-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: var(--pk-space-6);
    }

    .pk-cta-actions {
      margin-top: 0;
    }
  }

  /* Reduced motion: base.css kills all animation globally; the hero children
     animate with fill-mode 'both' from opacity 0, so they must be reset
     explicitly or reduced-motion users would get invisible content. */
  @media (prefers-reduced-motion: reduce) {
    .pk-hero-eyebrow,
    .pk-hero-title,
    .pk-hero-lead,
    .pk-hero .btn-group,
    .pk-hero-stamp {
      opacity: 1;
      transform: none;
    }
  }
}
