/* ==========================================================================
   AIB Solutions — Design system
   Tokens: Ink Navy #0A1628, Deep Blue #0F2A52, Electric Blue #1E5FFF,
   Cyan Signal #4FD8E8, Paper White #FFFFFF, Cool Gray #F4F6F9,
   Slate #43506B. Display: Space Grotesk. Body: Inter.
   ========================================================================== */

:root {
  --ink: #0a1628;
  --deep-blue: #0f2a52;
  --electric: #1e5fff;
  --cyan: #4fd8e8;
  --white: #ffffff;
  --cool-gray: #f4f6f9;
  --line-gray: #e2e7ee;
  --slate: #43506b;
  --slate-dim: #7c879c;

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius: 3px;
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; max-width: 62ch; color: var(--slate); }
a { color: inherit; text-decoration: none; }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--electric);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn-primary { background: var(--electric); color: var(--white); }
.btn-primary:hover { background: #164ad1; }
.btn-outline { border-color: rgba(255,255,255,0.35); color: var(--white); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }
.btn-outline-dark { border-color: var(--line-gray); color: var(--ink); }
.btn-outline-dark:hover { border-color: var(--ink); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--ink);
  color: var(--white);
  position: relative;
  z-index: 100;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 40px; width: auto; }
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand-text span { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.62rem; color: var(--slate-dim); letter-spacing: 0.04em; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav ul { list-style: none; display: flex; gap: 30px; margin: 0; padding: 0; }
.main-nav a {
  font-size: 0.94rem;
  color: rgba(255,255,255,0.82);
  position: relative;
  padding: 4px 0;
}
.main-nav a:hover, .main-nav a.active { color: var(--white); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--cyan);
}

.lang-switch { display: flex; gap: 2px; border: 1px solid rgba(255,255,255,0.25); border-radius: var(--radius); overflow: hidden; }
.lang-switch a { padding: 6px 10px; font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.6); }
.lang-switch a.active { background: var(--white); color: var(--ink); }

.nav-cta { display: flex; align-items: center; gap: 18px; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.mobile-nav { display: none; }

@media (max-width: 900px) {
  .main-nav ul, .nav-cta .btn { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--deep-blue);
    padding: 8px var(--gutter) 24px;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
  }
  .mobile-nav .btn { margin-top: 16px; width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--ink) 0%, var(--deep-blue) 100%);
  color: var(--white);
  padding: 88px 0 96px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-kicker {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 18px;
  letter-spacing: 0.03em;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.4rem);
  color: var(--white);
  max-width: 13ch;
}
.hero .subhead {
  color: rgba(255,255,255,0.78);
  font-size: 1.12rem;
  max-width: 46ch;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

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

/* ---------- Flow diagram (signature element) ---------- */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  position: relative;
  padding: 26px 18px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-align: center;
  position: relative;
}
.flow-node .dot {
  width: 11px; height: 11px;
  background: var(--cyan);
  border-radius: 2px;
  transform: rotate(45deg);
}
.flow-node span { font-size: 0.74rem; color: rgba(255,255,255,0.72); font-weight: 500; }
.flow-line { flex: 0 0 auto; width: 100%; height: 1px; background: linear-gradient(90deg, rgba(79,216,232,0.1), rgba(79,216,232,0.55)); position: absolute; top: 5px; left: 50%; z-index: -1; }
.flow-diagram .flow-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 5px; left: 55%; right: -45%;
  height: 1px;
  background: rgba(79,216,232,0.35);
}
.flow-diagram.light .flow-node span { color: var(--slate); }
.flow-diagram.light { border-color: var(--line-gray); background: var(--cool-gray); }
.flow-diagram.light .flow-node .dot { background: var(--electric); }
.flow-diagram.light .flow-node:not(:last-child)::after { background: rgba(30,95,255,0.25); }

@media (max-width: 640px) {
  .flow-diagram { flex-direction: column; gap: 22px; padding: 24px; }
  .flow-diagram .flow-node:not(:last-child)::after { display: none; }
}

/* ---------- Section rhythm ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-dark { background: var(--ink); color: var(--white); }
.section-alt { background: var(--cool-gray); }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-dark .section-head p, .section-dark p { color: rgba(255,255,255,0.72); }

/* ---------- Systems / case study cards ---------- */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-gray);
  border: 1px solid var(--line-gray);
}
.system-card {
  background: var(--white);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: background-color 0.2s var(--ease);
  overflow: hidden;
}
.system-card .card-body { padding: 26px 32px 32px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.card-media { aspect-ratio: 16/10; overflow: hidden; background: var(--deep-blue); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media svg { width: 100%; height: 100%; display: block; }
.system-card:hover { background: var(--cool-gray); }
.system-card .industry { font-size: 0.76rem; color: var(--slate-dim); font-weight: 600; }
.system-card h3 { font-size: 1.4rem; }
.system-card p { font-size: 0.94rem; margin-bottom: 6px; }
.system-card .mini-flow { display: flex; gap: 6px; margin: 6px 0 4px; }
.system-card .mini-flow span { width: 18px; height: 3px; background: var(--line-gray); border-radius: 2px; }
.system-card:hover .mini-flow span { background: var(--electric); }
.system-card .card-link { margin-top: auto; font-size: 0.88rem; font-weight: 600; color: var(--electric); }

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

/* ---------- Category icon grid (dark, matches reference strip) ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  overflow: hidden;
}
.cat-cell {
  padding: 30px 26px;
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.cat-cell:nth-child(3n) { border-right: none; }
.cat-cell:nth-child(n+4) { border-bottom: none; }
.cat-cell .cat-icon { margin-bottom: 16px; }
.cat-cell .cat-icon svg { display: block; }
.cat-cell h3 { color: var(--white); font-size: 1.02rem; margin-bottom: 8px; }
.cat-cell p { color: rgba(255,255,255,0.62); font-size: 0.87rem; margin: 0; }
@media (max-width: 860px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-cell:nth-child(3n) { border-right: 1px solid rgba(255,255,255,0.1); }
  .cat-cell:nth-child(2n) { border-right: none; }
  .cat-cell:nth-child(n+4) { border-bottom: 1px solid rgba(255,255,255,0.1); }
  .cat-cell:nth-child(n+5) { border-bottom: none; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr; }
  .cat-cell { border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
  .cat-cell:last-child { border-bottom: none !important; }
}

/* ---------- Editorial rows (Business Solutions categories) ---------- */
.category-list { border-top: 1px solid var(--line-gray); }
.category-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line-gray);
  align-items: start;
}
.category-row .cat-icon { margin-bottom: 14px; }
.category-row .cat-icon svg { display: block; }
.category-row h3 { font-size: 1.15rem; margin-bottom: 0; }
.category-row p { margin: 0; font-size: 0.96rem; }
@media (max-width: 700px) {
  .category-row { grid-template-columns: 1fr; gap: 8px; }
  .category-row .cat-icon { margin-bottom: 10px; }
}

/* ---------- Process steps ---------- */
.process-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}
.process-step { border-top: 2px solid var(--electric); padding-top: 18px; }
.process-step .num { font-family: var(--font-display); font-size: 0.85rem; color: var(--electric); font-weight: 600; }
.process-step h3 { font-size: 1.02rem; margin: 8px 0 8px; }
.process-step p { font-size: 0.88rem; margin: 0; }
@media (max-width: 900px) {
  .process-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .process-list { grid-template-columns: 1fr; }
}

/* ---------- Products ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.product-card {
  border: 1px solid var(--line-gray);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-card h3 { font-size: 1.1rem; }
.product-card p { font-size: 0.9rem; margin-bottom: 4px; }
.product-card .card-link { font-size: 0.85rem; font-weight: 600; color: var(--electric); margin-top: auto; }
@media (max-width: 860px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ---------- Final CTA ---------- */
.final-cta {
  background: var(--ink);
  color: var(--white);
  padding: 88px 0;
  text-align: left;
}
.final-cta h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); max-width: 16ch; }
.final-cta .cta-row { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }

/* ---------- Case study pages ---------- */
.case-hero {
  background: var(--deep-blue);
  color: var(--white);
  padding: 72px 0 64px;
}
.case-hero-media { width: 100%; aspect-ratio: 21/9; overflow: hidden; background: var(--deep-blue); }
.case-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-hero-media svg { width: 100%; height: 100%; display: block; }
.case-hero .breadcrumb { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-bottom: 18px; }
.case-hero .breadcrumb a { color: rgba(255,255,255,0.8); }
.case-hero .industry-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
  border: 1px solid rgba(79,216,232,0.4);
  padding: 5px 12px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.case-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); max-width: 18ch; }
.case-hero p.lede { color: rgba(255,255,255,0.8); font-size: 1.06rem; max-width: 56ch; }

.case-section { padding: 64px 0; border-bottom: 1px solid var(--line-gray); }
.case-section:last-of-type { border-bottom: none; }
.case-section .label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--electric);
  margin-bottom: 10px;
}
.case-section h2 { font-size: 1.7rem; max-width: 20ch; }
.case-section .body-copy { max-width: 640px; }

.module-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-gray); border: 1px solid var(--line-gray); margin-top: 24px; }
.module-item { background: var(--white); padding: 22px 24px; font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.module-item .idx { font-family: var(--font-display); color: var(--electric); font-size: 0.85rem; }
@media (max-width: 640px) { .module-list { grid-template-columns: 1fr; } }

.case-cta { background: var(--cool-gray); }

.share-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.share-row span.lbl { font-size: 0.8rem; color: var(--slate-dim); }
.share-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-gray);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--slate);
  background: var(--white);
  cursor: pointer;
}
.share-btn:hover { border-color: var(--electric); color: var(--electric); }

/* ---------- About ---------- */
.about-hero { padding: 88px 0 40px; }
.about-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); max-width: 16ch; }
.about-approach { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 40px 0; border-top: 1px solid var(--line-gray); }
@media (max-width: 700px) { .about-approach { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 0.85fr; gap: 64px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 7px; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-gray);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--white);
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .form-row-2 { grid-template-columns: 1fr; } }
.form-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.form-msg { padding: 14px 16px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 20px; display: none; }
.form-msg.success { display: block; background: #e8f7ee; color: #146c3f; border: 1px solid #b7e5c8; }
.form-msg.error { display: block; background: #fdeceb; color: #a3271c; border: 1px solid #f3c3bd; }

.contact-info { border-left: 1px solid var(--line-gray); padding-left: 40px; }
@media (max-width: 900px) { .contact-info { border-left: none; padding-left: 0; padding-top: 24px; border-top: 1px solid var(--line-gray); } }
.contact-info a { color: var(--electric); font-weight: 600; }

/* ---------- Legal pages ---------- */
.legal-content { max-width: 760px; }
.legal-content h2 { font-size: 1.25rem; margin-top: 2em; }
.legal-content p, .legal-content li { color: var(--slate); font-size: 0.96rem; }
.legal-notice {
  background: var(--cool-gray);
  border: 1px solid var(--line-gray);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.86rem;
  color: var(--slate-dim);
  margin-bottom: 40px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.7); padding: 72px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand img { height: 32px; width: auto; margin-bottom: 14px; }
.footer-brand p { color: rgba(255,255,255,0.6); font-size: 0.9rem; max-width: 32ch; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 16px; letter-spacing: 0.02em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.88rem; color: rgba(255,255,255,0.65); }
.footer-col a:hover { color: var(--white); }
.social-icons { display: flex; gap: 10px; }
.social-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  color: rgba(255,255,255,0.75);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.social-icon:hover { border-color: var(--cyan); color: var(--cyan); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; flex-wrap: wrap; gap: 14px; font-size: 0.82rem; color: rgba(255,255,255,0.5); }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Cookie consent ---------- */
.cookie-banner {
  position: fixed;
  left: 20px; right: 20px; bottom: 20px;
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line-gray);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(10,22,40,0.14);
  padding: 22px 24px;
  z-index: 300;
  display: none;
}
.cookie-banner.visible { display: block; }
.cookie-banner p { font-size: 0.88rem; margin-bottom: 16px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn { padding: 10px 18px; font-size: 0.85rem; }
.cookie-actions .btn-text { background: none; border: none; color: var(--slate-dim); font-size: 0.85rem; cursor: pointer; padding: 10px 6px; }

.cookie-modal-backdrop { position: fixed; inset: 0; background: rgba(10,22,40,0.5); z-index: 400; display: none; align-items: center; justify-content: center; padding: 20px; }
.cookie-modal-backdrop.visible { display: flex; }
.cookie-modal { background: var(--white); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 32px; }
.cookie-toggle-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-gray); }
.cookie-toggle-row:first-of-type { border-top: none; }
.cookie-toggle-row h4 { font-size: 0.95rem; margin-bottom: 4px; }
.cookie-toggle-row p { font-size: 0.84rem; margin: 0; }
.switch { position: relative; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line-gray); border-radius: 20px; transition: 0.2s; }
.switch .track::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--white); border-radius: 50%; transition: 0.2s; }
.switch input:checked + .track { background: var(--electric); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:disabled + .track { opacity: 0.5; }

/* ---------- 404 ---------- */
.not-found { padding: 120px 0; text-align: center; }
.not-found .code { font-family: var(--font-display); font-size: 1rem; color: var(--electric); font-weight: 600; margin-bottom: 12px; }
