/* ==========================================================================
   Nubit Solutions Inc. — site.css
   Hand-written, no framework. CSS custom properties hold design tokens.
   ========================================================================== */

:root {
  /* Brand colors (SPEC section 4) */
  --color-navy: #0E2A47;
  --color-navy-2: #123B63;
  --color-cyan: #2BA8D1;
  --color-white: #FFFFFF;
  --color-bg-alt: #F4F7FA;
  --color-slate: #4A5A6A;
  --color-border: #E1E8EF;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* 8px spacing grid */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-card: 0 1px 2px rgba(14, 42, 71, 0.06), 0 8px 24px rgba(14, 42, 71, 0.08);
  --shadow-card-hover: 0 4px 10px rgba(14, 42, 71, 0.10), 0 14px 32px rgba(14, 42, 71, 0.12);

  --max-width: 1140px;
}

/* --------------------------------------------------------------------------
   Reset-ish basics
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-slate);
  background: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-cyan);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-navy);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
}

h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--space-2); }

ul { padding-left: 1.2em; }

/* Hide Alpine-controlled elements until Alpine has initialized them, so a
   collapsed accordion panel (or other x-show-bound element) doesn't flash
   visible for a moment while the deferred scripts are still loading.
   Alpine removes the x-cloak attribute itself once a component boots. */
[x-cloak] { display: none !important; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-1) var(--space-2);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section {
  padding-block: var(--space-8);
}

.section--alt {
  background-color: var(--color-bg-alt);
  /* Faint blueprint/schematic grid — decorative, data: URI so it costs no
     extra HTTP request (CSP img-src allows data:). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M0 0.5H48M0.5 0V48' stroke='%230E2A47' stroke-opacity='0.055'/%3E%3C/svg%3E");
}

.section--navy {
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: rgba(255, 255, 255, 0.9);
}
.section--navy h1, .section--navy h2, .section--navy h3 { color: var(--color-white); }
.section--navy a:not(.btn) { color: #9fdcf0; }

.stack { display: flex; flex-direction: column; gap: var(--space-3); }

.grid {
  display: grid;
  gap: var(--space-3);
}

.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 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; }
}

.text-center { text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-cyan);
  margin-bottom: var(--space-1);
}
.lede {
  font-size: 1.15rem;
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.7em 1.4em;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--color-cyan);
  color: var(--color-navy);
}
.btn--primary:hover { background: #279cc4; }

.btn--outline {
  background: transparent;
  border-color: currentColor;
  color: var(--color-white);
}
.section:not(.section--navy) .btn--outline {
  color: var(--color-navy);
}
.btn--outline:hover { background: rgba(255, 255, 255, 0.12); }
.section:not(.section--navy) .btn--outline:hover { background: var(--color-bg-alt); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.btn-row--center {
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
  gap: var(--space-3);
}

.site-header__logo img {
  height: auto;
  max-height: 72px;
  max-width: 100%;
  aspect-ratio: 760 / 240;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav__links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--color-navy);
  font-weight: 600;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--color-cyan);
  text-decoration: none;
  border-bottom-color: var(--color-cyan);
}

.lang-switch {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  font-size: 0.9rem;
}
.lang-switch button {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
  font: inherit;
  color: var(--color-navy);
}
.lang-switch button[aria-current="true"] {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-navy);
  margin: 4px 0;
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .hamburger { display: inline-block; }

  .nav--mobile-open .nav__links {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-3);
  }
  .nav--mobile-open .nav__links a {
    display: block;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: var(--space-10);
}
.hero h1 { max-width: 20ch; }
.hero__subhead {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 68ch;
  margin-bottom: var(--space-4);
}
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 72ch;
}

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

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.service-card__icon {
  width: 40px;
  height: 40px;
  color: var(--color-cyan);
  margin-bottom: var(--space-2);
}

.service-card h3 { margin-bottom: var(--space-1); }
.service-card a.card-link {
  display: inline-block;
  margin-top: var(--space-1);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Why-Nubit / industries strips
   -------------------------------------------------------------------------- */

.differentiator {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.differentiator__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--color-cyan);
}

.industry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
}
.industry-card__icon {
  width: 40px;
  height: 40px;
  color: var(--color-cyan);
}
.industry-card__label {
  font-weight: 600;
  color: var(--color-navy);
}

/* --------------------------------------------------------------------------
   Home intro strip — turbine engine illustration
   -------------------------------------------------------------------------- */

.intro-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-5);
}
.intro-strip__art {
  width: 300px;
  flex-shrink: 0;
}
.intro-strip__art svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .intro-strip { grid-template-columns: 1fr; }
  .intro-strip__art { display: none; }
}

/* --------------------------------------------------------------------------
   CTA banner
   -------------------------------------------------------------------------- */

.cta-banner {
  text-align: center;
  padding-block: var(--space-8);
}
/* Heading color for .cta-banner comes from the `.section--navy h1/h2/h3`
   rule above when the banner is on a navy background — NOT from a
   standalone rule here, which previously forced white text even inside
   `.section--alt` (light gray) banners, making the heading invisible. */

/* --------------------------------------------------------------------------
   Services page — accordion
   -------------------------------------------------------------------------- */

.service-section {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-6);
  scroll-margin-top: 90px;
}
.service-section:first-of-type { border-top: none; }

.service-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
  font: inherit;
}

.service-section__icon {
  width: 44px;
  height: 44px;
  color: var(--color-cyan);
  flex-shrink: 0;
}

.service-section__toggle {
  margin-left: auto;
  color: var(--color-cyan);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease;
}
.service-section__toggle.is-open {
  transform: rotate(45deg);
}

.service-section__body {
  padding-top: var(--space-3);
  padding-left: calc(44px + var(--space-3));
  max-width: 74ch;
}

@media (max-width: 600px) {
  .service-section__body { padding-left: 0; }
}

/* --------------------------------------------------------------------------
   Standards badges (About page)
   -------------------------------------------------------------------------- */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--color-cyan);
  color: var(--color-navy);
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(43, 168, 209, 0.08);
}

.values-grid .card h3 { color: var(--color-navy); }

/* --------------------------------------------------------------------------
   About page — satellite illustration + V-model diagram
   -------------------------------------------------------------------------- */

.about-consultant {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-5);
}
.about-consultant__art {
  width: 260px;
  flex-shrink: 0;
}
.about-consultant__art svg { width: 100%; height: auto; display: block; }

.about-vmodel {
  padding-block: var(--space-2);
}
.about-vmodel svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  margin-inline: auto;
  display: block;
}

@media (max-width: 900px) {
  .about-consultant { grid-template-columns: 1fr; }
  .about-consultant__art { display: none; }
  .about-vmodel { display: none; }
}

/* Team Credentials panel — deliberately a navy panel (not the light
   cyan-bordered pills used by "Standards Expertise" below) so the two
   credential-adjacent blocks on this page read as distinct: this one is
   about experience/certifications held by the team, the other is about
   standards coverage. Reuses the certification/award icon from the
   Why-Nubit differentiators (pages/icons/certification_compliance.svg). */
.team-credentials {
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.team-credentials h3,
.team-credentials > p {
  color: var(--color-white);
}
.team-credentials__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
}
.team-credentials__item {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.team-credentials__icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--color-cyan);
}
.team-credentials__item span {
  color: var(--color-white);
  font-weight: 600;
}
.team-credentials__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.team-credentials__stat {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  font-weight: 600;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .team-credentials__list { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-field {
  margin-bottom: var(--space-3);
}
.form-field label {
  display: block;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: var(--space-1);
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.65em 0.8em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--color-slate);
  background: var(--color-white);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-cyan);
  outline-offset: 1px;
}
.help-text {
  font-size: 0.85rem;
  color: var(--color-slate);
  margin-top: 4px;
}
.form-field .field-errors {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  color: #B3261E;
  font-size: 0.9rem;
}

/* Honeypot field: visually hidden but present in the DOM (not display:none,
   so naive bots that skip hidden fields still fill it in). */
.hp-field-wrap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.alert--success {
  background: rgba(43, 168, 209, 0.12);
  border: 1px solid var(--color-cyan);
  color: var(--color-navy);
}
.alert--error {
  background: rgba(179, 38, 30, 0.08);
  border: 1px solid #B3261E;
  color: #7a1a15;
}

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* --------------------------------------------------------------------------
   Contact info / service-area
   -------------------------------------------------------------------------- */

.contact-details dt {
  font-weight: 700;
  color: var(--color-navy);
  margin-top: var(--space-2);
}
.contact-details dd {
  margin: 0;
}

.contact-art {
  width: 180px;
  margin-top: var(--space-5);
}
.contact-art svg { width: 100%; height: auto; display: block; }

@media (max-width: 600px) {
  .contact-art { width: 140px; margin-top: var(--space-4); }
}

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

.site-footer {
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.8);
  padding-block: var(--space-6) var(--space-4);
}
.site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer a:hover { color: var(--color-white); }

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 700px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.site-footer__logo img { height: 34px; margin-bottom: var(--space-2); }

.site-footer h4 {
  color: var(--color-white);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.site-footer__bottom {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Abstract geometric motif (decorative, echoes logo stroke style)
   -------------------------------------------------------------------------- */

.motif {
  position: absolute;
  top: 50%;
  right: -6%;
  transform: translateY(-50%);
  width: 46%;
  max-width: 620px;
  min-width: 320px;
  overflow: visible;
  pointer-events: none;
  opacity: 0.16;
  z-index: 0;
}
.motif svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .motif { display: none; }
}

.hero { position: relative; overflow: hidden; }

/* --------------------------------------------------------------------------
   Error pages (404 / 500)
   -------------------------------------------------------------------------- */

.error-page {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: var(--space-10);
}
.error-page .code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-cyan);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Photography — license-free photos treated as brand moments, not stock
   imagery. Two patterns:
   1. `.photo-band` — full-width decorative <img> band (own <section>,
      aria-hidden) with a navy gradient overlay via ::after.
   2. `.section--photo` — CSS background-image on an existing content
      section (hero / CTA banner) with a stronger navy overlay via ::before
      so headings/body copy keep 'section--navy' contrast rules. Per-image
      background URLs are set by `.section--photo-*` modifiers so the
      overlay itself stays defined once.
   All images live in static/img/photos/ as WebP (640/1280/1920) + a 1280
   JPEG fallback, generated from license-free originals cropped to keep the
   subject well composed (rule-of-thirds / centered on the focal subject).
   -------------------------------------------------------------------------- */

.photo-band {
  position: relative;
  overflow: hidden;
  height: 360px;
  line-height: 0;
}
.photo-band picture {
  display: block;
  width: 100%;
  height: 100%;
}
.photo-band__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(14, 42, 71, 0.72) 0%, rgba(14, 42, 71, 0.55) 100%);
}

@media (min-width: 900px) {
  .photo-band { height: 420px; }
}
@media (max-width: 600px) {
  .photo-band { height: 220px; }
}

.section--photo {
  position: relative;
  background-color: var(--color-navy);
  background-size: cover;
  background-position: center;
}
.section--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(14, 42, 71, 0.84) 0%, rgba(14, 42, 71, 0.72) 100%);
}
.section--photo > .container {
  position: relative;
  z-index: 1;
}

.section--photo-earth {
  background-image: url("../img/photos/earth-limb-1280.068de64467f2.jpg");
}
.section--photo-engine {
  background-image: url("../img/photos/engine-hero-1280.f0d05eb80984.jpg");
}

@supports (background-image: image-set(url("data:,") 1x)) {
  .section--photo-earth {
    background-image: image-set(url("../img/photos/earth-limb-640.440743df9566.webp") 1x);
  }
  .section--photo-engine {
    background-image: image-set(url("../img/photos/engine-hero-640.a3b67ad13f9d.webp") 1x);
  }
  @media (min-width: 700px) {
    .section--photo-earth {
      background-image: image-set(url("../img/photos/earth-limb-1280.fee90beb8186.webp") 1x);
    }
    .section--photo-engine {
      background-image: image-set(url("../img/photos/engine-hero-1280.d6179142bf29.webp") 1x);
    }
  }
  @media (min-width: 1300px) {
    .section--photo-earth {
      background-image: image-set(url("../img/photos/earth-limb-1920.3cbed9b09eb4.webp") 1x);
    }
    .section--photo-engine {
      background-image: image-set(url("../img/photos/engine-hero-1920.960b365fea64.webp") 1x);
    }
  }
}

/* Duotone treatment for the black & white turbine photo (About / Our
   Story) — grayscale source pushed through sepia + hue-rotate to land on
   the brand navy instead of the default sepia brown. */
.photo-duotone {
  filter: grayscale(1) sepia(1) hue-rotate(175deg) saturate(2.6) brightness(0.92) contrast(1.05);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.about-story {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-5);
}
.about-story__art {
  width: 240px;
  flex-shrink: 0;
}
.about-story__art picture { display: block; }
.about-story__art img { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .about-story { grid-template-columns: 1fr; }
  .about-story__art { display: none; }
}
