/* ==========================================================================
   Forem Software — site styles
   Brand colours taken from the original site: logo blue, charcoal #44444E,
   orange accent #DD3C05.
   ========================================================================== */

:root {
  --blue: #1a7fc1;
  --blue-dark: #0a5f97;
  --blue-light: #e8f3fb;
  --charcoal: #44444e;
  --ink: #1f2430;
  --text: #4a5160;
  --muted: #7a8190;
  --orange: #dd3c05;
  --orange-dark: #b83203;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --border: #e3e7ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
  --shadow-lg: 0 20px 50px rgba(31, 36, 48, 0.14);
  --max: 1160px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 200;
}
.skip-link:focus { left: 8px; color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .85em 1.6em;
  border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px rgba(221, 60, 5, .25); }
.btn-primary:hover { background: var(--orange-dark); color: #fff; }
.btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline:hover { background: #fff; color: var(--ink); }
.btn-ghost { border-color: var(--blue); color: var(--blue); }
.btn-ghost:hover { background: var(--blue); color: #fff; }

/* ---------- Top bar & header ---------- */
.topbar {
  background: var(--charcoal);
  color: #d6d8de;
  font-size: .85rem;
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap;
}
.topbar a { color: #fff; }
.topbar a:hover { color: #ffd166; }
.topbar-items { display: flex; gap: 22px; flex-wrap: wrap; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: 0 4px 20px rgba(31,36,48,.08); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 78px;
}
.logo img { height: 46px; width: auto; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; }
.nav a {
  display: block; padding: .55em 1em; border-radius: 8px;
  color: var(--charcoal); font-weight: 500; font-size: .97rem;
}
.nav a:hover { color: var(--blue); background: var(--blue-light); }
.nav a.active { color: var(--blue); }
.nav a.active::after {
  content: ""; display: block; height: 2px; background: var(--orange);
  margin-top: 3px; border-radius: 2px;
}
.nav .nav-cta a { background: var(--orange); color: #fff; padding: .55em 1.3em; border-radius: 999px; }
.nav .nav-cta a:hover { background: var(--orange-dark); color: #fff; }
.nav .nav-cta a.active::after { display: none; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 26px; height: 2px; background: var(--charcoal);
  margin: 6px 0; transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(26,127,193,.55), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(221,60,5,.35), transparent 40%),
    linear-gradient(135deg, #2c2c35 0%, var(--charcoal) 50%, #2b3a4d 100%);
  padding: 110px 0 120px;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; }
.hero h1 .accent { color: #ffb38a; }
.hero .lead { font-size: 1.15rem; color: #d9dce3; max-width: 600px; }
.hero .eyebrow { color: #ffb38a; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 14px;
}

.hero-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px; padding: 30px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-lg);
}
.hero-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 18px; }
.pill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pill-list li {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 16px;
  color: #eef0f4; font-weight: 500;
}
.pill-list .tag {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  background: var(--orange); color: #fff;
}
.pill-list li:nth-child(even) .tag { background: var(--blue); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background:
    radial-gradient(circle at 90% 10%, rgba(26,127,193,.5), transparent 45%),
    linear-gradient(135deg, #2c2c35, var(--charcoal));
  color: #fff; padding: 80px 0 70px;
}
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #d3d6dd; max-width: 720px; font-size: 1.1rem; margin: 0; }
.breadcrumb { font-size: .88rem; color: #b8bcc6; margin-bottom: 14px; }
.breadcrumb a { color: #fff; }
.breadcrumb span { margin: 0 8px; opacity: .6; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.top { align-items: start; }

.highlight-box {
  border-left: 4px solid var(--orange);
  background: #fff7f3;
  padding: 22px 26px; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink); font-size: 1.08rem; font-weight: 500;
}
.highlight-box strong { color: var(--orange); letter-spacing: .02em; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card h3 { margin-bottom: .5em; }
.card p:last-child { margin-bottom: 0; }

.icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 20px;
  background: var(--blue-light); color: var(--blue);
}
.icon svg { width: 28px; height: 28px; }
.icon.orange { background: #fdece5; color: var(--orange); }

.card-link { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
.card-link::after { content: "→"; transition: transform .2s; }
.card-link:hover::after { transform: translateX(4px); }

/* Mission / vision strip */
.values .card { text-align: left; }
.values .card .num {
  font-size: .8rem; font-weight: 800; color: var(--orange); letter-spacing: .12em;
}

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: -60px; position: relative; z-index: 2;
}
.stat {
  background: #fff; border-radius: var(--radius); padding: 26px 22px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.stat strong { display: block; font-size: 2rem; color: var(--blue); line-height: 1.1; }
.stat span { font-size: .9rem; color: var(--muted); }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 32px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7fc1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.checklist.cols { grid-template-columns: repeat(2, 1fr); column-gap: 24px; }

/* ---------- Services detail ---------- */
.service-detail {
  display: grid; grid-template-columns: 80px 1fr; gap: 28px;
  padding: 44px 0; border-bottom: 1px solid var(--border);
  scroll-margin-top: 100px;
}
.service-detail:last-child { border-bottom: 0; }
.service-detail .icon { width: 72px; height: 72px; border-radius: 18px; margin: 0; }
.service-detail .icon svg { width: 34px; height: 34px; }

.sub-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 18px; }
.sub-card { background: var(--bg-alt); border-radius: 12px; padding: 22px 24px; }
.sub-card h4 { margin-bottom: .4em; color: var(--blue-dark); }
.sub-card p { margin: 0; font-size: .96rem; }

.service-nav { position: sticky; top: 100px; }
.service-nav ul { list-style: none; margin: 0; padding: 0; }
.service-nav a {
  display: block; padding: 10px 16px; border-left: 3px solid var(--border);
  color: var(--text); font-weight: 500; font-size: .95rem;
}
.service-nav a:hover { color: var(--blue); border-left-color: var(--blue); }
.services-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; }

/* ---------- Products ---------- */
.product {
  display: grid; grid-template-columns: 260px 1fr; gap: 48px;
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 44px; box-shadow: var(--shadow); margin-bottom: 40px;
  scroll-margin-top: 100px;
}
.product-media {
  background: linear-gradient(160deg, var(--blue-light), #fff);
  border-radius: 16px; display: grid; place-items: center; padding: 28px;
  align-self: start;
}
.product-media img { width: 174px; height: auto; }
.product .badge {
  display: inline-block; background: #fdece5; color: var(--orange);
  font-weight: 700; font-size: .78rem; padding: 4px 12px; border-radius: 999px;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px;
}
.feature-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin-top: 10px; }
.feature-group h4 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--charcoal); margin-bottom: 12px;
}
.feature-group .checklist { font-size: .95rem; gap: 8px; }

/* ---------- Portfolio ---------- */
.project {
  overflow: hidden; padding: 0; display: flex; flex-direction: column;
}
.project-cover {
  height: 170px; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; position: relative;
}
.project-cover small {
  position: absolute; top: 16px; left: 18px; font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 999px;
}
.cover-1 { background: linear-gradient(135deg, #1a7fc1, #0a5f97); }
.cover-2 { background: linear-gradient(135deg, #dd3c05, #f17a3a); }
.cover-3 { background: linear-gradient(135deg, #b3122b, #e2475e); }
.cover-4 { background: linear-gradient(135deg, #44444e, #6b6b7a); }
.project-body { padding: 26px 28px 30px; }
.project-body dl { margin: 0; display: grid; gap: 6px; font-size: .95rem; }
.project-body dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.project-body dd { margin: 0 0 8px; color: var(--ink); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--blue-dark), var(--blue));
  color: #fff; border-radius: 24px; padding: 56px 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; margin-bottom: .2em; }
.cta-band p { color: #dbeaf6; margin: 0; font-size: 1.08rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; }
.contact-info { display: grid; gap: 18px; align-content: start; }
.info-item { display: flex; gap: 18px; align-items: flex-start; }
.info-item .icon { margin: 0; flex: none; width: 50px; height: 50px; }
.info-item .icon svg { width: 24px; height: 24px; }
.info-item h4 { margin: 0 0 4px; font-size: 1rem; }
.info-item p { margin: 0; }

.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: .97rem; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26,127,193,.15);
}
.form-note { font-size: .85rem; color: var(--muted); margin: 0; }

.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 8px; }
.map-wrap iframe { display: block; width: 100%; height: 260px; border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #24242b; color: #a9adb8; padding: 72px 0 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: #c9ccd4; }
.site-footer a:hover { color: #ffb38a; }
.footer-logo {
  display: inline-block; background: #fff; padding: 8px 12px; border-radius: 10px; margin-bottom: 18px;
}
.footer-logo img { height: 38px; width: auto; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); margin-top: 56px; padding: 22px 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .88rem;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .services-layout { grid-template-columns: 1fr; }
  .service-nav { display: none; }
}

@media (max-width: 880px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 78px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 30px rgba(31,36,48,.1);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav.open { max-height: 480px; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 12px 24px 20px; gap: 2px; }
  .nav a.active::after { display: none; }
  .nav .nav-cta { margin-top: 8px; }
  .nav .nav-cta a { text-align: center; }

  .hero { padding: 80px 0 100px; }
  .hero .container, .split, .contact-grid, .product { grid-template-columns: 1fr; }
  .split { gap: 40px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .product { padding: 28px; gap: 28px; }
  .product-media { justify-self: start; }
  .section { padding: 72px 0; }
  .cta-band { padding: 40px 30px; }
}

@media (max-width: 560px) {
  .grid-4, .stats, .sub-cards, .checklist.cols, .form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .service-detail { grid-template-columns: 1fr; gap: 16px; }
  .topbar .container { justify-content: center; }
  .topbar-tagline { display: none; }
}

/* Contact form states */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note.is-success, .form-note.is-error { padding: 12px 16px; border-radius: 10px; font-size: .95rem; }
.form-note.is-success { background: #e9f7ef; color: #1e7b45; }
.form-note.is-error { background: #fdecea; color: #b3261e; }
.btn:disabled { opacity: .7; cursor: wait; transform: none; }

/* ==========================================================================
   Responsive refinements (phones, tablets, touch devices, notched screens)
   ========================================================================== */

/* Respect notches / rounded corners on modern phones */
.container {
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.site-footer { padding-bottom: env(safe-area-inset-bottom); }

/* Product feature columns never force a sideways scroll on tiny screens */
.feature-groups { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }

/* Long words / URLs / emails wrap instead of overflowing */
p, li, dd, h1, h2, h3, h4 { overflow-wrap: break-word; }

/* Lift-on-hover only on devices with a real pointer, so taps don't leave
   cards stuck in their hover state on phones and tablets */
@media (hover: none) {
  .card:hover, .btn:hover { transform: none; }
  .card:hover { box-shadow: var(--shadow); border-color: var(--border); }
}

/* Tablet */
@media (max-width: 1024px) {
  .hero .container { gap: 40px; }
  .split { gap: 48px; }
  .product { grid-template-columns: 220px 1fr; gap: 36px; padding: 36px; }
}

/* Mobile menu: scrollable if the screen is short (e.g. phone in landscape) */
@media (max-width: 880px) {
  .nav.open {
    max-height: calc(100vh - 78px);
    max-height: calc(100dvh - 78px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { padding: .8em 1em; font-size: 1.02rem; }   /* bigger tap targets */
  body.menu-open { overflow: hidden; }
  .hero { padding: 64px 0 96px; }
  .hero-card { padding: 24px; }
  .page-hero { padding: 56px 0 48px; }
  .section-head { margin-bottom: 40px; }
  .product { grid-template-columns: 1fr; }
  .product-media { justify-self: stretch; }
  .services-layout { gap: 0; }
  .service-detail { padding: 36px 0; }
  .cta-band { text-align: left; }
}

/* Phones */
@media (max-width: 560px) {
  .container { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .site-header .container { height: 66px; }
  .nav { top: 66px; }
  .nav.open { max-height: calc(100vh - 66px); max-height: calc(100dvh - 66px); }
  .logo img { height: 38px; }
  .topbar { font-size: .8rem; }

  .section { padding: 56px 0; }
  .hero { padding: 48px 0 88px; }
  .hero .lead { font-size: 1.02rem; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .pill-list li { padding: 10px 12px; font-size: .95rem; }

  .stats { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: -56px; }
  .stat { padding: 18px 12px; }
  .stat strong { font-size: 1.6rem; }
  .stat span { font-size: .8rem; line-height: 1.35; display: block; }

  .card { padding: 24px; }
  .grid { gap: 18px; }
  .product { padding: 22px; border-radius: 16px; margin-bottom: 24px; }
  .product-media { padding: 20px; }
  .product-media img { width: 140px; }
  .sub-card { padding: 18px; }
  .cta-band { padding: 32px 22px; border-radius: 18px; }
  .cta-band .btn { width: 100%; justify-content: center; }
  .map-wrap iframe { height: 220px; }
  .footer-bottom { flex-direction: column; }
  .form .btn { width: 100%; justify-content: center; }
}

/* Small phones (iPhone SE, Galaxy Fold folded) */
@media (max-width: 360px) {
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }
  .stat strong { font-size: 1.35rem; }
}

/* Form fields: 16px text stops iPhones zooming in when a field is tapped */
.form input, .form select, .form textarea { font-size: 16px; }

/* Large screens */
@media (min-width: 1600px) {
  :root { --max: 1280px; }
}
