/* =====================================================
   iQuelo Software Solutions — Design System
   Engineering-editorial aesthetic
   ===================================================== */

:root {
  /* Brand palette — derived from the iQuelo logo */
  --iq-royal:        #1e3a8a;   /* Quelo blue */
  --iq-royal-deep:   #15276a;
  --iq-royal-bright: #2956d2;
  --iq-red:          #dc2626;   /* "i" red dot */
  --iq-red-deep:     #991b1b;

  /* Surfaces */
  --ink-0:  #07091a;            /* deepest */
  --ink-1:  #0a0e1f;
  --ink-2:  #0f152b;
  --ink-3:  #131a35;
  --ink-4:  #1a2247;
  --line:   #232c52;
  --line-2: #2c3868;

  /* Text */
  --text:        #e8eaf3;
  --text-muted:  #98a0c4;
  --text-dim:    #6c759a;

  /* Accents */
  --gold:   #d4b483;
  --paper:  #f4f1ea;

  /* Type */
  --f-display: 'Fraunces', serif;
  --f-body:    'Inter Tight', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-body);
  background: var(--ink-1);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Utility ---------- */

.wrap        { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .wrap { padding: 0 40px; } }

.mono        { font-family: var(--f-mono); }
.display     { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.025em; line-height: 0.96; font-variation-settings: "opsz" 144; }
.display em  { font-style: italic; color: var(--gold); font-weight: 300; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--iq-royal-bright);
}

.eyebrow.red { color: var(--iq-red); }

/* Section index — like editorial blueprint */
.idx {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--iq-royal-bright);
}

/* Blueprint grid background */
.blueprint-grid {
  background-image:
    linear-gradient(rgba(41,86,210,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41,86,210,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* Subtle noise overlay */
.noise { position: relative; }
.noise::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.6 0 0 0 0 0.7 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .35;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
.noise > * { position: relative; z-index: 2; }

/* Image frames with editorial gradient */
.img-frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.img-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,9,26,0) 40%, rgba(7,9,26,0.85) 100%);
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(41, 86, 210, 0.4);
  background: rgba(41, 86, 210, 0.08);
  color: #6f8eff;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 2px;
}
.badge.red {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.08);
  color: #ff7373;
}
.badge.gold {
  border-color: rgba(212, 180, 131, 0.4);
  background: rgba(212, 180, 131, 0.06);
  color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 2px;
  transition: all .25s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--iq-royal-bright);
  color: white;
}
.btn-primary:hover { background: white; color: var(--ink-1); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--iq-royal-bright); color: white; }
.btn-red {
  background: var(--iq-red);
  color: white;
}
.btn-red:hover { background: white; color: var(--iq-red-deep); }

/* Numbers */
.num {
  font-family: var(--f-display);
  font-weight: 300;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 144;
}

/* Vertical text rail */
.vert {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.3em;
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Animations ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise   { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.d-100  { animation-delay: .1s; }
.d-200  { animation-delay: .2s; }
.d-300  { animation-delay: .3s; }
.d-400  { animation-delay: .4s; }
.d-500  { animation-delay: .5s; }
.d-600  { animation-delay: .6s; }
.d-700  { animation-delay: .7s; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track {
  animation: marquee 50s linear infinite;
  width: max-content;
  display: flex;
  gap: 64px;
  align-items: center;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 0; }
  25%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}
.scroll-dot { animation: scrollDot 2s ease-in-out infinite; }

/* ---------- Header / Nav ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(7, 9, 26, 0.92);
  border-bottom: 1px solid rgba(41, 86, 210, 0.22);
  box-shadow: 0 1px 32px rgba(0,0,0,0.45);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 1024px) { .nav-inner { padding: 0 40px; } }

.brand-mark {
  display: flex; align-items: center; gap: 12px;
  color: white;
  text-decoration: none;
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
  /* White pill so the actual brand colors (red i, blue Quelo) are visible on dark nav */
  background: rgba(255, 255, 255, 0.96);
  border-radius: 4px;
  padding: 4px 10px;
  transition: opacity .2s ease, box-shadow .2s ease;
}
.brand-logo:hover {
  opacity: 0.92;
  box-shadow: 0 0 0 2px rgba(41, 86, 210, 0.4);
}
.brand-mark .iq-tag {
  display: none;
  border-left: 1px solid var(--line-2);
  padding-left: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (min-width: 768px) { .brand-mark .iq-tag { display: inline-block; } }

.nav-main {
  display: none; gap: 36px;
  font-size: 14px; color: var(--text-muted);
}
@media (min-width: 1024px) { .nav-main { display: flex; align-items: center; } }

.nav-cta {
  display: none;
  font-size: 11px !important;
  padding: 10px 18px !important;
  letter-spacing: 0.14em !important;
}
@media (min-width: 1024px) { .nav-cta { display: inline-flex; } }

/* Language switcher */
.lang-switcher {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}
@media (min-width: 1024px) { .lang-switcher { display: flex; } }
.iq-lang-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 7px;
  border-radius: 2px;
  line-height: 1;
  transition: color .2s, background .2s;
}
.iq-lang-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.iq-lang-btn.active { color: var(--iq-royal-bright); }
.lang-sep { color: var(--line-2); font-size: 10px; line-height: 1; user-select: none; }

/* Mobile lang switcher (inside mobile menu) */
.mobile-lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-lang-switcher .iq-lang-btn {
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
}
.mobile-lang-switcher .iq-lang-btn.active {
  border-color: var(--iq-royal-bright);
  color: var(--iq-royal-bright);
}

.nav-link {
  position: relative;
  transition: color .25s ease;
  padding: 4px 0;
}
.nav-link:hover, .nav-link.active { color: white; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  height: 1px; width: 0;
  background: var(--iq-royal-bright);
  transition: width .35s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Mobile menu button */
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: 1px solid var(--line-2);
  padding: 10px 14px;
  border-radius: 2px;
  cursor: pointer;
}
@media (min-width: 1024px) { .menu-btn { display: none; } }

.mobile-menu {
  display: none;
  position: fixed; top: 72px; left: 0; right: 0;
  background: var(--ink-1);
  border-bottom: 1px solid var(--line);
  padding: 20px 24px;
  flex-direction: column; gap: 16px;
  z-index: 49;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
}

/* ---------- Sections ---------- */

.section { padding: 100px 0; position: relative; }
@media (min-width: 1024px) { .section { padding: 140px 0; } }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 64px;
}
@media (min-width: 1024px) {
  .section-head {
    grid-template-columns: 200px 1fr;
    gap: 48px;
  }
}
.section-head h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
}

/* ---------- Cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(26, 34, 71, 0.4) 0%, rgba(15, 21, 43, 0.6) 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  position: relative;
  transition: border-color .3s ease, transform .5s cubic-bezier(.2,.7,.2,1);
}
.card:hover {
  border-color: rgba(41, 86, 210, 0.5);
  transform: translateY(-3px);
}
.card .arrow {
  display: inline-block;
  transition: transform .35s ease;
}
.card:hover .arrow { transform: translate(4px, -4px); }

.card-img {
  width: 100%; height: 200px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 24px;
  filter: grayscale(0.3) contrast(1.1);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink-0);
  border-top: 1px solid var(--line);
  padding: 80px 0 32px;
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 64px;
}
@media (min-width: 768px)  { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-col h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--iq-royal-bright);
  margin: 0 0 20px 0;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (min-width: 768px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- Misc helpers ---------- */

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.bracket-left::before {
  content: "[";
  margin-right: 6px;
  color: var(--iq-royal-bright);
  font-family: var(--f-mono);
}
.bracket-right::after {
  content: "]";
  margin-left: 6px;
  color: var(--iq-royal-bright);
  font-family: var(--f-mono);
}

/* Subtle red accent dot — homage to the logo's red "i" */
.red-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--iq-red);
  vertical-align: middle;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.6);
}

/* ---------- Hazard / Engineering accent ---------- */

/* Engineering hazard stripe — diagonal yellow/dark tape used as accent */
.hazard-stripe {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    #d4b483 0px,
    #d4b483 10px,
    rgba(7,9,26,0.85) 10px,
    rgba(7,9,26,0.85) 20px
  );
  opacity: 0.55;
  border-radius: 1px;
}

/* Thicker accent version */
.hazard-stripe-lg {
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    #d4b483 0px,
    #d4b483 12px,
    #1a2247 12px,
    #1a2247 24px
  );
  opacity: 0.45;
}

/* Status tag — used next to live products */
.status-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #22c55e;
}
.status-live::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Compliance badge strip */
.compliance-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.compliance-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid rgba(35, 44, 82, 0.8);
  padding: 5px 10px;
  border-radius: 2px;
  background: rgba(15, 21, 43, 0.5);
}

/* CTA banner — US-market "schedule a call" style */
.cta-banner {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.3) 0%, rgba(41, 86, 210, 0.12) 50%, rgba(15, 21, 43, 0.6) 100%);
  border: 1px solid rgba(41, 86, 210, 0.4);
  border-radius: 4px;
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--iq-royal-bright), var(--iq-red), var(--iq-royal-bright));
}

/* Social links */
.social-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color .25s ease;
  padding: 8px 0;
}
.social-link:hover { color: var(--text); }
.social-link svg { flex-shrink: 0; }

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

/* ---------- Footer brand logo ---------- */
.footer-col .brand-logo {
  height: 26px;
  padding: 3px 8px;
  border-radius: 3px;
  opacity: 0.88;
}

/* ---------- Scrolled header state ---------- */
.site-header.scrolled {
  background: rgba(7, 9, 26, 0.97);
  box-shadow: 0 2px 40px rgba(0,0,0,0.6);
}

/* ================================================================
   RESPONSIVE SYSTEM
   Breakpoints (max-width): 479 · 639 · 767 · 1023
   Breakpoints (min-width): 1400
   ================================================================ */

/* ── Universal safety ── */
img, canvas, iframe, video, svg { max-width: 100%; }

/* ───────────────────────────────────────────────
   ≤ 1023px  tablet + all mobile
─────────────────────────────────────────────── */
@media (max-width: 1023px) {
  /* Section vertical rhythm */
  .section { padding: 80px 0; }

  /* Section heading: force single column */
  .section-head { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* Hero sections (class="noise" without class="section") */
  section.noise:not(.section) { padding: 130px 0 60px !important; }

  /* CTA banner */
  .cta-banner { padding: 40px 28px !important; }

  /* Card with very large inline padding */
  .card[style*="padding: 60px"] { padding: 36px 28px !important; }
}

/* ───────────────────────────────────────────────
   ≤ 767px  mobile (landscape + portrait)
─────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Base layout */
  .section { padding: 64px 0; }
  .wrap { padding: 0 16px; }

  /* Hero */
  section.noise:not(.section) { padding: 110px 0 52px !important; }

  /* Scale ALL .num elements fluidly */
  .num { font-size: clamp(28px, 8vw, 50px) !important; line-height: 1 !important; }

  /* Hero CTA row: less bottom margin */
  [style*="margin-bottom: 80px"] { margin-bottom: 40px !important; }

  /* Button rows: stack full-width below 640px */
  [style*="display:flex; flex-wrap:wrap; gap: 14px"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  [style*="display:flex; flex-wrap:wrap; gap: 14px"] .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Cards: reduce padding */
  .card                           { padding: 24px 18px; }
  .card[style*="padding: 60px"]   { padding: 28px 20px !important; }
  .card[style*="padding: 40px"]   { padding: 22px 18px !important; }
  .card[style*="padding: 28px"]   { padding: 20px 16px !important; }

  /* Timeline label-column: shrink from fixed 80px to auto */
  .card [style*="grid-template-columns: 80px 1fr"] {
    grid-template-columns: auto 1fr !important;
    gap: 16px !important;
  }

  /* Approach/Capabilities 2-col card body: collapse */
  .card[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Section-level 2-col grids: collapse */
  [data-rise][style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Practice grid image: reduce fixed height */
  .practice-grid .img-frame,
  [style*="height: 480px"] { height: 240px !important; }

  /* Section head h2 */
  .section-head h2 { font-size: clamp(28px, 6vw, 56px) !important; }

  /* CTA banner */
  .cta-banner { padding: 32px 20px !important; }

  /* Footer */
  .footer-grid { gap: 28px; }

  /* Contact */
  #iq-map { height: 220px !important; }
  #contact-form-section .card { padding: 28px 20px !important; }

  /* Prevent nav CTA from breaking layout on narrow screens */
  .nav-cta { padding: 8px 14px !important; font-size: 10px !important; }
}

/* ───────────────────────────────────────────────
   ≤ 639px  small mobile (narrow landscape)
─────────────────────────────────────────────── */
@media (max-width: 639px) {
  /* Compliance strip: tighter tags */
  .compliance-tag { font-size: 10px !important; padding: 4px 8px !important; }
  .compliance-strip { gap: 6px; }

  /* Metrics 2-col gap: tighter */
  [style*="grid-template-columns: repeat(2, 1fr)"] { gap: 18px 10px !important; }

  /* Cards: reduce internal num spacing */
  .card .num { margin-bottom: 14px !important; }

  /* Hide hero image at this size too (it's 52% wide, text would be too narrow) */
  #hero-img-decor { display: none !important; }
}

/* ───────────────────────────────────────────────
   ≤ 479px  small phones (iPhone SE, 320–479px)
─────────────────────────────────────────────── */
@media (max-width: 479px) {
  .wrap { padding: 0 12px; }
  .section { padding: 52px 0; }

  /* Hero: maximum space efficiency */
  section.noise:not(.section) { padding: 94px 0 40px !important; }

  /* Num: smallest floor */
  .num { font-size: clamp(26px, 9vw, 38px) !important; }

  /* Brand tag: too wide for tiny nav */
  .brand-mark .iq-tag { display: none !important; }

  /* Logo: slightly smaller */
  .brand-logo { height: 28px !important; }

  /* Section head h2 */
  .section-head h2 { font-size: clamp(24px, 8vw, 40px) !important; }

  /* Footer bottom text */
  .footer-bottom { font-size: 9px; letter-spacing: 0.09em; }

  /* Contact map */
  #iq-map { height: 180px !important; }
}

/* ───────────────────────────────────────────────
   ≥ 1400px  large / ultrawide monitors
─────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .wrap { padding: 0 56px; }
  .section { padding: 160px 0; }
}
