/* ==========================================================================
   Agenvas — Landing Page
   Design system: Dark Mode (OLED) · Developer Tool / IDE palette
   Type: JetBrains Mono (display/mono) + IBM Plex Sans (body) + system CJK
   ========================================================================== */

/* --- Design tokens: primitives ------------------------------------------- */
:root {
  /* Color — Developer Tool / IDE */
  --color-primary: #1e293b;
  --color-on-primary: #ffffff;
  --color-secondary: #334155;
  --color-on-secondary: #ffffff;
  --color-accent: #22c55e;
  --color-accent-strong: #16a34a;
  --color-on-accent: #0f172a;
  --color-background: #0f172a;
  --color-foreground: #f8fafc;
  --color-card: #1b2336;
  --color-card-foreground: #f8fafc;
  --color-muted: #272f42;
  --color-muted-foreground: #94a3b8;
  --color-border: #475569;
  --color-border-soft: #2b3a52;
  --color-destructive: #ef4444;
  --color-ring: #ffffff;

  /* Surfaces */
  --surface-raised: #1b2336;
  --surface-sunken: #0b1120;
  --surface-glass: rgba(15, 23, 42, 0.72);

  /* Spacing scale (standard density) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Type */
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
    Menlo, Consolas, "Liberation Mono", monospace;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
  --glow-accent: 0 0 0 1px rgba(34, 197, 94, 0.24),
    0 8px 32px -8px rgba(34, 197, 94, 0.32);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 480ms;

  /* Layout */
  --container: 1180px;
  --nav-h: 68px;
}

/* --- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

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

.section {
  padding-block: var(--space-9);
  scroll-margin-top: var(--nav-h);
}

.section--tight {
  padding-block: var(--space-8);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--dur-base) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-3);
}

/* --- Typography ----------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-7);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5.4vw, 4rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  margin-top: var(--space-3);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lede {
  margin-top: var(--space-4);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--color-muted-foreground);
  line-height: 1.75;
  text-wrap: pretty;
}

.accent {
  color: var(--color-accent);
}

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

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.btn svg {
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
}

.btn--primary:hover {
  background-color: #2ee06a;
  box-shadow: var(--glow-accent);
}

.btn--github {
  background-color: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-foreground);
}

.btn--github:hover {
  background-color: var(--color-muted);
  border-color: #64748b;
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-foreground);
}

.btn--ghost:hover {
  background-color: var(--color-muted);
  border-color: #64748b;
}

.btn--sm {
  min-height: 44px;
  padding: 0 var(--space-4);
  font-size: 0.875rem;
}

.btn--lg {
  min-height: 52px;
  padding: 0 var(--space-6);
  font-size: 1rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --- Nav ------------------------------------------------------------------ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.nav.is-stuck {
  background-color: var(--surface-glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: rgba(71, 85, 105, 0.5);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-inline-start: var(--space-4);
  font-size: 0.9375rem;
  color: var(--color-muted-foreground);
}

.nav__links a {
  position: relative;
  padding-block: var(--space-2);
  transition: color var(--dur-base) var(--ease-out);
}

.nav__links a::after {
  content: "";
  position: absolute;
  inset: auto 0 2px 0;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav__links a:hover {
  color: var(--color-foreground);
}

.nav__links a:hover::after {
  transform: scaleX(1);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-inline-start: auto;
}

/* --- Language switch ------------------------------------------------------ */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: rgba(27, 35, 54, 0.6);
}

.lang__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  transition: background-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out);
}

.lang__opt:hover {
  color: var(--color-foreground);
}

.lang__opt[aria-current="true"] {
  background-color: var(--color-muted);
  color: var(--color-foreground);
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + var(--space-9));
  padding-bottom: var(--space-9);
  overflow: hidden;
  isolation: isolate;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.55;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
      ellipse 70% 55% at 50% 0%,
      rgba(34, 197, 94, 0.09),
      transparent 68%
    ),
    linear-gradient(to bottom, transparent 55%, var(--color-background) 100%);
  pointer-events: none;
}

.hero__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 52rem;
  margin-inline: auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: rgba(27, 35, 54, 0.6);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}

.hero__badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: pulse 2.6s var(--ease-out) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hero h1 {
  margin-top: var(--space-5);
}

.hero .lede {
  max-width: 40rem;
}

.hero__cta {
  margin-top: var(--space-6);
  justify-content: center;
}

/* Terminal / install block */
.term {
  margin-top: var(--space-6);
  width: 100%;
  max-width: 52rem;
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--surface-sunken);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero .term {
  margin-inline: auto;
}

.term__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(71, 85, 105, 0.5);
  background-color: rgba(27, 35, 54, 0.5);
}

.term__dots {
  display: flex;
  gap: 6px;
}

.term__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-border);
}

.term__dots span:nth-child(1) {
  background-color: #f87171;
}
.term__dots span:nth-child(2) {
  background-color: #fbbf24;
}
.term__dots span:nth-child(3) {
  background-color: var(--color-accent);
}

.term__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}

.term__copy {
  margin-inline-start: auto;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
}

@media (hover: none) {
  .term__copy {
    min-height: 44px;
  }
}

.term__copy:hover {
  color: var(--color-foreground);
  border-color: #64748b;
  background-color: var(--color-muted);
}

.term__copy.is-copied {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.term__body {
  padding: var(--space-4);
  overflow-x: auto;
  background-color: var(--surface-sunken);
  /* Edge shadows appear only while the block actually scrolls sideways */
  background-image: linear-gradient(
      to right,
      var(--surface-sunken) 40%,
      rgba(11, 17, 32, 0)
    ),
    linear-gradient(to left, var(--surface-sunken) 40%, rgba(11, 17, 32, 0)),
    linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0)),
    linear-gradient(to left, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 42px 100%, 42px 100%, 16px 100%, 16px 100%;
  background-attachment: local, local, scroll, scroll;
}

.term__body pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--color-muted-foreground);
  white-space: pre;
}

.term__body .cmd {
  color: var(--color-foreground);
}

.term__body .prompt {
  color: var(--color-accent);
  user-select: none;
}

.term__foot {
  padding: 0 var(--space-4) var(--space-4);
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

.term__foot code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-accent);
}

/* Hero facts strip */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(71, 85, 105, 0.45);
}

.facts--center {
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fact__value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-foreground);
}

.fact__label {
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

.stage-caption {
  margin-top: var(--space-5);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}

/* --- Canvas demo (product mock) ------------------------------------------ */
.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--surface-sunken);
  background-image: radial-gradient(
    rgba(148, 163, 184, 0.16) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.stage__chrome {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(71, 85, 105, 0.45);
  background-color: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
}

.stage__chrome .term__dots span {
  width: 9px;
  height: 9px;
}

.stage__title {
  color: #cbd5e1;
}

.stage__chip {
  margin-inline-start: auto;
  padding: 3px 8px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius-pill);
  color: var(--color-accent);
}

.stage__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.stage__link {
  stroke: var(--color-border);
  stroke-width: 1.5;
  opacity: 0.75;
}

.stage__link--flow {
  stroke: var(--color-accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 5 16;
  opacity: 0.9;
  animation: flow 1.6s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -21;
  }
}

.node {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: rgba(27, 35, 54, 0.94);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.node__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.4);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  color: #cbd5e1;
}

.node__head svg {
  width: 12px;
  height: 12px;
  color: var(--color-accent);
}

.node__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node__meta {
  white-space: nowrap;
}

.node__status {
  width: 6px;
  height: 6px;
  margin-inline-start: auto;
  border-radius: 50%;
  background-color: var(--color-accent);
}

.node__status--run {
  background-color: #fbbf24;
  animation: pulse 1.8s var(--ease-out) infinite;
}

.node__body {
  padding: 10px;
}

.node--prompt {
  left: 2%;
  top: 8%;
  width: 22%;
  border-color: rgba(34, 197, 94, 0.45);
}

.node--text {
  left: 30%;
  top: 12%;
  width: 21%;
}

.node--image {
  left: 57%;
  top: 8%;
  width: 25%;
}

.node--video {
  left: 57%;
  top: 55%;
  width: 25%;
}

.node--agent {
  left: 2%;
  top: 56%;
  width: 22%;
}

.node--audio {
  left: 30%;
  top: 62%;
  width: 21%;
}

.lines {
  display: grid;
  gap: 5px;
}

.line {
  height: 5px;
  border-radius: 3px;
  background-color: var(--color-muted);
}

.line--accent {
  background-color: rgba(34, 197, 94, 0.6);
}

.thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e3a8a 0%, #0e7490 45%, #166534 100%);
  position: relative;
  overflow: hidden;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(248, 250, 252, 0.22) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: shimmer 2.8s var(--ease-out) infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.thumb--video::after {
  background: none;
}

.play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.play span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background-color: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(248, 250, 252, 0.35);
}

.play span::after {
  content: "";
  border-left: 9px solid var(--color-foreground);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-inline-start: 3px;
}

.wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 34px;
}

.wave i {
  flex: 1;
  border-radius: 2px;
  background-color: rgba(34, 197, 94, 0.55);
  animation: wave 1.5s var(--ease-out) infinite;
}

.wave i:nth-child(1) {
  height: 30%;
  animation-delay: 0s;
}
.wave i:nth-child(2) {
  height: 65%;
  animation-delay: 0.1s;
}
.wave i:nth-child(3) {
  height: 100%;
  animation-delay: 0.2s;
}
.wave i:nth-child(4) {
  height: 45%;
  animation-delay: 0.3s;
}
.wave i:nth-child(5) {
  height: 80%;
  animation-delay: 0.4s;
}
.wave i:nth-child(6) {
  height: 35%;
  animation-delay: 0.5s;
}
.wave i:nth-child(7) {
  height: 70%;
  animation-delay: 0.6s;
}
.wave i:nth-child(8) {
  height: 25%;
  animation-delay: 0.7s;
}
.wave i:nth-child(9) {
  height: 55%;
  animation-delay: 0.8s;
}
.wave i:nth-child(10) {
  height: 85%;
  animation-delay: 0.9s;
}
.wave i:nth-child(11) {
  height: 40%;
  animation-delay: 1s;
}
.wave i:nth-child(12) {
  height: 60%;
  animation-delay: 1.1s;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.bubble {
  display: block;
  max-width: 92%;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.625rem;
  line-height: 1.5;
  font-family: var(--font-sans);
}

.bubble--user {
  margin-inline-start: auto;
  background-color: var(--color-muted);
  color: #e2e8f0;
}

.bubble--agent {
  margin-top: 6px;
  background-color: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #d1fae5;
}

.approve {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.approve span {
  flex: 1;
  padding: 4px 0;
  border-radius: 5px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 600;
}

.approve .ok {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
}

.approve .no {
  border: 1px solid var(--color-border);
  color: var(--color-muted-foreground);
}

/* --- Cards / grids -------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  position: relative;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-card);
  transition: border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
}

.card:hover {
  border-color: #64748b;
  transform: translateY(-2px);
  background-color: #1f2840;
}

.card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: var(--space-4);
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: var(--radius-md);
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--color-accent);
}

.card__icon svg {
  width: 21px;
  height: 21px;
}

.card p {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  color: var(--color-muted-foreground);
  line-height: 1.7;
  text-wrap: pretty;
}

/* Modality rows */
.modality {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-6);
  padding-block: var(--space-6);
  border-top: 1px solid rgba(71, 85, 105, 0.4);
}

.modality:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.modality__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.modality__title svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

.modality p {
  color: var(--color-muted-foreground);
  text-wrap: pretty;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.tag {
  padding: 4px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: rgba(39, 47, 66, 0.6);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #cbd5e1;
  white-space: nowrap;
}

.tag--accent {
  border-color: rgba(34, 197, 94, 0.42);
  background-color: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

/* --- Quick start ---------------------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.tab {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: transparent;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
}

.tab:hover {
  color: var(--color-foreground);
  border-color: #64748b;
}

.tab[aria-selected="true"] {
  color: var(--color-on-accent);
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.steps {
  display: grid;
  gap: var(--space-6);
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-5);
}

.step__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius-md);
  background-color: rgba(34, 197, 94, 0.1);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
}

.step h3 {
  margin-bottom: var(--space-2);
}

.step p {
  color: var(--color-muted-foreground);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

.step .term {
  margin-top: var(--space-4);
  max-width: none;
}

.note {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: var(--radius-md);
  background-color: rgba(251, 191, 36, 0.07);
  font-size: 0.875rem;
  color: #fde68a;
  line-height: 1.65;
}

.note svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

/* --- Stack ---------------------------------------------------------------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.stack-col {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    rgba(27, 35, 54, 0.9),
    rgba(15, 23, 42, 0.9)
  );
}

.stack-col h3 {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.stack-col ul {
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.stack-col li {
  display: flex;
  gap: var(--space-3);
  font-size: 0.9375rem;
  color: #cbd5e1;
}

.stack-col li::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 50%;
  background-color: var(--color-accent);
  opacity: 0.75;
}

/* --- CTA ------------------------------------------------------------------ */
.cta {
  position: relative;
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: radial-gradient(
      ellipse 60% 120% at 50% 0%,
      rgba(34, 197, 94, 0.14),
      transparent 70%
    ),
    var(--color-card);
  text-align: center;
  overflow: hidden;
}

.cta h2 {
  margin-top: var(--space-3);
}

.cta .lede {
  margin-inline: auto;
  max-width: 36rem;
}

.cta .btn-row {
  justify-content: center;
  margin-top: var(--space-6);
}

.cta__meta {
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

/* --- Footer --------------------------------------------------------------- */
.footer {
  padding-block: var(--space-7) var(--space-6);
  border-top: 1px solid rgba(71, 85, 105, 0.4);
  background-color: var(--surface-sunken);
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, auto));
  gap: var(--space-7);
}

.footer__brand p {
  margin-top: var(--space-3);
  max-width: 26rem;
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}

.footer__qr {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.footer__qr img {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: #fff;
  padding: 4px;
}

.footer__qr span {
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

.footer h4 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
  font-weight: 500;
}

.footer__links {
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-3);
  font-size: 0.9375rem;
}

.footer__links a {
  color: #cbd5e1;
  transition: color var(--dur-base) var(--ease-out);
}

.footer__links a:hover {
  color: var(--color-accent);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  align-items: center;
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(71, 85, 105, 0.35);
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

.footer__bottom .spacer {
  margin-inline-start: auto;
}

/* --- Scroll reveal -------------------------------------------------------- */
.reveal {
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

/* Hidden only when scripting is available (the .js hook is set inline) */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid--3,
  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

@media (max-width: 860px) {
  .nav__links {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --space-9: 4rem;
    --space-8: 3rem;
  }

  /* English labels are wider than the space the nav was tuned for */
  .nav__inner {
    gap: var(--space-3);
    padding-inline: var(--space-4);
  }

  .nav__actions {
    gap: var(--space-2);
  }

  .btn--sm {
    padding: 0 var(--space-3);
  }

  .grid--3,
  .grid--2,
  .stack-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modality {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .footer__top {
    grid-template-columns: minmax(0, 1fr);
  }

  .wave i {
    animation: none;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .cta {
    padding: var(--space-7) var(--space-5);
  }

  .btn-row .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 600px) {
  .stage {
    aspect-ratio: 3 / 4;
  }

  /* The hero repeats this call to action, so the nav keeps room for the
     language switch and the GitHub link instead */
  .nav__actions .btn--primary {
    display: none;
  }

  .term__body {
    padding: var(--space-3);
  }

  .term__body pre {
    font-size: 0.75rem;
  }

  /* Keep only the four nodes that read clearly at phone width */
  .node--text,
  .node--audio,
  .node__meta {
    display: none;
  }

  .node--prompt {
    left: 3%;
    top: 13%;
    width: 44%;
  }

  .node--image {
    left: 53%;
    top: 13%;
    width: 44%;
  }

  .node--agent {
    left: 3%;
    top: 55%;
    width: 44%;
  }

  .node--video {
    left: 53%;
    top: 55%;
    width: 44%;
  }
}

/* --- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal,
  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .thumb::after {
    display: none;
  }

  .btn:hover,
  .card:hover {
    transform: none;
  }
}
