/* =========================================================================
   MENGI INC. — design system v2
   Navy + steel palette · matches the Mengi logo
   ========================================================================= */

:root {
  /* Brand — pulled from logo */
  --navy:      #1E4060;
  --navy-2:    #163350;
  --navy-3:    #2A5278;
  --steel:     #8B96A0;
  --steel-2:   #6E7984;

  /* Surfaces */
  --paper:     #F4F4F1;
  --paper-2:   #ECEBE6;
  --white:     #FFFFFF;

  /* Text */
  --ink:       #1A2530;
  --ink-2:     #2A3540;
  --mute:      #6B7480;
  --mute-2:    #A8B0B8;

  /* Lines */
  --rule:      #D8D9DC;
  --rule-2:    #E5E5E2;

  /* Layout */
  --max:        1280px;
  --gutter:     clamp(20px, 4vw, 48px);
  --radius:     2px;

  /* Type */
  --font-display: 'Funnel Display', 'Archivo Black', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Type system ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-2);
  font-weight: 500;
}
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6.5vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.h-1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.h-2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.h-3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}
.lede {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
}
.mono { font-family: var(--font-mono); }
.text-navy { color: var(--navy); }
.text-mute { color: var(--mute); }

/* ---------- Layout primitives ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding: clamp(64px, 9vw, 128px) 0; }
.section-tight { padding: clamp(48px, 6vw, 80px) 0; }
.rule { height: 1px; background: var(--rule); border: 0; }
.hairline { border-top: 1px solid var(--rule); }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
}
.topbar a { color: var(--paper); }
.topbar a:hover { color: var(--mute-2); }
.topbar .topbar-l { color: var(--mute-2); }

/* ---------- Header / nav ---------- */
.header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand img { height: 44px; width: auto; }
@media (min-width: 720px) {
  .brand img { height: 52px; }
}
.nav {
  display: none;
  gap: 36px;
  align-items: center;
}
@media (min-width: 720px) {
  .nav { display: flex; }
}
.nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
.nav a:hover { color: var(--navy); }
.nav a.is-active { color: var(--navy); }
.nav a.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--navy);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: var(--paper) !important;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background .15s ease;
}
.nav-cta:hover { background: var(--navy-2); }
.nav-cta::after { content: '→'; }
.nav-cta.is-active::after { display: none; }
.nav-cta.is-active { background: var(--navy-2); }

.menu-btn {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}
@media (min-width: 720px) { .menu-btn { display: none; } }
.menu-btn span { width: 22px; height: 2px; background: var(--ink); }

.mobile-nav {
  display: none;
  background: var(--navy);
  color: var(--paper);
  padding: 24px var(--gutter) 32px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block;
  padding: 14px 0;
  font-family: var(--font-display);
  font-size: 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--paper);
}
.mobile-nav a:last-child { border-bottom: 0; }

/* ---------- Hero ---------- */
.hero {
  background: var(--paper);
  padding: clamp(64px, 10vw, 128px) 0 clamp(56px, 9vw, 112px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(30,64,96,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30,64,96,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 60% at 80% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 80% 30%, black 30%, transparent 75%);
}
.hero .wrap { position: relative; }
.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; }
}
.hero-headline { max-width: 18ch; }
.hero-headline .navy-accent { color: var(--navy); }
.hero-lede {
  margin-top: 28px;
  color: var(--ink-2);
  max-width: 50ch;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.hero-mark {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-mark img {
  width: 100%;
  max-width: 420px;
  height: auto;
  filter: drop-shadow(0 8px 32px rgba(30,64,96,.15));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .15s ease;
  cursor: pointer;
}
.btn-primary { background: var(--navy); color: var(--paper); }
.btn-primary:hover { background: var(--navy-2); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--navy); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { color: var(--navy-2); }
.btn::after { content: '→'; transition: transform .15s ease; }
.btn:hover::after { transform: translateX(3px); }

/* ---------- Section header ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 64px);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.section-head .left { max-width: 60ch; }
.section-head .eyebrow { display: block; margin-bottom: 14px; }

/* ---------- Service cards (homepage teaser) ---------- */
.svc-grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (min-width: 720px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .svc-grid { grid-template-columns: repeat(4, 1fr); } }
.svc-tile {
  background: var(--paper);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  transition: background .15s ease;
}
.svc-tile:hover { background: var(--white); }
.svc-tile:hover .svc-arrow { color: var(--navy); transform: translateX(4px); }
.svc-tile .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--steel-2);
}
.svc-tile .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.15;
  margin: 16px 0 10px;
  color: var(--ink);
}
.svc-tile .desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}
.svc-arrow {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--steel);
  align-self: flex-end;
  margin-top: 28px;
  transition: transform .15s ease, color .15s ease;
}

/* ---------- Services list (services page, full) ---------- */
.svc-list { border-top: 1px solid var(--rule); }
.svc-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
@media (min-width: 720px) {
  .svc-row { grid-template-columns: 80px 1fr 2fr; gap: 32px; align-items: start; }
}
.svc-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--navy);
}
.svc-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.1;
  color: var(--ink);
}
.svc-desc { color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* ---------- Check-list ---------- */
.config-list { list-style: none; padding: 0; margin: 0; }
.config-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.config-list li::before {
  content: '✓';
  color: var(--navy);
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 13px;
}

/* ---------- About strip (dark) ---------- */
.about-strip {
  background: var(--navy);
  color: var(--paper);
  padding: clamp(64px, 9vw, 128px) 0;
  position: relative;
  overflow: hidden;
}
.about-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 80% at 90% 50%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 90% 50%, black 20%, transparent 75%);
}
.about-strip .wrap { position: relative; }
.about-strip .h-1 { color: var(--paper); }
.about-strip .h-2 { color: var(--paper); }
.about-strip .lede { color: var(--mute-2); }
.about-strip .eyebrow { color: var(--mute-2); }
.about-strip .stats {
  display: grid;
  gap: 1px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.1);
  margin-top: clamp(40px, 5vw, 64px);
}
@media (min-width: 720px) { .about-strip .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--navy);
  padding: 28px 24px;
}
.stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  color: var(--paper);
  letter-spacing: -0.01em;
}
.stat .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mute-2);
  margin-top: 12px;
}

/* ---------- Big CTA strip ---------- */
.cta-strip {
  background: var(--paper-2);
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cta-strip .wrap {
  display: grid;
  gap: 24px;
  align-items: center;
}
@media (min-width: 880px) {
  .cta-strip .wrap { grid-template-columns: 2fr 1fr; }
}
.cta-strip .h-1 { color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy);
  color: var(--paper);
  padding: 64px 0 28px;
}
.footer .footer-top {
  display: grid;
  gap: 40px;
  margin-bottom: 56px;
  align-items: start;
}
@media (min-width: 720px) { .footer .footer-top { grid-template-columns: 2fr 1fr 1fr; } }
.footer img { height: 56px; width: auto; filter: brightness(0) invert(1); }
.footer .brand-block p { color: var(--mute-2); max-width: 36ch; margin: 20px 0 0; font-size: 14px; line-height: 1.6; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mute-2);
  font-weight: 500;
  margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--paper); }
.footer a:hover { color: var(--mute-2); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mute-2);
  text-transform: uppercase;
}

/* ---------- Page header (interior pages) ---------- */
.page-head {
  background: var(--paper);
  padding: clamp(56px, 7vw, 96px) 0 clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--rule);
}
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel-2);
  margin-bottom: 28px;
}
.breadcrumb a { color: var(--steel-2); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb .sep { margin: 0 10px; color: var(--mute-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--steel-2);
}
.field input, .field textarea, .field select {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-body);
  border-radius: var(--radius);
  transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--navy);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: clamp(28px, 4vw, 48px);
}

/* ---------- Generic content ---------- */
.prose {
  max-width: 65ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
}
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  margin: 2em 0 0.6em;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.prose strong { color: var(--ink); font-weight: 600; }

.two-col { display: grid; gap: clamp(32px, 5vw, 64px); }
@media (min-width: 880px) { .two-col { grid-template-columns: 1fr 1fr; } }

.contact-block {
  border-left: 2px solid var(--navy);
  padding: 8px 0 8px 20px;
  margin-bottom: 28px;
}
.contact-block h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--steel-2);
  font-weight: 500;
}
.contact-block .val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}
.contact-block .val a { color: var(--ink); border-bottom: 1px solid var(--rule); }
.contact-block .val a:hover { color: var(--navy); border-color: var(--navy); }
.contact-block .sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel-2);
  margin-top: 6px;
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fadeUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .fade-up-2 { animation-delay: 0.1s; }
  .fade-up-3 { animation-delay: 0.2s; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
