/* ============================================================
   AAM BUILDS — "Build Manifest" design system
   Industrial engineering catalog × refined cinematic glass.
   Shared by every page on aam-builds.web.app
   ============================================================ */

:root {
  color-scheme: dark;

  /* — Ink & surfaces — */
  --ink:        #07070b;
  --ink-2:      #0a0a12;
  --surface:    rgba(255, 255, 255, 0.038);
  --surface-2:  rgba(255, 255, 255, 0.06);
  --border:     rgba(255, 255, 255, 0.09);
  --border-2:   rgba(255, 255, 255, 0.16);

  /* — Text — */
  --text:       #ededf5;
  --dim:        #a6a7be;
  --faint:      #71728c;

  /* — Accent story: electric indigo → violet, coral spark — */
  --accent:     #6c79ff;
  --accent-2:   #b06bff;
  --spark:      #ff6b8a;
  --cyan:       #4fe6ff;
  --grad:       linear-gradient(125deg, var(--accent) 0%, var(--accent-2) 52%, var(--spark) 100%);
  --grad-soft:  linear-gradient(125deg, rgba(108,121,255,.22), rgba(176,107,255,.18) 55%, rgba(255,107,138,.16));

  /* — Geometry — */
  --r-sm: 12px;
  --r:    18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --maxw: 1160px;
  --shadow:     0 30px 70px -28px rgba(0, 0, 0, .8);
  --shadow-up:  0 40px 90px -30px rgba(96, 80, 255, .45);

  /* — Type — */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Sora", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-weight: 400;
  color: var(--text);
  background: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ---------- Atmosphere: aurora + blueprint dot-grid + grain ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 18% 8%,  rgba(108,121,255,.28), transparent 60%),
    radial-gradient(55% 45% at 88% 12%, rgba(176,107,255,.22), transparent 62%),
    radial-gradient(60% 55% at 70% 95%, rgba(255,107,138,.16), transparent 60%),
    radial-gradient(45% 45% at 8% 92%,  rgba(79,230,255,.12),  transparent 60%),
    var(--ink);
}
.bg::before {            /* slow aurora drift */
  content: "";
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 38% at 30% 30%, rgba(108,121,255,.20), transparent 60%),
    radial-gradient(34% 34% at 75% 60%, rgba(176,107,255,.16), transparent 60%);
  filter: blur(14px);
  animation: drift 26s ease-in-out infinite alternate;
}
.bg::after {            /* blueprint dot-grid, faded toward edges */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1.4px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 25%, transparent 78%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 25%, transparent 78%);
  opacity: .22;
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0)      scale(1);    }
  50%  { transform: translate3d(3%, 2%, 0)  scale(1.08); }
  100% { transform: translate3d(-3%, 4%, 0) scale(1.04); }
}

/* ---------- Layout ---------- */
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.narrow { --maxw: 800px; }

a { color: var(--text); text-decoration: none; }

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

/* ---------- Header / nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 8px;
  -webkit-backdrop-filter: saturate(140%) blur(14px);
          backdrop-filter: saturate(140%) blur(14px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: min(100% - 40px, var(--maxw)); margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--display); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 15px; letter-spacing: -.04em;
  box-shadow: 0 8px 22px -6px rgba(120,100,255,.7), inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand .name { font-weight: 700; letter-spacing: .14em; font-size: 14px; }
.brand .name b { color: var(--text); }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em;
  color: var(--dim); padding: 8px 13px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 600px) { .nav-links a.hide-sm { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 12vw, 130px) 0 clamp(40px, 7vw, 84px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34e29b;
  box-shadow: 0 0 0 0 rgba(52,226,155,.7); animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(52,226,155,.6)} 70%{box-shadow:0 0 0 9px rgba(52,226,155,0)} 100%{box-shadow:0 0 0 0 rgba(52,226,155,0)} }

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.9rem, 9vw, 6.6rem);
  line-height: .96; letter-spacing: -.045em;
  margin: 26px 0 0;
}
.hero h1 .grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede {
  max-width: 620px; margin: 26px 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--dim); font-weight: 300;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; align-items: center; }

.stat-row {
  display: flex; flex-wrap: wrap; gap: 30px 46px; margin-top: 54px;
  padding-top: 30px; border-top: 1px solid var(--border);
}
.stat { font-family: var(--display); }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.03em; }
.stat .num .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  font-family: var(--body); font-weight: 600; font-size: .98rem; letter-spacing: .01em;
  color: #0b0712; background: #fff; border: none; cursor: pointer;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, filter .22s;
  box-shadow: 0 14px 36px -12px rgba(255,255,255,.34);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 22px 50px -16px rgba(255,255,255,.5); }
.btn.grad { color: #fff; background: var(--grad); box-shadow: var(--shadow-up); }
.btn.grad:hover { filter: brightness(1.07); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2);
  font-weight: 500; transition: background .2s, border-color .2s, transform .2s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.btn svg, .btn-ghost svg { width: 18px; height: 18px; }

/* ---------- Section heading ---------- */
.sec { padding: clamp(40px, 7vw, 80px) 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.sec-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); }
.sec h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 4.6vw, 2.9rem); letter-spacing: -.035em; margin: 12px 0 0; line-height: 1.04; }
.sec .sub { color: var(--dim); max-width: 440px; font-weight: 300; }

/* ---------- App manifest grid ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }

.app-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 18px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, background .3s;
}
.app-card::before {     /* aurora bloom revealed on hover */
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0;
  background: radial-gradient(80% 90% at 20% 0%, rgba(108,121,255,.20), transparent 60%);
  transition: opacity .35s;
}
.app-card:hover { transform: translateY(-6px); border-color: var(--border-2); background: var(--surface-2); }
.app-card:hover::before { opacity: 1; }
.app-card > * { position: relative; z-index: 1; }

.app-index { position: absolute; top: 18px; right: 22px; z-index: 1; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--faint); }
.app-top { display: flex; align-items: center; gap: 16px; }
.app-icon {
  width: 74px; height: 74px; flex: none; border-radius: 22px;
  background-size: cover; background-position: center;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.12);
  transition: transform .3s, box-shadow .3s;
}
.app-card:hover .app-icon { transform: scale(1.05) rotate(-1.5deg); box-shadow: 0 18px 40px -10px rgba(108,121,255,.55), inset 0 0 0 1px rgba(255,255,255,.18); }
.app-name { font-family: var(--display); font-weight: 600; font-size: 1.22rem; letter-spacing: -.02em; line-height: 1.1; }
.app-rating { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.app-rating .stars { color: #ffcf4a; letter-spacing: 1px; }

.app-desc { color: var(--dim); font-size: .94rem; font-weight: 300; flex: 1; margin: 0; }

.app-meta {
  display: flex; flex-wrap: wrap; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint);
}
.app-meta span { padding: 4px 9px; border-radius: 7px; background: rgba(255,255,255,.04); border: 1px solid var(--border); }

.app-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.badge-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #43e6a0;
}
.badge-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #34e29b; box-shadow: 0 0 10px #34e29b; }
.app-get {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 600; font-size: .85rem;
  box-shadow: 0 10px 26px -10px rgba(140,110,255,.7);
  transition: transform .2s, filter .2s;
}
.app-get:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* ---------- Generic glass card / CTA band ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px);
}
.cta-band {
  position: relative; overflow: hidden; text-align: center;
  border-radius: var(--r-xl); padding: clamp(40px, 7vw, 72px) 28px;
  border: 1px solid var(--border-2);
  background: var(--grad-soft);
}
.cta-band h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.8rem); letter-spacing: -.03em; margin: 0; }
.cta-band p { color: var(--dim); max-width: 480px; margin: 14px auto 28px; }

/* ---------- Document / legal pages ---------- */
.doc { padding: clamp(36px, 6vw, 64px) 0 90px; }
.doc-head { margin-bottom: 30px; }
.doc-head .eyebrow { margin-bottom: 18px; }
.doc h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -.04em; line-height: 1.02; margin: 0; }
.doc .updated { font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin-top: 14px; letter-spacing: .03em; }
.doc-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 46px); }
.doc-body .lede { font-size: 1.12rem; color: var(--text); font-weight: 300; margin-top: 0; }
.doc-body h2 { font-family: var(--display); font-weight: 600; font-size: 1.28rem; letter-spacing: -.015em; margin: 38px 0 10px; }
.doc-body h2:first-of-type { margin-top: 26px; }
.doc-body h3 { font-family: var(--display); font-weight: 600; font-size: 1.05rem; margin: 24px 0 8px; }
.doc-body p, .doc-body li { color: #cdcedd; font-weight: 300; }
.doc-body strong { color: var(--text); font-weight: 600; }
.doc-body a { color: #b9a3ff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(185,163,255,.4); }
.doc-body a:hover { text-decoration-color: #b9a3ff; }
.doc-body ul { padding-left: 20px; }
.doc-body li { margin: 7px 0; }
.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.doc-body blockquote {
  border-left: 2px solid var(--accent-2); margin: 18px 0; padding: 6px 18px;
  color: var(--dim); background: rgba(176,107,255,.06); border-radius: 0 10px 10px 0;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.pill {
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
  padding: 6px 12px; border-radius: 999px; color: var(--dim);
  background: rgba(255,255,255,.04); border: 1px solid var(--border-2);
}
.doc-appbar { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.doc-appbar .app-icon { width: 56px; height: 56px; border-radius: 16px; }

/* ---------- FAQ / details ---------- */
.faq { margin-top: 6px; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); margin-bottom: 12px; overflow: hidden;
  transition: border-color .2s, background .2s;
}
.faq details[open] { border-color: var(--border-2); background: var(--surface-2); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 22px;
  font-family: var(--display); font-weight: 600; font-size: 1.03rem; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.4rem; color: var(--accent-2);
  transition: transform .25s; line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: #cdcedd; font-weight: 300; }

/* ---------- Email / contact box ---------- */
.mailbox {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  padding: 22px 26px; border-radius: var(--r-lg);
  border: 1px solid var(--border-2); background: var(--surface-2);
}
.mailbox .label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.mailbox .addr { font-family: var(--display); font-weight: 600; font-size: clamp(1.1rem, 3vw, 1.5rem); letter-spacing: -.02em; }
.mailbox .addr a { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 46px 0 60px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 36px; }
.footer .brand { margin-bottom: 14px; }
.footer .tag { color: var(--faint); font-size: .9rem; max-width: 300px; font-weight: 300; }
.footer-col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--dim); font-size: .92rem; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; }

/* ---------- Back link ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); margin-bottom: 26px; transition: color .2s; }
.back:hover { color: var(--text); }

/* ---------- Reveal animation (progressive enhancement) ----------
   Hidden state ONLY applies once JS adds .js to <html>, so without JS
   (or before it runs) all content is fully visible. */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
.reveal.d4 { transition-delay: .24s; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

@media (max-width: 720px) {
  .footer-grid { gap: 26px; }
  .mailbox { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  html.js .reveal, .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .bg::before { animation: none; }
}
