/* ==========================================================================
   Maynyx Energy — shared stylesheet
   ========================================================================== */

:root {
  --ink: #0b1f1c;          /* near-black, deep green-black — night oilfield */
  --paper: #f6f4ee;        /* warm off-white */
  --paper-dim: #ece8dd;
  --flame: #e8571c;        /* flare-gas orange — primary accent */
  --flame-dim: #c94815;
  --teal: #0f4c4c;         /* transition-energy teal — secondary accent */
  --steel: #4a5a5e;        /* muted supporting tone */
  --line: rgba(11, 31, 28, 0.12);
  --line-light: rgba(246, 244, 238, 0.18);

  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max: 1180px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

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

h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.15rem; letter-spacing: 0.02em; }

p { margin: 0 0 1em; color: var(--ink); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--flame);
  display: inline-block;
  margin-bottom: 0.9em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 28px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--flame); color: var(--paper); }
.btn-primary:hover { background: var(--flame-dim); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line-light); }
.btn-ghost:hover { border-color: var(--paper); }
.btn-ghost.on-light { color: var(--ink); border-color: var(--line); }
.btn-ghost.on-light:hover { border-color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid var(--line-light);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .mark {
  width: 12px;
  height: 12px;
  background: var(--flame);
  flex-shrink: 0;
}
.logo-badge {
  background: var(--paper);
  padding: 7px 10px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.logo img {
  height: 22px;
  width: auto;
  display: block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav a {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  opacity: 0.78;
  transition: opacity 0.15s ease;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; border-bottom-color: var(--flame); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--paper);
  width: 36px;
  height: 28px;
  position: relative;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--paper);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle::before { top: 6px; }
.nav-toggle span { top: 13px; }
.nav-toggle::after { top: 20px; }
.nav-toggle[aria-expanded="true"]::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"]::after { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle[aria-expanded="true"] span { opacity: 0; }

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 84px; left: 0; right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--line-light);
    transition: max-height 0.25s ease;
  }
  .nav.open { max-height: 320px; }
  .nav a { width: 100%; padding: 16px 28px; border-bottom: 1px solid var(--line-light); }
  .nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--line-light); background: rgba(255,255,255,0.04); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--paper);
  background: var(--ink);
  overflow: hidden;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--ink) 8%, rgba(11,31,28,0.35) 55%, rgba(11,31,28,0.65) 100%);
}
.hero-inner { position: relative; padding: 90px 0 70px; max-width: 820px; }
.hero p.lead { font-size: 1.15rem; max-width: 560px; color: rgba(246,244,238,0.86); margin-bottom: 1.6em; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }

.page-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 130px 0 60px;
}
.page-hero p.lead { max-width: 620px; color: rgba(246,244,238,0.82); font-size: 1.08rem; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-tight { padding: 64px 0; }
.on-dark { background: var(--ink); color: var(--paper); }
.on-teal { background: var(--teal); color: var(--paper); }
.on-dim { background: var(--paper-dim); }

.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head p { color: var(--steel); }
.on-dark .section-head p, .on-teal .section-head p { color: rgba(246,244,238,0.78); }

/* ---------- Service flow (signature element) ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-light);
}
.flow-step {
  padding: 34px 30px 34px 0;
  border-bottom: 1px solid var(--line-light);
  position: relative;
}
.flow-step + .flow-step { border-left: 1px solid var(--line-light); padding-left: 30px; }
.flow-step .num {
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--flame);
  display: block;
  margin-bottom: 14px;
}
.flow-step h3 { margin-bottom: 10px; color: var(--paper); }
.flow-step p { color: rgba(246,244,238,0.78); font-size: 0.95rem; }
.flow-arrow {
  display: none;
}
@media (min-width: 781px) {
  .flow-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -14px; top: 34px;
    font-family: var(--display);
    color: var(--flame);
    font-size: 1.1rem;
    z-index: 2;
  }
}
@media (max-width: 780px) {
  .flow { grid-template-columns: 1fr; }
  .flow-step + .flow-step { border-left: none; padding-left: 0; }
}

/* ---------- Service cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card {
  background: var(--paper);
  padding: 38px 32px;
}
.card .tier {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--flame);
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
}
.card p { color: var(--steel); font-size: 0.96rem; }
.card ul { margin: 14px 0 0; padding-left: 18px; color: var(--steel); font-size: 0.94rem; }
.card ul li { margin-bottom: 8px; }
.card ul li:last-child { margin-bottom: 0; }

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

/* ---------- Split (text + image) ---------- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}
.split.reverse { grid-template-columns: 0.95fr 1.05fr; }
.split.reverse .split-media { order: -1; }
.split-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5; }
.split-media.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split-media.duo img { aspect-ratio: 3/4; }
@media (max-width: 860px) {
  .split, .split.reverse { grid-template-columns: 1fr; gap: 30px; }
  .split.reverse .split-media { order: 0; }
}

/* ---------- Photo trio ---------- */
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 44px;
}
.trio img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
@media (max-width: 700px) {
  .trio { grid-template-columns: 1fr; }
}

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}
.stat { padding: 36px 30px; border-left: 1px solid var(--line-light); }
.stat:first-child { border-left: none; }
.stat .big { font-family: var(--display); font-size: 2.1rem; color: var(--flame); display: block; margin-bottom: 6px; }
.stat p { color: rgba(246,244,238,0.75); font-size: 0.9rem; margin: 0; }
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line-light); }
  .stat:first-child { border-top: none; }
}

/* ---------- Services page: expandable groups ---------- */
.service-group { border-top: 1px solid var(--line); padding: 40px 0; }
.service-group:last-child { border-bottom: 1px solid var(--line); }
.service-group-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.service-group-head .tier { color: var(--flame); font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.service-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; padding: 0; margin: 0; list-style: none; }
.service-list li {
  padding: 12px 0 12px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 0.96rem;
  color: var(--steel);
}
.service-list li::before {
  content: "";
  position: absolute; left: 0; top: 19px;
  width: 8px; height: 8px;
  background: var(--flame);
}
.service-list.single { grid-template-columns: 1fr; }
@media (max-width: 700px) {
  .service-list { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-detail { margin-bottom: 22px; }
.contact-detail .eyebrow { margin-bottom: 6px; }
.contact-detail a { text-decoration: none; font-size: 1.1rem; font-family: var(--display); border-bottom: 1px solid var(--line-light); padding-bottom: 2px; }
.contact-detail a:hover { border-color: var(--flame); color: var(--flame); }

form.contact-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); }
.field input, .field textarea {
  font-family: var(--body);
  font-size: 1rem;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--flame);
  outline-offset: 1px;
  border-color: var(--flame);
}
.form-note { font-size: 0.82rem; color: var(--steel); margin-top: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(246,244,238,0.7); padding: 56px 0 30px; }
.footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; margin-bottom: 40px; }
.footer-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-nav a { text-decoration: none; color: rgba(246,244,238,0.7); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--flame); }
.footer-bottom { border-top: 1px solid var(--line-light); padding-top: 22px; font-size: 0.8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Visually hidden (skip link etc.) ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--flame); color: var(--paper); padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

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