/*
 * PIYAVE Labs — site chrome and section layouts
 * Navbar and footer per section 13; the landing-page section grammar per
 * section 14; the responsive tier table per section 26.
 */

/* ==== Navbar ==============================================================
 * h72 desktop / h64 mobile, white ground, 1px bottom border, 1200 container.
 * Secondary lockup at 32px on the left. Sticky: gains shadow-md after 24px of
 * scroll. Active item carries a 2px blue underline. Nav items never move. */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--duration-base) var(--ease-standard);
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: var(--nav-height-mobile);
}
@media (min-width: 640px) { .site-header__inner { height: var(--nav-height); } }

/* Clear space around the lockup is X, the height of the blue bar. Nothing
 * enters it — the flex gap guarantees it. */
.site-brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.site-brand img { height: 28px; width: auto; }
@media (min-width: 640px) { .site-brand img { height: 32px; } }

.site-nav { display: none; }
@media (min-width: 1024px) {
  .site-nav { display: block; margin-right: auto; }
  .site-nav ul { display: flex; align-items: center; gap: var(--space-6); }
  .site-nav a {
    display: inline-block;
    padding-block: var(--space-2);
    font-size: 0.9375rem;
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition-colors);
  }
  .site-nav a:hover { color: var(--text); }
  .site-nav .current-menu-item > a,
  .site-nav .current-menu-ancestor > a,
  .site-nav .current_page_item > a,
  .site-nav .current_page_ancestor > a {
    color: var(--text);
    border-bottom-color: var(--accent);
  }
}

.site-header__actions { display: none; margin-left: auto; }
@media (min-width: 1024px) {
  .site-header__actions { display: flex; align-items: center; gap: var(--space-4); }
}

/* Mobile: hamburger → full-height sheet, items at 20px, 240ms slide. */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px; /* 44px hit area on touch */
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] .icon-open { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }

.mobile-nav {
  position: fixed;
  inset: var(--nav-height-mobile) 0 0;
  z-index: var(--z-drawer);
  background: var(--bg);
  padding: var(--space-6) var(--space-5) var(--space-12);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  /* Visibility is stepped, not eased, and its change is delayed until the fade
   * has finished — so the sheet stays reachable while it animates out. On the
   * way in the delay is removed (below) so visibility flips immediately:
   * an element that is still `visibility: hidden` cannot take focus, and the
   * script moves focus into the sheet in the same tick as the class change. */
  transition:
    transform var(--duration-slow) var(--ease-decelerate),
    opacity var(--duration-slow) var(--ease-decelerate),
    visibility 0s linear var(--duration-slow);
}
.mobile-nav.is-open {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition:
    transform var(--duration-slow) var(--ease-decelerate),
    opacity var(--duration-slow) var(--ease-decelerate),
    visibility 0s linear 0s;
}
@media (min-width: 1024px) { .mobile-nav { display: none; } }

.mobile-nav ul { display: grid; }
.mobile-nav li { border-bottom: 1px solid var(--border); }
.mobile-nav a {
  display: block;
  padding: var(--space-4) 0;
  font-size: 1.25rem; /* 20 */
  font-weight: var(--weight-medium);
  color: var(--text);
  text-decoration: none;
}
.mobile-nav a:hover { color: var(--accent); }
.mobile-nav .current-menu-item > a { color: var(--accent); }
.mobile-nav__actions { display: grid; gap: var(--space-3); margin-top: var(--space-8); }

body.nav-open { overflow: hidden; }

/* ==== Hero ================================================================
 * Left-aligned, never centred. Mono overline → Display-2XL headline →
 * Body-LG sub-line → primary + secondary action → thin trust strip.
 * Pad-y 80/112/128. 2-col 7/5 from laptop up, visual right. */

.hero { padding-block: var(--space-20); position: relative; overflow: hidden; }
@media (min-width: 640px) { .hero { padding-block: 112px; } }
@media (min-width: 1024px) { .hero { padding-block: var(--space-32); } }

.hero__grid { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: 6fr 6fr; gap: var(--space-16); }
}
@media (min-width: 1440px) {
  .hero__grid { grid-template-columns: 7fr 5fr; }
}

.hero__title { margin-block: var(--space-5) 0; }
.hero__sub {
  margin-top: var(--space-6);
  max-width: 34ch;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}
.hero__actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
@media (min-width: 640px) {
  .hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }
}

/* Trust strip — thin, beneath the hero actions. */
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero__visual { position: relative; }
.hero__visual img, .hero__visual svg {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-none);
}

/* ==== Grids =============================================================== */

.grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .grid { gap: var(--space-6); } }

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px) {
  .grid--2, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  /* 3-up, never 4 — measure over density. */
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ==== Feature rows ========================================================
 * Alternating 2-column rows (text / square visual), 96px between rows, the
 * visual side alternating left-right. Stacked below laptop, visual always
 * after the text. Maximum four rows. */

.feature-rows { display: grid; gap: var(--space-16); }
@media (min-width: 1024px) { .feature-rows { gap: var(--space-24); } }

.feature-row { display: grid; gap: var(--space-8); align-items: center; }
@media (min-width: 1024px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: var(--space-16); }
  .feature-row:nth-child(even) .feature-row__text { order: 2; }
}
.feature-row__title { margin-block: var(--space-3) var(--space-4); }
.feature-row__text p {
  max-width: 60ch;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}
.feature-row__text .tick-list { margin-top: var(--space-6); }
.feature-row__visual img, .feature-row__visual svg {
  width: 100%;
  border: 1px solid var(--border);
}

/* ==== Stats band ==========================================================
 * Full-bleed Navy. Four figures, mono labels beneath, separated by 1px
 * rgba(255,255,255,.12) vertical rules. 2×2 on mobile, 4-up from tablet. */

.stats-band { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stats-band { grid-template-columns: repeat(4, 1fr); } }

.stats-band .stat {
  padding: var(--space-6) var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.stats-band .stat:nth-child(odd) { padding-left: 0; }
@media (min-width: 640px) {
  .stats-band .stat { border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.12); }
  .stats-band .stat:first-child { border-left: 0; padding-left: 0; }
  .stats-band .stat:nth-child(odd) { padding-left: var(--space-6); }
  .stats-band .stat:first-child { padding-left: 0; }
}
.section--navy .stat__figure { color: #fff; }
.section--navy .stat__label { color: var(--neutral-400); }
/* One figure may be Electric Blue — and only one. */
.section--navy .stat--accent .stat__figure { color: var(--blue-400); }

/* ==== Trust strip (client wordmarks) ======================================
 * 4–6 wordmarks in Neutral-400 monochrome at equal optical height, 1px rules
 * above and below. Never coloured, never a scrolling marquee. */

.trust {
  padding-block: var(--space-10);
  border-block: 1px solid var(--border);
}
.trust__label {
  display: block;
  margin-bottom: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.trust__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-10);
}
.trust__list img {
  height: 24px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.7;
}

/* ==== Timeline / numbered steps ==========================================
 * Vertical on mobile, horizontal on desktop: a 1px spine with 8px navy nodes,
 * the current node Electric Blue. Maximum six nodes. */

.steps { display: grid; gap: var(--space-8); counter-reset: step; }
@media (min-width: 768px) { .steps--4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); } }
@media (min-width: 768px) { .steps--3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); } }

.step { position: relative; padding-top: var(--space-6); border-top: 1px solid var(--border); }
.step__num {
  display: block;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
}
.step__title { margin-bottom: var(--space-2); }
.step p { font-size: var(--text-sm); line-height: 1.55; color: var(--text-secondary); }

/* ==== Testimonials ========================================================
 * Two or three side by side, static. No quotation-mark graphics, no star
 * ratings, no carousel. */

.quote__text {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text);
}
.quote__by { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.quote__avatar { width: 32px; height: 32px; border-radius: var(--radius-full); flex: none; }
.quote__name { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.quote__org {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ==== CTA band ============================================================
 * Full-bleed Navy before the footer, 128px pad-y, centred: H2 in white,
 * one line in Neutral-300, one primary + one inverse-ghost secondary.
 * Nothing else in the band. */

.cta-band { padding-block: var(--space-20); text-align: center; }
@media (min-width: 1024px) { .cta-band { padding-block: var(--space-32); } }
.cta-band h2 { color: #fff; max-width: 20ch; margin-inline: auto; }
.cta-band p {
  margin: var(--space-5) auto 0;
  max-width: 52ch;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--neutral-300);
}
.cta-band__actions {
  display: grid;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-10);
}
@media (min-width: 640px) { .cta-band__actions { display: flex; gap: var(--space-4); } }

/* ==== Footer ==============================================================
 * Navy-950 ground, 96px top / 64px bottom padding. Four columns. Links 15px
 * Neutral-300 → white on hover. Bottom bar separated by a 1px rule. */

.site-footer {
  padding-top: var(--space-24);
  padding-bottom: var(--space-16);
  background: var(--neutral-950);
  color: var(--neutral-300);
}
.site-footer__grid { display: grid; gap: var(--space-10); }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-8); }
}

.site-footer__brand img { height: 30px; width: auto; margin-bottom: var(--space-5); }
.site-footer__brand p {
  max-width: 34ch;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--neutral-400);
}
.site-footer h2 {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  /* Neutral-400, not Neutral-500. Section 27: on a Navy ground the lightest
   * permitted content value is Neutral-400 (5.6:1); Neutral-500 is a light-
   * theme tertiary and measures 3.96:1 here, below the 4.5:1 AA floor. */
  color: var(--neutral-400);
}
.site-footer ul { display: grid; gap: var(--space-3); }
.site-footer a {
  font-size: 0.9375rem;
  color: var(--neutral-300);
  text-decoration: none;
  transition: color var(--duration-instant) var(--ease-standard);
}
.site-footer a:hover { color: #fff; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--neutral-400);
}
.site-footer__bottom ul { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.site-footer__bottom a { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--neutral-400); }
.site-footer__bottom a:hover { color: #fff; }

/* ==== Page header (interior pages) ======================================== */

.page-header { padding-block: var(--space-16) var(--space-12); }
@media (min-width: 1024px) { .page-header { padding-block: var(--space-24) var(--space-16); } }
.page-header .breadcrumb { margin-bottom: var(--space-6); }
.page-header h1 { margin-top: var(--space-4); max-width: 20ch; }
.page-header__lead {
  margin-top: var(--space-6);
  max-width: 60ch;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ==== Prose (legal, blog body) ===========================================
 * Body 18px, measure 68ch, headings H3/H4 only. */

.prose { max-width: 68ch; font-size: var(--text-lg); line-height: var(--leading-relaxed); }
.prose > * + * { margin-top: var(--space-6); }
.prose h2 { margin-top: var(--space-12); font-size: var(--text-xl); }
.prose h3 { margin-top: var(--space-10); font-size: var(--text-lg); font-family: var(--font-body); }
.prose ul, .prose ol { padding-left: var(--space-6); display: grid; gap: var(--space-2); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--text-tertiary); }
.prose blockquote {
  padding-left: var(--space-6);
  border-left: 2px solid var(--accent);
  color: var(--text-secondary);
}
.prose code {
  padding: 2px var(--space-1);
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.prose pre {
  padding: var(--space-4);
  background: var(--neutral-950);
  color: var(--neutral-200);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}
.prose pre code { background: none; padding: 0; }
.prose img { margin-block: var(--space-8); }

/* ==== Post list ==========================================================
 * A list, not a card grid — this is writing, not merchandise. */

.post-list { display: grid; }
.post-list__item { padding-block: var(--space-8); border-top: 1px solid var(--border); }
.post-list__item:last-child { border-bottom: 1px solid var(--border); }
.post-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.post-list__title { margin-bottom: var(--space-3); }
.post-list__title a { color: var(--text); text-decoration: none; }
.post-list__title a:hover { color: var(--accent); }
.post-list__excerpt { max-width: 68ch; color: var(--text-secondary); line-height: var(--leading-relaxed); }

/* ==== Contact layout ======================================================
 * Two columns: form (max 560px) left, direct routes right. */

.contact-grid { display: grid; gap: var(--space-12); }
@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: 7fr 5fr; gap: var(--space-16); align-items: start; }
}
.contact-routes { display: grid; gap: var(--space-8); }
.contact-route__label {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.contact-route p, .contact-route a { font-size: 0.9375rem; line-height: 1.6; }

/* ==== 404 ================================================================= */

.error-page { padding-block: var(--space-24); text-align: left; }
.error-page__code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
}
.error-page h1 { margin-block: var(--space-4) var(--space-5); }
.error-page p { max-width: 52ch; font-size: var(--text-lg); color: var(--text-secondary); }
.error-page__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-8); }
.error-page__links { margin-top: var(--space-16); padding-top: var(--space-8); border-top: 1px solid var(--border); }

/* ==== Diagram panels =====================================================
 * Schematics stand in where no photograph exists. They are always square-
 * cornered and framed with a hairline, never rounded. */

.panel-diagram { margin: 0; }
.panel-diagram svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-none);
}
.panel-diagram figcaption { margin-top: var(--space-3); }

.diagram {
  width: 100%;
  height: auto;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
