/* Agent Architects home. Same tokens, type, components and hero sky as the cortext lander (join.agentarchitects.net). */
@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/Sora-Variable.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-raised: #111;
  --fg: #ededed;
  --fg-muted: #a1a1a1;
  --fg-faint: #8b8b8b;
  --line: #262626;
  --line-strong: #3a3a3a;
  --accent: #3b8ef0;
  --accent-soft: rgb(59 142 240 / 0.16);
  --radius: 12px;
  --sans: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms;
  --t-med: 320ms;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[data-i="1"] { --i: 1; } [data-i="2"] { --i: 2; } [data-i="3"] { --i: 3; } [data-i="4"] { --i: 4; } [data-i="5"] { --i: 5; } [data-i="6"] { --i: 6; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
section[id] { scroll-margin-top: 72px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px;
  transition: top var(--t-fast) var(--ease-out);
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid var(--btn-line); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --btn-line: #555; background: #161616; }
.btn:active { transform: scale(0.97); }
.btn .arrow { transition: transform var(--t-med) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { --btn-bg: var(--fg); --btn-fg: #0a0a0a; --btn-line: var(--fg); }
.btn-primary:hover { background: #fff; --btn-line: #fff; }
.btn-glass {
  --btn-line: rgb(255 255 255 / 0.16); background: rgb(255 255 255 / 0.04); color: #e4e4e4;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-glass:hover { background: rgb(255 255 255 / 0.09); --btn-line: rgb(255 255 255 / 0.3); }
.btn-outline:hover { background: #1a1a1a; }
.btn-ghost-line { --btn-line: var(--line-strong); color: var(--fg); }
.btn-sm { height: 34px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn-block { width: 100%; height: 48px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(10 10 10 / 0.6);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) ease, background var(--t-med) ease;
}
.nav.scrolled { border-bottom-color: var(--line); background: rgb(10 10 10 / 0.78); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.015em; font-size: 15.5px; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.nav-links > a:not(.btn) { position: relative; color: var(--fg-muted); text-decoration: none; transition: color var(--t-fast) ease; }
.nav-links > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease-out);
}
.nav-links > a:not(.btn):hover { color: var(--fg); }
.nav-links > a:not(.btn):hover::after { transform: scaleX(1); }

/* ---------- Hero (sky from the cortext lander) ---------- */
.hero { position: relative; isolation: isolate; }
.hero-inner { padding-block: clamp(84px, 13vw, 168px) clamp(84px, 12vw, 148px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.sky {
  position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; top: calc(-60px - env(safe-area-inset-top, 0px));
  overflow: hidden; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, #15171c, transparent 70%), #070708;
}
.sky-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; opacity: 0; transition: opacity 1.6s ease; }
.sky[data-sky="webgl"] .sky-canvas { opacity: 1; }
.sky-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 50% 42% at 50% 54%, rgb(7 7 8 / 0.8), rgb(7 7 8 / 0.5) 60%, transparent 100%),
    linear-gradient(180deg, rgb(10 10 10 / 0.35), transparent 26%, transparent 66%, var(--bg) 100%);
}


.hero-title { font-size: clamp(38px, 7.2vw, 78px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 600; color: #f5f5f5; text-wrap: balance; }
.hero-title .line { display: block; }
.hero-title .line:last-child {
  background: linear-gradient(180deg, #e6e6e6 10%, #9a9a9a 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 26px; max-width: 37em; color: #cccccc; font-size: clamp(16px, 2vw, 18px); text-wrap: pretty; }
.hero-cta { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.hero .line, .hero-sub, .hero-cta {
  opacity: 0; transform: translateY(14px);
  animation: rise 800ms var(--ease-out) forwards;
  animation-delay: calc(140ms + var(--i, 0) * 80ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Section titles ---------- */
.section-title { max-width: 760px; margin-bottom: 44px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.035em; text-wrap: balance; }
.section-title.center { margin-inline: auto; text-align: center; }
.hero-sub a { color: #fff; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size var(--t-med) var(--ease-out); }
.hero-sub a:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ---------- Pillars with custom diagrams (cortext mark grammar: round strokes, nodes at the joints) ---------- */
.what { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(72px, 11vw, 136px); }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pillar:nth-child(odd) { border-right: 1px solid var(--line); }
.pillar:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.pillar { padding: clamp(22px, 3vw, 32px); background: var(--bg); }
.pillar h3 { font-size: 18px; margin: 22px 0 8px; letter-spacing: -0.02em; }
.pillar p { color: var(--fg-muted); font-size: 15px; max-width: 32em; }
.viz { position: relative; aspect-ratio: 2 / 1; border-radius: 12px; background: radial-gradient(80% 90% at 50% 50%, #131417, #0c0c0d 75%); border: 1px solid #1f1f1f; overflow: hidden; }
.viz::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgb(255 255 255 / 0.06) 1px, transparent 1.2px); background-size: 16px 16px; }
.viz-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.sw-ports circle { transition: fill 300ms ease, stroke 300ms ease; }
.sw-ports circle.on { fill: #3b8ef0; stroke: #3b8ef0; }
.sw-left text, .sw-right text { transition: fill 300ms ease; }
.sw-left text.on, .sw-right text.on { fill: #f0f0f0; }
.pillar[data-i="3"] { cursor: pointer; }

/* ---------- Foundation (cortext) ---------- */
.foundation { position: relative; padding-block: clamp(72px, 10vw, 128px); border-block: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(70% 80% at 85% 50%, rgb(59 142 240 / 0.07), transparent 70%), #080809; }
.foundation-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.foundation .section-title { margin-bottom: 0; }
.foundation .body { margin-top: 18px; color: var(--fg-muted); font-size: 16px; }
.foundation .btn { margin-top: 30px; }
.shots { position: relative; margin: 0; padding-bottom: 40px; }
.device { position: relative; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: #050505; box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.8), 0 0 0 1px rgb(255 255 255 / 0.02); }
.device-bar { height: 30px; display: flex; align-items: center; gap: 6px; padding-inline: 12px; border-bottom: 1px solid var(--line); }
.device-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a2a2a; }
.device img { width: 100%; height: auto; }
.phone {
  position: absolute; right: -8px; bottom: 0; width: 26%; min-width: 110px;
  padding: 5px; border: 1px solid var(--line-strong); border-radius: 26px; background: #050505;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.9);
}
.phone img { width: 100%; height: auto; border-radius: 21px; }

/* ---------- Stack rail: a line with a node per layer; a signal runs down it once in view ---------- */
.stack { padding-block: clamp(72px, 11vw, 136px); }
.rail { --n: 5; list-style: none; margin: 0; padding: 0 0 0 44px; position: relative; display: grid; gap: 0; }
.rail li:not(:last-child)::after { content: ""; position: absolute; left: -34px; top: 33px; width: 2px; height: 100%; background: linear-gradient(var(--accent), #6aa8f5) 0 0 / 100% 0 no-repeat, #262626; transition: background-size 520ms linear; }
.rail.in li:not(:last-child)::after { background-size: 100% 100%; }
.rail li { position: relative; display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 6px 24px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid #1a1a1a; opacity: 0.35; transform: translateX(-6px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.rail li:last-child { border-bottom: 0; }
.rail li::before { content: ""; position: absolute; z-index: 1; left: -40px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid #3a3a3a; transition: border-color 400ms ease, background 400ms ease, box-shadow 400ms ease; }
.rail.in li { opacity: 1; transform: none; }
.rail.in li::before { border-color: var(--fg); background: var(--fg); }
.rail.in li:nth-child(1), .rail.in li:nth-child(1)::before { transition-delay: 0ms; }
.rail.in li:nth-child(1)::after { transition-delay: 200ms; }
.rail.in li:nth-child(2), .rail.in li:nth-child(2)::before { transition-delay: 520ms; }
.rail.in li:nth-child(2)::after { transition-delay: 720ms; }
.rail.in li:nth-child(3), .rail.in li:nth-child(3)::before { transition-delay: 1040ms; }
.rail.in li:nth-child(3)::after { transition-delay: 1240ms; }
.rail.in li:nth-child(4), .rail.in li:nth-child(4)::before { transition-delay: 1560ms; }
.rail.in li:nth-child(4)::after { transition-delay: 1760ms; }
.rail.in li:nth-child(5), .rail.in li:nth-child(5)::before { transition-delay: 2080ms; }
.rail.in li.rail-cx::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 6px rgb(59 142 240 / 0.18); }
.rail b { font-weight: 600; font-size: clamp(18px, 2.2vw, 22px); letter-spacing: -0.025em; transition: color var(--t-fast) ease; }
.rail span { color: var(--fg-muted); font-size: 15px; }
.rail li.rail-cx b { color: #9ec7ff; }
.rail li:hover b { color: #fff; }
.rail li:hover::before { box-shadow: 0 0 0 6px rgb(255 255 255 / 0.08); }
.start { margin-top: 48px; color: var(--fg-muted); font-size: 16px; max-width: 46em; }
.draw-link { color: var(--fg); text-decoration: none; font-weight: 500; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat; transition: background-size var(--t-med) var(--ease-out), color var(--t-fast) ease; padding-bottom: 2px; }
.draw-link::after { content: "→"; display: inline-block; margin-left: 5px; transition: transform var(--t-med) var(--ease-out); }
.draw-link:hover { color: #fff; background-size: 100% 2px; }
.draw-link:hover::after { transform: translateX(3px); }

/* ---------- Two ways in ---------- */
.choose { padding-bottom: clamp(80px, 12vw, 152px); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 880px; margin-inline: auto; }
.choice { display: flex; flex-direction: column; padding: clamp(24px, 4vw, 36px); border: 1px solid var(--line); border-radius: 16px; background: var(--bg-raised); }
.choice h3 { font-size: 22px; letter-spacing: -0.025em; }
.choice p { margin: 10px 0 28px; color: var(--fg-muted); font-size: 15px; flex: 1; }
.choice-main { position: relative; border-color: rgb(255 255 255 / 0.18); background: radial-gradient(120% 90% at 50% 0%, rgb(59 142 240 / 0.12), transparent 60%), var(--bg-raised); }

.addr { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; padding: 0 6px 0 16px; border: 1px dashed #333; border-radius: 999px; }
.addr-text { font: 400 13.5px/1 var(--mono); color: #cfcfcf; user-select: all; -webkit-user-select: all; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { position: relative; flex: none; height: 32px; min-width: 76px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: #161616; color: var(--fg); font: 500 13px/1 var(--sans); cursor: pointer; overflow: hidden; transition: border-color var(--t-fast) ease, background var(--t-fast) ease, transform var(--t-fast) var(--ease-out); -webkit-tap-highlight-color: transparent; }
.copy:hover { background: #1d1d1d; border-color: #555; }
.copy:active { transform: scale(0.95); }
.copy > span { display: block; transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast) ease; }
.copy .copy-done { position: absolute; inset: 0; display: grid; place-items: center; transform: translateY(100%); opacity: 0; color: #9ec7ff; }
.copy.copied { border-color: var(--accent); }
.copy.copied .copy-idle { transform: translateY(-100%); opacity: 0; }
.copy.copied .copy-done { transform: none; opacity: 1; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-block: 28px; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer-links a { color: var(--fg-muted); text-decoration: none; transition: color var(--t-fast) ease; }
.footer-links a:hover { color: var(--fg); }

/* ---------- Scroll reveal ---------- */
@media (scripting: enabled) { .js [data-reveal]:not(.in) { opacity: 0; transform: translateY(18px); } }
[data-reveal] { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out), border-color var(--t-med) ease; transition-delay: calc(var(--i, 0) * 80ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Narrow ---------- */
@media (max-width: 900px) {
  .foundation-inner { grid-template-columns: 1fr; }
  .shots { max-width: 640px; }
}
@media (max-width: 760px) {
  .sky-shade {
    background:
      radial-gradient(ellipse 95% 48% at 50% 52%, rgb(7 7 8 / 0.84), rgb(7 7 8 / 0.56) 65%, transparent 100%),
      linear-gradient(180deg, rgb(10 10 10 / 0.35), transparent 26%, transparent 66%, var(--bg) 100%);
  }
  .nav-links { gap: 16px; }
  .nav-links > a:not(.btn) { display: none; }
  .nav-links > a.nav-keep { display: inline; }
  .hero-cta { flex-direction: column; width: 100%; max-width: 360px; }
  .hero-cta .btn { width: 100%; }
  .pillars { grid-template-columns: 1fr; }
  .pillar:nth-child(odd) { border-right: 0; }
  .pillar:not(:last-child) { border-bottom: 1px solid var(--line); }
  .rail { padding-left: 36px; }
  .rail li { grid-template-columns: 1fr; padding: 16px 0; }
  .rail li::before { left: -32px; top: 23px; }
  .rail li:not(:last-child)::after { left: -26px; top: 30px; }
  .choices { grid-template-columns: 1fr; }
  .phone { right: -4px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  [data-reveal]:not(.in) { transform: none !important; }
}
html:not(.js) .rail li { opacity: 1; transform: none; }
