/* NISA Solutions — hand-built stylesheet
   Font stacks and layout come from the source site's computed styles
   (Playfair Display headings, a system sans body). Color is NISA
   Solutions' own: the deep blue and red sampled from the logo, over
   a navy hero (swapped out from the source site's gold-on-black). */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-ink: #16181c;
  --color-body: #212529;
  --color-muted: #5c6470;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-accent: #c8102e;      /* logo red — CTAs, badges, breadcrumbs */
  --color-accent-ink: #ffffff;
  --color-brand-blue: #14487a;  /* logo blue — link/nav hover, secondary accents */
  --color-dark: #0e2038;        /* deep navy — hero/footer, derived from the blue */
  --color-line: #e2e6ec;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-body);
  background: var(--color-bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--color-ink); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; color: var(--color-body); }
.lede { font-size: 1.15rem; color: var(--color-muted); max-width: 62ch; }

.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .8em 1.5em; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--color-ink); background: transparent; color: var(--color-ink);
  cursor: pointer; font-size: .95rem; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn-dark { background: var(--color-ink); border-color: var(--color-ink); color: #fff; }
.btn .arrow { display: inline-block; }
.arrow { display: inline-block; transition: transform .15s ease; }
a:hover .arrow, .btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--color-line); position: sticky; top: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); z-index: 100; }
.header-row { display: flex; align-items: center; gap: 32px; padding: 14px 24px; }
.brand-logo { height: 40px; width: auto; }
.main-nav { flex: 1; }
.main-nav > ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; font-weight: 600; font-size: .95rem; }
.main-nav > ul > li > a { padding: 10px 0; display: inline-block; transition: color .15s ease; }
.main-nav > ul > li > a:hover { color: var(--color-brand-blue); }
.has-mega .mega-menu {
  display: none; position: fixed; top: 69px; left: 0; right: 0; width: 100%;
  background: var(--color-dark); border: none; border-radius: 0;
  box-shadow: 0 24px 48px rgba(0,0,0,.25); padding: 48px 0 44px; z-index: 110;
}
.has-mega:hover .mega-menu { display: block; }
.has-mega .mega-menu.mega-menu-small {
  position: absolute; top: 100%; left: -20px; right: auto; width: auto;
  min-width: 260px; border-radius: var(--radius); padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.mega-menu-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.mega-menu-small .mega-menu-inner { grid-template-columns: 1fr; max-width: none; margin: 0; padding: 0; }
.mega-col-title { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 12px; color: #fff; font-size: 1rem; }
.mega-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mega-col ul li a { font-weight: 400; color: rgba(255,255,255,.6); font-size: .92rem; }
.mega-col ul li a:hover { color: var(--color-accent); }
.mega-sub { margin-top: 6px; padding-left: 14px; border-left: 2px solid rgba(255,255,255,.15); }
.mega-menu-footer { max-width: var(--max-width); margin: 32px auto 0; padding: 24px 24px 0; border-top: 1px solid rgba(255,255,255,.12); }
.mega-view-all { color: var(--color-accent); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .4em; }

/* ---------- Nav flyouts: title + link block beside content (Case Studies / Careers) ---------- */
.mega-menu-split .mega-menu-inner { grid-template-columns: 260px 1fr; align-items: start; }
.mega-flyout-head { border-right: 1px solid rgba(255,255,255,.18); padding-right: 40px; }
.mega-flyout-head h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.9rem; color: #fff; margin: 0 0 20px; }
.mega-flyout-head .more, .mega-blurb-col .more {
  color: #fff; font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: .4em; transition: color .15s ease;
}
.mega-flyout-head .more:hover, .mega-blurb-col .more:hover { color: var(--color-accent); }

.mega-case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mega-case-card { display: block; }
.mega-case-media {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--color-brand-blue) 0%, var(--color-dark) 100%);
}
.mega-case-media .eyebrow {
  position: absolute; top: 14px; left: 14px; background: #fff; color: var(--color-ink);
  text-transform: uppercase; font-weight: 700; font-size: .7rem; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 999px;
}
.mega-case-card h4 { color: #fff; font-size: 1.05rem; margin: 0 0 6px; }
.mega-case-card p { color: rgba(255,255,255,.6); font-size: .85rem; margin: 0; }
.mega-case-card:hover h4 { color: var(--color-accent); }

.mega-blurb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px; }
.mega-blurb-col h4 { font-family: var(--font-display); font-size: 1.25rem; color: #fff; margin: 0 0 10px; }
.mega-blurb-col p { color: rgba(255,255,255,.65); margin: 0 0 16px; }
.header-cta { white-space: nowrap; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0; margin-left: auto;
  background: var(--color-accent); color: #fff; border: none; border-radius: 50%;
  font-size: 1.15rem; line-height: 1; cursor: pointer; transition: transform .15s ease;
}
.nav-toggle:hover { transform: scale(1.06); }
.nav-toggle-icon-close { display: none; }
.nav-toggle.is-open .nav-toggle-icon { display: none; }
.nav-toggle.is-open .nav-toggle-icon-close { display: inline; }
.mega-caret { display: none; }
.mega-back { display: none; }
.nav-contact-mobile { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--color-dark); color: #fff; position: relative; overflow: hidden;
  padding: 80px 0 100px;
}
.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero .wrap > * { min-width: 0; }
.hero h1 { color: #fff; }
.hero h1 .accent { color: var(--color-accent); }
.hero-media { border-radius: 50%; overflow: hidden; aspect-ratio: 1/1; border: 1px solid rgba(255,255,255,.25); min-width: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 16px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

/* ---------- Page header (non-home) ---------- */
.page-hero { background: var(--color-dark); color: #fff; padding: 64px 0; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero .lede { color: rgba(255,255,255,.75); }
.breadcrumb { color: var(--color-accent); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .6em; display: inline-flex; align-items: center; gap: .35em; }
a.breadcrumb:hover { text-decoration: underline; }

/* ---------- Sections / cards ---------- */
section { padding: 72px 0; }
section.alt { background: var(--color-bg-alt); }
.section-head { max-width: 720px; margin: 0 0 40px; }
.section-head .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--color-muted); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 16px 32px rgba(0,0,0,.06); transform: translateY(-2px); }
.card .eyebrow { text-transform: uppercase; font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: var(--color-accent-ink); background: var(--color-accent); display: inline-block; padding: 3px 10px; border-radius: 999px; width: fit-content; }
.card p { color: var(--color-muted); font-size: .95rem; margin-bottom: 0; }
.card .more { margin-top: auto; font-weight: 600; font-size: .88rem; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-row .stat-value { font-family: var(--font-display); font-size: 2.6rem; color: var(--color-brand-blue); }
.stat-row .stat-label { color: var(--color-muted); font-size: .9rem; }
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

.quote-card { background: var(--color-bg-alt); border-radius: var(--radius); padding: 28px; }
.quote-card p { font-style: italic; color: var(--color-ink); }
.quote-card .who { font-weight: 700; font-size: .9rem; }
.quote-card .who span { display: block; font-weight: 400; color: var(--color-muted); font-size: .82rem; }
.placeholder-flag { display: inline-block; margin-top: 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #a15c00; background: #fff3cf; padding: 2px 8px; border-radius: 999px; }

.value-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.value-list li { border-left: 3px solid var(--color-accent); padding-left: 16px; }

/* ---------- Body content (service/case-study/article rich text) ---------- */
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }

/* ---------- Service detail: intro copy + alternating feature rows ---------- */
.service-body { padding-bottom: 32px; }
.service-prose > p { max-width: 780px; margin-left: auto; margin-right: auto; font-size: 1.08rem; text-align: center; }
.service-prose > p:first-of-type { font-size: 1.22rem; color: var(--color-ink); font-weight: 500; }

.feature-list { margin-top: 56px; display: flex; flex-direction: column; gap: 64px; }
.feature-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s ease;
}
.feature-row.is-visible { opacity: 1; transform: translateY(0); }
.feature-row--reverse .feature-media { order: 2; }
.feature-row--reverse .feature-text { order: 1; }

.feature-media {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; min-width: 0;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-brand-blue) 100%);
  display: flex; align-items: center; justify-content: center;
}
.feature-media::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 78%, rgba(255,255,255,.14), transparent 60%);
}
.feature-media-num {
  font-family: var(--font-display); font-size: 5rem; font-weight: 700; line-height: 1;
  color: rgba(255,255,255,.18);
}
.feature-media-mark {
  position: absolute; top: 24px; left: 24px; width: 34px; height: 34px; border-radius: 9px;
  background: var(--color-accent);
}

.feature-text { min-width: 0; }
.feature-text h3 { margin-top: 0; font-size: 1.5rem; }
.feature-text p { color: var(--color-muted); }
.feature-text ul { margin-top: .6em; }

@media (max-width: 860px) {
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
  .feature-row--reverse .feature-media, .feature-row--reverse .feature-text { order: 0; }
  .feature-media { aspect-ratio: 16/9; }
}
@media (max-width: 500px) {
  .service-prose > p { text-align: left; }
}

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 32px 0; }
.metric-card { background: var(--color-bg-alt); border-radius: var(--radius); padding: 20px; }
.metric-card .metric-value { font-weight: 700; color: var(--color-ink); }
.metric-card .metric-label { color: var(--color-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag { background: rgba(20,72,122,.08); border-radius: 999px; padding: 4px 12px; font-size: .8rem; color: var(--color-brand-blue); font-weight: 600; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter-bar a { border: 1px solid var(--color-line); border-radius: 999px; padding: 6px 16px; font-size: .85rem; }
.filter-bar a.active, .filter-bar a:hover { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--color-line); border-radius: 8px;
  font-family: var(--font-body); font-size: .95rem; background: #fff;
}
textarea { min-height: 130px; resize: vertical; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; color: var(--color-muted); }
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { background: #e8f6ec; border: 1px solid #b7e3c4; color: #1c6b34; padding: 12px 16px; border-radius: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,.8);
  padding: 64px 0 0;
  margin-top: 80px;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(140px, 1fr));
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.footer-col,
.footer-brand {
  min-width: 0;
}

.footer-logo {
  height: 32px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  margin-bottom: 10px;
}

.footer-brand p {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  line-height: 1.7;
  margin: 0;
  overflow-wrap: anywhere;
}

.footer-col h4 {
  color: #fff;
  font-family: var(--font-body);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 14px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col li {
  min-width: 0;
}

.footer-col a {
  display: inline-block;
  max-width: 100%;
  font-size: .88rem;
  line-height: 1.5;
  color: rgba(255,255,255,.65);
  overflow-wrap: anywhere;
  transition: color .15s ease;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.card .more {
  color: var(--color-brand-blue);
}

.footer-offices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  padding: 32px 24px;
  font-size: .8rem;
  line-height: 1.6;
  color: rgba(255,255,255,.5);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.footer-offices .office {
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer-offices strong {
  display: block;
  color: rgba(255,255,255,.85);
  margin-bottom: 4px;
  line-height: 1.4;
}

.footer-offices span {
  display: block;
  overflow-wrap: anywhere;
}

.footer-bottom {
  padding: 20px 24px 32px;
  font-size: .8rem;
  line-height: 1.5;
  color: rgba(255,255,255,.4);
  text-align: left;
}

/* Tablets */
@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: 1.5fr repeat(2, 1fr);
    gap: 30px 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Small tablets / large phones */
@media (max-width: 700px) {
  .site-footer {
    padding-top: 48px;
    margin-top: 60px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
    padding-bottom: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-logo {
    height: 30px;
  }

  .footer-offices {
    grid-template-columns: 1fr 1fr;
    gap: 22px 18px;
    padding: 26px 24px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .site-footer {
    padding-top: 40px;
    margin-top: 48px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 30px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-col h4 {
    margin-bottom: 10px;
  }

  .footer-col ul {
    gap: 8px;
  }

  .footer-col a {
    font-size: .86rem;
  }

  .footer-offices {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px;
  }

  .footer-bottom {
    padding: 18px 24px 26px;
    text-align: center;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .site-footer {
    padding-top: 32px;
  }

  .footer-grid,
  .footer-offices,
  .footer-bottom {
    padding-left: 16px;
    padding-right: 16px;
  }

  .footer-grid {
    gap: 24px;
    text-align: center;
  }

  .footer-logo {
    height: 28px;
  }

  .footer-brand p,
  .footer-col a {
    font-size: .84rem;
  }

  .footer-offices {
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .main-nav { flex: none; display: none; }
  /* backdrop-filter creates a new containing block for fixed-position descendants,
     which breaks the full-screen nav overlay below (it would size against the
     69px header instead of the viewport) — drop it at nav-overlay widths. */
  .site-header { backdrop-filter: none; }
  body.nav-open { overflow: hidden; }

  /* Full-screen dark overlay menu, opens below the still-visible header */
  body.nav-open .main-nav {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; top: 69px;
    background: var(--color-dark); z-index: 90; overflow-y: auto; padding: 8px 24px 40px;
  }
  body.nav-open .main-nav > ul { display: flex; flex-direction: column; gap: 0; }
  body.nav-open .main-nav > ul > li { border-bottom: 1px solid rgba(255,255,255,.12); }
  body.nav-open .main-nav > ul > li > a {
    display: block; padding: 20px 0; font-family: var(--font-display); font-size: 1.5rem;
    font-weight: 500; color: #fff;
  }
  body.nav-open .nav-contact-mobile { display: list-item; margin-top: 16px; border-bottom: none; }
  body.nav-open .nav-contact-mobile a {
    display: inline-flex !important; padding: 12px 24px !important; font-size: 1rem !important;
    font-family: var(--font-body) !important; font-weight: 600 !important;
    background: var(--color-accent); color: #fff; border-radius: 999px;
  }

  /* Top-level items with a submenu: label + caret on the same row */
  body.nav-open .has-mega { position: relative; display: flex; align-items: center; justify-content: space-between; }
  body.nav-open .has-mega > a { flex: 1; }
  .mega-caret {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: none; border: none; color: #fff;
    font-size: 1.6rem; cursor: pointer; flex-shrink: 0;
  }

  /* Submenu becomes its own full-screen panel with a Back button, shown on tap */
  body.nav-open .has-mega .mega-menu {
    display: none; position: fixed; inset: 69px 0 0 0; z-index: 95;
    background: var(--color-dark); border: none; box-shadow: none; min-width: 0;
    padding: 8px 24px 40px; overflow-y: auto;
  }
  body.nav-open .has-mega.submenu-open .mega-menu { display: block; }
  .mega-back {
    display: flex; align-items: center; gap: 6px; margin: 12px 0 20px;
    background: none; border: none; color: var(--color-accent); font-weight: 600;
    font-size: 1rem; cursor: pointer; padding: 8px 0;
  }
  .mega-back span { font-size: 1.3rem; }
  body.nav-open .mega-menu-inner { display: flex; flex-direction: column; gap: 28px; }
  body.nav-open .mega-menu-inner > a.mega-col-title { display: none; }
  body.nav-open .mega-col-title {
    display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.05rem; margin-bottom: 14px;
  }
  body.nav-open .mega-col-title::before { content: ""; width: 8px; height: 8px; background: var(--color-accent); flex-shrink: 0; }
  body.nav-open .mega-col ul { gap: 14px; padding-left: 18px; }
  body.nav-open .mega-col ul li a { color: rgba(255,255,255,.72); font-size: 1rem; }
  body.nav-open .mega-col ul li a:hover { color: #fff; }
  body.nav-open .mega-sub { border-left-color: rgba(255,255,255,.25); }

  /* Case Studies / Careers split flyouts: stack everything, drop the divider */
  body.nav-open .mega-flyout-head { border-right: none; padding-right: 0; }
  body.nav-open .mega-flyout-head h3 { display: none; }
  body.nav-open .mega-case-grid,
  body.nav-open .mega-blurb-grid { display: flex; flex-direction: column; gap: 24px; }
}
