@font-face { font-family: "BVP"; src: url(fonts/be-vietnam-pro-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BVP"; src: url(fonts/be-vietnam-pro-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #F5F2EC;
  --bg-alt: #ECE7DE;
  --surface: #FFFFFF;
  --ink: #171513;
  --ink-2: #4A4540;
  --ink-3: #6E675F;
  --line: #DCD5CA;
  --accent: #E8471B;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFE3D8;
  --hot-bg: #171513;
  --hot-ink: #F5F2EC;
  --code-bg: #1C1A18;
  --code-ink: #EDE8E0;
  --shadow: 0 1px 2px rgb(60 40 20 / .06), 0 12px 32px -12px rgb(60 40 20 / .22);
  --r: 18px;
  --font: "BVP", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0E0D;
    --bg-alt: #171513;
    --surface: #1E1C1A;
    --ink: #F3EFE8;
    --ink-2: #C9C2B8;
    --ink-3: #9A9288;
    --line: #2F2B27;
    --accent: #FF6A3D;
    --accent-ink: #160C08;
    --accent-soft: #3A1C12;
    --hot-bg: #FF6A3D;
    --hot-ink: #160C08;
    --code-bg: #171513;
    --code-ink: #EDE8E0;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 16px 40px -16px rgb(0 0 0 / .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font); overflow-x: hidden;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 800; margin: 0; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); color: var(--ink); padding: .08em .35em; border-radius: 6px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; }
.logo-frame { fill: var(--accent); }
.logo-play { fill: var(--accent-ink); }
.nav { display: none; gap: 4px; margin-left: 24px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.nav a:hover { color: var(--ink); background: var(--bg-alt); }
@media (min-width: 900px) { .nav { display: flex; } }
.gh { margin-left: auto; }
.gh svg { width: 18px; height: 18px; fill: currentColor; }
.gh small { color: var(--ink-3); font-size: 13px; font-weight: 400; margin-left: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 800 16px/1 var(--font); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 56px; overflow: hidden; }
.hero-in { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 96px; } .hero-in { grid-template-columns: 1.15fr .85fr; gap: 64px; } }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1 { font-size: clamp(44px, 12vw, 92px); line-height: 1.04; margin: 20px 0 20px; letter-spacing: -.045em; }
h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; color: var(--ink); max-width: 32ch; }
.lead-sub { margin-top: 8px; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 28px; margin: 32px 0 0; }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .facts { gap: 8px 18px; } .facts dd { font-size: 16px; } }

.hero-media { margin: 0; display: grid; justify-items: center; gap: 14px; }
.phone { position: relative; width: min(78vw, 340px); aspect-ratio: 9 / 16; border-radius: 34px; padding: 8px; background: var(--ink); box-shadow: var(--shadow), 0 40px 80px -40px color-mix(in srgb, var(--accent) 55%, transparent); transform: rotate(2deg); }
.phone video { width: 100%; height: 100%; object-fit: cover; border-radius: 27px; background: #000; }
.hero-media figcaption { font-size: 14px; color: var(--ink-3); text-align: center; max-width: 34ch; }
@media (prefers-reduced-motion: reduce) { .phone { transform: none; } }

/* ---------- sections ---------- */
.sec { padding: 64px 0; }
.sec-alt { background: var(--bg-alt); }
@media (min-width: 900px) { .sec { padding: 104px 0; } }
.sec-head { margin-bottom: 32px; max-width: 720px; }
.eyebrow { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
h2 { font-size: clamp(30px, 6.4vw, 52px); line-height: 1.05; }
.sec-lead { margin-top: 16px; color: var(--ink-2); font-size: 18px; max-width: 56ch; }

/* ---------- filters + grid ---------- */
.filters { display: grid; gap: 10px; margin-bottom: 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 400 15px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background-color .15s, border-color .15s, color .15s; }
.chip span { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 800; }
.chip[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip-sm { min-height: 40px; font-size: 14px; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; } }
.card[hidden] { display: none; }
.card-media { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: var(--bg-alt); box-shadow: var(--shadow); cursor: pointer; isolation: isolate; }
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-media video { opacity: 0; transition: opacity .2s ease; }
.card-media.is-playing video { opacity: 1; }
.play { position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(20 18 16 / .62); color: #fff; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .15s; }
.play:active { transform: scale(.92); }
.play svg { width: 20px; height: 20px; fill: currentColor; }
.play .i-pause, .is-playing .play .i-play { display: none; }
.is-playing .play .i-pause { display: inline; }
.card-body { padding: 12px 2px 0; display: grid; gap: 4px; }
.card-id { font-size: 13px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.card-name { font-size: 17px; line-height: 1.25; letter-spacing: -.015em; }
.card-blurb { font-size: 14px; color: var(--ink-2); line-height: 1.45; display: none; }
@media (min-width: 640px) { .card-blurb { display: block; } }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.card-tags span, .sheet-tags span { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.card-more { justify-self: start; margin-top: 2px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 400 14px/1.3 var(--font); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; cursor: pointer; text-align: left; }
.card-more:hover { text-decoration-color: var(--accent); }
.empty { padding: 40px 0; text-align: center; color: var(--ink-2); }
.link { border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
.note { margin-top: 32px; font-size: 14px; color: var(--ink-3); }

/* ---------- flow ---------- */
.flow { margin: 0 0 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 12px; }
@media (min-width: 900px) { .flow { padding: 28px; } }
.flow-h { display: none; width: 100%; height: auto; }
.flow-v { width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
@media (min-width: 900px) { .flow-h { display: block; } .flow-v { display: none; } }
.f-box { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.f-box-hot { fill: var(--hot-bg); stroke: var(--hot-bg); }
.f-ico { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.f-ico-hot { stroke: var(--accent); stroke-width: 3.5; }
@media (prefers-color-scheme: dark) { .f-ico-hot { stroke: var(--hot-ink); } }
.f-accent { fill: var(--accent); stroke: var(--accent); }
.f-fill { fill: var(--accent); stroke: none; }
.f-t { font: 800 19px var(--font); fill: var(--ink); }
.f-s { font: 400 14px var(--font); fill: var(--ink-3); }
.f-t-hot { fill: var(--hot-ink); }
.f-s-hot { fill: color-mix(in srgb, var(--hot-ink) 75%, transparent); }
.f-line path, .f-loop { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 5 6; }
.f-arrowhead { fill: var(--ink-3); }
@media (prefers-reduced-motion: no-preference) {
  .f-line path { animation: dash 1.2s linear infinite; }
  @keyframes dash { to { stroke-dashoffset: -22; } }
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.step-n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.steps h3 { font-size: 19px; margin-bottom: 6px; }
.steps p { color: var(--ink-2); font-size: 15px; }
.points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .points { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.points li { color: var(--ink-2); font-size: 15px; padding-left: 16px; border-left: 3px solid var(--accent); }
.points strong { color: var(--ink); }

/* ---------- agent ---------- */
.tabs { background: var(--code-bg); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.tablist { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px; border-bottom: 1px solid rgb(255 255 255 / .08); }
.tablist::-webkit-scrollbar { display: none; }
.tablist button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: rgb(237 232 224 / .7); font: 400 15px/1 var(--font); cursor: pointer; }
.tablist button:hover { color: #fff; }
.tablist button[aria-selected="true"] { background: rgb(255 255 255 / .1); color: #fff; font-weight: 800; }
.panel { padding: 18px 18px 20px; color: var(--code-ink); }
.panel > p { font-size: 15px; color: rgb(237 232 224 / .78); margin-bottom: 12px; }
.panel code, .pre-lg code { background: rgb(255 255 255 / .08); color: var(--code-ink); }
pre { margin: 0; overflow-x: auto; font: 14px/1.6 var(--mono); }
pre code { background: none !important; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.panel pre { color: var(--code-ink); }
.pre-lg { background: var(--code-bg); color: var(--code-ink); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }

.agent-grid { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 900px) { .agent-grid { grid-template-columns: 1fr 1.2fr; gap: 24px; } }
.ask, .tools { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.ask-label { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
blockquote { margin: 0; font-size: 18px; line-height: 1.5; }
.ask blockquote { border-left: 3px solid var(--accent); padding-left: 14px; }
.ask-foot { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.tools dl { margin: 0; display: grid; gap: 0; }
.tools dl div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.tools dl div:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 520px) { .tools dl div { grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: baseline; } }
.tools dt code { background: none; padding: 0; font-weight: 600; color: var(--accent); }
.tools dd { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---------- install ---------- */
.install { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.install > *, .agent-grid > *, .hero-in > * { min-width: 0; }
@media (min-width: 900px) { .install { grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; } }
.env { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.env li { font-size: 15px; color: var(--ink-2); }

/* ---------- footer ---------- */
.foot { padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot-in { display: grid; gap: 6px; }
@media (min-width: 768px) { .foot-in { grid-template-columns: 1fr auto; align-items: center; } }
.foot-sub { font-size: 14px; color: var(--ink-3); }

/* ---------- dialog ---------- */
.sheet { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(880px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); }
.sheet::backdrop { background: rgb(10 8 6 / .7); backdrop-filter: blur(4px); }
.sheet-in { position: relative; background: var(--surface); border-radius: 22px; overflow: auto; max-height: calc(100dvh - 24px); display: grid; }
@media (min-width: 720px) { .sheet-in { grid-template-columns: 320px 1fr; } }
.sheet-media { background: #000; display: grid; place-items: center; }
.sheet-media video { width: 100%; max-height: 62dvh; aspect-ratio: 9 / 16; object-fit: contain; }
@media (min-width: 720px) { .sheet-media video { max-height: none; height: 100%; } }
.sheet-body { padding: 24px; display: grid; gap: 8px; align-content: start; }
.sheet-body h3 { font-size: 26px; line-height: 1.15; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.sheet-body .ask-label { margin: 8px 0 4px; }
.sheet-body blockquote { border-left: 3px solid var(--accent); padding-left: 14px; font-size: 17px; white-space: pre-line; }
.sheet-note { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.sheet-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(20 18 16 / .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sheet-close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] .sheet-in { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
  @keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
}
