/* ===========================================================
   RedFlag Technologies — shared theme
   Carbon Design System language · black / white / red
   IBM Plex Sans + IBM Plex Mono · sharp corners · 2x grid
   =========================================================== */

:root {
  /* --- brand interactive color (replaces Carbon's blue 60) --- */
  --rf-red: #eb0a22;
  --rf-red-hover: #ff2436;
  --rf-red-active: #b80019;

  /* --- Carbon-style gray ramp, anchored to true black --- */
  --ui-00: #000000;          /* page background */
  --ui-01: #0c0c0c;          /* layer 01 */
  --ui-02: #161616;          /* layer 02 / tiles (Carbon gray-100) */
  --ui-03: #262626;          /* layer 03 / fields (Carbon gray-90) */
  --ui-hover: #1f1f1f;        /* layer hover */
  --ui-field: #262626;
  --ui-border-subtle: #262626;
  --ui-border-strong: #393939;
  --ui-border-input: #525252;

  /* --- text tokens --- */
  --tx-primary: #ffffff;
  --tx-secondary: #c6c6c6;
  --tx-helper: #8d8d8d;
  --tx-disabled: #525252;

  /* --- Carbon spacing scale --- */
  --sp-03: 8px;  --sp-04: 12px; --sp-05: 16px; --sp-06: 24px;
  --sp-07: 32px; --sp-08: 40px; --sp-09: 48px; --sp-10: 64px;

  --rf-nav-h: 56px;

  /* --- legacy aliases: keep existing inline styles resolving --- */
  --rf-black: #000000;
  --rf-ink: #0c0c0c;
  --rf-panel: #161616;
  --rf-pill: #161616;
  --rf-line: #262626;
  --rf-line-strong: #393939;
  --rf-text: #ffffff;
  --rf-muted: #c6c6c6;
  --rf-faint: #8d8d8d;
  --rf-red-deep: #b80019;
  --rf-red-bright: #ff2436;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  background: var(--ui-00);
  color: var(--tx-primary);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--rf-red); color: #fff; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--rf-red);
  outline-offset: 1px;
}

/* ---- type ---- */
/* hero keeps its own inline sizing; .hero-title left intact */
.hero-title { letter-spacing: -0.03em; line-height: 0.95; }

/* Carbon expressive display — light weight, tight tracking */
.display {
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.0;
  text-transform: lowercase;
}

/* Carbon label / eyebrow — mono, uppercase, square marker */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 500;
  color: var(--tx-helper);
}
.eyebrow .dot {
  font-size: 0;
  width: 9px;
  height: 9px;
  background: var(--rf-red);
  display: inline-block;
}

.lower { text-transform: lowercase; }

/* ---- divider motifs ---- */
/* base .diag stays diagonal — used only by the (preserved) hero stats */
.diag {
  display: inline-block;
  height: 1px;
  width: 96px;
  background: var(--rf-line-strong);
  transform: rotate(-20deg);
}
.diag.up { transform: rotate(20deg); }
/* the red accent is orthogonal everywhere else — a Carbon tick */
.diag.red {
  background: var(--rf-red);
  height: 3px;
  width: 40px;
  transform: none;
}

/* ---- buttons (Carbon) — rectangular, label left, icon right ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  min-height: 48px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  border-radius: 0;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  text-transform: lowercase;
  white-space: nowrap;
}
.btn > span { margin-left: auto; transition: transform .15s ease; }
.btn:hover > span { transform: translateX(3px); }
.btn:focus-visible { outline: 2px solid var(--rf-red); outline-offset: -4px; }

.btn-white { background: #fff; color: #000; }
.btn-white:hover { background: #e0e0e0; }
.btn-red { background: var(--rf-red); color: #fff; }
.btn-red:hover { background: var(--rf-red-hover); }
.btn-ghost { background: transparent; color: #fff; border-color: var(--ui-border-strong); }
.btn-ghost:hover { border-color: #fff; background: var(--ui-hover); }

/* ---- nav (Carbon UI Shell header) ---- */
.site-nav {
  position: fixed;
  z-index: 50;
  top: 0; left: 0; right: 0;
  height: var(--rf-nav-h);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 0 0 16px;
  border-bottom: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
.site-nav.scrolled {
  background: var(--ui-02);
  border-bottom-color: var(--ui-border-strong);
}
.nav-logo { display: flex; align-items: center; padding-right: 32px; }
.nav-logo img { height: 22px; width: auto; display: block; }

.nav-center {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-right: auto;
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: var(--tx-secondary);
  padding: 0 16px;
  border-radius: 0;
  transition: color .15s ease, background-color .15s ease;
  text-transform: lowercase;
}
.nav-link:hover { color: #fff; background: var(--ui-hover); }
.nav-link.active { color: #fff; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--rf-red);
}

.btn-nav-cta {
  align-self: stretch;
  height: var(--rf-nav-h);
  border-radius: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff2436 0%, #b80019 42%, #160203 100%);
  background-size: 160% 160%;
  background-position: 0% 0%;
  transition: background-position .35s ease;
}
.btn-nav-cta:hover { background: linear-gradient(135deg, #ff2436 0%, #b80019 42%, #160203 100%); background-size: 160% 160%; background-position: 100% 100%; }

.nav-mobile-toggle {
  display: none;
  align-self: center;
  background: transparent;
  border: none;
  color: #fff;
  width: 48px; height: 48px;
  border-radius: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-mobile-toggle span,
.nav-mobile-toggle span::before,
.nav-mobile-toggle span::after {
  content: "";
  display: block;
  width: 18px; height: 2px;
  background: #fff;
  position: relative;
}
.nav-mobile-toggle span::before { position: absolute; top: -6px; }
.nav-mobile-toggle span::after { position: absolute; top: 6px; }

/* mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0,0,0,0.97);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 0 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.nav-drawer.open { opacity: 1; pointer-events: auto; }
.nav-drawer a {
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  padding: 10px 0;
  color: rgba(255,255,255,0.85);
}
.nav-drawer a:hover { color: var(--rf-red); }

@media (max-width: 860px) {
  .nav-center, .site-nav .btn-nav-cta { display: none; }
  .nav-mobile-toggle { display: inline-flex; margin-left: auto; margin-right: 8px; }
}

/* ---- layout helpers ---- */
.wrap { max-width: 1312px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 64px); }
.section { padding: clamp(72px, 10vw, 144px) 0; position: relative; }
.section-tight { padding: clamp(56px, 8vw, 104px) 0; }

.page-head { padding-top: calc(var(--rf-nav-h) + clamp(48px, 7vw, 96px)); }

/* ---- footer ---- */
.site-footer {
  background: var(--ui-01);
  border-top: 1px solid var(--ui-border-strong);
  padding: clamp(56px, 7vw, 90px) 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}
.footer-cta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: clamp(48px, 6vw, 80px);
  margin-bottom: clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--ui-border-strong);
}
.footer-col h4 {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-helper);
  margin: 0 0 18px;
  font-weight: 500;
}
.footer-col a, .footer-col p { display: block; color: var(--tx-secondary); font-size: 15px; margin: 0 0 11px; line-height: 1.5; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--ui-border-subtle);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--tx-helper);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

/* ---- reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.settled { opacity: 1 !important; transform: none !important; transition: none !important; }
.reveal.d1 { transition-delay: .07s; }
.reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; }
.reveal.d4 { transition-delay: .28s; }
.reveal.d5 { transition-delay: .35s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- media placeholder (striped) ---- */
.ph {
  position: relative;
  background-color: #0d0d0d;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.045) 0 14px,
    rgba(255,255,255,0) 14px 28px
  );
  border: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.34);
  text-transform: lowercase;
  padding: 0 12px;
  text-align: center;
}

/* ---- stat / counter (Carbon expressive — light) ---- */
.stat-num {
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  font-size: clamp(44px, 6vw, 76px);
}
.stat-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--tx-helper);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ---- tags / chips (Carbon tag) ---- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-size: 12px;
  color: var(--tx-secondary);
  background: var(--ui-03);
  border: 1px solid transparent;
  border-radius: 0;
  padding: 4px 12px;
  text-transform: lowercase;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.chip:hover, .chip.on { color: #fff; }
.chip:hover { background: #333333; }
.chip.on { background: var(--rf-red); border-color: var(--rf-red); color: #fff; }

/* ---- tile / card (Carbon tile — flat, sharp) ---- */
.card {
  background: var(--ui-02);
  border: 1px solid var(--ui-border-subtle);
  border-radius: 0;
  transition: background-color .15s ease, border-color .15s ease;
}
.card:hover { background: var(--ui-03); border-color: var(--ui-border-strong); }

/* ---- mobile polish ---- */
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-cta { align-items: flex-start; }
  .footer-cta .btn { width: 100%; justify-content: space-between; }
  .btn { gap: 24px; }
}
