/* AgentSpace landing. Sistema: CSS puro, tema automático (claro/escuro), um acento (âmbar, o mesmo do app).
   Raio único: 10px. Movimento: arquétipo "corporate" (curva 0.2,0,0,1), só transform e opacity. */

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --bg-2: #eceef2;
  --text: #15181e;
  --muted: #465061;
  --line: #d3d8e0;
  --accent: #a35405;
  --on-accent: #ffffff;
  --code-bg: #12161d;
  --code-text: #e4e8ef;
  --shadow: 0 18px 40px -22px rgb(21 36 60 / 0.35);
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --font: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e13;
    --bg-2: #11151c;
    --text: #e7eaf0;
    --muted: #a0a9b8;
    --line: #232a35;
    --accent: #f0a64a;
    --on-accent: #1a1205;
    --code-bg: #060810;
    --shadow: 0 22px 50px -24px rgb(0 0 0 / 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2rem, 76rem); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--text); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

/* Navegação */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 4rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 6px; }
.top nav { display: flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.nav-link { text-decoration: none; padding: 0.5rem 0.75rem; border-radius: var(--radius); color: var(--muted); font-size: 0.95rem; }
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-gh { color: var(--text); border: 1px solid var(--line); }

/* Botões */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform 150ms var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }

/* Hero */
.hero { padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1fr; }
h1 {
  margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700;
  text-wrap: balance;
}
.lead { margin: 1.25rem 0 0; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 34rem; }
.hero-shot { margin: 0; }
.hero-shot img {
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  aspect-ratio: 1440 / 900;
}

/* Seções */
section + section { border-top: 1px solid var(--line); }
h2 { margin: 0; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
h3 { margin: 0 0 0.4rem; font-size: 1.15rem; letter-spacing: -0.01em; }
.section-sub { color: var(--muted); max-width: 40rem; margin: 0.9rem 0 0; }

/* Fluxo */
.flow { padding: clamp(3rem, 7vw, 5.5rem) 0; background: var(--bg-2); }
.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 0; grid-template-columns: 1fr; }
.steps li { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps p { margin: 0; color: var(--muted); font-size: 1rem; }
.steps h3 { color: var(--accent); }

/* Bento de telas */
.shots { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.bento { display: grid; gap: 1.5rem; margin-top: 2.5rem; grid-template-columns: 1fr; }
.bento figure { margin: 0; }
.bento img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 1440 / 900; transition: transform 300ms var(--ease); }
.bento figure:hover img { transform: translateY(-3px); }
.bento figcaption { margin-top: 0.7rem; font-size: 0.95rem; color: var(--muted); }

/* Decisões */
.decisions { padding: clamp(3rem, 7vw, 5.5rem) 0; background: var(--bg-2); }
.decisions-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
.decisions-list { margin: 0; display: grid; gap: 0; grid-template-columns: 1fr; }
.decisions-list > div { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.decisions-list dt { font-weight: 650; font-size: 1.1rem; letter-spacing: -0.01em; }
.decisions-list dd { margin: 0.4rem 0 0; color: var(--muted); font-size: 1rem; max-width: 38rem; }
.decisions-list code, .section-sub code, .stack code { background: color-mix(in srgb, var(--text) 8%, transparent); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
.stack { grid-column: 1 / -1; margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; }

/* Como rodar */
.run { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.run-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
.run .section-sub code { overflow-wrap: anywhere; }
.term { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; min-width: 0; }
.term figcaption { padding: 0.6rem 1rem; font-size: 0.85rem; color: #9aa4b5; border-bottom: 1px solid #232a35; }
.term pre { margin: 0; padding: 1.1rem 1rem; overflow-x: auto; font-size: 0.9rem; line-height: 1.7; }
.term pre code { font-size: inherit; }

/* Rodapé */
.foot { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.95rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.foot p { margin: 0; }
.foot a { color: var(--text); text-underline-offset: 3px; }

/* Responsivo */
@media (max-width: 38rem) {
  .nav-link:not(.nav-gh) { display: none; }
  .btn { flex: 1 1 100%; }
}
@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .steps li { border-top: 2px solid var(--line); padding: 1.25rem 0 0; }
  .steps li:first-child { border-top: 2px solid var(--line); }
  .bento { grid-template-columns: repeat(6, 1fr); }
  .b-a { grid-column: span 4; }
  .b-b { grid-column: span 2; align-self: end; }
  .b-c, .b-d, .b-e { grid-column: span 2; }
  .decisions-list { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
}
@media (min-width: 64rem) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3.5rem; }
  .hero-shot { margin-right: -4rem; }
  .decisions-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 3rem 4rem; }
  .decisions-head { position: sticky; top: 6rem; align-self: start; }
  .run-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; }
}

/* Movimento: só com preferência normal. Entrada do hero (stagger curto) e revelação por scroll (CSS puro). */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
  .hero h1 { animation: rise 500ms var(--ease) both; }
  .hero .lead { animation: rise 500ms var(--ease) 80ms both; }
  .hero .cta-row { animation: rise 500ms var(--ease) 160ms both; }
  .hero-shot { animation: slide-in 600ms var(--ease) 120ms both; }

  @supports (animation-timeline: view()) {
    @keyframes reveal { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
    .steps li, .bento figure, .decisions-list > div, .term, .section-sub {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}
