/* ===========================================================
   Davis Mechatronics — site styles
   Palette from davismechatronics/colors.md
   =========================================================== */

:root {
  /* Brand blues */
  --blue-1: #163258;
  --blue-2: #395a87;
  /* Neutrals */
  --dark-grey: #1f1f1b;
  --warm-grey: #65665c;
  --beige: #a6a696;
  --cream: #d1d1bd;
  /* Accents (use sparingly) */
  --accent-1: #a0a538;
  --accent-2: #d1d923;
  /* Status */
  --green: #22c55e;

  /* Derived surfaces */
  --bg: #14140f;
  --bg-alt: #1b1b16;
  --panel: #21211b;
  --panel-2: #26261f;
  --logo-plate: #f4f2ea;
  --border: rgba(166, 166, 150, 0.16);
  --border-strong: rgba(166, 166, 150, 0.28);

  --text: #e9e9dc;
  --text-dim: var(--beige);
  --text-faint: var(--warm-grey);

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (max-width: 560px) { html { scroll-padding-top: 76px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }

a { color: inherit; text-decoration: none; }

.container { width: min(var(--maxw), 92vw); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent-2); color: var(--dark-grey);
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(20, 20, 15, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(20, 20, 15, 0.9);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 88px;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 60px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: var(--text-dim); font-size: 0.94rem; font-weight: 500; transition: color 0.2s; }
.nav a:hover { color: var(--text); }
.nav-cta {
  color: #fff !important; background: var(--blue-2);
  padding: 9px 18px; border-radius: 999px; font-weight: 600 !important;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(57, 90, 135, 0.55); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav { position: absolute; top: 100%; left: 0; right: 0; z-index: 49; display: none; flex-direction: column; padding: 0 4vw; max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); border-top: 1px solid var(--border); background: rgba(20, 20, 15, 0.98); backdrop-filter: blur(12px); }
.mobile-nav.open { max-height: 560px; }
.mobile-nav a { padding: 15px 0; border-bottom: 1px solid var(--border); color: var(--text-dim); font-weight: 500; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 0.97rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn-primary { background: var(--blue-2); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(57, 90, 135, 0.6); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--beige); background: rgba(166,166,150,0.06); }
.btn-lg { padding: 17px 34px; font-size: 1.05rem; font-family: var(--font-mono); letter-spacing: -0.01em; }

/* ===== Hero ===== */
.hero { position: relative; padding: clamp(24px, 4.5vh, 80px) 0 clamp(48px, 8vh, 96px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 520px at 72% -10%, rgba(57, 90, 135, 0.5), transparent 60%),
    radial-gradient(800px 500px at 8% 0%, rgba(22, 50, 88, 0.55), transparent 55%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image:
    linear-gradient(rgba(166, 166, 150, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 166, 150, 0.07) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(circle at 60% 25%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 60% 25%, #000 0%, transparent 72%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero-copy { max-width: 620px; }
.hero-media { margin: 0; position: relative; }
.hero-media img {
  width: 100%; max-height: 540px; object-fit: cover; object-position: center;
  border-radius: var(--radius-lg); border: 1px solid var(--border-strong);
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.75);
  display: block;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-1); margin: 0 0 22px;
}
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.4rem); font-weight: 700; }
.grad {
  background: linear-gradient(100deg, var(--accent-2), var(--accent-1) 55%, var(--blue-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-dim); max-width: 660px; margin: 26px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px 28px; margin: 58px 0 0; padding-top: 34px; border-top: 1px solid var(--border); }
@media (max-width: 820px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.hero-stats dt { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--text); }
.hero-stats dd { margin: 4px 0 0; font-size: 0.9rem; color: var(--text-faint); line-height: 1.45; }
@media (max-width: 560px) {
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
  .hero-stats div { max-width: none; }
}

/* ===== Customers / logo strip ===== */
.logos { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 30px 0; }
.logos-label { text-align: center; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 22px; }
.logos-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 32px 52px; background: var(--logo-plate); border-radius: 16px; padding: 26px 44px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); }
.logo-item { height: 32px; width: auto; display: block; }
.logo-symmetry { height: 40px; }
.logo-capstan { height: 66px; }
@media (max-width: 560px) { .logos-row { gap: 24px 32px; padding: 22px 24px; } .logo-item { height: 28px; } .logo-symmetry { height: 34px; } .logo-capstan { height: 56px; } }

/* ===== Sections ===== */
.section { padding: clamp(38px, 6vh, 72px) 0 clamp(64px, 10vh, 120px); }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 660px; margin-bottom: 52px; }
.section-kicker { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-1); margin: 0 0 12px; }
.section-kicker.center { text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.section-sub { color: var(--text-dim); font-size: 1.08rem; margin: 16px 0 0; }
.section-sub.center { text-align: center; }

/* ===== Service cards ===== */
.cards { display: grid; gap: 20px; }
/* Services etc: only 4-wide, 2x2, or 1-wide — never an odd 3 */
.cards-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cards-4 { grid-template-columns: 1fr; } }
/* Engagement: only 3-wide or 1-wide */
.cards-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 28px; overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.card-icon {
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: 12px; background: rgba(57, 90, 135, 0.22); color: var(--accent-2);
  border: 1px solid var(--border); margin-bottom: 20px;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 0.97rem; margin: 0; }

/* ===== Selected Work ===== */
.work-grid { grid-template-columns: repeat(2, 1fr); }
.work-card { padding: 0; overflow: hidden; }
.work-card > img { width: 100%; height: 250px; object-fit: cover; display: block; border-bottom: 1px solid var(--border); }
.work-body { padding: 30px 32px 34px; }
.work-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-1); padding: 5px 12px; margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: 999px;
}
.work-card h3 { font-size: 1.4rem; margin-bottom: 12px; }
.work-card p { color: var(--text-dim); margin: 0; }

/* ===== In the field (showcase strip) ===== */
.showcase { padding: clamp(34px, 5vh, 64px) 0 clamp(56px, 8vh, 92px); }
.showcase .section-head { margin-bottom: 34px; }
.showcase-track { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.showcase-item { position: relative; margin: 0; }
.showcase-item video { width: 100%; height: clamp(280px, 40vh, 440px); object-fit: cover; display: block; background: var(--panel); }
.showcase-item figcaption {
  padding: 14px 2px 0; font-size: 0.95rem; color: var(--text-dim);
}
@media (max-width: 760px) { .showcase-track { grid-template-columns: 1fr; } .showcase-item video { height: auto; } }

/* ===== Facility ===== */
.facility-photo { margin: 0 0 40px; }
.facility-photo img { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--border); display: block; }
.facility-grid {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.facility-grid li { background: var(--bg-alt); padding: 0; overflow: hidden; }
.facility-grid li img { width: 100%; height: 160px; object-fit: cover; display: block; }
.fac-body { padding: 20px 22px 24px; }
.facility-grid h3 { font-size: 1.12rem; margin-bottom: 8px; }
.facility-grid p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }
@media (max-width: 760px) { .facility-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .work-grid { grid-template-columns: 1fr; } }
/* facility stays 2-wide on phones, with smaller tiles */
@media (max-width: 560px) {
  .facility-grid li img { height: 96px; }
  .fac-body { padding: 13px 14px 15px; }
  .facility-grid h3 { font-size: 0.98rem; margin-bottom: 5px; }
  .facility-grid p { font-size: 0.82rem; line-height: 1.4; }
}
@media (max-width: 560px) { .header-inner { height: 70px; } .brand-logo { height: 46px; } }

/* ===== Capabilities ===== */
.cap-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
@media (max-width: 760px) { .cap-grid { grid-template-columns: repeat(2, 1fr); } }
.cap-grid li { background: var(--bg-alt); padding: 28px 28px; }
.cap-grid h3 { font-size: 1.18rem; margin: 0 0 8px; }
.cap-grid p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

/* ===== Industries chips ===== */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
@media (max-width: 560px) {
  .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .chip { text-align: center; padding: 12px 10px; }
  .chip:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.chip {
  font-family: var(--font-display); font-weight: 500; font-size: 1.02rem;
  padding: 12px 22px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border); color: var(--cream);
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s;
}

/* ===== Approach steps ===== */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 920px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .steps { gap: 16px; }
  .steps h3 { font-size: 1rem; }
  .steps p { font-size: 0.86rem; }
}
.steps li { position: relative; padding-top: 18px; border-top: 2px solid var(--border-strong); }
.step-index {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  font-family: var(--font-mono); font-weight: 500; color: var(--accent-2);
  background: rgba(160, 165, 56, 0.12); border: 1px solid var(--border); margin-bottom: 16px;
}
.steps h3 { font-size: 1.12rem; margin-bottom: 8px; }
.steps p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 50px; align-items: start; }
.about-grid h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.about-body p { color: var(--text-dim); font-size: 1.08rem; margin: 0 0 18px; }
.about-body strong { color: var(--text); font-weight: 600; }
.address-line { font-size: 0.97rem !important; color: var(--text-faint) !important; padding-top: 8px; }

/* ===== Team ===== */
.team-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.member { text-align: center; }
/* group team photo banner */
.team-photo { margin: 0 0 44px; }
.team-photo img { width: 100%; max-height: 470px; object-fit: cover; object-position: center 30%; border-radius: var(--radius-lg); border: 1px solid var(--border); display: block; }

/* named members still awaiting a headshot — gear placeholder avatar, normal name */
.member--nophoto img { object-fit: contain; padding: 26%; opacity: 0.3; filter: none; background: var(--panel); }
.member--nophoto:hover img { transform: none; border-color: var(--border); }
.member img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--panel); display: block;
  filter: grayscale(0.15) contrast(1.02);
  transition: transform 0.3s var(--ease), border-color 0.3s, filter 0.3s;
}
.member h3 { font-size: 1.05rem; margin: 16px 0 2px; }
.member p { color: var(--text-faint); font-size: 0.86rem; font-family: var(--font-mono); margin: 0; }

/* ===== CTA ===== */
.cta { text-align: center; position: relative; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(700px 400px at 50% 120%, rgba(57, 90, 135, 0.4), transparent 65%);
}
.cta-inner { max-width: 720px; margin-inline: auto; }
.cta h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-bottom: 6px; }
.cta-actions { margin-top: 34px; }
.cta-meta { margin-top: 26px; font-family: var(--font-mono); font-size: 0.86rem; color: var(--text-faint); letter-spacing: 0.04em; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 28px; background: var(--bg-alt); }
.footer-top { display: flex; flex-wrap: wrap; gap: 32px 60px; justify-content: space-between; align-items: flex-start; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 430px; }
.footer-logo { height: 40px; width: auto; display: block; }
.footer-tag { color: var(--text-dim); font-size: 0.95rem; line-height: 1.5; margin: 0; }
.footer-email { font-family: var(--font-mono); font-size: 0.92rem; color: var(--accent-1); }
.footer-email:hover { color: var(--accent-2); }
.footer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.footer-nav a { color: var(--text-dim); font-size: 0.94rem; transition: color 0.2s; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); }
.footer-copy { color: var(--text-faint); font-size: 0.85rem; margin: 0; }
.footer-top-link { color: var(--text-faint); font-size: 0.85rem; transition: color 0.2s; }
.footer-top-link:hover { color: var(--text); }

/* ===== Reveal animation ===== */
.reveal, .section-head { opacity: 0; transform: translateY(12px); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
.is-visible { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .section-head { opacity: 1; transform: none; transition: none; }
}

/* ===== Responsive ===== */
@media (max-width: 1040px) { .team-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 820px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 22px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-media { order: 2; }
  .hero-media img { max-height: 380px; }
  .hero-stats { gap: 26px; }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) { .team-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
