/* Enoia landing pages. Tokens copied from crates/enoia-web/style/tokens.css (light + dark). */
@font-face {
  font-family: "Google Sans Flex"; /* OFL; instanced to wght 100-1000 + opsz, Latin + Vietnamese */
  src: url("fonts/GoogleSansFlex-LatinVi.woff") format("woff");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
:root {
  --font-ui: "Google Sans Flex", system-ui, -apple-system, sans-serif;
  --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px; --radius-pill: 999px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --page-w: 1120px;
}
:root, [data-theme="light"] {
  color-scheme: light;
  --bg-app: #ffffff; --bg-float: #f4f4f5; --bg-tile: #ffffff; --bg-track: #ededef; --bg-hover: #e9e9eb;
  --border: #ececee; --text-1: #111214; --text-2: #5b5f64; --text-3: #676c75;
  --accent: #2f6fe4; --accent-hover: #2560cb; --accent-weak: rgba(47,111,228,.12); --on-accent: #ffffff;
  --ok: #1f8f4e; --danger: #d93a48; --overlay: rgba(20,22,26,.3); --cv-grid: #e4e5e7;
  --frame-shadow: 0 24px 60px -28px rgba(17,18,20,.28);
  --logo-filter: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-app: #0b0b0c; --bg-float: #151618; --bg-tile: #1d1e21; --bg-track: #28292d; --bg-hover: #26272b;
    --border: #2e3035; --text-1: #ececee; --text-2: #a6a8ad; --text-3: #8a8d94;
    --accent: #86c96a; --accent-hover: #9dd683; --accent-weak: rgba(134,201,106,.16); --on-accent: #0b0b0c;
    --ok: #86c96a; --danger: #f07a85; --overlay: rgba(0,0,0,.55); --cv-grid: #1c1d20;
    --frame-shadow: 0 24px 60px -28px rgba(0,0,0,.8);
    --logo-filter: invert(1);
  }
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #0b0b0c; --bg-float: #151618; --bg-tile: #1d1e21; --bg-track: #28292d; --bg-hover: #26272b;
  --border: #2e3035; --text-1: #ececee; --text-2: #a6a8ad; --text-3: #8a8d94;
  --accent: #86c96a; --accent-hover: #9dd683; --accent-weak: rgba(134,201,106,.16); --on-accent: #0b0b0c;
  --ok: #86c96a; --danger: #f07a85; --overlay: rgba(0,0,0,.55); --cv-grid: #1c1d20;
  --frame-shadow: 0 24px 60px -28px rgba(0,0,0,.8);
  --logo-filter: invert(1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font-ui); color: var(--text-1); background: var(--bg-app);
  background-image: radial-gradient(var(--cv-grid) 1px, transparent 1.2px);
  background-size: 22px 22px; -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: inherit; }
.wrap { width: 100%; max-width: var(--page-w); margin: 0 auto; padding: 0 20px; }

/* Header */
.top { padding: 14px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 15px; }
.brand img { width: 34px; height: 34px; filter: var(--logo-filter); display: block; }
.brand small { color: var(--text-2); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill-bar { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: var(--radius-pill); background: var(--bg-float); border: 1px solid var(--border); }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius-pill); text-decoration: none;
  transition: background .16s var(--ease-out), color .16s var(--ease-out);
}
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--bg-tile); color: var(--text-1); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.icon-btn { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.icon-btn svg { width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero */
.hero { text-align: center; padding: 36px 0 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2);
  padding: 5px 12px; border-radius: var(--radius-pill); background: var(--bg-float); border: 1px solid var(--border); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: block; }
.hero h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1.08; font-weight: 500; letter-spacing: -0.02em; margin: 18px auto 0; max-width: 18ch; text-wrap: balance; }
.hero p.lead { font-size: clamp(15px, 1.6vw, 18px); color: var(--text-2); max-width: 58ch; margin: 16px auto 0; text-wrap: pretty; }
.cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

.center { min-height: calc(100vh - 150px); display: flex; align-items: center; justify-content: center; }
.center .hero { width: 100%; }
.hero-logo { width: 112px; height: 112px; display: block; margin: 0 auto 24px; filter: var(--logo-filter); }

.sub-vi { font-size: clamp(17px, 2vw, 22px); color: var(--text-2); margin: 12px auto 0; max-width: 40ch; text-wrap: balance; }
.leads { max-width: 64ch; margin: 22px auto 0; display: flex; flex-direction: column; gap: 10px; }
.leads .lead { margin: 0; font-size: 16px; color: var(--text-1); }
.leads .lead-vi { font-size: 15px; color: var(--text-2); }
.tags { list-style: none; padding: 0; margin: 22px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tags li { font-size: 13px; padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-tile); color: var(--text-2); }
.card p strong { color: var(--text-1); font-weight: 500; }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text-1); }

.thumb { display: block; margin: -8px -8px 6px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bg-float); aspect-ratio: 16 / 10; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.t-dark { display: none !important; }
[data-theme="dark"] .t-light { display: none !important; }
[data-theme="dark"] .t-dark { display: block !important; }
.card p.vi { font-size: 13px; color: var(--text-3); }
.cards { max-width: 980px; }

/* App mockup */
.mock { margin: 36px auto 72px; max-width: 1080px; }
.mock-frame { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--bg-float);
  padding: 8px; box-shadow: var(--frame-shadow); }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px 10px; }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg-track); display: block; }
.mock-bar span { margin-left: 10px; font-size: 12px; color: var(--text-3); }
.mock-view { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg-app);
  border: 1px solid var(--border); aspect-ratio: 1440 / 900; }
.mock-view iframe { position: absolute; top: 0; left: 0; width: 1440px; height: 900px; border: 0;
  transform-origin: 0 0; pointer-events: none; }

/* Index cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 860px; margin: 40px auto 0; text-align: left; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius-xl);
  background: var(--bg-tile); border: 1px solid var(--border); text-decoration: none; min-height: 200px;
  transition: border-color .16s var(--ease-out), transform .16s var(--ease-out); }
.card:hover { border-color: var(--text-3); transform: translateY(-2px); }
.card .tag { font-size: 12px; color: var(--text-2); }
.card h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-2); font-size: 14px; }
.card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent); }
.foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 40px 0 28px; }

/* Dialog */
dialog.sign { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--bg-tile); color: var(--text-1);
  padding: 0; width: min(420px, calc(100vw - 32px)); }
dialog.sign::backdrop { background: var(--overlay); }
.sign form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.sign h2 { margin: 0; font-size: 20px; font-weight: 500; }
.sign .sub { margin: -6px 0 0; color: var(--text-2); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.field input { font: inherit; font-size: 14px; color: var(--text-1); background: var(--bg-float); border: 1px solid var(--border);
  border-radius: var(--radius-md); height: 40px; padding: 0 12px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sign .note { font-size: 12px; color: var(--text-3); margin: 0; }
.sign .note a { color: var(--text-2); }
.sign .row { display: flex; gap: 8px; justify-content: flex-end; }
.sign .msg { font-size: 13px; margin: 0; min-height: 1em; }
.sign .msg.ok { color: var(--ok); }
.sign .msg.err { color: var(--danger); }
.sign .x { position: absolute; top: 12px; right: 12px; }

@media (max-width: 640px) {
  .hero { padding: 32px 0 24px; }
  .cards { grid-template-columns: 1fr; }
  .mock { margin: 32px auto 48px; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Language: one language at a time (early.js sets html[data-lang]). */
[data-lang="vi"] [data-l="en"] { display: none !important; }
html:not([data-lang="vi"]) [data-l="vi"] { display: none !important; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-pill); background: var(--bg-float); border: 1px solid var(--border); }
.seg button { appearance: none; border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500;
  height: 26px; min-width: 34px; padding: 0 8px; border-radius: var(--radius-pill); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg-tile); color: var(--text-1); box-shadow: 0 0 0 1px var(--border); }
.seg button:hover { color: var(--text-1); }

/* Fit in one screen on desktop-sized viewports; phones scroll as usual. */
@media (min-width: 760px) and (min-height: 560px) {
  body.fit { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .fit .top { flex: none; padding: 12px 0; }
  .fit main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .fit .hero { flex: none; padding: clamp(4px, 2.5vh, 28px) 0 0; }
  .fit .hero h1 { font-size: clamp(30px, min(5vw, 6.4vh), 58px); max-width: 24ch; margin-top: clamp(10px, 1.8vh, 18px); }
  .fit .hero p.lead { font-size: clamp(14px, 1.9vh, 17px); max-width: 66ch; margin-top: clamp(8px, 1.6vh, 16px); }
  .fit .tags { margin-top: clamp(10px, 1.8vh, 18px); }
  .fit .cta { margin-top: clamp(12px, 2.2vh, 24px); }
  .fit .mock { flex: 1; min-height: 0; width: 100%; margin: clamp(14px, 3vh, 32px) auto 0; overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
  .fit .foot { flex: none; padding: 8px 0 12px; }

  .fit-index .hero { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
  .fit-index .hero-logo { width: clamp(44px, 8vh, 80px); height: clamp(44px, 8vh, 80px); margin-bottom: clamp(10px, 2vh, 20px); }
  .fit-index .cards { margin-top: clamp(16px, 3.2vh, 36px); width: 100%; }
  .fit-index .card { min-height: 0; padding: 14px 14px 16px; gap: 6px; }
  .fit-index .thumb { aspect-ratio: auto; height: clamp(96px, 22vh, 240px); margin: 0 0 6px; }
  .fit-index .card h2 { font-size: clamp(17px, 2.4vh, 22px); }
  .fit-index .card p { font-size: 13.5px; }
}

/* ---------- Motion (references: Awwwards SaaS / type-foundry idioms) ---------- */
main, .top, .foot { position: relative; z-index: 1; }

/* Cursor spotlight on the dot grid */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background-image: radial-gradient(var(--accent) 1.2px, transparent 1.5px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 70%);
  mask-image: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 70%); }
body.spot::before { opacity: .55; }

/* Entrance: headline slides up out of a mask, the rest follows in order, the mockup tilts flat */
.hero h1 { animation: h-in .9s var(--ease-out) both; }
.rv { animation: rv-in .7s var(--ease-out) both; animation-delay: calc(.15s + var(--i, 0) * 80ms); }
.mock-frame { transform-origin: 50% 0; animation: tilt-in 1.1s var(--ease-out) .45s both; }
@keyframes h-in { from { clip-path: inset(0 0 100% 0); transform: translateY(24px); } to { clip-path: inset(0 0 -20% 0); transform: none; } }
@keyframes rv-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tilt-in { from { opacity: 0; transform: perspective(1600px) rotateX(16deg) translateY(48px) scale(.97); } to { opacity: 1; transform: none; } }
.card .thumb img { transition: transform .5s var(--ease-out); }
.card:hover .thumb img { transform: scale(1.03); }

/* Type: variable-weight headline (weights driven by site.js) */
.wave { font-weight: 400; letter-spacing: -0.015em; }
.wave .ch { display: inline-block; font-variation-settings: "wght" var(--w, 400); font-weight: var(--w, 400); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wave .wd { display: inline-block; white-space: nowrap; }

/* Workflow: node graph behind the headline */
.hero-wf { position: relative; }
.hero-graph { position: absolute; left: 50%; top: 50%; width: 1440px; height: auto; transform: translate(-50%, -50%);
  z-index: -1; pointer-events: none; overflow: visible;
  -webkit-mask-image: linear-gradient(to right, #000 0 25%, transparent 33% 67%, #000 75%);
  mask-image: linear-gradient(to right, #000 0 25%, transparent 33% 67%, #000 75%); }
.hg-e path { fill: none; stroke: var(--text-3); stroke-opacity: .45; stroke-width: 1.3; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw .9s var(--ease-out) forwards; animation-delay: calc(.6s + var(--d)); }
.hg-dots circle { fill: var(--accent); }
.gn rect { fill: var(--bg-tile); stroke: var(--border); stroke-width: 1; }
.gn text { font: 500 11px var(--font-ui); fill: var(--text-2); text-anchor: middle; }
.gn { opacity: 0; animation: fade-in .5s var(--ease-out) forwards; }
@keyframes fade-in { to { opacity: 1; } }
.gn.n0 { animation-delay: .45s; } .gn.n1 { animation-delay: .6s; } .gn.n2 { animation-delay: .75s; } .gn.n3 { animation-delay: .9s; }
.gn rect { animation: glow 6s linear infinite; }
.gn.n0 rect { animation-delay: 0s; } .gn.n1 rect { animation-delay: 1.7s; } .gn.n2 rect { animation-delay: 3.5s; } .gn.n3 rect { animation-delay: 4.7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { 0%, 12%, 100% { stroke: var(--border); fill: var(--bg-tile); } 3%, 8% { stroke: var(--accent); fill: var(--accent-weak); } }

@media (max-width: 1179px), (max-height: 559px) { .hero-graph { display: none; } }
@media (max-width: 759px) { body::before { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero h1, .rv, .mock-frame, .gn, .gn rect, .hg-e path { animation: none !important; }
  .hg-e path { stroke-dashoffset: 0; } .gn { opacity: 1; } .hg-dots { display: none; }
  body::before { display: none; }
}

/* Type: glyph-table background instead of the dot grid */
body.glyph-bg { background-image: none; }
body.glyph-bg::before { display: none; }
.glyphs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  display: grid; grid-template-columns: repeat(auto-fill, 76px); grid-auto-rows: 76px; justify-content: center;
  -webkit-mask-image: radial-gradient(ellipse 42% 30% at 50% 22%, transparent 40%, #000 95%);
  mask-image: radial-gradient(ellipse 42% 30% at 50% 22%, transparent 40%, #000 95%); }
.glyphs span { display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 26px; line-height: 1; color: var(--text-3); opacity: .2; font-weight: var(--w, 200); font-variation-settings: "wght" var(--w, 200);
  transition: color .3s, opacity .3s; }
.glyphs span.hot { color: var(--accent); opacity: .9; }
@media (prefers-reduced-motion: reduce) { .glyphs span { transition: none; } }
