/* =========================================================
   6AppStudio — styles
   Warm off-white canvas, ink text, single orange accent.
   ========================================================= */

:root {
  --canvas:      #faf9f7;
  --surface:     #ffffff;
  --ink:         #111114;
  --ink-2:       #3f4147;
  --ink-3:       #75777f;
  --line:        rgba(17, 17, 20, 0.10);
  --line-soft:   rgba(17, 17, 20, 0.06);
  --accent:      #ef4a18;   /* cam branding */
  --accent-soft: rgba(239, 74, 24, 0.10);

  --shell: 1180px;

  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Home is a single screen: header / hero / footer stacked to fill it. */
body.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0;
  text-decoration: none; font-size: 14px;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ───────────────────────── Type ───────────────────────── */

.display {
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 5.8vw, 4.4rem);   /* mono rộng ngang hơn sans nên hạ cỡ */
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.display .accent { color: var(--accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin: 0 0 22px;
}

/* ───────────────────────── Buttons ───────────────────────── */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .3s var(--ease), background-color .25s, border-color .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-arrow { transition: transform .3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

.btn-dark   { --btn-bg: var(--ink);   --btn-fg: #fff; }
.btn-dark:hover { --btn-bg: #26262c; }

.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; }
.btn-accent:hover { --btn-bg: #d63f10; }

/* ───────────────────────── Header ───────────────────────── */

/* Thanh nav nổi: fixed để trôi trên nền lỏng, bo góc, cách mép một khoảng. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 14px 0;
  pointer-events: none;          /* khoảng trống hai bên không chặn chuột của hero */
}
.site-header > .shell { pointer-events: none; }

.header-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 8px 8px 22px;   /* trái nới thêm để logo không dính vào chỗ bo */
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid rgba(17, 17, 20, 0.05);
  box-shadow: 0 8px 28px -14px rgba(17, 17, 20, 0.28);
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-stuck .header-inner {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 32px -14px rgba(17, 17, 20, 0.34);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; letter-spacing: -0.02em;
}
/* Logo mark — nguồn ảnh là assets/icon.svg, thay file đó là đổi được logo.
   Bo góc do chính file SVG lo, nên ở đây chỉ set kích thước + đổ bóng.
   drop-shadow bám theo hình thật của SVG (không bị lòi góc vuông như box-shadow). */
.brand-mark {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 4px 10px rgba(239, 74, 24, .30));
}
.brand-name { font-size: 16px; }

.nav {
  display: flex; gap: 28px;
  margin-inline: auto;
  font-size: 15px;
}
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  position: relative;
  transition: color .2s;
  white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.header-cta { padding: 10px 8px 10px 20px; }
.header-cta .btn-arrow {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 13px;
}

/* ───────────────────────── Hero ───────────────────────── */

.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;          /* cả cụm chữ + nút căn giữa theo chiều dọc */
  padding: 110px 0 60px;        /* chừa chỗ cho thanh nav nổi (fixed) */
  overflow: hidden;
}

/* Nền: 2 lớp vân sáng chạy chéo với tốc độ/góc khác nhau. Chúng trượt qua nhau
   nên chỗ giao thoa sáng tối cứ dồn rồi giãn — đó là cảm giác gợn sóng.
   --px/--py do main.js set, tạo parallax nhẹ theo con trỏ. */
.hero-bg {
  position: absolute;
  inset: -30% -12% auto -12%;
  height: 160%;
  z-index: 0;
  background:
    radial-gradient(58% 52% at 78% 8%, rgba(239, 74, 24, .17), transparent 62%),
    radial-gradient(52% 52% at 10% 4%, rgba(90, 130, 255, .11), transparent 60%);
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 1.1s var(--ease);
}

.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
  inset: -25%;
  filter: blur(2px);
  will-change: transform;
}

.hero-bg::before {
  background-image: repeating-linear-gradient(115deg,
    rgba(255,255,255,0)   0px,
    rgba(255,255,255,.62) 38px,
    rgba(255,255,255,0)   84px,
    rgba(17,17,20,.035)   130px,
    rgba(255,255,255,0)   190px);
  animation: waveA 19s ease-in-out infinite alternate;
}

.hero-bg::after {
  background-image: repeating-linear-gradient(101deg,
    rgba(255,255,255,0)   0px,
    rgba(255,255,255,.44) 54px,
    rgba(255,255,255,0)   118px,
    rgba(17,17,20,.022)   176px,
    rgba(255,255,255,0)   250px);
  opacity: .85;
  animation: waveB 27s ease-in-out infinite alternate;
}

@keyframes waveA {
  0%   { transform: translate3d(-3%, 0, 0)      skewY(0deg)    scale(1.04); }
  50%  { transform: translate3d(1%, -1.5%, 0)   skewY(-1.2deg) scale(1.08); }
  100% { transform: translate3d(4%, 1%, 0)      skewY(.9deg)   scale(1.05); }
}
@keyframes waveB {
  0%   { transform: translate3d(3%, 1%, 0)      skewY(.8deg)   scale(1.06); }
  50%  { transform: translate3d(-1%, -1%, 0)    skewY(-.6deg)  scale(1.02); }
  100% { transform: translate3d(-4%, 0, 0)      skewY(1.1deg)  scale(1.07); }
}

/* Quầng sáng cam bám theo con trỏ. Chỉ bật khi thiết bị thật sự có chuột. */
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .55s var(--ease);
  background:
    radial-gradient(330px 330px at var(--gx, 50%) var(--gy, 50%),
      rgba(239, 74, 24, .22), transparent 70%),
    radial-gradient(680px 680px at var(--gx, 50%) var(--gy, 50%),
      rgba(239, 74, 24, .10), transparent 72%);
}
.hero-glow.is-live { opacity: 1; }

/* Khi WebGL chạy được, liquid.js gắn class này và nhận luôn phần nền.
   Hai lớp CSS ở trên lúc đó chỉ còn là dự phòng cho máy không có WebGL. */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.has-liquid .hero-bg,
.has-liquid .hero-glow { display: none; }

.hero-inner { position: relative; z-index: 1; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 42px;
}

.mail {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color .25s, border-color .25s;
}
.mail:hover { color: var(--accent); border-color: var(--accent); }

/* ───────────────────────── Footer ───────────────────────── */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  padding: clamp(56px, 8vw, 92px) 0 26px;
}

.footer-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}

.footer-mail {
  display: inline-block;
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  letter-spacing: -.03em;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.footer-mail:hover { color: var(--accent); }

.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  justify-content: space-between; align-items: center;
  margin-top: clamp(44px, 6vw, 76px);
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 13.5px;
}
.footer-bottom p { margin: 0; }
.footer-bottom nav { display: flex; gap: 22px; }
.footer-bottom a { text-decoration: none; transition: color .2s; }
.footer-bottom a:hover { color: var(--accent); }

/* ───────────────────────── Legal pages ───────────────────────── */

.legal { padding: 130px 0 90px; }
.legal-wrap { max-width: 720px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 10px; }
.legal .updated { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 44px; }
.legal h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 44px 0 12px; }
.legal h3 { font-size: 1.02rem; letter-spacing: -.01em; margin: 28px 0 8px; color: var(--ink); }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--accent); }
/* Khối phạm vi áp dụng — trung tính, chỉ dùng gạch cam bên trái để tách khỏi thân bài */
.legal .scope {
  border-left: 2px solid var(--accent);
  background: rgba(17, 17, 20, 0.025);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 0 0 40px;
  font-size: 15px;
  color: var(--ink-2);
}

.legal .note {
  background: var(--accent-soft);
  border: 1px solid rgba(239,74,23,.22);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 14.5px;
  color: #8f2f0e;
  margin-bottom: 40px;
}
.legal .note a { color: inherit; }

/* ───────────────────────── Responsive ───────────────────────── */

@media (max-width: 860px) {
  .nav { gap: 18px; font-size: 14px; }
  .header-cta { padding: 9px 8px 9px 16px; font-size: 14px; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; row-gap: 12px; }
  .nav { order: 3; width: 100%; margin-inline: 0; gap: 20px; }
  .header-cta { margin-left: auto; }
  .hero { align-items: center; padding-top: 40px; }
  .footer-bottom { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
