/* =====================================================================
   On Corporation — landing page (việc #173250)
   Design Pattern "Vercel" · token đầy đủ (màu · chữ · góc cạnh · bóng/viền ·
   khoảng cách) · sáng/tối theo hệ thống + công tắc chủ đề · mobile-first
   0 request Google Fonts — phông tự lưu tại fonts/
   ===================================================================== */

/* ---------- Phông tự lưu (biến thiên — 1 tệp phủ 100..900) ---------- */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-mono-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Token chủ đề "neon" (mặc định) ---------- */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #06070a;
  --bg-elev: #0c0e13;
  --surface: #111319;
  --surface-2: #161a22;
  --line: #232936;
  --line-soft: #1a1f29;
  --fg: #f3f5f8;
  --fg-muted: #a3adbd;
  --fg-faint: #6b7484;

  --accent: #5b8cff;
  --accent-2: #22d3ee;
  --accent-3: #a78bfa;
  --accent-contrast: #04060d;
  --ring: #7aa2ff;

  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-pill: 999px;
  --radius-input: 10px;
  --radius-tag: 8px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03) inset;
  --shadow-2: 0 12px 34px -12px rgba(0,0,0,.72);
  --shadow-glow: 0 0 40px -12px rgba(91,140,255,.55);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --section-y: clamp(48px, 9vw, 104px);
  --content: 1120px;

  --topbar-h: 60px;
  --hero-lh: 1.05;

  color-scheme: dark;
}

/* ---------- Chủ đề "sang" (sáng) ---------- */
[data-theme="sang"] {
  --bg: #ffffff;
  --bg-elev: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --line: #e4e8ee;
  --line-soft: #eef1f5;
  --fg: #0b0e14;
  --fg-muted: #4b5563;
  --fg-faint: #8a93a3;

  --accent: #2f6bff;
  --accent-2: #0891b2;
  --accent-3: #7c5cf5;
  --accent-contrast: #ffffff;
  --ring: #2f6bff;

  --radius-card: 18px;
  --radius-btn: 999px;
  --radius-pill: 999px;
  --radius-input: 12px;
  --radius-tag: 999px;

  --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 0 0 1px rgba(16,24,40,.04) inset;
  --shadow-2: 0 18px 40px -22px rgba(16,24,40,.28);
  --shadow-glow: 0 0 34px -14px rgba(47,107,255,.5);
  color-scheme: light;
}

/* ---------- Chủ đề "cochan" (chữ có chân, bo vuông) ---------- */
[data-theme="cochan"] {
  --font-sans: Georgia, "Times New Roman", "Noto Serif", serif;
  --bg: #f6f2e9;
  --bg-elev: #fbf8f1;
  --surface: #fffdf8;
  --surface-2: #f3ecdd;
  --line: #e0d6c1;
  --line-soft: #ece3d2;
  --fg: #241f16;
  --fg-muted: #5c5344;
  --fg-faint: #8c8271;

  --accent: #8a5a24;
  --accent-2: #0f6d5c;
  --accent-3: #7a3f6a;
  --accent-contrast: #fffaf1;
  --ring: #8a5a24;

  --radius-card: 4px;
  --radius-btn: 3px;
  --radius-pill: 3px;
  --radius-input: 3px;
  --radius-tag: 3px;

  --shadow-1: 0 1px 0 rgba(36,31,22,.08);
  --shadow-2: 0 16px 30px -22px rgba(36,31,22,.4);
  --shadow-glow: 0 0 0 0 transparent;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 16px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
h1,h2,h3,h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 640; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--content); margin-inline: auto; padding-inline: clamp(16px, 5vw, 32px); }

/* ---------- Nền trang trí (KHÔNG tham gia lưới — position:absolute) ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 46% at 78% -8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(48% 40% at 6% 12%, color-mix(in srgb, var(--accent-3) 20%, transparent), transparent 72%),
    linear-gradient(to bottom, transparent 0, var(--bg) 60%);
}
.bg-grid::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px;
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0, transparent 85%);
          mask-image: radial-gradient(80% 60% at 50% 0%, #000 0, transparent 85%);
}

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  min-height: var(--topbar-h); height: auto;
  display: flex; align-items: center; gap: var(--space-4);
  padding-block: 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--fg-faint); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a { color: var(--fg-muted); font-size: 14.5px; padding: 8px 12px; border-radius: var(--radius-pill); }
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav + .actions { margin-left: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-btn);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); border-color: transparent; box-shadow: var(--shadow-glow); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }

/* công tắc chủ đề */
.theme-switch { display: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
@media (min-width: 760px) { .theme-switch { display: flex; } }
.theme-switch-drawer { display: flex !important; }
.theme-switch button {
  border: 0; background: transparent; color: var(--fg-muted); cursor: pointer;
  min-width: 34px; min-height: 32px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; padding: 0 8px; flex: none;
}
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }
.burger { display: inline-flex; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .burger { display: none; }
}

/* nav khổ hẹp */
.drawer {
  position: fixed; inset: 0; z-index: 50; display: none;
}
.drawer[data-open="true"] { display: block; }
.drawer .mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.drawer .panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(84vw, 340px);
  background: var(--bg-elev); border-left: 1px solid var(--line);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.drawer .panel a { padding: 14px 12px; border-radius: var(--radius-btn); color: var(--fg); font-weight: 600; }
.drawer .panel a:hover { background: var(--surface-2); }
.drawer .panel .x { align-self: flex-end; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(44px, 11vw, 120px) clamp(40px, 8vw, 84px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--fg-muted); border: 1px solid var(--line); background: var(--surface);
  padding: 7px 14px; border-radius: var(--radius-pill); letter-spacing: .02em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.hero h1 {
  margin-top: var(--space-5);
  font-size: clamp(34px, 7.4vw, 72px);
  line-height: var(--hero-lh); font-weight: 700;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { margin-top: var(--space-5); font-size: clamp(16px, 2.1vw, 20px); color: var(--fg-muted); max-width: 62ch; }
.hero .cta { margin-top: var(--space-6); display: flex; flex-wrap: wrap; gap: 12px; }
.hero .stats { margin-top: var(--space-7); display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 640px; }
.stat { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-card); padding: 18px 18px; box-shadow: var(--shadow-1); }
.stat b { font-size: clamp(24px, 4vw, 32px); font-weight: 700; letter-spacing: -0.03em; display: block; }
.stat span { color: var(--fg-muted); font-size: 13.5px; }
.stat-chu b { font-size: clamp(17px, 2.4vw, 21px); letter-spacing: -0.01em; line-height: 1.25; }
@media (min-width: 720px) { .hero .stats { grid-template-columns: repeat(4, minmax(0,1fr)); } }

/* ---------- Mục chung ---------- */
section { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.band { padding-block: var(--section-y); }
.band.elev { background: var(--bg-elev); border-block: 1px solid var(--line-soft); }
.head { max-width: 60ch; margin-bottom: clamp(28px, 5vw, 52px); }
.head .kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.head h2 { margin-top: 12px; font-size: clamp(26px, 4.6vw, 42px); font-weight: 680; }
.head p { margin-top: 14px; color: var(--fg-muted); font-size: clamp(15.5px, 2vw, 18px); }

/* ---------- Lưới mảng ---------- */
.segments { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .segments { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1000px) { .segments { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.seg {
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-card);
  padding: 22px; box-shadow: var(--shadow-1); min-width: 0;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.seg:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow-2); }
.seg .ico {
  width: 46px; height: 46px; border-radius: var(--radius-btn); display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
}
.seg .ico svg { width: 24px; height: 24px; }
.seg h3 { font-size: 19px; font-weight: 660; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg p { color: var(--fg-muted); font-size: 14.8px; }
.seg .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.tag {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 10px; border-radius: var(--radius-tag);
  border: 1px solid var(--line); color: var(--fg-muted); background: var(--surface-2);
}
.tag.live { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
.tag.soon { color: var(--fg-faint); }
.seg .link { color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.seg .link:hover { text-decoration: underline; }

/* ---------- Khối 2 cột (về chúng tôi / công nghệ) ---------- */
.split { display: grid; gap: clamp(24px, 5vw, 56px); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr .95fr; } }
.prose p { color: var(--fg-muted); margin-top: 16px; font-size: clamp(15.5px, 2vw, 17.5px); }
.prose p:first-child { margin-top: 0; }
.values { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: var(--space-5); }
.value { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-btn); padding: 14px 15px; }
.value b { display: block; font-size: 15px; }
.value span { color: var(--fg-muted); font-size: 13px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.timeline li { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.timeline li:first-child { border-top: 0; }
.timeline .no { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: 13px; padding-top: 3px; }
.timeline h4 { font-size: 16.5px; }
.timeline p { color: var(--fg-muted); font-size: 14.5px; margin-top: 4px; }

/* ---------- Công nghệ ---------- */
.tech { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: var(--space-5); }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-btn); padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; }
.chip b { font-size: 14.5px; display: block; }
.chip span { color: var(--fg-muted); font-size: 13px; }

/* ---------- Liên hệ ---------- */
.contact { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; align-items: center; } }
.contact .card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-card); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-2); }
.contact a.mail { color: var(--accent); font-weight: 660; font-size: clamp(17px, 3vw, 22px); overflow-wrap: anywhere; }
.contact .muted { color: var(--fg-muted); font-size: 14.5px; margin-top: 10px; }
.contact-form { display: grid; gap: 14px; margin-top: 18px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; color: var(--fg-muted); min-width: 0; }
.contact-form input, .contact-form textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; /* ≥16px: Safari iPhone không tự phóng to ô nhập */
  color: var(--fg); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 11px 12px;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.contact-form button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Chân trang ---------- */
footer { border-top: 1px solid var(--line-soft); background: var(--bg-elev); padding-block: var(--space-7) var(--space-5); }
.foot-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-col h5 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); font-family: var(--font-mono); margin: 0 0 12px; }
.foot-col a { display: block; color: var(--fg-muted); padding: 5px 0; font-size: 14.5px; }
.foot-col a:hover { color: var(--fg); }
.foot-chu { display: block; color: var(--fg-muted); padding: 5px 0; font-size: 14.5px; }
.foot-bottom { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--fg-faint); font-size: 13px; }

/* ---------- Hiện dần khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Nút lên đầu trang (đáy, nhường thanh an toàn) ---------- */
.totop {
  position: fixed; right: 16px; z-index: 30;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 46px; height: 46px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.totop.show { opacity: 1; pointer-events: auto; }

/* ---------- Trợ năng ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 60; background: var(--accent); color: var(--accent-contrast); padding: 10px 16px; border-radius: var(--radius-btn); transition: top .15s ease; }
.skip:focus { top: 8px; }
