/* ==========================================================================
   API — Automation Process Integration
   Design System  ·  styles.css
   Single source of truth for color, type, spacing, and components.
   ========================================================================== */

/* ---- Fonts ---------------------------------------------------------------
   Loaded via Google Fonts <link> in each page <head>. Can be self-hosted
   later for zero external dependency (see README). Fallbacks are strong. */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  /* color */
  --base:        #0C0C0E;
  --surface:     #111114;
  --surface-2:   #17171b;
  --line:        rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.16);
  --text:        #F2F2F4;
  --muted:       #9A9AA2;
  --muted-2:     #6c6c76;

  /* brand gradients */
  --chrome:  linear-gradient(180deg,#ffffff 0%,#d7d7de 42%,#8f8f9c 72%,#c9c9d2 100%);
  --aurora:  linear-gradient(90deg,#5B7CFF,#A95BFF);
  --aurora-a: #5B7CFF;
  --aurora-b: #A95BFF;

  /* type */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* spacing scale */
  --sp-1: 8px;   --sp-2: 16px;  --sp-3: 24px;  --sp-4: 40px;
  --sp-5: 64px;  --sp-6: 96px;  --sp-7: 140px;

  /* geometry */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --container: 1160px;

  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Reset & base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;   /* stop long words forcing horizontal scroll */
}

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

::selection { background: rgba(91,124,255,.35); color: #fff; }

/* ---- Accessibility ------------------------------------------------------ */
/* Visible focus ring for keyboard users (mouse clicks don't trigger it). */
:focus-visible {
  outline: 2px solid var(--aurora-a);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Skip link — first tab stop, jumps past the header to main content. */
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---- Layout ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding-block: var(--sp-6); position: relative; }
.section--tight { padding-block: var(--sp-5); }

/* ---- Typography helpers ------------------------------------------------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: var(--sp-3);
}

.serif { font-family: var(--font-serif); }

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

h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.08; }

.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -.01em;
}
.display b { font-weight: 600; }

.lead { color: var(--muted); font-size: clamp(15px, 2vw, 19px); line-height: 1.6; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease), border-color .25s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-aurora {
  background: var(--aurora);
  color: #fff;
  box-shadow: 0 8px 26px rgba(91,124,255,.30);
}
.btn-aurora:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(122,90,255,.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.04); }

.btn-text { color: var(--muted); font-weight: 600; font-size: 14px; }
.btn-text:hover { color: var(--text); }

/* ---- Pill / eyebrow chip ------------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--aurora-a);
  box-shadow: 0 0 10px var(--aurora-a);
}

/* ---- Card --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: transform .3s var(--ease), border-color .3s var(--ease),
              background .3s var(--ease);
}

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12,12,14,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* logo (CSS text — always sharp, uses the loaded web font) */
.logo { display: inline-flex; flex-direction: column; line-height: 1; }
.logo .word {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: .10em;
  background: var(--chrome);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo .tag {
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: .30em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: 14px; color: var(--muted); transition: color .2s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
/* The in-nav CTA is for the mobile menu only; desktop uses .nav-actions.
   Without this, both buttons render side by side on desktop. */
.nav .btn { display: none; }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--sp-4);
  color: var(--muted-2);
}
.site-footer .row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.site-footer .links { display: flex; gap: 22px; font-size: 13px; }
.site-footer .links a:hover { color: var(--text); }
.site-footer .copy { font-size: 13px; }

/* ---- Responsive header -------------------------------------------------- */
@media (max-width: 720px) {
  .nav-actions .btn { display: none; }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; gap: 0;
    background: rgba(12,12,14,.98);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
    transform: translateY(-120%);
    transition: transform .3s var(--ease);
  }
  .nav.open { transform: translateY(0); }
  .nav a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav .btn { display: inline-flex; margin-top: 14px; }
  .nav-toggle { display: inline-flex; }
}

/* ==========================================================================
   Homepage
   ========================================================================== */

/* ---- Hero --------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; text-align: center;
  padding-block: clamp(72px, 12vw, 132px); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 340px at 50% -12%, rgba(91,124,255,.22), transparent 62%),
    radial-gradient(560px 320px at 88% 118%, rgba(169,91,255,.16), transparent 60%);
}
.hero > * { position: relative; z-index: 1; }
.hero .pill { margin-bottom: 26px; }
.hero h1 { max-width: 15ch; margin-inline: auto; }
.hero .lead { max-width: 600px; margin: 22px auto 32px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* subtle chrome sheen sweep on the hero headline */
.sheen { position: relative; }
.sheen::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  mix-blend-mode: screen; opacity: 0; animation: sheen 6s ease-in-out 1.2s infinite;
  pointer-events: none;
}
@keyframes sheen { 0%,100% { opacity: 0; } 8%,14% { opacity: .9; } }

/* ---- Trust bar ---------------------------------------------------------- */
.trust { border-block: 1px solid var(--line); }
.trust .row {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 14px 28px; padding-block: 20px;
  color: var(--muted); font-size: 13px; letter-spacing: .04em;
}
.trust .sep { color: var(--muted-2); }

/* ---- Section heading ---------------------------------------------------- */
.sec-head { max-width: 640px; margin-bottom: var(--sp-4); }
.sec-head h2 { font-size: clamp(26px, 4vw, 40px); }
.sec-head p { color: var(--muted); margin-top: 14px; font-size: 16px; }
.sec-head.center { margin-inline: auto; text-align: center; }

/* ---- Services grid ------------------------------------------------------ */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.service-card { display: flex; flex-direction: column; gap: 12px; }
.service-card:hover { transform: translateY(-4px); border-color: var(--line-strong);
  background: var(--surface-2); }
.service-ic {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--aurora); opacity: .92;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(91,124,255,.28);
}
.service-ic svg { stroke: #fff; }
.service-card h3 { font-size: 19px; font-family: var(--font-serif); }
.service-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.service-card .arrow { margin-top: auto; color: var(--muted-2); font-size: 20px; }

.service-card.more {
  align-items: center; justify-content: center; text-align: center;
  background: transparent; border-style: dashed;
}
.service-card.more:hover { transform: none; background: rgba(255,255,255,.02); }

/* ---- How it works ------------------------------------------------------- */
.how { background: #0a0a0d; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step .num {
  font-family: var(--font-serif); font-size: 40px;
  background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.step h3 { font-size: 20px; margin: 8px 0 8px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ---- Impact stats ------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: center; }
.stat-num {
  font-family: var(--font-serif); font-size: clamp(38px, 6vw, 58px); line-height: 1;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-lbl { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---- Final CTA band ----------------------------------------------------- */
.cta-band { text-align: center; }
.cta-box {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 22px; padding: clamp(40px, 7vw, 72px) 24px;
}
.cta-box::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(560px 260px at 50% -30%, rgba(91,124,255,.28), transparent 62%);
}
.cta-box > * { position: relative; z-index: 1; }
.cta-box h2 { font-size: clamp(28px, 5vw, 46px); }
.cta-box p { color: var(--muted); margin: 14px auto 28px; max-width: 460px; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .steps, .stats { grid-template-columns: 1fr; gap: 28px; }
  .stats { gap: 34px; }
}
@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Services page
   ========================================================================== */
.page-head { text-align: center; position: relative; overflow: hidden;
  padding-block: clamp(64px, 10vw, 108px); }
.page-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(680px 300px at 50% -20%, rgba(91,124,255,.18), transparent 62%);
}
.page-head > * { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(32px, 6vw, 58px); max-width: 18ch; margin-inline: auto; }
.page-head .lead { max-width: 560px; margin: 20px auto 30px; }

/* alternating service blocks */
.svc-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.svc-block:nth-child(even) .svc-media { order: 2; }

.svc-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line); border-radius: 18px;
  background:
    radial-gradient(360px 200px at 30% 20%, rgba(91,124,255,.20), transparent 65%),
    radial-gradient(320px 200px at 80% 90%, rgba(169,91,255,.18), transparent 65%),
    var(--surface);
  display: grid; place-items: center;
}
.svc-media .glyph {
  width: 84px; height: 84px; border-radius: 22px;
  background: var(--aurora); display: grid; place-items: center;
  box-shadow: 0 14px 44px rgba(91,124,255,.4);
}
.svc-media .glyph svg { stroke: #fff; width: 40px; height: 40px; }
.svc-media .idx {
  position: absolute; top: 18px; left: 22px; z-index: 2;
  font-family: var(--font-serif); font-size: 66px; line-height: 1;
  color: rgba(255,255,255,.06);
}
.svc-media .svc-photo {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.svc-media:has(.svc-photo) .glyph,
.svc-media:has(.svc-photo) .idx { display: none; }

.svc-body .kicker { color: var(--aurora-a); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.svc-body h2 { font-size: clamp(26px, 4vw, 38px); margin: 8px 0 14px; }
.svc-body > p { color: var(--muted); font-size: 16px; line-height: 1.6; margin-bottom: 20px; }

.what-you-get { list-style: none; padding: 0; display: grid; gap: 11px; }
.what-you-get li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); font-size: 15px; }
.what-you-get li::before {
  content: ""; flex: none; margin-top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--aurora); box-shadow: 0 0 8px var(--aurora-a);
}

@media (max-width: 760px) {
  .svc-block { grid-template-columns: 1fr; gap: 24px; }
  .svc-block:nth-child(even) .svc-media { order: 0; }
  .svc-media { aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   About page
   ========================================================================== */
.mission { max-width: 760px; }
.mission p { font-family: var(--font-serif); font-size: clamp(20px, 3vw, 28px);
  line-height: 1.4; color: var(--text); }
.mission p .muted { color: var(--muted); }

.beliefs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.belief h3 { font-size: 20px; font-family: var(--font-serif); margin-bottom: 8px; }
.belief p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.belief .mark {
  width: 34px; height: 34px; border-radius: 9px; margin-bottom: 14px;
  border: 1px solid var(--line-strong); display: grid; place-items: center;
}
.belief .mark span {
  width: 12px; height: 12px; border-radius: 4px; background: var(--aurora);
  box-shadow: 0 0 12px rgba(91,124,255,.6);
}

/* founder */
.founder { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(24px, 4vw, 40px); }
.founder .founder-photo {
  width: 96px; height: 96px; border-radius: 22px;
  object-fit: cover; object-position: center top;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  display: block;
}
.founder h3 { font-size: 20px; margin-bottom: 6px; }
.founder .role { color: var(--aurora-a); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.founder p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.founder p + p { margin-top: 12px; }

@media (max-width: 760px) {
  .beliefs { grid-template-columns: 1fr; }
  .founder { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.contact-aside h1 { font-size: clamp(32px, 5vw, 52px); }
.contact-aside .lead { margin: 20px 0 28px; max-width: 42ch; }
.contact-points { list-style: none; padding: 0; display: grid; gap: 14px; margin-bottom: 30px; }
.contact-points li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 15px; }
.contact-points li::before {
  content: ""; flex: none; margin-top: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--aurora); box-shadow: 0 0 8px var(--aurora-a);
}
.alt-cta {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface);
}
.alt-cta span { font-size: 14px; color: var(--muted); }

/* form card */
.form-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 20px; padding: clamp(24px, 4vw, 40px);
}
.form-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 200px at 100% -10%, rgba(91,124,255,.16), transparent 60%);
}
.form-card > * { position: relative; z-index: 1; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 8px; font-weight: 500; }
.field label .opt { color: var(--muted-2); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--base); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 13px 15px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--aurora-a);
  box-shadow: 0 0 0 3px rgba(91,124,255,.18);
}
.field.invalid input, .field.invalid textarea { border-color: #ff6b6b; }
.field .err { display: none; color: #ff8585; font-size: 12px; margin-top: 6px; }
.field.invalid .err { display: block; }

.form-card .btn-aurora { width: 100%; justify-content: center; margin-top: 6px; }
.form-note { color: var(--muted-2); font-size: 12px; text-align: center; margin-top: 14px; }
.form-error { display: none; color: #ff8585; font-size: 13px; text-align: center; margin-top: 12px; }
.form-error.show { display: block; }

/* success state */
.form-success { display: none; text-align: center; padding: 20px 0; }
.form-success.show { display: block; }
.form-success .check {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--aurora); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(91,124,255,.4);
}
.form-success h3 { font-size: 22px; margin-bottom: 8px; }
.form-success p { color: var(--muted); font-size: 15px; }
.form-hidden { display: none; }

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Motion & interaction  (Phase 6)
   Progressive enhancement: `.js` is added to <html> before first paint. With
   no JS — or with reduced motion — everything below falls back to visible.
   ========================================================================== */

/* ---- Scroll reveal (fade + rise) ---------------------------------------- */
.reveal { opacity: 1; }                    /* no-JS fallback: always visible */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.in-view { opacity: 1; transform: none; }

/* ---- Cursor glow on aurora CTAs ----------------------------------------- */
.btn-aurora { position: relative; overflow: hidden; isolation: isolate; }
.btn-aurora::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(90px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, .40), transparent 62%);
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
.btn-aurora:hover::after { opacity: 1; }

/* ---- Cursor glow on hero ------------------------------------------------ */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--hx, 50%) var(--hy, 30%),
              rgba(122, 90, 255, .16), transparent 60%);
  transition: background .2s linear;
}

/* ---- Card hover glow + logo sheen --------------------------------------- */
.card:hover { box-shadow: 0 18px 50px rgba(91, 124, 255, .14); }
.logo .word { transition: filter .25s var(--ease); }
.logo:hover .word { filter: brightness(1.14); }

/* ---- Reduced motion: strip all of the above ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .sheen::after { animation: none; }
  .btn-aurora::after, .hero::after { display: none; }
  .btn, .card, .service-card { transition: none; }
}
