/* Enns Automations — production stylesheet (Direction B: Schematic)
   Themes: light + dark, with system-detect default.
   Color tokens are CSS variables so the Tweaks panel can override at runtime. */

:root {
  /* Base brand tokens — overridable via JS */
  --t-charcoal: #1A1A1A;
  --t-copper: #B87333;
  --t-orange: #FF6A00;
  --t-amber: #FFB000;
  --t-soft-white: #F7F7F7;

  /* Resolved theme tokens (default = light) */
  --bg: var(--t-soft-white);
  --bg-elev: #ffffff;
  --bg-sunken: #efefef;
  --ink: var(--t-charcoal);
  --ink-soft: #4a4a4a;
  --ink-muted: #8a8a8a;
  --border: rgba(26,26,26,0.12);
  --border-strong: rgba(26,26,26,0.28);
  --accent: var(--t-copper);
  --accent-bright: var(--t-orange);
  --accent-warm: var(--t-amber);
  --grid: rgba(26,26,26,0.04);
}

[data-theme="dark"] {
  --bg: var(--t-charcoal);
  --bg-elev: #232323;
  --bg-sunken: #0f0f0f;
  --ink: var(--t-soft-white);
  --ink-soft: #c8c8c8;
  --ink-muted: #888;
  --border: rgba(247,247,247,0.10);
  --border-strong: rgba(247,247,247,0.22);
  --grid: rgba(247,247,247,0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 220ms ease, color 220ms ease;
}

::selection { background: var(--accent-bright); color: var(--t-charcoal); }

a { color: inherit; text-decoration: none; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.display {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.kicker::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* ─── Nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 160ms ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--accent);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-toggle {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 160ms, background 160ms;
}
.theme-toggle:hover { border-color: var(--border-strong); background: var(--bg-elev); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ─── Logo ─────────────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}
.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 32px;
}
.logo-mark svg { width: 100%; height: 100%; }
.logo-text {
  font-size: 18px;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-text small {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  margin-top: 3px;
}

/* Divider line in logo */
.logo-divider {
  width: 1px;
  height: 28px;
  background: var(--border-strong);
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-bright);
  color: var(--t-charcoal);
}
.btn-primary:hover {
  background: var(--accent-warm);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent-bright) 60%, transparent);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  background: var(--bg-elev);
  border-color: var(--ink);
}
.btn-copper {
  background: var(--accent);
  color: #fff;
}
.btn-copper:hover { filter: brightness(1.1); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn .arr { transition: transform 180ms ease; }
.btn:hover .arr { transform: translateX(3px); }

/* ─── Section primitives ───────────────────────────────────── */
.section {
  padding: 96px 0;
  position: relative;
}
.section-tight { padding: 64px 0; }
.section-sunken { background: var(--bg-sunken); }

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

h1, h2, h3, h4 { margin: 0; }

.h-display {
  font-size: clamp(44px, 6vw, 88px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.0;
}
.h-section {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.h-card {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 580px;
}

/* ─── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 180ms, transform 180ms;
}
.card:hover {
  border-color: var(--border-strong);
}
.card-bordered {
  background: transparent;
  border: 1px solid var(--border);
}

/* ─── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  background: var(--bg-sunken);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; font-size: 14px; }
.footer li a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-muted);
}
.tagline {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
}
.circuit-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 24px;
}
.circuit-bar svg { display: block; }

/* ─── Decorative grid bg ──────────────────────────────────── */
.bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ─── Tag/pill ─────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.tag-copper { border-color: var(--accent); color: var(--accent); }

/* ─── Form ─────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 600;
}
.field input, .field textarea, .field select {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 0;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-bottom-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 110px; }

/* ─── Utility ──────────────────────────────────────────────── */
.muted { color: var(--ink-muted); }
.copper { color: var(--accent); }
.orange { color: var(--accent-bright); }
.amber { color: var(--accent-warm); }

/* Responsive helpers */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 64px 0; }
}
