/* ==========================================================================
   Mathale Group — core stylesheet
   Palette: deep navy structure, signal-yellow accent, steel greys
   ========================================================================== */

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

:root {
  --navy-900: #060f1f;
  --navy-800: #0b1b33;
  --navy-700: #12294a;
  --navy-600: #1c3a63;
  --steel-400: #64789a;
  --steel-200: #c3ccda;
  --paper: #f2f4f7;
  --white: #ffffff;
  --signal: #f5c518;
  --signal-dark: #d9a900;

  --display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --body: 'Archivo', system-ui, -apple-system, sans-serif;

  --wrap: 1200px;
  --gut: clamp(1.25rem, 4vw, 3rem);
  --radius: 2px;
  --shadow: 0 18px 40px -22px rgba(6, 15, 31, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--navy-800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy-600); }

h1, h2, h3, h4 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }

p { margin: 0 0 1.1em; }

.wrap {
  width: min(100% - (var(--gut) * 2), var(--wrap));
  margin-inline: auto;
}

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--navy { background: var(--navy-800); color: var(--steel-200); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--paper { background: var(--paper); }

/* ---------- Eyebrow / section headers ---------- */

.eyebrow {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal-dark);
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow::before {
  content: '';
  width: 2rem;
  height: 3px;
  background: var(--signal);
  flex: none;
}

.section--navy .eyebrow { color: var(--signal); }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 62ch;
  color: var(--navy-700);
}

.section--navy .lede { color: var(--steel-200); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.7rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--signal); color: var(--navy-900); }
.btn--primary:hover { background: var(--white); }

.btn--ghost { border-color: currentColor; color: var(--white); background: transparent; }
.btn--ghost:hover { background: var(--white); color: var(--navy-900); border-color: var(--white); }

.btn--dark { background: var(--navy-800); color: var(--white); }
.btn--dark:hover { background: var(--navy-600); }

/* ---------- Top bar ---------- */

.topbar {
  background: var(--navy-900);
  color: var(--steel-200);
  font-size: 0.85rem;
}

.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.75rem;
  justify-content: flex-end;
  padding-block: 0.55rem;
}

.topbar a { color: var(--steel-200); text-decoration: none; }
.topbar a:hover { color: var(--signal); }
.topbar strong { color: var(--white); font-weight: 600; }

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

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--navy-800);
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  text-transform: uppercase;
  line-height: 1;
}

.brand-tag {
  display: block;
  font-family: var(--body);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel-400);
  margin-top: 0.2rem;
}

.nav { display: flex; align-items: center; gap: 0.35rem; }

.nav a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy-800);
  padding: 0.5rem 0.85rem;
  border-bottom: 3px solid transparent;
}

.nav a:hover { color: var(--navy-600); border-bottom-color: var(--signal); }
.nav a[aria-current='page'] { border-bottom-color: var(--signal); }

.nav .btn { margin-left: 0.5rem; font-size: 0.95rem; padding: 0.65rem 1.2rem; border-bottom: none; }
.nav .btn:hover { border-bottom: none; }

.nav-toggle {
  display: none;
  background: var(--navy-800);
  border: 0;
  color: var(--white);
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after { transform: translateY(4px); }

.nav-toggle[aria-expanded='true'] span { background: transparent; }
.nav-toggle[aria-expanded='true'] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded='true'] span::after { transform: rotate(-45deg) translateY(-1px); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    border-bottom: 3px solid var(--signal);
    padding: 0.5rem var(--gut) 1.25rem;
    gap: 0;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--paper); }
  .nav .btn { margin: 0.75rem 0 0; justify-content: center; }
}

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

.hero {
  position: relative;
  isolation: isolate;
  background: var(--navy-900);
  color: var(--white);
  overflow: hidden;
  min-height: clamp(560px, 82vh, 820px);
  display: flex;
  align-items: center;
}

/* Full-bleed photograph */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 55%;
}

/* Readability scrim: dense behind the text, clearing to the right
   so the plant and crew stay visible. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      100deg,
      rgba(4, 11, 24, 0.96) 0%,
      rgba(5, 13, 27, 0.94) 40%,
      rgba(8, 20, 38, 0.68) 64%,
      rgba(8, 20, 38, 0.36) 100%
    ),
    linear-gradient(to top, rgba(6, 15, 31, 0.72) 0%, rgba(6, 15, 31, 0) 42%);
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  z-index: 1;
  background: repeating-linear-gradient(90deg, var(--signal) 0 42px, var(--navy-900) 42px 84px);
}

.hero .wrap {
  position: relative;
  z-index: 2;
  padding-block: clamp(3.5rem, 9vw, 6rem);
  max-width: 1100px;
}

.hero h1 {
  color: var(--white);
  max-width: 16ch;
  text-shadow: 0 2px 24px rgba(6, 15, 31, 0.55);
}

.hero h1 em { font-style: normal; color: var(--signal); }

.hero p {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  max-width: 56ch;
  color: #dbe3ee;
  text-shadow: 0 1px 12px rgba(6, 15, 31, 0.6);
}

/* On narrow screens the crop tightens and the scrim goes vertical,
   because there is no longer a spare right-hand side to clear. */
@media (max-width: 760px) {
  .hero { min-height: auto; }
  .hero-media img { object-position: 68% 50%; }
  .hero::before {
    background: linear-gradient(
      to bottom,
      rgba(6, 15, 31, 0.90) 0%,
      rgba(6, 15, 31, 0.82) 55%,
      rgba(6, 15, 31, 0.92) 100%
    );
  }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.75rem;
}

.badge {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(245, 197, 24, 0.45);
  border-radius: var(--radius);
  color: var(--signal);
  background: rgba(245, 197, 24, 0.07);
}

/* Page banner for interior pages */

.page-head {
  background:
    linear-gradient(110deg, rgba(6, 15, 31, 0.95), rgba(18, 41, 74, 0.78)),
    repeating-linear-gradient(135deg, #16304f 0 26px, #12294a 26px 52px);
  color: var(--white);
  border-bottom: 5px solid var(--signal);
}

.page-head .wrap { padding-block: clamp(2.75rem, 7vw, 4.75rem); }
.page-head h1 { color: var(--white); margin-bottom: 0.35em; }
.page-head p { color: var(--steel-200); max-width: 60ch; margin: 0; }

.crumbs {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--steel-400);
  margin-bottom: 1rem;
}

.crumbs a { color: var(--steel-200); text-decoration: none; }
.crumbs a:hover { color: var(--signal); }

/* ---------- Stats strip ---------- */

.stats {
  background: var(--signal);
  color: var(--navy-900);
}

.stats .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  padding-block: 0;
}

.stat {
  padding: clamp(1.5rem, 3vw, 2.25rem) 1rem;
  text-align: center;
  box-shadow: 1px 0 0 rgba(6, 15, 31, 0.14);
}

.stat-num {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 0.4rem;
  display: block;
}

/* ---------- Grids & cards ---------- */

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--steel-200);
  border-top: 4px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-top-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-top-color: var(--signal);
}

.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; color: var(--navy-700); font-size: 0.97rem; }

.card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--navy-800);
  color: var(--signal);
  border-radius: var(--radius);
  margin-bottom: 1.1rem;
}

.card-icon svg { width: 26px; height: 26px; }

.card ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.93rem;
  color: var(--navy-700);
}

.card li { margin-bottom: 0.3rem; }

/* Service card with figure */

.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  border-bottom: 1px solid var(--steel-200);
}

.service:last-child { border-bottom: 0; }
.service:nth-child(even) .service-figure { order: 2; }

.service-figure {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(6, 15, 31, 0.86), rgba(28, 58, 99, 0.7)),
    repeating-linear-gradient(45deg, #1c3a63 0 18px, #12294a 18px 36px);
  display: grid;
  place-items: center;
  color: var(--signal);
  border: 1px solid var(--steel-200);
}

.service-figure svg { width: 33%; height: auto; opacity: 0.85; }

.service-figure img { width: 100%; height: 100%; object-fit: cover; }

.service-num {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: var(--signal);
  color: var(--navy-900);
  padding: 0.35rem 0.8rem;
}

/* ---------- Split content ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.rule-list { list-style: none; margin: 0; padding: 0; }

.rule-list li {
  padding: 0.9rem 0 0.9rem 2rem;
  border-bottom: 1px solid var(--steel-200);
  position: relative;
}

.section--navy .rule-list li { border-bottom-color: rgba(195, 204, 218, 0.2); }

.rule-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: 12px;
  height: 12px;
  background: var(--signal);
  transform: rotate(45deg);
}

/* ---------- Accreditation table ---------- */

.accred-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.accred-table caption {
  text-align: left;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--steel-400);
  padding-bottom: 0.75rem;
}

.accred-table th,
.accred-table td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--steel-200);
}

.accred-table th {
  font-family: var(--body);
  font-weight: 600;
  color: var(--navy-800);
  width: 55%;
}

.accred-table td {
  font-variant-numeric: tabular-nums;
  color: var(--navy-700);
  font-weight: 500;
}

.accred-table tbody tr:hover { background: var(--paper); }

/* ---------- Client list ---------- */

.clients {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: rgba(195, 204, 218, 0.35);
  border: 1px solid rgba(195, 204, 218, 0.35);
}

.client {
  background: var(--navy-800);
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.2;
}

.client::before {
  content: '';
  width: 6px;
  align-self: stretch;
  background: var(--signal);
  flex: none;
}

/* ---------- Process steps ---------- */

.steps { counter-reset: step; display: grid; gap: 1.25rem; }

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(195, 204, 218, 0.25);
}

.step:last-child { border-bottom: 0; padding-bottom: 0; }

.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--signal);
  line-height: 1;
  padding-top: 0.15rem;
}

.step h3 { margin-bottom: 0.3rem; }
.step p { margin: 0; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--navy-900);
  color: var(--white);
  border-top: 5px solid var(--signal);
}

.cta-band .wrap {
  padding-block: clamp(2.75rem, 6vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.cta-band h2 { margin: 0 0 0.35em; color: var(--white); }
.cta-band p { margin: 0; color: var(--steel-200); max-width: 52ch; }

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

.form-card {
  background: var(--white);
  border: 1px solid var(--steel-200);
  border-top: 4px solid var(--signal);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field { margin-bottom: 1.15rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--navy-800);
}

.field .req { color: #b4321f; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.97rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--steel-400);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy-900);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(245, 197, 24, 0.55);
  outline-offset: 1px;
  border-color: var(--navy-600);
}

.field textarea { min-height: 140px; resize: vertical; }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

.form-note { font-size: 0.85rem; color: var(--steel-400); margin: 0.5rem 0 0; }

.form-status {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--signal);
  background: var(--paper);
  font-size: 0.93rem;
  display: none;
}

.form-status.is-visible { display: block; }

.error-text {
  display: none;
  color: #b4321f;
  font-size: 0.83rem;
  margin-top: 0.3rem;
  font-weight: 500;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #b4321f; }

.field.has-error .error-text { display: block; }

/* ---------- Contact details block ---------- */

.contact-block { margin-bottom: 2rem; }

.contact-block h3 {
  font-size: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--signal);
  display: inline-block;
}

.contact-block address {
  font-style: normal;
  line-height: 1.7;
  color: var(--navy-700);
}

.contact-block a { color: var(--navy-600); font-weight: 600; }

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

.site-footer {
  background: var(--navy-900);
  color: var(--steel-200);
  font-size: 0.93rem;
}

.site-footer .wrap { padding-block: clamp(2.75rem, 6vw, 4rem); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 2rem;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.site-footer h4 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--white);
  margin: 0 0 1rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--steel-200); text-decoration: none; }
.site-footer a:hover { color: var(--signal); text-decoration: underline; }

.footer-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand img { width: 56px; height: 56px; object-fit: cover; border-radius: 3px; }
.footer-brand .brand-name { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(195, 204, 218, 0.18);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--steel-400);
}

.footer-bottom a { color: var(--steel-400); }

/* ---------- Utilities & motion ---------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--signal);
  color: var(--navy-900);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-weight: 700;
}

.skip-link:focus { left: 0.5rem; top: 0.5rem; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .service { grid-template-columns: 1fr; }
  .service:nth-child(even) .service-figure { order: 0; }
  .cta-band .wrap { flex-direction: column; align-items: flex-start; }
}
