/* ===========================================================================
   os-ui — hệ thống thành phần thị giác dùng chung cho toàn bộ landing site
   (trang chủ, /l2stack, /bronhatt, /antiddos). Ra đời từ /antiddos, sau đó
   lan ra các trang còn lại để cả site có cùng một ngôn ngữ thiết kế: lõi
   khiên phát sáng trong hero, lưới bento cho danh sách tính năng, bảng
   dashboard số liệu, cửa sổ mã lệnh, banner CTA gradient...
   Dùng chung bảng màu/token với site.css (:root); namespace .os-* để không
   đụng vào các thành phần gốc của site.css (server card, feature-grid...).
   =========================================================================== */

.os-eyebrow-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--online-soft);
  margin-right: 0.5rem;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

/* --------------------------------------------------------------------- Hero */
.os-hero {
  position: relative;
  padding: 3.75rem 0 4.5rem;
  overflow: clip;
}
.os-hero-bg {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(48rem 32rem at 82% 18%, rgba(88, 101, 242, 0.24), transparent 60%),
    radial-gradient(36rem 26rem at 8% 60%, rgba(52, 211, 153, 0.10), transparent 60%);
  pointer-events: none;
}
.os-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 3rem;
  align-items: center;
}
@media (max-width: 980px) { .os-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 3rem; } }

.os-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.3);
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
  border-radius: 999px;
}

.os-hero h1 {
  margin: 1.15rem 0 0;
  font-size: clamp(2.5rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.os-hero h1 .grad {
  background: linear-gradient(120deg, #fff 8%, var(--accent-soft) 48%, var(--accent-bright) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.os-hero-lede {
  margin: 1.35rem 0 0;
  font-size: clamp(1.03rem, 1.6vw, 1.16rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 34rem;
}
.os-hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.1rem; }

.os-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}
.os-hero-badge { display: flex; align-items: center; gap: 0.55rem; font-size: 0.85rem; color: var(--text-dim); }
.os-hero-badge svg { width: 17px; height: 17px; color: var(--accent-bright); flex: none; }
.os-hero-badge strong { color: var(--text); font-weight: 650; }

/* -------------------------------------------------------- Hero — lõi khiên */
.os-orb-wrap {
  position: relative;
  width: 100%;
  max-width: 26rem;
  aspect-ratio: 1;
  margin-inline: auto;
  display: grid;
  place-items: center;
}
.os-orb-glow {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.35), rgba(88, 101, 242, 0.05) 60%, transparent 72%);
  filter: blur(6px);
}
.os-orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(124, 156, 255, 0.22);
}
.os-orb-ring.r1 { inset: 0%; }
.os-orb-ring.r2 { inset: 11%; border-style: dashed; border-color: rgba(124, 156, 255, 0.16); animation: os-spin 46s linear infinite; }
.os-orb-ring.r3 { inset: 22%; animation: os-spin 32s linear infinite reverse; }
@keyframes os-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .os-orb-ring { animation: none !important; } }

.os-orb-core {
  position: relative;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 60px rgba(88, 101, 242, 0.35), inset 0 0 30px rgba(88, 101, 242, 0.15);
}
.os-orb-core svg {
  width: 46%; height: 46%;
  color: var(--accent-bright);
  filter: drop-shadow(0 0 16px rgba(124, 156, 255, 0.65));
}

.os-chip {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-card);
  animation: os-float 5s var(--ease-standard) infinite;
}
.os-chip .c-value { font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-chip .c-label { font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.os-chip.c1 { top: 4%; left: -4%; animation-delay: 0s; }
.os-chip.c2 { bottom: 12%; right: -8%; animation-delay: 1.4s; }
.os-chip.c3 { bottom: -4%; left: 12%; animation-delay: 2.8s; }
@keyframes os-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@media (prefers-reduced-motion: reduce) { .os-chip { animation: none; } }
@media (max-width: 980px) {
  .os-orb-wrap { max-width: 20rem; margin-top: 1rem; }
  .os-chip.c1 { left: -2%; }
  .os-chip.c2 { right: -2%; }
  .os-chip.c3 { left: 6%; }
}
@media (max-width: 560px) {
  .os-chip { padding: 0.5rem 0.7rem; }
  .os-chip .c-value { font-size: 0.9rem; }
}

/* -------------------------------------------------------------- Section shell */
.os-section { padding: 5rem 0; }
.os-head { max-width: 40rem; margin-bottom: 3rem; }
.os-head.is-centered { margin-inline: auto; text-align: center; }
.os-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.os-head h2 { margin: 0.7rem 0 0; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -0.03em; }
.os-head p { margin: 0.85rem 0 0; color: var(--text-muted); font-size: 1.01rem; line-height: 1.65; }

/* ------------------------------------------------------------------- Bước */
.os-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (max-width: 900px) { .os-steps { grid-template-columns: minmax(0, 1fr); } }
.os-steps::before {
  content: "";
  position: absolute;
  top: 26px;
  left: calc(12.5% + 4px);
  right: calc(12.5% + 4px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 12%, var(--border-strong) 88%, transparent);
}
@media (max-width: 900px) { .os-steps::before { display: none; } }
.os-step { position: relative; }
.os-step-num {
  position: relative;
  z-index: 1;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-bright);
  margin-bottom: 1.15rem;
}
.os-step h3 { font-size: 1.02rem; margin: 0 0 0.5rem; }
.os-step p { margin: 0; font-size: 0.89rem; color: var(--text-muted); line-height: 1.6; }

/* -------------------------------------------------------------- Kiến trúc */
.os-arch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
@media (max-width: 900px) { .os-arch { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; } }
.os-arch-node {
  position: relative;
  padding: 1.6rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.os-arch-node:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.os-arch-node:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 900px) {
  .os-arch-node, .os-arch-node:first-child, .os-arch-node:last-child { border-radius: var(--radius); }
}
.os-arch-node + .os-arch-node { border-left: 0; }
@media (max-width: 900px) { .os-arch-node + .os-arch-node { border-left: 1px solid var(--border); } }
.os-arch-node::after {
  content: "";
  position: absolute;
  top: 50%; right: -13px;
  width: 26px; height: 26px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  z-index: 1;
}
.os-arch-node:last-child::after { display: none; }
@media (max-width: 900px) { .os-arch-node::after { display: none; } }
.os-arch-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(88, 101, 242, 0.14);
  color: var(--accent-bright);
  margin-bottom: 1rem;
}
.os-arch-icon svg { width: 20px; height: 20px; }
.os-arch-role { font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); }
.os-arch-node h3 { font-size: 0.98rem; margin: 0.3rem 0 0.5rem; }
.os-arch-node p { margin: 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }

/* ------------------------------------------------------------------ Bento */
.os-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(11.5rem, auto);
  gap: 1.1rem;
}
@media (max-width: 980px) { .os-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .os-bento { grid-template-columns: minmax(0, 1fr); } }
.os-bento-item {
  position: relative;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--transition-base) var(--ease-standard), transform var(--transition-base) var(--ease-standard);
}
.os-bento-item:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.os-bento-item.is-lg { grid-column: span 2; }
@media (max-width: 600px) { .os-bento-item.is-lg { grid-column: span 1; } }
.os-bento-item::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 60%; height: 60%;
  background: radial-gradient(circle, var(--bento-glow, rgba(88, 101, 242, 0.14)), transparent 70%);
  pointer-events: none;
}
.os-bento-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--accent-bright);
  margin-bottom: 1.1rem;
}
.os-bento-icon svg { width: 19px; height: 19px; }
.os-bento-item h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.os-bento-item p { margin: 0; font-size: 0.87rem; color: var(--text-muted); line-height: 1.6; }
.os-bento-item .os-bento-fill { flex: 1; }

/* -------------------------------------------------------------- Dashboard */
.os-dash {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.os-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.6rem;
  border-bottom: 1px solid var(--border);
}
.os-dash-head .h-left { display: flex; align-items: center; gap: 0.7rem; }
.os-dash-head .h-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online-soft); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15); }
.os-dash-head .h-dot.is-loading { background: var(--text-dim); box-shadow: none; }
.os-dash-head strong { font-size: 0.95rem; }
.os-dash-head span.h-sub { display: block; font-size: 0.78rem; color: var(--text-dim); margin-top: 0.1rem; }
.os-dash-foot { font-size: 0.78rem; color: var(--text-dim); }

.os-dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
@media (max-width: 760px) { .os-dash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.os-dash-metric {
  padding: 1.4rem 1.5rem;
  border-right: 1px solid var(--border);
}
.os-dash-metric:last-child { border-right: 0; }
@media (max-width: 760px) { .os-dash-metric:nth-child(2n) { border-right: 0; } .os-dash-metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); } }
.os-dash-metric .d-value {
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.os-dash-metric .d-label { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: var(--text-dim); }

.os-dash-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2rem;
  padding: 1.9rem 1.6rem;
}
@media (max-width: 760px) { .os-dash-body { grid-template-columns: minmax(0, 1fr); } }

.os-gauges { display: flex; gap: 1.5rem; justify-content: space-around; flex-wrap: wrap; }
.os-gauge { position: relative; width: 116px; height: 116px; }
.os-gauge-ring {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: conic-gradient(var(--accent-bright) calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.07) 0);
  display: grid;
  place-items: center;
  transition: background 900ms var(--ease-standard);
}
.os-gauge-inner {
  width: 76%; height: 76%;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  text-align: center;
}
.os-gauge-value { font-size: 1.15rem; font-weight: 800; }
.os-gauge-caption { display: block; margin-top: 0.5rem; text-align: center; font-size: 0.78rem; color: var(--text-dim); }

.os-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; align-content: start; }
.os-bars .b-head { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.4rem; }
.os-bars .b-label { color: var(--text-muted); }
.os-bars .b-value { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-bars .b-track { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); overflow: hidden; }
.os-bars .b-fill { height: 100%; border-radius: 999px; width: 4%; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transition: width 900ms var(--ease-standard); }

/* -------------------------------------------------------------- API window */
.os-api-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 2.25rem; align-items: start; }
@media (max-width: 900px) { .os-api-layout { grid-template-columns: minmax(0, 1fr); } }

.os-window {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.os-window-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.os-window-dots { display: flex; gap: 0.4rem; }
.os-window-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.os-window-dots span:nth-child(1) { background: #f87171; }
.os-window-dots span:nth-child(2) { background: #fbbf24; }
.os-window-dots span:nth-child(3) { background: #34d399; }
.os-window-file {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.os-window-body {
  margin: 0;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.75;
  color: var(--accent-soft);
}
.os-window-body .tok-cmd { color: var(--text-dim); }
.os-window-body .tok-str { color: var(--online-soft); }
.os-window-body .tok-key { color: #fbbf24; }

.os-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.os-checklist li { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.92rem; color: var(--text-muted); }
.os-checklist svg { width: 19px; height: 19px; flex: none; margin-top: 0.1rem; color: var(--online-soft); }
.os-checklist strong { color: var(--text); }

/* ----------------------------------------------------------------- CTA */
.os-cta {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.16), rgba(52, 211, 153, 0.08));
  border: 1px solid var(--border-strong);
}
.os-cta h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.05rem); letter-spacing: -0.03em; }
.os-cta p { margin: 0.85rem auto 0; max-width: 32rem; color: var(--text-muted); }
.os-cta .os-hero-actions { justify-content: center; margin-top: 1.75rem; }

/* ------------------------------------------------------------ Contact */
.os-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.os-contact-card {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition-base) var(--ease-standard);
}
.os-contact-card:hover { border-color: var(--accent-bright); }
.os-contact-icon {
  width: 44px; height: 44px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.14);
  color: var(--accent-bright);
}
.os-contact-icon svg { width: 21px; height: 21px; }
.os-contact-label { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.os-contact-value { display: block; font-size: 1.02rem; font-weight: 650; overflow-wrap: anywhere; }
