/* Stickybit — design tokens and rules from DESIGN.md. Brand wins colours/fonts, reference wins layout/feel. */

/* ---------- Fonts (self-hosted, D-003) ---------- */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../assets/fonts/poppins-v24-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/poppins-v24-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/poppins-v24-latin-600.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --color-blue: #002d9c;
  --color-red: #ee0000;
  --color-red-hover: #c40000;
  --color-white: #ffffff;
  --color-ink: #101a3d;
  --color-ink-soft: #525d80;
  --color-ink-faint: #8b93ad;
  --color-mist: #f2f5fb;
  --color-blue-soft: #8fa4dd;

  --font-sans: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --text-body: 18px;
  --text-nav-label: 14px;

  --spacing-6: 6px; --spacing-12: 12px; --spacing-18: 18px; --spacing-24: 24px;
  --spacing-30: 30px; --spacing-36: 36px; --spacing-60: 60px; --spacing-96: 96px;
  --spacing-120: 120px;

  --page-max-width: 1280px;
  --radius: 24px;
  --radius-full: 9999px;

  --section-gap: clamp(60px, 9vw, 120px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--color-blue); color: var(--color-white); }

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

p { margin: 0 0 var(--spacing-24); max-width: 62ch; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--color-ink); }

.wrap {
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: clamp(20px, 4.5vw, 56px);
}

/* ---------- Type scale (scale over weight, D-005) ---------- */
h1, h2, h3 { font-weight: 400; color: var(--color-blue); margin: 0 0 var(--spacing-24); }

.t-display {
  font-size: clamp(42px, 7vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.t-lg {
  font-size: clamp(38px, 5.5vw, 78px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.t-h {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.t-sm {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}
.t-sub {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.t-2xs {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.t-label {
  font-size: var(--text-nav-label);
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  line-height: 1.2;
}

.lede { font-size: clamp(18px, 1.8vw, 21px); }
.muted { color: var(--color-ink-soft); }

/* ---------- Buttons (the red pill, D-004) ---------- */
.btn {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: var(--text-nav-label);
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  line-height: 1;
  padding: 17px 30px;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.25s ease, transform 0.15s ease;
}
@media (max-width: 640px) {
  .btn { white-space: normal; text-align: center; line-height: 1.4; padding-block: 13px; }
}
.btn:hover { background: var(--color-red-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--color-blue); outline-offset: 3px; }
.band-blue .btn:focus-visible { outline-color: var(--color-white); }

.link-arrow {
  font-size: var(--text-nav-label);
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--color-blue);
}

/* ---------- Navigation ---------- */
.nav {
  background: var(--color-white);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-24);
  min-height: 76px;
  padding-block: var(--spacing-12);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-12);
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo img.mark { height: 40px; width: auto; }
.nav-logo img.word { height: 20px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: var(--text-nav-label);
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--color-ink); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--color-ink); }
.nav-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--spacing-6);
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-blue);
  margin: 6px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-24) clamp(20px, 4.5vw, 56px) var(--spacing-36);
    gap: var(--spacing-24);
    z-index: 40;
  }
  .nav { position: relative; }
  .nav.open .nav-links { display: flex; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .nav-cta { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-gap); }
.section-tight { padding-block: calc(var(--section-gap) * 0.6); }

/* Immersive blue band (D-002) */
.band-blue {
  background: var(--color-blue);
  color: var(--color-white);
}
.band-blue h1, .band-blue h2, .band-blue h3 { color: var(--color-white); }
.band-blue p { color: var(--color-blue-soft); }
.band-blue p strong { color: var(--color-white); }
.band-blue a { color: var(--color-white); }
.band-blue .lede { color: var(--color-blue-soft); }

/* ---------- Hero ---------- */
.hero-blue {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 7vw, 96px) clamp(72px, 9vw, 130px);
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}
/* Blue scrim keeps white hero text readable over the moving clouds (flat tint, not a gradient). */
.hero-blue::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 45, 156, 0.52); /* --color-blue at 52% */
  pointer-events: none;
}
.hero-blue .wrap { position: relative; z-index: 1; }
.hero-blue h1 {
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  max-width: 1060px;
  margin-bottom: clamp(30px, 4vw, 48px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(36px, 5vw, 90px);
  align-items: center;
}
.hero-copy .btn { margin-top: var(--spacing-12); }
.hero-copy p { margin-bottom: var(--spacing-36); }
.hero-motif { min-width: 0; }
.hero-motif svg { width: 100%; max-width: 460px; height: auto; margin-inline: auto; }

.hero-page {
  padding-block: clamp(48px, 6vw, 96px) clamp(36px, 5vw, 72px);
}
.hero-page .hero-grid { align-items: center; }
.hero-page h1 {
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: var(--spacing-30);
}
.hero-page .btn { margin-top: var(--spacing-12); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-motif { max-width: 420px; }
}

/* ---------- Two-column zigzag ---------- */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 5vw, 96px);
  align-items: start;
}
.cols.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 860px) {
  .cols, .cols.flip { grid-template-columns: 1fr; }
  .cols .order-first { order: -1; }
}

/* ---------- Value list (bold-lead items) ---------- */
.value-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(30px, 4vw, 48px);
}
.value-list li { max-width: 56ch; }
.value-list strong { display: block; font-size: 24px; font-weight: 400; color: var(--color-blue); letter-spacing: -0.02em; line-height: 1.25; margin-bottom: var(--spacing-6); }

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(36px, 4.5vw, 72px) clamp(36px, 5vw, 96px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.value-grid li { max-width: 46ch; }
.value-grid strong { display: block; font-size: 24px; font-weight: 400; color: var(--color-blue); letter-spacing: -0.02em; line-height: 1.25; margin-bottom: var(--spacing-6); }
@media (max-width: 720px) {
  .value-grid { grid-template-columns: 1fr; }
}

/* ---------- Service index (left-aligned rows) ---------- */
.svc-list { display: grid; gap: clamp(48px, 6vw, 84px); }
.svc { max-width: 720px; }
.svc h3 { margin-bottom: var(--spacing-12); }
.svc p { margin-bottom: var(--spacing-18); }

/* ---------- Topic blocks (stacked, full width) ---------- */
.topics { display: grid; gap: clamp(48px, 6vw, 84px); }
.topic { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 72px); align-items: start; }
.topic:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.topic:nth-child(even) .topic-head { order: 2; }
.topic:nth-child(even) .topic-body { order: 1; }
.topic h2, .topic h3 { margin-bottom: 0; }
@media (max-width: 860px) {
  .topic, .topic:nth-child(even) { grid-template-columns: 1fr; }
  .topic:nth-child(even) .topic-head { order: 1; }
  .topic:nth-child(even) .topic-body { order: 2; }
}

/* ---------- Statement section ---------- */
.statement { max-width: 900px; }
.statement h2 { margin-bottom: var(--spacing-30); }

/* ---------- Closing CTA band ---------- */
.closing { text-align: left; }
.closing h2 { max-width: 20ch; }
.closing p { margin-bottom: var(--spacing-36); }

/* ---------- Footer ---------- */
.footer { padding-block: clamp(48px, 6vw, 84px) var(--spacing-36); }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(36px, 5vw, 96px);
  align-items: start;
  padding-bottom: clamp(36px, 5vw, 60px);
}
.footer-brand { font-size: 24px; font-weight: 400; letter-spacing: -0.02em; color: var(--color-white); max-width: 30ch; }
.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-12) var(--spacing-36);
}
.footer-nav a {
  font-size: var(--text-nav-label);
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--color-blue-soft);
}
.footer-nav a:hover { color: var(--color-white); text-decoration: none; }
.footer-meta { padding-top: var(--spacing-30); }
.footer-meta p { font-size: 15px; color: var(--color-blue-soft); max-width: none; margin-bottom: var(--spacing-6); }
.footer-meta a { color: var(--color-white); }
@media (max-width: 720px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- Contact form (Mist surfaces only) ---------- */
.form-grid { display: grid; gap: var(--spacing-24); max-width: 560px; }
.field { display: grid; gap: 8px; }
.field label {
  font-size: var(--text-nav-label);
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}
.field input, .field textarea {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 300;
  color: var(--color-ink);
  background: var(--color-mist);
  border: 0;
  border-radius: var(--radius);
  padding: 16px 22px;
  width: 100%;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--color-ink-faint); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}
.form-note { font-size: 15px; color: var(--color-ink-soft); }

/* Honeypot: moved off-screen, not display:none (some bots skip hidden fields) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error { font-size: 15px; font-weight: 600; color: var(--color-ink); max-width: 48ch; }
.form-error a { color: var(--color-blue); }
.form-confirm { display: none; }
.form-confirm.visible { display: block; }
.form-confirm p { font-size: 24px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.35; color: var(--color-blue); max-width: 30ch; }

/* ---------- Offices ---------- */
.offices { display: grid; gap: clamp(36px, 4vw, 56px); }
.office h3 { margin-bottom: var(--spacing-12); }
.office p { color: var(--color-ink-soft); margin-bottom: 0; }
.office a { color: var(--color-ink); }

/* ---------- Globe (About page, GCC section) ---------- */
.globe-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  min-width: 0;
}
.globe-wrap canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: grab;
  contain: layout paint size;
}

/* ---------- Ink-reveal motif (D-018) ---------- */
.hero-motif { position: relative; }
.hero-motif .ink-canvas {
  position: absolute;
  pointer-events: none; /* geometry set from the SVG's box in ink-reveal.js */
}
.hero-motif.ink-live svg { opacity: 0; } /* SVG keeps the layout box; canvas paints it */

/* ---------- Motif line-work (D-008) ---------- */
.motif-stroke {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

@media (prefers-reduced-motion: no-preference) {
  .motif-draw .motif-stroke {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: draw 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .motif-draw .motif-stroke:nth-child(2) { animation-delay: 0.25s; }
  .motif-draw .motif-stroke:nth-child(3) { animation-delay: 0.5s; }
  .motif-draw .motif-dot { opacity: 0; animation: dot-in 0.6s ease forwards; }
  .motif-draw .motif-dot:nth-of-type(1) { animation-delay: 1.6s; }
  .motif-draw .motif-dot:nth-of-type(2) { animation-delay: 1.75s; }
  .motif-draw .motif-dot:nth-of-type(3) { animation-delay: 1.9s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot-in { to { opacity: 1; } }

/* ---------- Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal.in { opacity: 1; transform: none; }
  .reveal-2 { transition-delay: 0.08s; }
  .reveal-3 { transition-delay: 0.16s; }
}

/* ---------- Utilities ---------- */
.mb-0 { margin-bottom: 0; }
.mt-36 { margin-top: var(--spacing-36); }
.max-52 { max-width: 52ch; }
