/* Integral Automation, Inc. — static site styles */

:root {
  /* Brand palette */
  --navy-header: #21273c;
  --navy-footer: #02133e;
  --blue-light: #a4c2f4;
  --indigo-heading: #1f2260;
  --indigo-link: #2e3192;

  /* Neutrals */
  --ink: #1a1a1a;
  --muted: #55586b;
  --bg: #ffffff;
  --bg-soft: #f5f6fb;
  --border: #e4e6f1;

  /* Hero photo overlay: --navy-footer at 68% alpha. Kept as its own variable
     so the literal is not repeated mid-stylesheet; rgba() rather than
     color-mix() so an unsupported value can't drop the whole hero overlay
     and leave white text on a bright photo. */
  --navy-overlay: rgba(2, 19, 62, 0.68);

  --maxw: 1000px;
}

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

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh; /* excludes the mobile URL bar; older browsers keep 100vh */
}

main {
  flex: 1 0 auto; /* fill remaining height so the footer sits at the bottom */
}

a {
  color: var(--indigo-link);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--navy-header);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none; /* shown only on mobile */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

/* Highlighted only while the menu is open */
.nav-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-name {
  font-weight: 700;
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-light);
  color: var(--navy-footer);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav a.active {
  color: var(--blue-light);
}

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(var(--navy-overlay), var(--navy-overlay)),
    url("../assets/FANUC_R2000iB_AtWork.jpg") center / cover no-repeat;
  color: #fff;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 24px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* ---------- Content sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px;
}

.section.narrow {
  max-width: 760px;
}

/* Tighten the gap between the hero and the first content section */
.hero + .section {
  padding-top: 32px;
}

/* Centered contact prompt at the foot of the home page */
.contact-cta {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.intro-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
}

.intro-head h1,
.intro-head h2 {
  margin: 0;
}

.body-logo {
  display: block;
  width: 180px;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .intro-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .body-logo {
    order: -1; /* logo above the heading when stacked */
    width: 150px;
  }
}

.section h1,
.section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--indigo-heading);
  margin-top: 0;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  /* min() lets the 300px floor collapse on viewports narrower than ~348px
     (300px + the section's horizontal padding), which would otherwise
     overflow the page horizontally */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
  margin: 24px 0;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: var(--indigo-heading);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.stat-card {
  display: flex;
  flex-direction: column;
}

/* Card holding the FANUC SSA badge image. The image is absolutely
   positioned so its size can't inflate the grid row height — the text
   cards set the row, and the badge scales to fit inside it. */
.badge-card {
  position: relative;
  /* Lets the badge raise its row's height up to this much, without
     the image's natural size inflating it further */
  min-height: 200px;
}

.badge-card img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
}

.stat-number {
  margin-top: auto; /* bottom-align so figures line up across the row */
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--indigo-heading);
}

/* ---------- Contact ---------- */
.contact-details {
  margin-top: 24px;
  font-size: 1.1rem;
}

.contact-details p {
  margin: 0 0 16px;
}

.contact-details a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-footer);
  color: var(--blue-light);
  font-size: 0.9rem;
}

.footer-inner {
  padding: 28px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}

/* Underlined because the link color is identical to the surrounding footer
   text — color alone cannot distinguish them (WCAG 1.4.1), and hover is
   not available on touch */
.footer-inner a {
  color: var(--blue-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Keyboard focus ---------- */
/* The nav, call button, and hamburger sit on navy, where the browser's
   default focus ring is hard to see — and .nav-toggle removes its border,
   so it has no other outline of its own */
:focus-visible {
  outline: 2px solid var(--indigo-link);
  outline-offset: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible {
  outline-color: #fff;
}

/* ---------- Hover & touch feedback ---------- */
/* Hover styles only on devices with a real pointer, so taps
   don't leave buttons stuck in the highlighted state */
@media (hover: hover) {
  .nav a:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .call-btn:hover {
    background: #fff;
  }

  .contact-details a:hover {
    color: var(--indigo-heading);
  }

  .footer-inner a:hover {
    color: #fff;
  }
}

/* Momentary press feedback (touch and mouse) */
.nav a:active {
  background: rgba(255, 255, 255, 0.2);
}

.call-btn:active {
  background: #fff;
}

.contact-details a:active {
  color: var(--indigo-heading);
}

.footer-inner a:active {
  color: #fff;
}

/* ---------- Large screens ---------- */
/* Stop header/footer content short of the screen edges */
@media (min-width: 1600px) {
  .header-inner,
  .footer-inner {
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* ---------- Mobile ---------- */
/* Breakpoints are per-element rather than a shared scale: each threshold is
   the width at which that specific element runs out of room (750px nav,
   640px intro row, 520px brand name). Deliberately not consolidated —
   retuning one should not shift the others. */

/* Nav buttons collapse into the hamburger dropdown */
@media (max-width: 750px) {
  .header-inner {
    padding: 12px 20px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  /* Collapse the nav into a dropdown panel under the header */
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    background: var(--navy-header);
    padding: 8px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 14px;
  }

  .hero-inner {
    padding: 64px 24px;
  }

  .section {
    padding: 48px 24px;
  }
}

/* Hide the company name when space is tight */
@media (max-width: 520px) {
  .brand-name {
    display: none;
  }
}
