/* =========================================================
   LUCID CONSULTING GROUP — Design System
   Typography: Red Hat Display + Red Hat Text
   Palette: graphite + warm neutrals + terracotta accent
   ========================================================= */

:root {
  /* Color: monochrome — white, near-black, neutral greys (v2) */
  --ink:        #18181A;   /* primary text — near-black */
  --ink-2:      #34353A;   /* secondary text */
  --ink-3:      #6E7074;   /* tertiary / labels */
  --ink-4:      #9B9DA2;   /* muted / hint */
  --rule:       #E8E8EA;   /* light grey hairline */
  --rule-2:     #D7D8DB;   /* slightly stronger */
  --paper:      #FFFFFF;   /* pure white background */
  --paper-2:    #F3F3F5;   /* light grey panel */
  --paper-3:    #FAFAFB;   /* near-white panel */
  --white:      #FFFFFF;

  /* Accent — company-profile orange (v3: white + orange) */
  --accent:     #D9622B;   /* brand orange */
  --accent-2:   #E2894C;   /* lighter orange */
  --accent-soft: #F6E2D2;  /* soft peach */

  /* Type scale */
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-text:    "Red Hat Text", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Layout */
  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(44px, 7vw, 112px);

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ----------- Typography ----------- */
.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.h1 { font-size: clamp(32px, 4.6vw, 62px); font-weight: 500; letter-spacing: -0.022em; line-height: 1.05; font-family: var(--font-display); }
.h2 { font-size: clamp(30px, 3.6vw, 56px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; font-family: var(--font-display); }
.h3 { font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: -0.012em; line-height: 1.15; font-family: var(--font-display); }
.h4 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; font-family: var(--font-display); }

/* Balanced, hyphen-free wrapping for display headings — avoids orphans like "the / GCC." */
.h1, .h2, .h3, .h4, .h-display,
.disc-title, .cs-title, .matrix-label, .sector-row .ttl, .proj-types li,
.software-name, .dd-head-title, .team-name, .office-city, .sd-text .h2,
.disc-tagline, .lede {
  text-wrap: balance;
  hyphens: none;
  -webkit-hyphens: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lede {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.42;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

p { color: var(--ink-2); max-width: 64ch; }

/* ----------- Layout ----------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.shell-wide {
  max-width: 1640px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { padding: var(--section) 0; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* Typography: cleaner line breaking across EN/PL/AR — balanced headings,
   no orphan last lines in body/intro copy. Progressive enhancement. */
h1, h2, h3, .h1, .h2 { text-wrap: balance; }
p, .lede { text-wrap: pretty; }

/* ----------- Buttons ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  border-radius: 0;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper-3); }
.btn .arr {
  width: 14px; height: 1px; background: currentColor; position: relative;
  transition: width .25s var(--ease);
}
.btn .arr::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arr { width: 22px; }

/* ----------- Technical accents ----------- */
.tick {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.coord {
  position: relative;
}
.coord::before, .coord::after {
  content: "";
  position: absolute;
  width: 8px; height: 1px;
  background: var(--ink);
}
.coord::before { top: -1px; left: 0; }
.coord::after { top: -1px; left: 0; transform: rotate(90deg); transform-origin: left top; }

/* Numbered node */
.node-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* Hover line */
.hover-line {
  position: relative;
  display: inline-block;
}
.hover-line::after {
  content: "";
  position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.hover-line:hover::after { transform: scaleX(1); transform-origin: left; }

/* ----------- Nav ----------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
  padding: 0 var(--gutter);
  max-width: 1640px;
  margin: 0 auto;
}
.nav-logo {
  height: 18px;
  width: auto;
  filter: brightness(0);
  /* pure black logo on the white v2 bar */
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 24px;
  flex: 1;
}
.nav-link {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink);
  padding: 8px 0;
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link .chev {
  width: 6px; height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .5;
}
.nav-link:hover { color: var(--accent); }
.nav-right {
  display: flex; align-items: center; gap: 18px;
  margin-left: auto;
}
.lang-switch {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  display: flex; gap: 0; align-items: center;
  border: 1px solid var(--rule-2);
  padding: 4px;
}
.lang-switch button,
.lang-switch a {
  padding: 4px 8px;
  color: var(--ink-3);
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
}
.lang-switch button.active,
.lang-switch a.active {
  background: var(--ink);
  color: var(--paper-3);
}

/* Mega-menu / dropdown */
.dropdown {
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 24px 32px -28px rgba(31,34,38,.18);
  padding: 40px var(--gutter) 48px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 49;
}
.dropdown.open {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.dropdown-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1640px;
  margin: 0 auto;
  gap: 64px;
}
.dd-head-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--ink);
}
.dd-head-sub {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.7;
  color: var(--ink-3);
}
.dropdown-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}
.dd-item {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: padding .25s var(--ease);
}
.dd-item:hover { padding-left: 6px; color: var(--accent); }
.dd-item .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 4px;
}
.dd-item .ttl {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.dd-item .sub {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
}
.dd-item.dd-support { opacity: 0.82; }
.dd-item.dd-support .num { color: var(--ink-4); }

/* Cross-cutting link inside the Disciplines mega-menu */
.dd-integration {
  display: block;
  margin-top: 30px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  background: var(--paper);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.dd-integration:hover { border-color: var(--accent); background: var(--white); }
.dd-integration-ttl {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 16px;
  letter-spacing: -0.01em; color: var(--ink);
}
.dd-integration:hover .dd-integration-ttl { color: var(--accent); }
.dd-integration-sub {
  display: block; margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--ink-3);
}

/* ----------- Footer ----------- */
.footer {
  background: var(--paper-2);
  color: var(--ink-2);
  padding: 100px 0 40px;
  margin-top: 0;
  border-top: 1px solid var(--rule);
}
.footer h4 { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 18px; font-family: var(--font-text); }
.footer-logo {
  height: 30px;
  width: auto;
  margin-bottom: 20px;
  filter: brightness(0);
  /* black logo on the light v2 footer */
}
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--accent); }
.footer .grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
  gap: 48px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--rule);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 6px 0; font-size: 13px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ----------- Cards / shared ----------- */
.card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  padding: 28px;
  position: relative;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.card:hover { border-color: var(--ink-3); background: var(--white); }
.card .corner {
  position: absolute; top: 0; left: 0;
  width: 14px; height: 14px;
  border-top: 1px solid var(--ink); border-left: 1px solid var(--ink);
}
.card .corner.tr { left: auto; right: 0; border-left: 0; border-right: 1px solid var(--ink); }
.card .corner.bl { top: auto; bottom: 0; border-top: 0; border-bottom: 1px solid var(--ink); }
.card .corner.br { top: auto; bottom: 0; left: auto; right: 0; border-top: 0; border-left: 0; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }

/* Grid backdrop */
.grid-bg {
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ----------- Mobile navigation (burger + slide-in menu) ----------- */
.nav-burger { display: none; }
.mobile-menu { display: none; }

/* Mobile */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .footer .grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .dropdown-cols { grid-template-columns: 1fr 1fr; }
  .dropdown-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Hide bar CTAs on mobile — they live inside the menu instead */
  .nav-right .btn { display: none; }

  /* Burger toggle */
  .nav-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    margin-left: 4px;
    flex-shrink: 0;
  }
  .nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: transform .28s var(--ease), opacity .2s var(--ease);
  }
  .nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.is-open span:nth-child(2) { opacity: 0; }
  .nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Slide-in panel */
  .mobile-menu {
    display: block;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    transform: translateX(100%);
    transition: transform .3s var(--ease);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 48;
  }
  .mobile-menu.open { transform: translateX(0); }
  .mobile-menu-inner { padding: 12px var(--gutter) 56px; }
  .mm-block { border-bottom: 1px solid var(--rule); padding: 4px 0; }
  .mm-link {
    display: block;
    padding: 15px 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
  }
  .mm-sub { display: flex; flex-direction: column; padding: 0 0 14px; }
  .mm-sub-link {
    padding: 8px 0 8px 18px;
    margin-left: 2px;
    font-family: var(--font-text);
    font-size: 15px;
    color: var(--ink-3);
    border-left: 1px solid var(--rule);
  }
  .mm-link:hover, .mm-sub-link:hover { color: var(--accent); }
  .mm-sub-link:hover { border-left-color: var(--accent); }
  .mm-cta { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
  .mm-cta .btn { width: 100%; justify-content: space-between; }
}
