/* VOOC TECH — hệ thống thiết kế dùng chung (trang chủ + trang dự án).
   Phong cách Apple: nhiều khoảng trắng, chữ lớn, 1 màu nhấn (navy logo). */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --hair: rgba(0, 0, 0, 0.08);
  --brand: #0a245c;          /* navy của logo VOOC TECH */
  --brand-2: #1b3f8f;
  --link: #0066cc;
  --live: #1e9e57;
  --dev: #c46b00;
  --dark: #000000;
  --dark-2: #161617;
  --dark-ink: #f5f5f7;
  --dark-muted: #a1a1a6;
  --radius-l: 28px;
  --radius-m: 20px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 48px rgba(0, 0, 0, 0.10);
  --max: 1120px;
  --gutter: 22px;
  --nav-h: 52px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Be Vietnam Pro",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #101012;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --muted: #a1a1a6;
    --hair: rgba(255, 255, 255, 0.12);
    --brand: #8fb2ff;
    --brand-2: #b7cdff;
    --link: #2997ff;
    --live: #30d158;
    --dev: #ff9f0a;
    --dark: #161617;
    --dark-2: #1c1c1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 48px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #000000;
  --bg-alt: #101012;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --ink-2: #d2d2d7;
  --muted: #a1a1a6;
  --hair: rgba(255, 255, 255, 0.12);
  --brand: #8fb2ff;
  --brand-2: #b7cdff;
  --link: #2997ff;
  --live: #30d158;
  --dev: #ff9f0a;
  --dark: #161617;
  --dark-2: #1c1c1e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 48px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--link) 60%, transparent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- chữ ---------- */
.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--brand); margin: 0 0 10px; }
.display {
  font-size: clamp(44px, 7.2vw, 88px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0;
}
.title { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.headline { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.lead { font-size: clamp(19px, 2vw, 24px); line-height: 1.4; color: var(--muted); font-weight: 500; letter-spacing: -0.015em; margin: 0; }
.body-l { font-size: 19px; color: var(--ink-2); }
.muted { color: var(--muted); }
.grad {
  background: linear-gradient(100deg, var(--brand) 0%, #2f6fde 55%, #36b3c9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .grad { background: linear-gradient(100deg, #9ec0ff 0%, #5aa2ff 50%, #64d2ff 100%); -webkit-background-clip: text; background-clip: text; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: 0.02em; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand .brand-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand .brand-light { display: none; } .brand .brand-dark { display: block; } }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); opacity: 0.8; font-size: 13px; font-weight: 500; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-cta { font-size: 13px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--hair); padding: 8px var(--gutter) 18px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: 0.25s ease;
  }
  .nav-links a { display: block; padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--hair); }
  .nav.open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
  .nav-cta { display: none; }
}

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 980px; font-size: 17px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: background 0.2s, transform 0.2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
@media (prefers-color-scheme: dark) { .btn-primary { background: #2f6fde; } .btn-primary:hover { background: #4a84ea; } }
.btn-ghost { color: var(--link); border-color: currentColor; }
.btn-ghost:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.link-arrow { font-weight: 500; }
.link-arrow::after { content: " ›"; }

/* ---------- section ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin: 0 0 clamp(36px, 5vw, 56px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .lead { margin-top: 16px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(72px, 10vw, 120px) 0 clamp(56px, 8vw, 96px); text-align: center; overflow: hidden; }
.hero .lead { max-width: 720px; margin: 22px auto 0; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero-art { position: relative; margin: clamp(48px, 7vw, 72px) auto 0; max-width: 980px; }
.hero-art svg { width: 100%; height: auto; }
.trace { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.trace-soft { fill: none; stroke: var(--hair); stroke-width: 1.4; }
.pad { fill: var(--bg); stroke: var(--brand); stroke-width: 2.2; }
.chip { fill: var(--surface); stroke: var(--brand); stroke-width: 2.2; }
.chip-label { fill: var(--brand); font: 600 13px var(--mono); letter-spacing: 0.04em; }
.pulse { fill: none; stroke: #2f6fde; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 26 520; animation: run 5.5s linear infinite; }
.pulse.d2 { animation-delay: -1.8s; stroke: #36b3c9; }
.pulse.d3 { animation-delay: -3.6s; }
@keyframes run { from { stroke-dashoffset: 546; } to { stroke-dashoffset: 0; } }

/* ---------- nhãn trạng thái ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; letter-spacing: 0; padding: 5px 11px; border-radius: 980px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.live { color: var(--live); background: color-mix(in srgb, var(--live) 12%, transparent); }
.status.live::before { box-shadow: 0 0 0 0 currentColor; animation: beat 2.4s ease-out infinite; }
.status.dev { color: var(--dev); background: color-mix(in srgb, var(--dev) 13%, transparent); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- bento dự án ---------- */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow);
  color: var(--ink); padding: clamp(28px, 4vw, 44px); min-height: 420px;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), box-shadow 0.35s;
}
.tile:hover { text-decoration: none; transform: translateY(-4px) scale(1.005); box-shadow: var(--shadow-hover); }
.tile .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tile .kind { font-size: 13px; font-weight: 600; color: var(--muted); }
.tile h3 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.08; letter-spacing: -0.03em; margin: 0; }
.tile p { color: var(--muted); font-size: 17px; margin: 12px 0 0; max-width: 520px; }
.tile .more { margin-top: 18px; color: var(--link); font-weight: 500; }
.tile .more::after { content: " ›"; }
.tile-art { margin-top: auto; padding-top: 28px; }

.tile-feature { grid-column: 1 / -1; background: var(--dark); color: var(--dark-ink); min-height: 560px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.tile-feature p, .tile-feature .kind { color: var(--dark-muted); }
.tile-feature .more { color: #2997ff; }
.tile-feature .tile-art { margin: 0; padding: 0; }
.app-icon {
  width: 76px; height: 76px; border-radius: 18px; background: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); margin-bottom: 22px;
}
.app-icon img { width: 58px; height: 58px; object-fit: contain; }
.shot {
  border-radius: 14px; overflow: hidden; background: #1c1c1e;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.shot-bar { display: flex; gap: 7px; padding: 11px 13px; background: #2a2a2d; }
.shot-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.shot-bar i:nth-child(2) { background: #febc2e; }
.shot-bar i:nth-child(3) { background: #28c840; }
.shot img { width: 100%; height: auto; }
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .tile-feature { grid-template-columns: 1fr; min-height: 0; }
  .tile { min-height: 0; }
}

/* ---------- dịch vụ ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--surface); border-radius: var(--radius-m); padding: 28px; box-shadow: var(--shadow); }
.section.alt .card { box-shadow: none; }
.card h3 { font-size: 21px; letter-spacing: -0.02em; margin: 18px 0 8px; line-height: 1.2; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.card li + li { margin-top: 4px; }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 9%, transparent); color: var(--brand); }
.icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- năng lực ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 44px; }
.stat { padding: 8px 0; border-top: 1px solid var(--hair); }
.stat b { display: block; font-size: clamp(36px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -0.035em; padding-top: 18px; }
.stat span { display: block; color: var(--muted); font-size: 15px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span { font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 980px; background: var(--surface); border: 1px solid var(--hair); color: var(--ink-2); }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- quy trình ---------- */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-top: 58px; }
.steps li::before {
  content: counter(s, decimal-leading-zero); position: absolute; top: 0; left: 0;
  font: 600 15px var(--mono); color: var(--brand); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--brand);
}
.steps li::after { content: ""; position: absolute; top: 20px; left: 52px; right: 12px; height: 1.5px; background: var(--hair); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 21px; letter-spacing: -0.02em; margin: 0 0 8px; }
.steps p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; } .steps li::after { display: none; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- liên hệ ---------- */
.contact { text-align: center; }
.contact .lead { max-width: 640px; margin: 18px auto 0; }
.contact-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 44px; text-align: left; }
.contact-cards a { display: block; color: var(--ink); background: var(--surface); border-radius: var(--radius-m); padding: 24px 26px; box-shadow: var(--shadow); transition: transform 0.3s, box-shadow 0.3s; }
.contact-cards a:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.contact-cards small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.contact-cards strong { display: block; font-size: 20px; letter-spacing: -0.02em; margin-top: 6px; word-break: break-word; }
@media (max-width: 760px) { .contact-cards { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.footer { background: var(--bg-alt); color: var(--muted); font-size: 12px; padding: 34px 0 44px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer a { color: var(--ink-2); }

/* ---------- trang dự án ---------- */
.p-hero { text-align: center; padding: clamp(64px, 9vw, 112px) 0 clamp(40px, 6vw, 64px); }
.p-hero .status { margin-bottom: 20px; }
.p-hero .lead { max-width: 760px; margin: 20px auto 0; }
.crumb { font-size: 14px; margin-bottom: 26px; display: inline-block; }
.diagram { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 36px); }
.diagram svg { width: 100%; height: auto; }
.dg-box { fill: var(--bg-alt); stroke: var(--hair); stroke-width: 1.5; }
.dg-key { fill: color-mix(in srgb, var(--brand) 9%, var(--surface)); stroke: var(--brand); stroke-width: 1.8; }
.dg-t { fill: var(--ink); font: 600 15px var(--font); }
.dg-s { fill: var(--muted); font: 500 12.5px var(--font); }
.dg-line { fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; marker-end: url(#arrow); }
.dg-dash { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 6; }
.spec { width: 100%; border-collapse: collapse; font-size: 16px; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 16px 0; border-bottom: 1px solid var(--hair); }
.spec th { width: 34%; color: var(--muted); font-weight: 500; padding-right: 18px; }
.note { font-size: 14px; color: var(--muted); margin-top: 18px; }
.cta-band { text-align: center; }
.cta-band .hero-actions { margin-top: 26px; }

/* ---------- hiện dần khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s cubic-bezier(.2, .8, .2, 1), transform 0.9s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; } .reveal.d3 { transition-delay: 0.24s; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse, .status.live::before { animation: none; }
  .tile, .btn, .contact-cards a { transition: none; }
}

/* ---------- ảnh bản mạch (render KiCad nền đen) ---------- */
.board-shot { background: #000; border-radius: var(--radius-m); overflow: hidden; }
.board-shot img { width: 100%; height: auto; }
.tile .board-shot { margin-top: 4px; }
.dark-band { background: #000; color: #f5f5f7; text-align: center; padding: clamp(72px, 10vw, 120px) 0 clamp(56px, 8vw, 96px); }
.dark-band .eyebrow { color: #8fb2ff; }
.dark-band .lead { color: #a1a1a6; max-width: 720px; margin: 18px auto 0; }
.dark-band .hero-board { max-width: 1000px; margin: clamp(32px, 5vw, 56px) auto 0; }
.dark-band .stats { margin: clamp(32px, 5vw, 56px) 0 0; text-align: left; }
.dark-band .stat { border-top-color: rgba(255, 255, 255, 0.16); }
.dark-band .stat span { color: #a1a1a6; }
.hw-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 4vw, 48px); align-items: start; }
.figure { margin: 0; }
.figure img { width: 100%; height: auto; border-radius: var(--radius-m); box-shadow: var(--shadow); }
.figure figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; }
@media (max-width: 860px) { .hw-grid { grid-template-columns: 1fr; } }
