/* ============================================================
   MGM Engineering, LLC — Shared Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --ink:        #14131a;
  --ink-2:      #1b1a24;
  --ink-3:      #232130;
  --line:       #322f42;
  --purple:     #8163b8;
  --purple-2:   #704d9f;
  --purple-deep:#4f3572;
  --teal:       #1ab58b;
  --teal-deep:  #0f8f6c;
  --paper:      #f3f1f7;
  --paper-dim:  #cdc9d9;
  --muted:      #9490a3;

  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;

  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--paper);
  line-height: 1.18;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { max-width: 62ch; color: var(--paper-dim); }

/* ---------- language toggle logic ----------
   !important is required here: several later component classes
   (.btn, etc.) also declare `display`, and without !important
   the cascade's source-order tiebreak (equal specificity) would
   let those later rules silently un-hide the inactive language. */
[data-es] { display: none !important; }
body.es [data-en] { display: none !important; }
body.es [data-es] { display: revert !important; }

/* ---------- header / nav ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 19, 26, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand img { height: 34px; width: auto; }

.brand-text {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: 0.01em;
}

.brand-text small {
  display: block;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

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

nav.links a {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--paper-dim);
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

nav.links a:hover, nav.links a[aria-current="page"] {
  color: var(--paper);
  border-color: var(--teal);
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle button.active {
  background: var(--purple-2);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- hero ---------- */
.hero {
  padding: 5rem 0 4.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 1.6rem;
  align-items: start;
}

/* benchmark rule — signature element, hero only */
.benchmark {
  position: relative;
  height: 100%;
  min-height: 260px;
  border-left: 1px solid var(--line);
  margin-left: 4px;
}

.benchmark .tick {
  position: absolute;
  left: -4px;
  width: 9px;
  height: 1px;
  background: var(--muted);
}

.benchmark .tick.major {
  width: 16px;
  background: var(--teal);
  height: 2px;
}

.benchmark .tick-label {
  position: absolute;
  left: 20px;
  width: 80px;
  font-family: var(--font-head);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(-50%);
}

.hero h1 { max-width: 16ch; margin-bottom: 1.4rem; }
.hero h1 .accent { color: var(--teal); }

/* ---------- stationing ruler (Option B — horizontal, below hero content) ---------- */
.stationing-bar { margin-top: 2.8rem; max-width: 640px; }
.stationing-track { position: relative; height: 2px; background: var(--line); }
.stationing-track .pt {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 8px;
  background: var(--muted);
  transform: translateX(-50%);
}
.stationing-track .pt.major {
  top: -5px;
  width: 3px;
  height: 12px;
  background: var(--teal);
}
.stationing-labels { position: relative; height: 1.1rem; margin-top: 0.6rem; }
.stationing-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-head);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.stationing-labels span.major { color: var(--teal); }
.stationing-labels span:first-child { transform: translateX(0); }
.stationing-labels span:last-child { transform: translateX(-100%); }

.hero .lede {
  font-size: 1.08rem;
  color: var(--paper-dim);
  max-width: 52ch;
  margin-bottom: 2.2rem;
}

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }

.badges-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.badge-pill {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 0.4rem 0.85rem;
  border-radius: 3px;
  background: var(--ink-2);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
}

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

.btn-primary { background: var(--teal); color: #0a1310; }
.btn-primary:hover { background: #2fcf9f; }

.btn-outline {
  border-color: var(--line);
  color: var(--paper);
  background: transparent;
}
.btn-outline:hover { border-color: var(--purple); color: var(--purple); }

/* ---------- generic sections ---------- */
section { padding: 4.2rem 0; border-top: 1px solid var(--line); }
section.no-border { border-top: none; }
section.alt { background: var(--ink-2); }

.section-head { margin-bottom: 2.6rem; max-width: 60ch; }
.section-head h2 { margin-bottom: 0.7rem; }
.kicker {
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--teal);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

/* ---------- cards / grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.8rem;
}

.card h3 { margin-bottom: 0.65rem; color: var(--paper); }
.card p { font-size: 0.92rem; margin: 0; max-width: none; }

.tag-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.service-card .num {
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--purple);
  margin-bottom: 0.9rem;
  display: block;
}

/* ---------- credentials ---------- */
.cred-list { display: flex; flex-direction: column; gap: 0; }
.cred-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.cred-row:last-child { border-bottom: 1px solid var(--line); }
.cred-row .title { color: var(--paper); font-weight: 500; }
.cred-row .meta { color: var(--muted); font-size: 0.85rem; text-align: right; }

.badge-cards { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 2.2rem; }
.badge-card {
  background: var(--paper);
  border-radius: 6px;
  padding: 0.9rem;
  width: 150px;
}
.badge-card img { border-radius: 3px; }

/* ---------- projects ---------- */
.project-row {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}
.project-row:last-child { border-bottom: 1px solid var(--line); }
.project-row h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.project-row .loc { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.project-row .role {
  font-size: 0.72rem;
  color: var(--teal);
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}

/* ---------- stats ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 3rem;
}
.stat {
  background: var(--ink);
  padding: 1.6rem 1.4rem;
}
.stat .n {
  font-family: var(--font-head);
  font-size: 1.9rem;
  color: var(--paper);
  font-weight: 600;
}
.stat .n span { color: var(--teal); }
.stat .l { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.contact-item { margin-bottom: 1.6rem; }
.contact-item .label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.contact-item a, .contact-item span.value {
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
}
.contact-item a:hover { color: var(--teal); }

form.contact-form { display: flex; flex-direction: column; gap: 1rem; }
form.contact-form label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  display: block;
}
form.contact-form input,
form.contact-form textarea {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.75rem 0.9rem;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.92rem;
}
form.contact-form input:focus,
form.contact-form textarea:focus {
  outline: none;
  border-color: var(--teal);
}
form.contact-form textarea { min-height: 130px; resize: vertical; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  padding: 2.8rem 0;
  background: var(--ink-2);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand img { height: 26px; }
.footer-brand span { font-family: var(--font-head); font-size: 0.85rem; color: var(--paper-dim); }
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.82rem; color: var(--paper-dim); text-decoration: none; }
.footer-links a:hover { color: var(--teal); }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------- focus visibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  nav.links { display: none; }
  .nav-toggle { display: inline-block; }
  header.site.open nav.links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 1rem 2rem 1.4rem;
    gap: 1rem;
  }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 18px 1fr; gap: 1.2rem; }
  .benchmark .tick-label { display: none; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .project-row { grid-template-columns: 1fr; }
  .project-row .role { text-align: left; }
  .cred-row { grid-template-columns: 1fr; }
  .cred-row .meta { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
