/* ============================================
   Core Automation · Substrate brand · site.css
   ============================================ */

:root {
  /* Substrate palette */
  --bg:        #0A0E1A;
  --surface:   #11172A;
  --surface-2: #161E36;
  --surface-3: #1C2541;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.16);
  --line-3:    rgba(255,255,255,0.28);
  --text:      #F4F4F0;
  --text-dim:  #9AA3B8;
  --text-mute: #5B6478;
  --accent:    #3D7CFF;
  --accent-dim:#1E4FCB;
  --warn:      #FF9F47;
  --good:      #4FD49A;

  /* Type */
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* Sizing */
  --max:    1280px;
  --max-w:  1280px;
  --pad:    clamp(24px, 4vw, 64px);
  --r-sm:   2px;
  --r-md:   4px;
  --r-lg:   8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wm-i {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

::selection { background: var(--accent); color: var(--bg); }

/* ============================================
   Container + grid utilities
   ============================================ */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
}

.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section--tight { padding: clamp(56px, 8vw, 96px) 0; }
.section--border-t { border-top: 1px solid var(--line); }
.section--border-b { border-bottom: 1px solid var(--line); }

/* Hairline grid background — used on hero */
.bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, black 0%, transparent 75%);
          mask-image: radial-gradient(ellipse at 70% 30%, black 0%, transparent 75%);
  opacity: 0.55;
}

.bg-glow {
  position: absolute; pointer-events: none; z-index: 0;
  filter: blur(0);
}
.bg-glow--top-right {
  top: -240px; right: -160px;
  width: 720px; height: 720px;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 22%, transparent) 0%, transparent 60%);
}
.bg-glow--bottom-left {
  bottom: -280px; left: -160px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 14%, transparent) 0%, transparent 60%);
}

/* ============================================
   Typography
   ============================================ */

.mono { font-family: var(--mono); }
.dim  { color: var(--text-dim); }
.mute { color: var(--text-mute); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow--dim { color: var(--text-mute); }
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex: 0 0 auto;
}

h1, h2, h3, h4 { font-family: var(--sans); font-weight: 600; margin: 0; line-height: 1.05; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(48px, 7.2vw, 96px); letter-spacing: -0.035em; line-height: 0.96; }
h2 { font-size: clamp(36px, 4.4vw, 64px); letter-spacing: -0.03em; line-height: 1; }
h3 { font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.02em; line-height: 1.1; }
h4 { font-size: 18px; letter-spacing: -0.01em; line-height: 1.2; }

p { margin: 0; color: var(--text-dim); }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--text-dim); line-height: 1.5; max-width: 56ch; }

.tick { color: var(--accent); }
.divider { height: 1px; background: var(--line); border: 0; }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  text-decoration: none;
}
.btn:hover { background: rgba(255,255,255,0.04); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}
.btn--primary:hover { background: #fff; border-color: #fff; }

.btn--accent {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}
.btn--accent:hover { background: color-mix(in oklch, var(--accent) 90%, white); }

.btn--ghost { border-color: transparent; padding: 12px 8px; }
.btn--ghost:hover { background: transparent; color: var(--text); }

.btn .arrow { transition: transform 160ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================
   Header / nav
   ============================================ */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  max-width: var(--max-w); margin: 0 auto;
}
.site-header__nav {
  display: flex; gap: 32px;
  font-size: 14px; font-weight: 500;
  color: var(--text-dim);
}
.site-header__nav a {
  position: relative;
  transition: color 120ms ease;
}
.site-header__nav a:hover { color: var(--text); }
.site-header__nav a.is-active { color: var(--text); }
.site-header__nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -22px;
  height: 1px; background: var(--accent);
}

/* Logo lockup */
.lockup {
  display: inline-flex; align-items: center; gap: 1px;
  text-decoration: none; color: var(--text);
}
.lockup__col {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
}
.lockup__word {
  font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); line-height: 1;
}
.lockup__tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-mute);
  line-height: 1;
  white-space: nowrap;
}

/* ============================================
   Site footer
   ============================================ */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 80px var(--pad) 32px;
}
.site-footer__inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 64px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.site-footer__brand p { margin-top: 20px; max-width: 32ch; font-size: 14px; color: var(--text-dim); }
.site-footer__col h5 {
  font-family: var(--mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin: 0 0 16px; font-weight: 500;
}
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { font-size: 14px; color: var(--text-dim); transition: color 120ms ease; }
.site-footer__col a:hover { color: var(--text); }

.site-footer__meta {
  max-width: var(--max-w); margin: 24px auto 0;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.5px;
}

@media (max-width: 800px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 40px; }
}

/* ============================================
   Cards / surfaces
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 32px;
  position: relative;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.card:hover { border-color: var(--line-2); background: var(--surface-2); }

.card__num {
  font-family: var(--mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 1px; margin-bottom: 16px;
}
.card__title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 12px; }
.card__body  { color: var(--text-dim); font-size: 15px; line-height: 1.55; }
.card__meta {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* "Code box" panel */
.code-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
}
.code-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.5px;
}
.code-panel__dots { display: flex; gap: 6px; }
.code-panel__dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--line-2); }
.code-panel__dots span:last-child { background: var(--accent); }
.code-panel__body { padding: 20px 22px; line-height: 1.7; }

/* ============================================
   Tag / chip
   ============================================ */

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.chip .dot { width: 6px; height: 6px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ============================================
   Form
   ============================================ */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--mono); font-size: 11px; color: var(--text-mute);
  letter-spacing: 1px; text-transform: uppercase; font-weight: 500;
}
.field input, .field textarea, .field select {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--sans); font-size: 15px;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  background: var(--surface-2);
}
.field textarea { min-height: 140px; resize: vertical; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 22px) center, calc(100% - 16px) center; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

.radiogroup { display: flex; flex-wrap: wrap; gap: 8px; }
.radiogroup label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-family: var(--sans); font-size: 14px; color: var(--text-dim);
  cursor: pointer;
  letter-spacing: -0.005em; text-transform: none;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.radiogroup label:hover { border-color: var(--line-3); color: var(--text); }
.radiogroup input { display: none; }
.radiogroup input:checked + span,
.radiogroup label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 800px) {
  .site-header__nav { display: none; }
  h1 { font-size: clamp(40px, 10vw, 56px); }
  .section { padding: 64px 0; }
}

/* ============================================
   The Aperture mark sits inline as SVG.
   Sizing variants:
   ============================================ */
.aperture { display: inline-block; flex: 0 0 auto; }
