:root {
  --bg: #070a09;
  --bg-2: #0c120f;
  --panel: #0e1613;
  --line: #1b2823;
  --line-2: #26372f;
  --ink: #e8f2ec;
  --mut: #8ba69a;
  --mut-2: #5f7a6e;
  --acc: #7ee787;
  --acc-2: #4dd4ac;
  --mix: #0b100e;
  --m-default: #7ee787;
  --m-accept: #6aa9ff;
  --m-plan: #c49aff;
  --m-auto: #f5c451;
  --m-bypass: #ff7b72;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1140px;
  --rad: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

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

img {
  display: block;
}

/* language switching: default VI, hide EN */
html[data-lang="vi"] .en {
  display: none !important;
}
html[data-lang="en"] .vi {
  display: none !important;
}

.bg-grid,
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-grid {
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  background: radial-gradient(60% 40% at 15% 0%, rgba(126, 231, 135, 0.12), transparent 60%),
    radial-gradient(50% 40% at 90% 10%, rgba(77, 212, 172, 0.1), transparent 60%);
}

main,
.nav,
.foot {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.is-stuck {
  border-bottom-color: var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img {
  border-radius: 8px;
}
.brand-name {
  font-size: 1.05rem;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--mut);
}
.nav-links a {
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.lang {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--mut);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lang:hover {
  color: var(--acc);
  border-color: var(--acc);
}
.btn-ghost {
  font-family: var(--mono);
  font-size: 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0.38rem 0.7rem;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover {
  border-color: var(--acc);
  background: rgba(126, 231, 135, 0.06);
}

/* ---------------------------------------------------------------- layout */
.hero,
.pillars,
.section,
.cta,
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

/* ---------------------------------------------------------------- hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--mut);
  margin: 0 0 1.4rem;
}
.pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 4px rgba(126, 231, 135, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(126, 231, 135, 0.16);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(126, 231, 135, 0.04);
  }
}
.hero h1 {
  font-family: var(--mono);
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.3rem;
  font-weight: 700;
}
.hero h1 em {
  font-style: normal;
  color: var(--acc);
}
.lede {
  color: var(--mut);
  font-size: 1.06rem;
  max-width: 33rem;
  margin: 0 0 2rem;
}

/* install widget */
.install {
  border: 1px solid var(--line-2);
  border-radius: var(--rad);
  background: var(--panel);
  overflow: hidden;
  max-width: 40rem;
}
.install-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--mix);
}
.install-tabs button {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--mut);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.install-tabs button:hover {
  color: var(--ink);
}
.install-tabs button.is-on {
  color: var(--acc);
  background: rgba(126, 231, 135, 0.08);
}
.install-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
}
.install-row code {
  flex: 1;
  font-size: 0.8rem;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.install-row code::-webkit-scrollbar {
  display: none;
}
.copy {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--mut);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.copy:hover {
  color: var(--acc);
  border-color: var(--acc);
}
.copy.done {
  color: var(--acc);
  border-color: var(--acc);
}
.hero-foot {
  font-size: 0.88rem;
  color: var(--mut-2);
  margin: 1.1rem 0 0;
}
.hero-foot a {
  color: var(--acc-2);
  border-bottom: 1px solid transparent;
}
.hero-foot a:hover {
  border-bottom-color: var(--acc-2);
}
.hero-foot code {
  color: var(--mut);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.06rem 0.35rem;
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------- terminal */
.term {
  border: 1px solid var(--line-2);
  border-radius: var(--rad);
  background: linear-gradient(180deg, #0b120f, #080c0a);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(126, 231, 135, 0.04);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--mix);
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-2);
}
.dot:nth-child(1) {
  background: #ff5f57;
}
.dot:nth-child(2) {
  background: #febc2e;
}
.dot:nth-child(3) {
  background: #28c840;
}
.term-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--mut-2);
  margin-left: 0.5rem;
}
.term-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--m-accept);
  border: 1px solid color-mix(in srgb, var(--m-accept) 40%, transparent);
  background: color-mix(in srgb, var(--m-accept) 10%, transparent);
  border-radius: 20px;
  padding: 0.14rem 0.55rem;
}
.term-body {
  margin: 0;
  padding: 1.1rem 1.15rem 1.35rem;
  font-size: 0.82rem;
  line-height: 1.85;
  min-height: 262px;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .t-line {
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.t-prompt {
  color: var(--acc);
}
.t-user {
  color: var(--ink);
}
.t-dim {
  color: var(--mut-2);
}
.t-acc {
  color: var(--acc-2);
}
.t-warn {
  color: var(--m-auto);
}
.cursor {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  vertical-align: -0.16em;
  background: var(--acc);
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-bottom: 4.5rem;
}
.pillar {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--panel);
  padding: 1.4rem 1.35rem;
}
.pillar-ico {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--acc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  margin-bottom: 0.8rem;
}
.pillar h3 {
  font-size: 1rem;
  margin: 0 0 0.45rem;
  letter-spacing: -0.01em;
}
.pillar p {
  margin: 0;
  color: var(--mut);
  font-size: 0.9rem;
}
.pillar code {
  color: var(--acc-2);
  font-size: 0.84em;
}

/* ---------------------------------------------------------------- sections */
.section {
  padding-block: 4.5rem;
  border-top: 1px solid var(--line);
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.sec-num {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--mut-2);
}
.sec-head h2 {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 700;
}
.sec-lede {
  color: var(--mut);
  max-width: 52rem;
  margin: 0 0 2rem;
}
.sec-foot {
  color: var(--mut);
  font-size: 0.92rem;
  margin-top: 1.6rem;
}
.sec-foot code,
.sec-lede code {
  color: var(--acc-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08rem 0.38rem;
  font-size: 0.85em;
}
kbd {
  font-size: 0.78em;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  background: var(--panel);
  color: var(--ink);
}

/* ---------------------------------------------------------------- bento */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--panel);
  padding: 1.35rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.card-wide {
  grid-column: span 2;
}
.card-tall {
  grid-row: span 2;
}
.card h3 {
  font-size: 1rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--mut);
  font-size: 0.9rem;
}
.card code {
  color: var(--acc-2);
  font-size: 0.85em;
}
.mini {
  margin: 0;
  background: var(--mix);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-size: 0.76rem;
  color: var(--mut);
  overflow-x: auto;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--mut);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  transition: color 0.2s, border-color 0.2s;
}
.card:hover .chip {
  color: var(--acc-2);
  border-color: color-mix(in srgb, var(--acc-2) 35%, transparent);
}
.hook-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  columns: 2;
  column-gap: 1rem;
}
.hook-list li {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--mut);
  padding: 0.18rem 0;
  break-inside: avoid;
}
.hook-list code {
  color: var(--acc);
}

/* ---------------------------------------------------------------- modes */
.modes {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--panel);
  padding: 1.25rem;
}
.mode-rail {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mode-rail button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--mut);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.mode-rail button:hover {
  color: var(--ink);
}
.mode-rail button.is-on {
  color: var(--ink);
  background: color-mix(in srgb, var(--m) 10%, transparent);
  border-color: color-mix(in srgb, var(--m) 45%, transparent);
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--m);
  flex-shrink: 0;
}
.mode-rail button[data-mode="default"] {
  --m: var(--m-default);
}
.mode-rail button[data-mode="accept"] {
  --m: var(--m-accept);
}
.mode-rail button[data-mode="plan"] {
  --m: var(--m-plan);
}
.mode-rail button[data-mode="auto"] {
  --m: var(--m-auto);
}
.mode-rail button[data-mode="bypass"] {
  --m: var(--m-bypass);
}

.mode-stage {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mix);
  padding: 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  border-color: color-mix(in srgb, var(--m) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--m) 12%, transparent),
    0 20px 50px -40px color-mix(in srgb, var(--m) 60%, transparent);
}
.prompt-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  border: 1px solid color-mix(in srgb, var(--m) 45%, var(--line-2));
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  background: var(--bg-2);
}
.prompt-box .u {
  color: var(--m);
  font-weight: 700;
}
.prompt-box .ph {
  color: var(--ink);
  opacity: 0.85;
}
.mode-meta {
  margin: 1rem 0 0;
}
.mode-meta dt {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--m);
  margin-bottom: 0.25rem;
}
.mode-meta dd {
  margin: 0;
  color: var(--mut);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: step;
}
.steps li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--panel);
  padding: 1.3rem 1.25rem;
  transition: border-color 0.25s, transform 0.25s;
}
.steps h3 {
  font-family: var(--sans);
  font-size: 0.98rem;
  margin: 0 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 2rem;
}
.steps li:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--acc);
}
.steps pre {
  margin: 0;
  background: var(--mix);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  font-size: 0.77rem;
  overflow-x: auto;
}
.steps code {
  color: var(--ink);
}
.c {
  color: var(--mut-2);
}

/* ---------------------------------------------------------------- compat */
.compat-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
}
.compat-grid li {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 0.75rem;
  font-size: 0.82rem;
  text-align: center;
  color: var(--mut);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  min-height: 58px;
}
.compat-grid code {
  color: var(--acc-2);
  font-size: 0.78rem;
}
.compat-grid kbd {
  color: var(--ink);
}

/* ---------------------------------------------------------------- docs */
.docs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}
.docs a {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: border-color 0.25s, transform 0.25s;
}
.docs a:hover {
  border-color: var(--acc);
  transform: translateY(-2px);
}
.docs span {
  font-weight: 600;
  font-size: 0.94rem;
}
.docs small {
  color: var(--mut-2);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- cta */
.cta {
  text-align: center;
  padding-block: 5rem;
  border-top: 1px solid var(--line);
}
.cta h2 {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  letter-spacing: -0.03em;
  margin: 0 0 1.6rem;
}
.install-row.solo {
  max-width: 44rem;
  margin: 0 auto;
  border: 1px solid var(--line-2);
  border-radius: var(--rad);
  background: var(--panel);
}
.cta-foot {
  color: var(--mut-2);
  font-size: 0.88rem;
  margin-top: 1.1rem;
}

/* ---------------------------------------------------------------- footer */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--mut-2);
  flex-wrap: wrap;
}
.foot-left,
.foot-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.foot-left img {
  border-radius: 6px;
}
.sep {
  opacity: 0.5;
}
.foot-right a {
  transition: color 0.2s;
}
.foot-right a:hover {
  color: var(--acc);
}

/* ---------------------------------------------------------------- reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 3rem;
  }
  .pillars,
  .bento,
  .steps {
    grid-template-columns: 1fr;
  }
  .card-wide,
  .card-tall {
    grid-column: auto;
    grid-row: auto;
  }
  .modes {
    grid-template-columns: 1fr;
  }
  .compat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .docs {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .hook-list {
    columns: 1;
  }
  .docs,
  .compat-grid {
    grid-template-columns: 1fr;
  }
}

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