/* ==========================================================================
   SignAptics — Core Stylesheet
   Single-file, zero-build design system. Organized in sections:
     1. Design tokens (CSS custom properties)
     2. Reset / base
     3. Layout primitives (container, grid, section)
     4. Typography
     5. Components (buttons, nav, cards, badges, forms)
     6. Page sections (hero, features, use-cases, process, CTA, footer)
     7. Utilities
     8. Responsive + motion preferences
   ========================================================================== */

/* 1. DESIGN TOKENS ========================================================= */
:root {
  /* Brand palette — industrial, high-contrast, matte */
  --graphite-900: #0d0f12;   /* near-black surface */
  --graphite-800: #14171c;
  --graphite-700: #1d222a;
  --graphite-600: #2a313b;
  --graphite-400: #5b6573;
  --graphite-200: #aab3c0;
  --paper:        #f5f6f8;   /* light surface */
  --paper-2:      #e9ecf1;
  --white:        #ffffff;

  --signal:       #ff5a1f;   /* industrial accent (safety orange) */
  --signal-600:   #e64a14;
  --signal-tint:  rgba(255, 90, 31, 0.12);
  --cyan:         #19c3d8;   /* secondary accent for QR/tech cues */

  /* Semantic */
  --bg:           var(--graphite-900);
  --bg-elev:      var(--graphite-800);
  --bg-card:      var(--graphite-700);
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong:rgba(255, 255, 255, 0.16);
  --text:         #eef1f5;
  --text-muted:   var(--graphite-200);
  --text-dim:     var(--graphite-400);
  --accent:       var(--signal);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 2rem + 3.2vw, 4.6rem);

  /* Space + radius + motion */
  --space-xs: 0.5rem;
  --space-sm: 0.875rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --radius:   10px;
  --radius-lg:18px;
  --shadow:   0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --ring:     0 0 0 3px var(--signal-tint);
  --maxw:     1180px;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
}

/* 2. RESET / BASE ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
ul[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* 3. LAYOUT PRIMITIVES ===================================================== */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space-md); }
.section { padding-block: clamp(3.5rem, 2rem + 7vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.grid { display: grid; gap: var(--space-md); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stack > * + * { margin-top: var(--space-sm); }

/* 4. TYPOGRAPHY ============================================================ */
h1, h2, h3, h4 { line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 500;
}
.lead { font-size: var(--step-1); color: var(--text-muted); line-height: 1.45; font-weight: 400; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.balance { text-wrap: balance; }

/* 5. COMPONENTS ============================================================ */
/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.85em 1.5em;
  border-radius: var(--radius);
  font-weight: 600; font-size: var(--step-0);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--signal); color: #fff; }
.btn--primary:hover { background: var(--signal-600); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--accent); color: #fff; }
.btn--lg { padding: 1.05em 1.9em; font-size: var(--step-1); }

/* Badge / pill */
.badge {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-mono); font-size: var(--step--1);
  padding: 0.35em 0.8em; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-muted);
  background: rgba(255,255,255,0.03);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 15, 18, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 0.6em; font-weight: 800; letter-spacing: -0.03em; font-size: 1.18rem; }
.brand .mark { width: auto; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { font-size: var(--step--1); color: var(--text-muted); font-weight: 500; transition: color 0.15s; }
.nav-links a:hover { color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0.45em 0.6em; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.card .icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; background: var(--signal-tint); color: var(--accent);
  margin-bottom: var(--space-sm);
}
.card .icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--text-muted); font-size: var(--step--1); }

/* Use-case card (niche) */
.usecase {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 320px; padding: var(--space-md);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,15,18,0) 35%, rgba(13,15,18,0.9) 100%), var(--bg-elev);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.usecase:hover { transform: translateY(-4px); border-color: var(--accent); }
.usecase h3 { font-size: var(--step-2); }
.usecase .arrow { margin-top: var(--space-sm); color: var(--accent); font-family: var(--font-mono); font-size: var(--step--1); }

/* Forms (native field styling for embedded/Cognito fallback + native forms) */
.field { display: block; margin-bottom: var(--space-sm); }
.field label { display: block; font-size: var(--step--1); font-weight: 600; margin-bottom: 0.4em; color: var(--text-muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.8em 1em;
  background: var(--graphite-800); border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }

/* 6. PAGE SECTIONS ========================================================= */
/* Hero */
.hero { position: relative; padding-block: clamp(4rem, 2rem + 9vw, 8rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(255,90,31,0.16), transparent 60%),
    radial-gradient(50% 40% at 0% 100%, rgba(25,195,216,0.10), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--space-lg); align-items: center; }
.hero h1 { margin: 0.4em 0; }
.hero .lead { max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-md); }
.hero-proof { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: var(--space-lg); color: var(--text-dim); font-size: var(--step--1); }
.hero-proof strong { color: var(--text); font-size: var(--step-1); display: block; font-weight: 700; }

/* Visual panel (product mock) */
.hero-visual {
  aspect-ratio: 4 / 5; border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, var(--graphite-700), var(--graphite-900));
  box-shadow: var(--shadow);
  display: grid; place-items: center; position: relative;
}

/* Logo / trust strip */
.trust { border-block: 1px solid var(--border); }
.trust .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md); padding-block: var(--space-md); }
.trust .label { font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-dim); }

/* Section heading block */
.section-head { max-width: 60ch; margin-bottom: var(--space-lg); }
.section-head h2 { margin: 0.3em 0 0.4em; }

/* Process / spec list */
.spec { display: flex; gap: var(--space-md); align-items: flex-start; padding-block: var(--space-md); border-top: 1px solid var(--border); }
.spec .num { font-family: var(--font-mono); color: var(--accent); font-size: var(--step-1); min-width: 3ch; }
.spec h3 { margin-bottom: 0.3em; }
.spec p { color: var(--text-muted); }

/* CTA band */
.cta-band {
  border-radius: var(--radius-lg); padding: clamp(2rem, 1rem + 5vw, 4rem);
  background: linear-gradient(135deg, var(--signal), var(--signal-600));
  color: #fff; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band .btn--primary { background: #fff; color: var(--graphite-900); }
.cta-band .btn--primary:hover { background: var(--paper); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--graphite-800); padding-block: var(--space-lg); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: var(--space-lg); }
.footer-grid h4 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); margin-bottom: var(--space-sm); }
.footer-grid a { display: block; color: var(--text-muted); font-size: var(--step--1); padding-block: 0.25em; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--border); color: var(--text-dim); font-size: var(--step--1); }

/* 7. UTILITIES ============================================================= */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.hidden { display: none !important; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--signal); color: #fff; padding: 0.6em 1em; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* 8. RESPONSIVE + MOTION =================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header.is-open .nav-links {
    display: flex; position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--graphite-800); border-bottom: 1px solid var(--border); padding: var(--space-sm) var(--space-md);
  }
  .site-header.is-open .nav-links a { padding-block: 0.7em; width: 100%; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
