/* ============================================================
   Passive Edge — Global stylesheet
   Engineering-grade B2B · light theme · restrained
   ============================================================ */

/* --- Fonts (self-hosted IBM Plex) --- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/IBMPlexSans-var.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/IBMPlexMono-500.woff2") format("woff2");
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* --- Design tokens --- */
:root {
  /* Backgrounds */
  --bg-0: #ffffff;
  --bg-1: #fafaf9;       /* warm off-white section */
  --bg-2: #f4f4f1;       /* card surface */
  --bg-3: #0e1116;       /* dark inverse section (sparingly) */

  /* Ink */
  --ink-0: #0e1116;      /* primary text */
  --ink-1: #3a3f47;      /* secondary */
  --ink-2: #6b7280;      /* tertiary */
  --ink-3: #9ca3af;      /* quaternary */

  /* Rules / borders */
  --rule: #e5e5e2;
  --rule-strong: #d4d4d0;

  /* Brand & accents */
  --brand: #1689e0;          /* logo blue */
  --brand-deep: #0E62A6;     /* readable accent on light */
  --brand-soft: #e6f1fb;     /* tint background */
  --warn: #c2410c;           /* deep orange — warm / peak */
  --warn-soft: #fef0e8;
  --ok: #047857;
  --ok-soft: #ecfdf5;

  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Sizing */
  --container-max: 1280px;
  --pad-page-x: clamp(20px, 4vw, 56px);

  /* Radius scale — engineering-grade, restrained.
     Only two steps: tight for chips/buttons/badges, soft for card surfaces. */
  --r-chip: 2px;   /* tags, buttons, badges, tiny cells */
  --r-card: 6px;   /* cards, panels, media surfaces, visuals */
}

/* --- Typography --- */
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; font-weight: 500; color: var(--ink-0); }
p { margin: 0; }

.display {
  font-size: clamp(36px, 5.2vw, 68px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; }
.h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.h4 { font-size: 17px; font-weight: 500; }
.lead {
  font-size: clamp(16px, 1.25vw, 19px);
  color: var(--ink-1);
  line-height: 1.55;
  max-width: 62ch;
  font-weight: 400;
}
.body-sm { font-size: 14px; color: var(--ink-1); line-height: 1.6; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-2); }
.tiny { font-size: 12px; }

/* --- Layout primitives --- */
.container { max-width: var(--container-max); margin: 0 auto; padding-left: var(--pad-page-x); padding-right: var(--pad-page-x); }
.narrow { max-width: 920px; margin: 0 auto; padding-left: var(--pad-page-x); padding-right: var(--pad-page-x); }
.section { padding: clamp(72px, 9vw, 128px) 0; }
.section-compact { padding: clamp(56px, 7vw, 96px) 0; }
.section-light { background: var(--bg-0); }
.section-tint { background: var(--bg-1); }
.section-dark { background: var(--bg-3); color: #fff; }
.section-dark .eyebrow { color: rgba(255,255,255,0.6); }
.section-dark .lead { color: rgba(255,255,255,0.7); }
.section-dark .muted { color: rgba(255,255,255,0.55); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }

.header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  margin-bottom: clamp(48px, 6vw, 80px);
}
.header-row .h2 { margin-top: 14px; max-width: 18ch; }
@media (max-width: 820px) {
  .header-row { grid-template-columns: 1fr; gap: 18px; }
}

.rule-top { border-top: 1px solid var(--rule); padding-top: 24px; }
.rule-bottom { border-bottom: 1px solid var(--rule); padding-bottom: 24px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px var(--pad-page-x);
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-brand img { height: 30px; }
.nav-brand img.nav-logo-on-light { width: 92px; height: 32px; max-width: none; object-fit: contain; background: transparent; }
.nav-links { display: flex; gap: 28px; flex: 1; justify-content: center; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--ink-1); transition: color .15s;
  padding: 4px 0;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--brand-deep); }
.nav-links a.flagship::after {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-left: 8px; vertical-align: middle;
}

/* Step-down: tighten spacing so all eight links survive on laptops
   before the bar collapses to the hamburger. */
@media (max-width: 1200px) and (min-width: 1001px) {
  .nav-inner { gap: 22px; }
  .nav-links { gap: 19px; }
  .nav-links a { font-size: 13.5px; }
}
.nav-cta { display: inline-flex; align-items: center; gap: 8px; }
.nav-cta .btn { white-space: nowrap; }
.lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-1); border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 13px; transition: color .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.lang-switch:hover { color: var(--brand-deep); border-color: var(--brand-deep); }

/* Hamburger toggle — hidden on wide screens, shown when links collapse */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  background: transparent; border: 1px solid var(--rule);
  border-radius: var(--r-card); cursor: pointer;
  padding: 0; margin-left: 4px;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--ink-0); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
header.nav.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.nav.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
header.nav.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1000px) {
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    justify-content: flex-start; flex: none; gap: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 14px 30px -18px rgba(6, 8, 12, 0.32);
    padding: 8px var(--pad-page-x) 16px;
  }
  header.nav.menu-open .nav-links { display: flex; }
  .nav-links a {
    font-size: 15px;
    padding: 13px 0;
    border-bottom: 1px solid var(--rule);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.flagship::after { margin-left: 10px; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 520px) {
  .nav-inner { gap: 12px; }
  .nav-brand { min-width: 0; }
  .nav-brand img.nav-logo-on-light { width: 86px; height: 30px; }
  .nav-cta .btn { display: none; }
  .lang-switch { padding: 7px 11px; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink-0);
  background: var(--ink-0);
  color: #fff;
  border-radius: var(--r-chip);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-secondary { background: transparent; color: var(--ink-0); }
.btn-secondary:hover { background: var(--ink-0); color: #fff; border-color: var(--ink-0); }
.btn-ghost { background: transparent; color: var(--ink-0); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink-0); border-color: var(--ink-0); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--brand-deep);
}
.btn-link:hover { color: var(--ink-0); }
.btn-link .arrow { transition: transform .2s; }
.btn-link:hover .arrow { transform: translateX(3px); }

/* --- Tag / chip --- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-chip);
  padding: 4px 10px;
  white-space: nowrap;
}
.tag-brand { color: var(--brand-deep); background: var(--brand-soft); border-color: rgba(22,137,224,0.18); }
.tag-warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(194,65,12,0.16); }
.tag-flagship {
  background: var(--ink-0); color: #fff; border-color: var(--ink-0);
}

/* --- Card --- */
.card {
  background: var(--bg-0);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 28px;
  transition: border-color .2s, transform .2s;
  display: flex; flex-direction: column; gap: 14px;
}
.card:hover { border-color: var(--ink-0); }
.card .num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-2); letter-spacing: 0.16em;
}
.card h3 { font-weight: 500; }
.card p { color: var(--ink-1); font-size: 14.5px; line-height: 1.6; }
.card .card-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
}

.card-clean { background: transparent; border: 0; padding: 0; }
.card-tint { background: var(--bg-1); border-color: var(--rule); }

/* --- Visual placeholder swatches (for image slots) --- */
.ph {
  position: relative;
  background: var(--bg-2);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.ph::after {
  content: attr(data-label);
  position: absolute; left: 12px; top: 12px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  color: var(--ink-2);
  background: rgba(255,255,255,0.8);
  border: 1px dashed var(--rule-strong);
  padding: 4px 8px;
  text-transform: uppercase;
}
.ph-grid::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.ph-dots::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.10) 1px, transparent 0);
  background-size: 14px 14px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 70%);
}
.ph-thermal { background: radial-gradient(circle at 50% 50%, #fdd7c0 0%, #fef0e8 35%, #f4f4f1 70%); }
.ph-cool { background: radial-gradient(circle at 50% 50%, #d9ecf9 0%, #eaf3fb 35%, #f4f4f1 70%); }

/* --- Footer --- */
.footer {
  background: var(--bg-3);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 28px;
}
.footer .container { color: inherit; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  margin-bottom: 18px;
  font-weight: 500;
}
.footer a { color: rgba(255,255,255,0.7); font-size: 14px; transition: color .2s; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 56px;
}
.footer-brand img { height: 36px; margin-bottom: 18px; filter: brightness(0) invert(1); }
.footer-brand img.footer-logo-on-dark { height: 48px; filter: none; }
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 13px; line-height: 1.65; max-width: 36ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 26px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* --- Reveal --- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
