/* ─────────────────────────────────────────────────────────────────────
   AMPZ Mechanical — public site styles
   Shared across every page in /site/. Designed for the agent to edit:
   look for "── EDITABLE TOKENS" at the top of this file.
   ───────────────────────────────────────────────────────────────────── */

/* ── EDITABLE TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:       oklch(0.13 0.005 60);
  --bg-2:     oklch(0.16 0.005 60);
  --fg:       oklch(0.96 0.005 60);
  --muted:    oklch(0.55 0.005 60);
  --muted-2:  oklch(0.42 0.005 60);
  --accent:   oklch(0.62 0.16 40);
  --accent-2: oklch(0.55 0.18 40);
  --card:     oklch(0.16 0.005 60);
  --border:   oklch(1 0 0 / 0.1);
  --border-2: oklch(1 0 0 / 0.2);
  --input-bg: oklch(0.10 0.005 60);
  --error:    oklch(0.65 0.20 25);
  --success:  oklch(0.65 0.18 145);

  --content-w: 64rem;          /* page max-width */
  --copy-w:    52rem;           /* prose / paragraph max-width */
  --radius-sm: 0.375rem;
  --radius:    0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Inter", sans-serif;
  background: var(--bg); color: var(--fg);
  min-height: 100vh; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── LAYOUT ──────────────────────────────────────────────────────── */
.wrap     { max-width: var(--content-w); margin: 0 auto; padding: 0 1.5rem; }
.wrap-sm  { max-width: 36rem; margin: 0 auto; padding: 0 1.5rem; }
.section  { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
@media (max-width: 40rem) {
  .section { padding: 3.5rem 0; }
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────────── */
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); margin-bottom: 1rem; }
h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.eyebrow {
  display: inline-block; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: oklch(0.62 0.16 40 / 0.15); color: var(--accent);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 1.25rem;
}
.lede {
  color: var(--muted); max-width: var(--copy-w);
  font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.65;
  margin-bottom: 2.5rem;
}
.prose p { color: var(--fg); margin-bottom: 1rem; max-width: var(--copy-w); line-height: 1.65; }
.prose p strong { color: var(--fg); }
.prose ul { list-style: none; padding: 0; max-width: var(--copy-w); }
.prose ul li {
  position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; color: var(--muted);
}
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: 0.65rem;
  width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent);
}
.prose .result {
  margin-top: 1.5rem; padding: 1rem 1.25rem; border-left: 3px solid var(--accent);
  background: oklch(0.62 0.16 40 / 0.06); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg); font-size: 0.95rem;
}

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.25rem; border-radius: var(--radius);
  font-family: inherit; font-weight: 600; font-size: 0.9375rem;
  cursor: pointer; transition: filter 0.15s, transform 0.15s, background 0.15s, border-color 0.15s;
  border: 1px solid transparent; line-height: 1; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost   { background: transparent; color: var(--fg); border-color: var(--border-2); }
.btn-ghost:hover { background: oklch(1 0 0 / 0.06); border-color: var(--accent); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.8125rem; }

/* ── SITE HEADER (loaded into <header id="site-header">) ─────────── */
#site-header {
  position: sticky; top: 0; z-index: 30;
  background: oklch(0.13 0.005 60 / 0.85);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--content-w); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem;
}
.site-logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; color: var(--fg); }
.site-logo .dot { width: 1.5rem; height: 1.5rem; border-radius: var(--radius-sm); background: var(--accent); display: grid; place-items: center; color: var(--bg); font-size: 0.85rem; font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
/* :not(.btn) so .btn-primary / .btn-ghost children keep their own color rules
   instead of being overridden by this higher-specificity .site-nav a selector. */
.site-nav a:not(.btn) {
  color: var(--muted); padding: 0.45rem 0.75rem; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; transition: color 0.15s, background 0.15s;
}
.site-nav a:not(.btn):hover, .site-nav a:not(.btn)[aria-current="page"] {
  color: var(--fg); background: oklch(1 0 0 / 0.04);
}
.site-nav .cta { margin-left: 0.75rem; }
.nav-toggle { display: none; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 0.5rem; font-size: 1.25rem; }
@media (max-width: 48rem) {
  .site-nav { display: none; position: absolute; top: 4rem; left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 0.75rem; gap: 0.25rem; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.75rem 1rem; }
  .site-nav .cta { margin-left: 0; margin-top: 0.5rem; text-align: center; }
  .nav-toggle { display: block; }
}

/* ── HERO ────────────────────────────────────────────────────────── */
.hero { padding: 5rem 0 4rem; }
.hero h1 { margin-bottom: 1.25rem; }
.hero .lede { margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-stats {
  margin-top: 4rem; display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 48rem) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.hero-stat {
  padding: 1.25rem 1.5rem; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.hero-stat .value { font-size: 1.875rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.hero-stat .label { font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; }

/* ── CARDS GRID (services / markets) ─────────────────────────────── */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 56rem) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 36rem) { .card-grid { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.5rem; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color 0.15s, transform 0.15s;
}
a.card { color: var(--fg); }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .card-eyebrow { font-size: 0.7rem; font-weight: 600; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.card h3 { font-size: 1.125rem; margin: 0; }
.card p { font-size: 0.9375rem; color: var(--muted); line-height: 1.55; margin: 0.25rem 0 0; }
.card .more { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--accent); font-weight: 600; }

/* ── 4-PILLAR (Why us) ───────────────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 56rem) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 36rem) { .pillars { grid-template-columns: 1fr; } }
.pillar h3 { color: var(--accent); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }
.pillar p { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }

/* ── TESTIMONIAL ─────────────────────────────────────────────────── */
.quote {
  position: relative; padding: 2rem 2.5rem; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  max-width: var(--copy-w); margin: 0 auto;
}
.quote::before {
  content: '"'; position: absolute; top: -0.5rem; left: 1.25rem;
  color: var(--accent); font-size: 4rem; line-height: 1; font-family: Georgia, serif;
}
.quote p { font-size: 1.0625rem; line-height: 1.6; color: var(--fg); margin-bottom: 1rem; }
.quote .cite { font-size: 0.8125rem; color: var(--muted); font-style: italic; }

/* ── CTA BANNER ──────────────────────────────────────────────────── */
.cta-banner {
  padding: 3.5rem 2rem; border-radius: var(--radius-xl);
  background: linear-gradient(135deg, oklch(0.62 0.16 40 / 0.18), oklch(0.62 0.16 40 / 0.05));
  border: 1px solid oklch(0.62 0.16 40 / 0.3);
  text-align: center;
}
.cta-banner h2 { margin-bottom: 0.75rem; }
.cta-banner p  { color: var(--muted); margin-bottom: 1.75rem; max-width: 36rem; margin-left: auto; margin-right: auto; }

/* ── KEY-VALUE / BENEFITS LIST ───────────────────────────────────── */
.kv-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 48rem) { .kv-grid { grid-template-columns: 1fr; } }
.kv h3 { font-size: 0.875rem; font-weight: 700; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5rem; }
.kv p { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }

/* ── MARKETS LIST (chips) ────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.5rem 0.875rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.8125rem; color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--fg); }

/* ── SITE FOOTER (loaded into <footer id="site-footer">) ─────────── */
#site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.site-footer-inner {
  max-width: var(--content-w); margin: 0 auto; padding: 3rem 1.5rem 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
  margin-bottom: 3rem;
}
@media (max-width: 56rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 36rem) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.footer-brand .tagline { color: var(--accent); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.footer-brand p { color: var(--muted); font-size: 0.875rem; line-height: 1.6; max-width: 22rem; }
.footer-col h4 { font-size: 0.75rem; font-weight: 700; color: var(--fg); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.875rem; }
.footer-col a, .footer-col p { display: block; color: var(--muted); font-size: 0.875rem; padding: 0.25rem 0; transition: color 0.15s; }
.footer-col a:hover { color: var(--fg); }
.footer-base {
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 0.75rem; flex-wrap: wrap; gap: 1rem;
}

/* ── FORMS (contact + apply pages) ───────────────────────────────── */
form { display: flex; flex-direction: column; gap: 1.25rem; }
.row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 30rem) { .row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.75rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.field label .req { color: var(--accent); margin-left: 0.25rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.7rem 0.85rem; font-family: inherit; font-size: 0.9375rem;
  background: var(--input-bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background: var(--bg);
}
.field textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
.yesno { display: flex; gap: 0.5rem; }
.yesno label {
  flex: 1; cursor: pointer; padding: 0.5rem 0.75rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--muted); transition: all 0.15s ease;
}
.yesno input[type="radio"] { display: none; }
.yesno label:has(input[type="radio"]:checked) { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.yesno label:hover { border-color: var(--border-2); }
button[type="submit"] {
  margin-top: 0.5rem; padding: 0.85rem 1.5rem;
  background: var(--accent); color: var(--bg); border: 0; border-radius: var(--radius);
  font-family: inherit; font-weight: 600; font-size: 0.9375rem;
  cursor: pointer; transition: filter 0.15s;
}
button[type="submit"]:hover { filter: brightness(1.1); }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.honeypot { position: absolute; left: -10000px; opacity: 0; pointer-events: none; }
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius); font-size: 0.875rem;
  margin-bottom: 1.5rem; line-height: 1.5; border: 1px solid var(--border);
}
.alert.success { background: oklch(0.65 0.18 145 / 0.12); border-color: oklch(0.65 0.18 145 / 0.4); color: var(--success); }
.alert.error   { background: oklch(0.65 0.20 25 / 0.10);  border-color: oklch(0.65 0.20 25 / 0.4);  color: var(--error); }
.alert .ref { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
.muted-foot { margin-top: 2rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.6; text-align: center; }
.muted-foot a { color: var(--muted); text-decoration: underline; }

/* ── CHAT WIDGET (loaded by _chrome.js into body) ────────────────── */
#chat-launcher {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 40;
  display: flex; align-items: center; gap: 0.5rem;
  height: 2.75rem; padding: 0 1.1rem; border-radius: 999px;
  background: var(--accent); color: var(--bg);
  border: 0; font-family: inherit; font-weight: 600; font-size: 0.875rem;
  cursor: pointer; box-shadow: 0 4px 24px oklch(0 0 0 / 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}
#chat-launcher:hover { filter: brightness(1.1); transform: translateY(-1px); }
#chat-launcher.hidden { display: none; }
#chat-panel {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 50;
  width: min(420px, calc(100vw - 3rem));
  height: min(640px, calc(100vh - 4rem));
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px oklch(0 0 0 / 0.5);
  display: flex; flex-direction: column;
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#chat-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
#chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
#chat-header h2 { font-size: 0.875rem; font-weight: 600; margin: 0; letter-spacing: 0; }
#chat-header p  { font-size: 0.6875rem; color: var(--muted); margin: 0; }
#chat-close {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 0.25rem 0.5rem; font-size: 1.25rem; line-height: 1;
}
#chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.msg { font-size: 0.875rem; line-height: 1.5; }
.msg.user {
  align-self: flex-end; max-width: 85%;
  background: oklch(0.62 0.16 40 / 0.15); padding: 0.5rem 0.75rem; border-radius: var(--radius-lg);
}
.msg.assistant { align-self: flex-start; max-width: 90%; color: var(--fg); white-space: pre-wrap; }
.msg.assistant.thinking { color: var(--muted); font-style: italic; }
.msg.complete {
  align-self: stretch; padding: 0.75rem; background: oklch(0.5 0.15 145 / 0.15);
  border: 1px solid oklch(0.5 0.15 145 / 0.3); border-radius: var(--radius);
  color: oklch(0.85 0.18 145); font-size: 0.8125rem;
}
#chat-form {
  display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); flex-shrink: 0;
}
#chat-input {
  flex: 1; padding: 0.5rem 0.75rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: oklch(1 0 0 / 0.04);
  color: var(--fg); font-family: inherit; font-size: 0.875rem;
  resize: none; outline: none;
}
#chat-input:focus { border-color: var(--accent); }
#chat-send {
  background: var(--accent); color: var(--bg); border: 0;
  padding: 0 0.875rem; border-radius: var(--radius); font-weight: 600; font-size: 0.875rem;
  cursor: pointer; min-width: 4rem;
}
#chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
