/* =========================================================
   J3 — Automation & Intelligence
   Shared design system  ·  Modern dark / tech
   ========================================================= */

:root {
  /* Surfaces */
  --bg:        #070a10;
  --bg-2:      #0b0f17;
  --surface:   #0f1521;
  --surface-2: #141b29;
  --line:      #1e2636;

  /* Text */
  --text:      #e8edf6;
  --muted:     #9aa7bd;
  --faint:     #6b7891;

  /* Accent — J3 brand teal (#11638a) family */
  --brand:     #11638a;            /* exact logo teal */
  --accent:    #3aa6d4;            /* brightened for dark-bg legibility */
  --accent-2:  #1b7fb0;            /* mid brand teal */
  --accent-3:  #4dc2c4;            /* teal-green secondary */
  --glow:      rgba(58, 166, 212, 0.42);

  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-soft: linear-gradient(135deg, rgba(58,166,212,.14), rgba(17,99,138,.16));

  /* Type */
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Layout */
  --maxw: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { scroll-behavior: smooth; }

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

/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(58,166,212,.10), transparent 60%),
    radial-gradient(50rem 40rem at 100% 0%, rgba(17,99,138,.14), transparent 55%),
    var(--bg);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

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

.section { padding: 110px 0; }
.section--tight { padding: 72px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head);
  font-size: .8rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); display: inline-block; }

.h-xl { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.h-lg { font-size: clamp(2rem, 4vw, 3rem); }
.h-md { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 60ch; }

.text-grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 500; font-size: .98rem;
  padding: 14px 26px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad); color: #061018; font-weight: 600;
  box-shadow: 0 8px 30px -8px var(--glow);
}
.btn-primary:hover { box-shadow: 0 14px 40px -8px var(--glow); }
.btn-ghost {
  background: rgba(255,255,255,.03);
  border-color: var(--line); color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(58,166,212,.06); }
.arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7,10,16,.65);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(7,10,16,.85); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { height: 30px; width: auto; display: block; }
.site-footer .brand img { height: 34px; }

.nav-links { display: flex; align-items: center; gap: 34px; list-style: none; }
.nav-links a { font-size: .95rem; color: var(--muted); transition: color .2s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--grad); border-radius: 2px;
}
.nav-cta { display: flex; align-items: center; gap: 18px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .3s; border-radius: 2px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 120px 0 90px; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(60rem 40rem at 50% 0%, #000 30%, transparent 75%);
  opacity: .35;
}
.hero h1 { margin-bottom: 22px; max-width: 16ch; }
.hero .lead { margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 46px; display: flex; gap: 38px; flex-wrap: wrap; }
.hero-meta .stat .n { font-family: var(--font-head); font-size: 1.7rem; font-weight: 600; }
.hero-meta .stat .l { font-size: .82rem; color: var(--faint); letter-spacing: .04em; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .82rem; color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  margin-bottom: 26px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
/* Contact: form spans full width at all sizes so the dropdown is never clipped */
.contact-grid { grid-template-columns: 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform .3s var(--ease), border-color .3s, background .3s;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); border-color: rgba(58,166,212,.4); background: var(--surface-2); }
.card .ico {
  width: 50px; height: 50px; border-radius: 12px;
  background: var(--grad-soft); border: 1px solid var(--line);
  display: grid; place-items: center; margin-bottom: 20px;
  font-size: 1.4rem;
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .96rem; }
.card .tag-row { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .76rem; color: var(--accent); padding: 4px 11px; border-radius: 999px; background: rgba(58,166,212,.08); border: 1px solid rgba(58,166,212,.2); }

/* Photo cards (real project photography) */
.card--photo { padding: 0; }
.card--photo .card-photo { position: relative; aspect-ratio: 3/2; overflow: hidden; }
.card--photo .card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.card--photo .card-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7,10,16,.55)); }
.card--photo:hover .card-photo img { transform: scale(1.06); }
.card--photo .card-body { padding: 24px 26px 28px; }
.card--photo .card-body h3 { font-size: 1.18rem; margin-bottom: 8px; }
.media-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.section-head { max-width: 64ch; margin-bottom: 54px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: 16px; }

/* ---------- Pillars (unified automation) ---------- */
.pillar {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center;
  padding: 44px 0;
}
.pillar:nth-child(even) .pillar-media { order: -1; }
.pillar-media {
  aspect-ratio: 4/3; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.pillar-media .glyph { font-size: 4rem; opacity: .9; }
.pillar-media::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(30rem 20rem at 70% 20%, rgba(58,166,212,.16), transparent 60%);
}

/* ---------- Process / steps ---------- */
.steps { counter-reset: s; display: grid; gap: 2px; }
.step { display: grid; grid-template-columns: 70px 1fr; gap: 22px; padding: 26px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step .num { counter-increment: s; font-family: var(--font-head); font-size: 1.5rem; color: var(--accent); }
.step .num::before { content: "0" counter(s); }
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  border: 1px solid var(--line); border-radius: 24px;
  background: var(--grad-soft);
  padding: 60px; text-align: center; position: relative; overflow: hidden;
}
.cta-band h2 { margin-bottom: 14px; }
.cta-band .lead { margin: 0 auto 28px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form .grid { min-width: 0; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-size: .85rem; color: var(--muted); font-family: var(--font-head); }
.field input, .field textarea, .field select {
  width: 100%; max-width: 100%; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--text); font-family: var(--font-body); font-size: .98rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(58,166,212,.15);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: .85rem; color: var(--faint); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Contact info list ---------- */
.info-list { list-style: none; display: grid; gap: 22px; }
.info-list li { display: flex; gap: 16px; align-items: flex-start; }
.info-list .ico { width: 44px; height: 44px; border-radius: 11px; background: var(--grad-soft); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.info-list .k { font-family: var(--font-head); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.info-list .v { font-size: 1.05rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 36px; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 18px; }
.footer-col ul { list-style: none; display: grid; gap: 11px; }
.footer-col a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-brand p { color: var(--muted); margin: 16px 0 20px; max-width: 38ch; font-size: .95rem; }
.socials { display: flex; gap: 12px; }
.socials a { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: .25s; }
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 26px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--faint); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  /* Contact: stack form + info column so the form isn't squeezed */
  .contact-grid { grid-template-columns: 1fr !important; }
  .pillar { grid-template-columns: 1fr; gap: 26px; }
  .pillar:nth-child(even) .pillar-media { order: 0; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .section { padding: 80px 0; }
  .nav-links {
    position: fixed; inset: 74px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 10px 24px 24px; transform: translateY(-120%); transition: transform .35s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: block; }
  .nav-cta .btn { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 24px; }
  .hero-meta { gap: 24px; }
}
