/* ================================================================
   MARS — Modern Analytics & Research Solutions
   v9.2 — header logo balanced; About photo unchanged;
           desktop footer uses full logo; mobile/tablet footer uses smaller icon
   ================================================================ */

/* ---------- Brand tokens ---------- */
:root {
  --martian-red: #a21e24;
  --deep-space: #1e1853;
  --stellar-grey: #676767;
  --star-dust: #f7f6f3;
  --text: #1b1b1b;
  --white: #fff;

  --max: 1140px;
  --radius: 16px;
  --shadow: 0 12px 28px rgba(0, 0, 0, .08);
  --focus: 2px solid var(--deep-space);

  /* header height used by hero min-height calc */
  --header-h: 88px;

  --space-xl: 96px;
  --space-lg: 72px;
  --space-md: 48px;
  --space-sm: 24px;

  color-scheme: light;
}

/* ---------- Base / reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (hover:none) and (pointer:coarse) { html { scroll-behavior: auto; } }
html.boot-lock { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-anchor: none;
}

/* true top anchor allowed to anchor */
#top-sentinel { height: 1px; overflow-anchor: auto; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--deep-space); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: var(--focus); outline-offset: 2px; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

h1,h2,h3 { margin: 0 0 10px; line-height: 1.2; font-weight: 800; letter-spacing: .2px; }
h1 { font-size: clamp(2.6rem, 1.8rem + 4vw, 6.2rem); color: var(--deep-space); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); color: var(--deep-space); }
h3 { font-size: 1.12rem; color: var(--deep-space); }
p { margin: 0 0 12px; color: #444; }
.lede { color: var(--stellar-grey); max-width: 760px; margin: 0 auto var(--space-sm); }

/* ================================================================
   Header / Navigation (wordmark only in header)
   ================================================================ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #ececec;
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
  min-height: 88px;
  padding-block: 4px;
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Header brand image: balanced scale */
.brand img {
  display: block;
  height: auto;
  max-height: clamp(38px, 4.5vw, 52px);
  max-width:  clamp(180px, 11vw, 240px);
  object-fit: contain;
  transition: max-height .2s ease, max-width .2s ease;
}

/* Nav links */
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0; padding: 0;
}
.nav-list a {
  color: var(--deep-space);
  font-weight: 600;
  letter-spacing: .2px;
  padding: 10px 8px;
  border-radius: 10px;
  transition: color .15s ease, background .15s ease;
}

.nav-toggle { display: none; background: transparent; border: 0; padding: 6px; cursor: pointer; }
.nav-toggle .bar {
  display: block; width: 22px; height: 2px;
  background: #2b2b2b; margin: 4px 0; border-radius: 2px;
}

/* ================================================================
   Sections / Hero / Buttons
   ================================================================ */
.section { padding: var(--space-xl) 0; }

.section--hero {
  min-height: calc(100svh - var(--header-h));
  display: grid; place-items: center;
  padding: clamp(56px, 6vh, 96px) 0;
  text-align: center;
}

.hero-subtitle { margin-top: 12px; }
.hero-subtitle .subtitle-line { display: block; }
.hero-subtitle .subtitle-line strong {
  font-weight: 800; color: #555;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 2rem);
  display: block; margin-bottom: 6px;
}
.hero-subtitle .subtitle-line:last-child {
  color: #6b6b6b;
  font-size: clamp(1rem, 0.95rem + 0.5vw, 1.5rem);
}

.cta-row {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  gap: 16px; text-align: center; margin-top: 24px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; user-select: none;
  padding: 1.05rem 1.6rem; min-width: 280px;
  border-radius: 18px;
  font-weight: 800; letter-spacing: .2px;
  font-size: clamp(1rem, .9rem + .35vw, 1.25rem);
  box-shadow: 0 18px 36px rgba(0,0,0,.08);
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px) scale(.995); }

.btn--solid { background: var(--martian-red); color: #fff; }
.btn--solid:hover { background: #8e1a20; }

.btn--outline {
  background: #fff; color: var(--deep-space);
  border: 3px solid var(--deep-space);
}

/* ================================================================
   ABOUT (keeps original graphics.jpg)
   ================================================================ */
.section--band {
  background: var(--star-dust);
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
}

.kicker {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--deep-space);
  color: #fff;
  margin-bottom: 16px;
  font-size: clamp(1.05rem, .9rem + .6vw, 1.25rem);
}
.kicker--light { background: rgba(255,255,255,.22); }

.about-flow .about-lede {
  text-align: left;
  color: var(--stellar-grey);
  line-height: 1.9;
  margin: 0 0 var(--space-md) 0;
  max-width: 860px;
}
.about-columns {
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 40px;
  align-items: start;
}
.about-content { display: flex; flex-direction: column; gap: 28px; }
.about-block { padding-left: 18px; border-left: 3px solid var(--deep-space); }
.about-block h3 { margin: 0 0 8px 0; font-weight: 700; }

.about-visual {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  aspect-ratio: auto;
}
.about-visual img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 3 / 2;
}

/* ================================================================
   SERVICES
   ================================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
  margin-top: var(--space-sm);
}
.service.card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 18px 18px 20px;
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  border-top: 4px solid var(--deep-space);
  transition: transform .15s ease, box-shadow .15s ease, border-top-color .15s ease;
  display: flex; flex-direction: column;
}
.service.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-top-color: var(--martian-red); }
.service.card::after {
  content: ""; position: absolute; inset: 0;
  background: url("assets/logo-icon.png") no-repeat center center / 120px 120px;
  background-origin: content-box;
  opacity: 0;
  filter: grayscale(100%) contrast(80%) brightness(110%);
  transition: opacity .2s ease;
  pointer-events: none;
}
.service.card:hover::after { opacity: .06; }
.service h3 { margin: .2rem 0 .35rem; font-size: 1.07rem; }
.service p { margin: 0; color: var(--stellar-grey); }
.service-icon { width: 36px; height: 36px; border-radius: 8px; margin-bottom: 10px; background: #efeff7; }

/* ================================================================
   CONTACT
   ================================================================ */
.section.contact {
  padding: var(--space-lg) 0 var(--space-xl);
  background: var(--deep-space);
  color: #fff;
}
.section.contact .kicker { background: rgba(255,255,255,.22); }

.section.contact .contact-lede {
  color: #f7f7ff;
  font-weight: 400;
}

.contact-inner { max-width: 900px; }
.contact-email { margin-bottom: var(--space-sm); }
.contact-link { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.btn--light { background: #fff; color: #0f0f3a; border: 2px solid rgba(255,255,255,0); }
.section.contact .btn--light:hover { background: transparent; color: #fff; border-color: #fff; }

/* ================================================================
   BACK TO TOP
   ================================================================ */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  width: 56px; height: 56px;
  display: none;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ececec;
  box-shadow: 0 10px 22px rgba(0,0,0,.15);
  align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
}
.back-to-top img { width: 32px; height: 32px; display: block; }
.back-to-top:active { transform: scale(.98); }

/* ================================================================
   FOOTER (full logo on desktop, small icon on mobile/tablet)
   ================================================================ */
.site-footer {
  background: #fff;
  border-top: 2px solid rgba(30,24,83,.18);
}
.footer-inner {
  /* extra top padding so the logo never touches the edge */
  padding: calc(var(--space-sm) + 16px) 0 var(--space-md);
  text-align: center;
  color: var(--stellar-grey);
}

/* Mobile/tablet: icon-only logo — small and neat */
.footer-mark {
  display: block;
  margin: 8px auto 14px auto;
  width: clamp(56px, 24vw, 88px);
  height: auto;
  opacity: .9;
  aspect-ratio: 1 / 1;
}

/* Desktop: show the full logo, true ratio (no warp) */
.footer-logo-full {
  display: none;             /* hidden by default (mobile/tablet) */
  margin: 0 auto 14px;
  max-width: 300px;
  width: 100%;
  height: auto;              /* keep intrinsic aspect ratio */
  object-fit: contain;       /* defensive: prevents stretching */
}

@media (min-width: 980px) {
  .footer-logo-full { display: block; }
  .footer-mark { display: none; }
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width:1080px) { .container { padding: 0 20px; } }

@media (max-width:980px) {
  .about-columns { grid-template-columns: 1fr; gap: 28px; }
  .services-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width:720px) {
  /* comfy header on mobile */
  .nav { padding: 18px 20px; }
  .site-header { min-height: 76px; }

  .section { padding: var(--space-lg) 0; }
  .back-to-top { display: flex; }

  /* even more breathing room on smaller phones */
  .footer-inner { padding: calc(var(--space-sm) + 22px) 0 var(--space-md); }
}

@media (max-width:680px) {
  .nav-toggle { display: block; }
  #primary-nav {
    position: absolute;
    top: 64px; right: 16px; left: 16px;
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(0,0,0,.06);
    padding: 10px;
    display: none;
  }
  #primary-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 6px; }
  .nav-list a { padding: 10px 12px; border-radius: 8px; }
  .services-grid { grid-template-columns: 1fr; }
  .cta-row { justify-content: center; }
}

/* hover color micro-polish */
a:hover { color: var(--martian-red); }

/* ================================================================
   Accessibility & UX preferences
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  a:focus-visible, button:focus-visible { outline: 2px solid CanvasText; }
}

/* Print-friendly stylesheet */
@media print {
  * { box-shadow: none !important; text-shadow: none !important; }
  body { color: #000; background: #fff !important; }
  .site-header, .back-to-top, .nav-toggle { display: none !important; }
  .section.contact { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a, a:visited { text-decoration: underline; }
  a[href]:after { content: " (" attr(href) ")"; font-weight: normal; }
  .btn, .service.card { border-color: #00000020 !important; }
}