/* ============================================================
   Portivra — shared stylesheet
   Design tokens
   ============================================================ */
:root {
  /* Color */
  --navy-900: #0C2B4A;
  --navy-700: #0C447C;
  --blue-600: #185FA5;
  --blue-500: #378ADD;
  --blue-200: #B5D4F4;
  --blue-100: #E6F1FB;
  --blue-50: #F6FAFE;
  --ink: #0F1E2E;
  --slate: #52667A;
  --slate-light: #7C8CA0;
  --line: #DEE7F1;
  --white: #FFFFFF;

  /* Type */
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout */
  --max-w: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-900);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.3rem; font-weight: 700; }
p { color: var(--slate); }
p.lede { font-size: 1.2rem; color: var(--slate); max-width: 46ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-600);
  font-weight: 500;
  margin-bottom: 14px;
}
.eyebrow .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eyebrow .bars span { width: 3px; background: var(--blue-500); border-radius: 1px; display: block; }
.eyebrow .bars span:nth-child(1) { height: 40%; background: var(--blue-200); }
.eyebrow .bars span:nth-child(2) { height: 68%; background: var(--blue-600); }
.eyebrow .bars span:nth-child(3) { height: 100%; background: var(--navy-900); }

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Ascending divider — signature device under section headings */
.stair {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  margin-bottom: 18px;
}
.stair span { width: 22px; background: var(--line); border-radius: 2px 2px 0 0; }
.stair span:nth-child(1) { height: 40%; background: var(--blue-200); }
.stair span:nth-child(2) { height: 70%; background: var(--blue-500); }
.stair span:nth-child(3) { height: 100%; background: var(--navy-900); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--navy-900); color: var(--white); }
.btn-primary:hover { background: var(--navy-700); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(12,43,74,0.25); }
.btn-secondary { background: transparent; color: var(--navy-900); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--navy-900); transform: translateY(-1px); }
.btn-light { background: var(--white); color: var(--navy-900); }
.btn-light:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  max-width: var(--max-w); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
.brand .mark span { width: 6px; border-radius: 2px; display: block; }
.brand .mark span:nth-child(1) { height: 45%; background: var(--navy-700); }
.brand .mark span:nth-child(2) { height: 72%; background: var(--blue-600); }
.brand .mark span:nth-child(3) { height: 100%; background: var(--blue-500); }
.brand .word { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--navy-900); }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--slate); transition: color 0.15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--navy-900); }
.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--navy-900); border-radius: 2px; }

@media (max-width: 860px) {
  .nav-links { position: fixed; top: 68px; left: 0; right: 0; background: var(--white); flex-direction: column; align-items: flex-start; padding: 24px 32px; gap: 20px; border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform 0.25s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .nav-cta .btn-secondary { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 96px 0 100px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
}
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero p.lede { margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* Ascending bars visual for hero */
.hero-bars {
  display: flex; align-items: flex-end; justify-content: center; gap: 14px;
  height: 320px;
}
.hero-bars .bar {
  width: 46px; border-radius: 10px 10px 0 0;
  animation: rise 0.9s cubic-bezier(.2,.7,.3,1) both;
}
.hero-bars .bar:nth-child(1) { height: 38%; background: var(--blue-200); animation-delay: 0.05s; }
.hero-bars .bar:nth-child(2) { height: 62%; background: var(--blue-500); animation-delay: 0.18s; }
.hero-bars .bar:nth-child(3) { height: 84%; background: var(--blue-600); animation-delay: 0.31s; }
.hero-bars .bar:nth-child(4) { height: 100%; background: var(--navy-900); animation-delay: 0.44s; }
@keyframes rise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.hero-bars .bar { transform-origin: bottom; }

/* ============================================================
   Cards / grids
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(12,43,74,0.08); border-color: var(--blue-200); }
.card .icon { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-100); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.95rem; }

/* Product spotlight card (home page) */
.product-card {
  border-radius: 20px;
  padding: 40px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 320px;
}
.product-card.ppm { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); }
.product-card.construct { background: linear-gradient(135deg, var(--blue-600), var(--navy-900)); }
.product-card .tag { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue-200); margin-bottom: 14px; }
.product-card h3 { color: var(--white); font-size: 1.7rem; margin-bottom: 12px; }
.product-card p { color: rgba(255,255,255,0.78); margin-bottom: 24px; }
.product-card .btn-light { align-self: flex-start; }

/* Stat row */
.stats { display: flex; gap: 56px; flex-wrap: wrap; }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; color: var(--navy-900); }
.stat .label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--slate-light); text-transform: uppercase; letter-spacing: 0.05em; }

/* Section paddings */
.section { padding: 88px 0; }
.section.tint { background: var(--blue-50); }
.section.dark { background: var(--navy-900); color: var(--white); }
.section.dark h2, .section.dark h3 { color: var(--white); }
.section.dark p { color: rgba(255,255,255,0.72); }

/* Feature list with staircase markers */
.feature-list { display: flex; flex-direction: column; gap: 22px; }
.feature-item { display: flex; gap: 18px; align-items: flex-start; }
.feature-item .stepbar { flex: none; width: 6px; border-radius: 3px; margin-top: 4px; }
.feature-item h4 { font-family: var(--font-display); font-size: 1.05rem; color: var(--navy-900); margin-bottom: 4px; }
.feature-item p { font-size: 0.95rem; margin: 0; }

/* Blueprint texture (Construct page) */
.blueprint-bg {
  background-color: var(--navy-900);
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ============================================================
   Forms
   ============================================================ */
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy-900); margin-bottom: 8px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink); background: var(--white);
  transition: border-color 0.15s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(55,138,221,0.15);
}
.form-field textarea { resize: vertical; min-height: 120px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,0.7); padding: 64px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-top .brand .word { color: var(--white); }
.footer-top p { color: rgba(255,255,255,0.55); font-size: 0.92rem; margin-top: 14px; max-width: 32ch; }
.footer-col h4 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; font-family: var(--font-mono); font-weight: 500; }
.footer-col a, .footer-col span { display: block; font-size: 0.92rem; color: rgba(255,255,255,0.65); margin-bottom: 10px; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; color: rgba(255,255,255,0.45); }

@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue-500); outline-offset: 2px;
}

/* Page hero variants */
.page-hero { padding: 72px 0 64px; }
.page-hero.tint { background: var(--blue-50); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.78rem; color: var(--blue-600); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
