/* =========================================================
   IAI FLOW
   UI CORE SYSTEM
   Final homepage visual upgrade
========================================================= */

:root{
  --max:1280px;
  --header-h:92px;

  --bg:#071019;
  --bg-2:#0b1520;
  --bg-3:#101c28;

  --surface:#101b27;
  --surface-2:#132131;
  --surface-3:#17283c;

  --text:#eef4fb;
  --muted:#9fb0c3;
  --muted-2:#7f91a5;

  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.16);

  --accent:#7fd3ff;
  --accent-2:#4db8ff;
  --accent-3:#6ee7c8;
  --gold:#d7b56d;

  --success:#bdf5e6;
  --warning:#ffe2ad;
  --danger:#ffd2d8;

  --shadow:0 18px 60px rgba(0,0,0,.30);
  --shadow-soft:0 14px 34px rgba(0,0,0,.18);

  --radius-xl:28px;
  --radius-lg:22px;
  --radius-md:18px;
  --radius-sm:12px;
  --radius-xs:10px;

  --mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

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

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  min-width:320px;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(127,211,255,.08), transparent 26%),
    radial-gradient(circle at top right, rgba(110,231,200,.06), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, #08121c 100%);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size:16px;
  line-height:1.6;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

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

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

button{
  color:inherit;
}

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

ul,
ol{
  margin:0;
}

p{
  margin:0;
}

h1,h2,h3,h4,h5,h6{
  margin:0;
  line-height:1.15;
}

[data-lang="en"]{
  display:none;
}

html.lang-en [data-lang="vi"]{
  display:none !important;
}

html.lang-en [data-lang="en"]{
  display:inline !important;
}

html.lang-vi [data-lang="vi"]{
  display:inline !important;
}

html.lang-vi [data-lang="en"]{
  display:none !important;
}

.hero-title,
.home-hero-title{
  font-weight:800;
}

.section-head h2{
  margin:0 0 8px;
  font-size:clamp(28px,4vw,44px);
  letter-spacing:-.04em;
}

.section-head p,
.section-desc,
.hero-desc,
.home-hero-sub,
.side-card p,
.node-panel-copy,
.playground-status-copy{
  color:var(--muted);
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:40px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid rgba(127,211,255,.16);
  background:rgba(127,211,255,.08);
  color:var(--accent);
  font-size:13px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.panel,
.card,
.callout,
.feature-card,
.story-card,
.roadmap-card,
.docs-card,
.platform-card,
.home-card,
.app-card,
.dash-card,
.wf-card,
.agent-card,
.monitor-card,
.settings-card,
.quick-card{
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow:var(--shadow-soft);
}

.card,
.callout,
.feature-card,
.story-card,
.roadmap-card,
.docs-card,
.platform-card,
.home-card,
.app-card,
.dash-card,
.wf-card,
.agent-card,
.monitor-card,
.settings-card,
.quick-card{
  padding:22px;
}

.kpi{
  padding:16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}

.kpi strong{
  display:block;
  margin-bottom:6px;
  font-size:22px;
  line-height:1;
  letter-spacing:-.03em;
}

.kpi span{
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.site-header{
  backdrop-filter:blur(14px);
  background:rgba(7,16,25,.82);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:12px;
  min-width:0;
  white-space:nowrap;
}

.nav{
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:nowrap;
}

.nav a,
.site-nav a{
  position:relative;
  color:var(--muted);
  font-size:14px;
  line-height:1;
  transition:color .18s ease;
}

.nav a:hover,
.site-nav a:hover,
.nav a.is-active,
.site-nav a.is-active{
  color:var(--text);
}

.nav a::after,
.site-nav a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-8px;
  width:0;
  height:2px;
  background:linear-gradient(90deg, rgba(215,181,109,.12), rgba(215,181,109,.95), rgba(215,181,109,.12));
  transition:width .18s ease;
}

.nav a:hover::after,
.site-nav a:hover::after,
.nav a.is-active::after,
.site-nav a.is-active::after{
  width:100%;
}

.menu-toggle{
  display:none;
  width:42px;
  height:42px;
  padding:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  transition:border-color .18s ease, background .18s ease;
}

.menu-toggle:hover{
  border-color:rgba(127,211,255,.28);
  background:rgba(255,255,255,.06);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:0 18px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  white-space:nowrap;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

.btn:hover{
  transform:translateY(-1px);
  border-color:rgba(127,211,255,.28);
  background:rgba(255,255,255,.06);
}

.btn:focus-visible,
.menu-toggle:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible{
  outline:2px solid rgba(127,211,255,.55);
  outline-offset:2px;
}

.btn.btn-primary{
  border-color:transparent;
  background:linear-gradient(135deg, rgba(127,211,255,.95), rgba(110,231,200,.88));
  color:#071019;
  font-weight:700;
  box-shadow:0 10px 28px rgba(127,211,255,.22);
}

.btn.btn-primary:hover{
  background:linear-gradient(135deg, rgba(127,211,255,1), rgba(110,231,200,1));
}

.btn.btn-small{
  min-height:38px;
  padding:0 14px;
  font-size:13px;
  border-radius:10px;
  background:rgba(255,255,255,.03);
}

.hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:24px;
}

.mini-link,
.card-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:16px;
  color:var(--accent);
  font-size:14px;
  font-weight:700;
  transition:opacity .18s ease;
}

.mini-link:hover,
.card-link:hover{
  opacity:.88;
}

input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:12px 14px;
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

input[type="search"]::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder{
  color:var(--muted-2);
}

input[type="search"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus{
  border-color:rgba(127,211,255,.36);
  background:rgba(255,255,255,.05);
  outline:none;
}

textarea{
  resize:vertical;
}

.lang-switch{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  overflow:hidden;
}

.lang-switch button{
  border:0;
  background:transparent;
  color:var(--muted);
  min-height:36px;
  min-width:46px;
  padding:0 14px;
  cursor:pointer;
  transition:background .18s ease, color .18s ease;
}

.lang-switch button:hover{
  color:var(--text);
}

.lang-switch button.is-active{
  background:rgba(127,211,255,.12);
  color:var(--text);
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
  line-height:1;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

*{
  scrollbar-width:thin;
  scrollbar-color:rgba(127,211,255,.24) rgba(255,255,255,.04);
}

*::-webkit-scrollbar{
  width:10px;
  height:10px;
}

*::-webkit-scrollbar-track{
  background:rgba(255,255,255,.04);
}

*::-webkit-scrollbar-thumb{
  background:rgba(127,211,255,.24);
  border-radius:999px;
  border:2px solid rgba(255,255,255,.04);
}

*::-webkit-scrollbar-thumb:hover{
  background:rgba(127,211,255,.34);
}

@media (max-width: 900px){
  .menu-toggle{
    display:inline-flex;
  }

  .nav{
    display:none;
  }

  .nav.is-open,
  .site-nav.is-open,
  [data-nav].is-open{
    display:flex;
    position:absolute;
    top:calc(var(--header-h) - 8px);
    left:0;
    right:0;
    margin-inline:16px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:20px;
    background:rgba(7,16,25,.96);
    box-shadow:var(--shadow);
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
    z-index:70;
  }

  .nav.is-open a,
  .site-nav.is-open a,
  [data-nav].is-open a{
    font-size:15px;
  }

  body.nav-open{
    overflow:hidden;
  }
}

@media (max-width: 760px){
  .btn{
    min-height:44px;
    padding:0 16px;
  }

  .btn.btn-small{
    min-height:38px;
  }

  .lang-switch button{
    min-height:34px;
    padding:0 12px;
  }

  .card,
  .callout,
  .feature-card,
  .story-card,
  .roadmap-card,
  .docs-card,
  .platform-card,
  .home-card,
  .app-card,
  .dash-card,
  .wf-card,
  .agent-card,
  .monitor-card,
  .settings-card,
  .quick-card{
    padding:20px;
    border-radius:18px;
  }
}

@media (max-width: 520px){
  .btn{
    width:100%;
  }

  .hero-actions .btn{
    flex:1 1 100%;
  }

  .header-actions{
    gap:8px;
  }
}
