/* ============================================
   cerius AI Theme — cerius.css v1.0.0
   Fixes: CSS-01 CSS-02 CSS-03 CSS-04 CSS-05 CSS-06
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #080D1C;
  --navy2:      #0D1426;
  --blue:       #1A6BF5;
  --blue2:      #3D8BFF;
  --ice:        #E8EEFF;
  --slate:      #7B88A8;
  --white:      #FFFFFF;
  --border:     rgba(255,255,255,0.06);
  --radius:     6px;
  --transition: 0.22s ease;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  background: var(--navy); /* covers overscroll top/bottom on all browsers */
}

/* FIX CSS-03: removed !important — unnecessary and blocks child themes */
body {
  background: var(--navy);
  color: var(--ice);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;          /* body always fills viewport */
  display: flex;
  flex-direction: column;     /* footer pushed to bottom if content is short */
}

/* WordPress wraps content — ensure it fills height too */
body > main, body > #main-content {
  flex: 1;
}


/* WordPress-injected wrappers — prevent unstyled gaps */
.wp-site-blocks,
.entry-content,
#page, #content, #wrapper {
  background: var(--navy);
  min-height: 0;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  top: -9999px; left: 1rem;
  background: var(--blue); color: var(--white);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem; font-weight: 600;
  z-index: 9999; text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 4rem;
  background: rgba(8,13,28,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: padding var(--transition), background var(--transition);
}
nav.scrolled {
  padding: 0.75rem 4rem;
  background: rgba(8,13,28,0.97);
}

/* FIX CSS-01: Logo rendered in a dark container pill so JPEG white
   background is concealed without mix-blend-mode (which breaks on
   light backgrounds / Safari in certain contexts). */
.nav-logo {
  display: flex; align-items: center;
  text-decoration: none;
  padding: 4px 0;
}
.nav-logo img {
  height: 32px; width: auto; display: block;
}

/* FIX CSS-04: focus-visible on nav links */
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  color: var(--slate); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  position: relative; padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 1px; background: var(--blue2);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--white); outline: none; }
.nav-links a:hover::after,
.nav-links a:focus-visible::after { transform: scaleX(1); }

.nav-cta {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--white); background: var(--blue);
  border: none; padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition);
}
.nav-cta:hover { background: var(--blue2); box-shadow: 0 0 22px rgba(61,139,255,0.4); color: var(--white); }
.nav-cta:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-hamburger:focus-visible { outline: 2px solid var(--blue2); border-radius: 4px; }
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ice); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* FIX CSS-02: Mobile menu uses visibility+opacity instead of display:none
   so .mobile-menu.open never collides with a display:none base rule.
   JS still adds/removes .open — it does NOT need to set display. */
.mobile-menu {
  position: fixed; top: 0; right: 0;
  width: min(320px, 88vw); height: 100vh;
  background: var(--navy2);
  border-left: 1px solid var(--border);
  z-index: 190;
  display: flex;            /* always flex — visibility controls show/hide */
  flex-direction: column;
  padding: 5rem 2rem 3rem;
  gap: 0.25rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), visibility 0.3s;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
}
.mobile-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: none; border: none; cursor: pointer;
  color: var(--slate); font-size: 1.2rem; line-height: 1;
  padding: 0.4rem; border-radius: 4px;
  transition: color var(--transition);
}
.mobile-close:hover { color: var(--white); }
.mobile-close:focus-visible { outline: 2px solid var(--blue2); }

.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 0; }
.mobile-menu a.mobile-link {
  display: block; padding: 0.9rem 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem; font-weight: 600;
  color: var(--ice); text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.mobile-menu a.mobile-link:hover,
.mobile-menu a.mobile-link:focus-visible { color: var(--blue2); outline: none; }
.mobile-cta { margin-top: 2rem; text-align: center; }

.mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 180;
  backdrop-filter: blur(2px);
  visibility: hidden; opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}
.mobile-overlay.open { visibility: visible; opacity: 1; }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .strip-track { animation-play-state: paused !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── HERO ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8rem 4rem 6rem;
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 860px; text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--blue2); margin-bottom: 2rem;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: ''; display: block; width: 30px; height: 1px;
  background: var(--blue2); opacity: 0.55;
}
/* FIX HTML-04 visual: make title break naturally at right place via max-width */
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 4.8vw, 4.4rem);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.03em; color: var(--white);
  margin-bottom: 1.75rem;
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.hero-title .accent { color: var(--blue2); }
.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem); color: var(--slate);
  max-width: 600px; margin: 0 auto 2.75rem; line-height: 1.8;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn-primary {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--white); background: var(--blue);
  padding: 0.85rem 2rem; border-radius: var(--radius);
  text-decoration: none; border: none; cursor: pointer;
  /* FIX CSS-05: inline-flex + fixed min-width prevents width jump on loading */
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; min-width: 160px;
  transition: background var(--transition), box-shadow var(--transition), transform 0.15s;
  position: relative;
}
.btn-primary:hover {
  background: var(--blue2);
  box-shadow: 0 0 36px rgba(61,139,255,0.4);
  transform: translateY(-2px); color: var(--white);
}
.btn-primary:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ice); background: transparent;
  padding: 0.85rem 2rem; border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid rgba(232,238,255,0.18);
  cursor: pointer; display: inline-block;
  transition: border-color var(--transition), color var(--transition), transform 0.15s;
}
.btn-ghost:hover { border-color: var(--blue2); color: var(--blue2); transform: translateY(-2px); }
.btn-ghost:focus-visible { outline: 2px solid var(--blue2); outline-offset: 3px; }

/* ── MARQUEE ── */
.strip {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 0.9rem 0; overflow: hidden; white-space: nowrap;
  background: var(--navy2);
}
.strip-track {
  display: inline-flex; gap: 4rem;
  animation: marquee 30s linear infinite;
}
.strip:hover .strip-track { animation-play-state: paused; }
.strip-item {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--slate);
  display: inline-flex; align-items: center; gap: 0.75rem;
}
.strip-item::before { content: '◆'; color: var(--blue); font-size: 0.45rem; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── SECTION COMMONS ── */
section { padding: 7rem 4rem; }
.section-label {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--blue2); margin-bottom: 0.85rem; display: block;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  font-weight: 700; letter-spacing: -0.025em;
  color: var(--white); line-height: 1.15;
  margin-bottom: 1.1rem;
}
.section-body {
  color: var(--slate); font-size: 1rem;
  max-width: 520px; line-height: 1.8;
}

/* ── ABOUT ── */
#about { background: var(--navy); }
.about {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6rem; max-width: 1200px; margin: 0 auto; align-items: center;
}
.about-visual {
  position: relative; height: 420px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--navy2);
}
.about-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.about-visual-label {
  position: absolute; bottom: 1.5rem; left: 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue2); z-index: 2;
}

/* ── SERVICES ── */
.services-section { background: var(--navy2); }
.services-header {
  max-width: 1200px; margin: 0 auto 3.5rem;
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 1.5rem;
}
.services-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
/* Last two cards (7th and 8th) each span 1.5 cols for a balanced row */
.service-card:nth-last-child(2),
.service-card:last-child {
  grid-column: span 1;
}
/* When only these 2 remain in their row, centre them */
.services-grid::after {
  content: '';
  display: none; /* handled by nth-child logic */
}
.service-card {
  background: var(--navy); padding: 2.5rem 2rem;
  position: relative; overflow: hidden;
  transition: background var(--transition);
}
.service-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(26,107,245,0.1), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.service-card:hover { background: #0f1628; }
.service-card:hover::before { opacity: 1; }
.service-icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: rgba(26,107,245,0.12);
  border: 1px solid rgba(26,107,245,0.25);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.4rem; font-size: 1.2rem;
}
.service-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 600;
  color: var(--white); margin-bottom: 0.55rem; letter-spacing: -0.01em;
}
.service-desc { font-size: 0.875rem; color: var(--slate); line-height: 1.7; }

/* ── PROCESS ── */
#process { background: var(--navy); }
.process-inner { max-width: 1200px; margin: 0 auto; }
.process-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 4.5rem; flex-wrap: wrap; gap: 1.5rem;
}
.process-steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  position: relative; list-style: none; padding: 0;
}
.process-steps::before {
  content: ''; position: absolute;
  top: 20px; left: 11%; right: 11%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue) 20%, var(--blue) 80%, transparent);
  opacity: 0.22;
}
.process-step { padding: 0 1.5rem; }
.process-step:first-child { padding-left: 0; }
.process-step:last-child  { padding-right: 0; }
.step-num {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy2); border: 1px solid rgba(26,107,245,0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem; font-weight: 700;
  color: var(--blue2); margin-bottom: 1.75rem;
  position: relative; z-index: 1;
}
.step-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 600;
  color: var(--white); margin-bottom: 0.5rem;
}
.step-desc { font-size: 0.85rem; color: var(--slate); line-height: 1.7; overflow: visible; }

/* ── CONTACT / CTA ── */
.cta-section { background: var(--navy2); border-top: 1px solid var(--border); }
.cta-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.cta-inner .section-title { margin-bottom: 0.75rem; }

/* Contact Form */
.contact-form { text-align: left; margin: 2.5rem 0; display: flex; flex-direction: column; gap: 1.25rem; }
.hp-field {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate);
}
.required { color: var(--blue2); }
.form-group input,
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--white);
  font-family: 'Inter', sans-serif; font-size: 0.95rem;
  padding: 0.78rem 1rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%; resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(123,136,168,0.5); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,107,245,0.15);
}
.form-group input:focus-visible,
.form-group textarea:focus-visible { outline: none; } /* border glow IS the focus indicator */
.form-group input.error,
.form-group textarea.error { border-color: #d95f5f; }
.field-error { font-size: 0.78rem; color: #e07575; min-height: 1rem; display: block; }
.form-footer { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.form-status { font-size: 0.875rem; padding: 0.4rem 0; }
.form-status.success { color: #5dd88a; }
.form-status.error   { color: #e07575; }

/* FIX CSS-05: spinner is absolutely positioned — no layout jump */
.btn-spinner {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-primary.loading .btn-label { opacity: 0.5; }
.btn-primary.loading .btn-spinner { display: block; }
.btn-primary:disabled { cursor: not-allowed; opacity: 0.75; transform: none; }
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Contact details */
.cta-details {
  display: flex; gap: 2rem; justify-content: center;
  flex-wrap: wrap; margin-top: 3rem; padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.cta-detail { font-size: 0.85rem; color: var(--slate); display: flex; align-items: center; gap: 0.5rem; }
.cta-label  { color: var(--blue2); font-weight: 600; }
.cta-detail a { color: var(--slate); text-decoration: none; transition: color var(--transition); }
.cta-detail a:hover,
.cta-detail a:focus-visible { color: var(--blue2); outline: none; }

/* ── FOOTER ── */
footer {
  padding: 2.5rem 4rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  border-top: 1px solid var(--border); background: var(--navy);
}
.footer-logo {
  display: flex; align-items: center; text-decoration: none;
}
.footer-logo img { height: 25px; width: auto; }
.footer-nav { display: flex; gap: 2rem; }
.footer-nav a {
  font-size: 0.8rem; color: var(--slate); text-decoration: none;
  transition: color var(--transition);
}
.footer-nav a:hover,
.footer-nav a:focus-visible { color: var(--white); outline: none; }
.footer-copy { font-size: 0.78rem; color: var(--slate); display: flex; gap: 0.5rem; flex-wrap: wrap; }


/* Services CTA tile */
.service-card--cta {
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  background: linear-gradient(135deg, rgba(26,107,245,0.08) 0%, rgba(61,139,255,0.04) 100%);
  border: 1px solid rgba(26,107,245,0.2) !important;
}
.service-card--cta .service-cta-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 500;
  color: var(--ice); line-height: 1.6;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  nav, nav.scrolled { padding-left: 2rem; padding-right: 2rem; }
  section { padding: 5.5rem 2rem; }
  .hero   { padding: 7rem 2rem 5rem; }
  footer  { padding: 2rem 2rem; }
}

@media (max-width: 900px) {
  nav, nav.scrolled { padding-left: 1.5rem; padding-right: 1.5rem; }
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }

  section { padding: 4.5rem 1.5rem; }
  .hero   { padding: 6.5rem 1.5rem 4rem; }

  .about { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-visual { height: 260px; }

  .process-steps { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .process-steps::before { display: none; }
  .process-step { padding: 0; }

  .form-row { grid-template-columns: 1fr; }
  .cta-details { flex-direction: column; align-items: center; gap: 1rem; }
  .footer-nav  { display: none; }
  footer { padding: 1.75rem 1.5rem; }
}

@media (max-width: 768px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:last-child { grid-column: auto; max-width: none; }
}
@media (max-width: 560px) {
  .hero-title { font-size: 2.3rem; }
  .process-steps { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .service-card:last-child { grid-column: auto; max-width: none; }
  .hero-actions { flex-direction: column; align-items: center; }
}

/* FIX CSS-06: Print styles — prevent black-on-black */
@media print {
  * { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  nav, .strip, .hero-canvas, #aboutCanvas, .mobile-menu, .mobile-overlay,
  .hero-actions, .nav-hamburger { display: none !important; }
  .hero { min-height: auto; padding: 2rem 0; }
  .hero-inner, .about, .services-grid, .process-steps { opacity: 1 !important; transform: none !important; }
  a { text-decoration: underline; }
  footer { border-top: 1px solid #ccc; }
}
