/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fa;
  --ink: #0f1318;
  --ink-2: #2e3642;
  --muted: #586070;
  --line: #e1e6ee;
  --line-strong: #cbd3df;

  --accent: #1f5eff;
  --accent-hover: #1749d1;
  --accent-soft: #eaf0ff;
  --accent-glow: #82a5ff;
  --accent-ice: #cfe0ff;

  --dark: #0f1318;
  --dark-deep: #0a0d12;
  --dark-2: #141a22;
  --dark-3: #1b2230;
  --dark-line: rgba(255, 255, 255, .09);
  --on-dark: #eaeef4;
  --on-dark-muted: #9ca6b5;

  --k-java: #1f5eff;
  --k-node: #82a5ff;
  --k-mobile: #b8ccff;
  --k-web: #6d7a90;

  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1200px;
  --gutter: 24px;
  --section-y: clamp(96px, 12vw, 160px);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 88px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  background: var(--dark);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain over everything, very low intensity */
body::after {
  content: "";
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, 3%); }
  100% { transform: translate(0, 0); }
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
em { font-style: normal; }
img, svg { display: block; max-width: 100%; }

.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 12px 16px; background: var(--accent); color: #fff; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.dark :focus-visible, .site-header :focus-visible { outline-color: var(--accent-glow); }

.dark { background: var(--dark); color: var(--on-dark); }

/* Placeholder for missing content: visible on purpose so nothing ships unfilled */
.ph {
  font-family: var(--font-mono);
  font-size: .86em;
  font-weight: 500;
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px dashed #9db5f5;
  border-radius: 5px;
  padding: 1px 6px;
}
.dark .ph { color: var(--accent-ice); background: rgba(31, 94, 255, .14); border-color: rgba(130, 165, 255, .45); }

.scroll-progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 80;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  box-shadow: 0 0 12px rgba(31, 94, 255, .8);
}

/* ==========================================================================
   Buttons & links
   ========================================================================== */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 20px;
  border: 1px solid transparent; border-radius: 12px;
  font: 600 15px/1.2 var(--font-sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), transform .35s var(--ease-out);
}
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 56px; padding: 16px 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 10px 30px -10px rgba(31, 94, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { background: #2a68ff; box-shadow: 0 16px 40px -12px rgba(31, 94, 255, 1), inset 0 1px 0 rgba(255, 255, 255, .3); }

.btn-glass {
  color: var(--on-dark);
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }

/* a beam of light passing over the button */
.btn-shine::after {
  content: ""; position: absolute; z-index: -1; inset: -2px auto -2px -60%;
  width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shine 4.5s var(--ease) infinite;
}
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }

.link-arrow {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: none;
}
.link-arrow::after { content: "→"; margin-left: 8px; transition: transform .25s var(--ease); }
.link-arrow:hover::after { transform: translateX(5px); }

/* ==========================================================================
   Header — floating glass pill
   ========================================================================== */
.site-header {
  position: fixed; z-index: 70; top: 14px; left: 0; right: 0;
  padding-inline: var(--gutter);
  pointer-events: none;
}
.header-pill {
  pointer-events: auto;
  max-width: var(--container); margin-inline: auto;
  height: 60px; padding: 0 8px 0 18px;
  display: flex; align-items: center; gap: 24px;
  color: var(--on-dark);
  background: rgba(12, 16, 22, .55);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease), max-width .5s var(--ease-out);
}
.site-header.is-scrolled .header-pill {
  max-width: 1040px;
  background: rgba(12, 16, 22, .84);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .55);
}

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.logo-text { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(31, 94, 255, .7);
  display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-left: 6px;
}
.logo-mark i { display: block; height: 2.5px; border-radius: 2px; background: #fff; }
.logo-mark i:nth-child(1) { width: 6px; opacity: .6; }
.logo-mark i:nth-child(2) { width: 10px; opacity: .8; }
.logo-mark i:nth-child(3) { width: 14px; }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 2px; }
.nav a:not(.btn) {
  position: relative;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--on-dark-muted);
  border-radius: 10px; transition: color .2s, background-color .2s;
}
.nav a:not(.btn):hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-cta-mobile { display: none; }
/* link to the sister landing: marked so it reads as a different page, not a section */
.nav a.nav-edu { color: var(--accent-glow); }
.nav a.nav-edu::after { content: "↗"; margin-left: 5px; font-size: .85em; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-toggle-bar { width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease); }
.nav-toggle[aria-expanded="true"] .sr-only + .nav-toggle-bar { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar + .nav-toggle-bar { transform: translateY(-4px) rotate(-45deg); }

/* ==========================================================================
   Section scaffolding
   ========================================================================== */
.section { position: relative; padding-block: var(--section-y); }

.sec-head { max-width: 820px; margin-bottom: clamp(48px, 7vw, 80px); }
.sec-head h2 { font-size: clamp(32px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -0.035em; }
.lead { margin-top: 22px; font-size: 18.5px; color: var(--muted); max-width: 640px; }
.dark .lead { color: var(--on-dark-muted); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow .mono {
  display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 8px;
  border-radius: 7px; background: var(--accent); color: #fff; letter-spacing: 0;
  box-shadow: 0 0 20px rgba(31, 94, 255, .45);
}
.dark .eyebrow { color: var(--on-dark-muted); }

.hl {
  color: transparent;
  background: linear-gradient(100deg, #6f95ff 0%, #c9d8ff 40%, #ffffff 50%, #c9d8ff 60%, #6f95ff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: sheen 6s linear infinite;
}
.section:not(.dark) .hl, .why-sec .hl { background-image: linear-gradient(100deg, #1f5eff, #4c7dff 45%, #1749d1); }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ==========================================================================
   Kinetic headings (words rise out of a mask) & scroll reveal
   Vietnamese diacritics stack high, so the mask gets extra headroom.
   ========================================================================== */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: .16em .02em .1em; margin: -.16em -.02em -.1em; }
.w > * , .w > span { display: inline-block; }
.js [data-split] .w > * {
  transform: translateY(105%) rotate(4deg); opacity: 0;
  transition: transform 1s var(--ease-out), opacity .6s var(--ease);
  transition-delay: calc(var(--wi, 0) * 45ms);
}
.js [data-split].is-in .w > * { transform: none; opacity: 1; }

/* hide headings until they are split; the animation un-hides them if effects.js never runs */
.js [data-split]:not(.is-split) { opacity: 0; animation: unhide 0s 2.5s forwards; }
@keyframes unhide { to { opacity: 1; } }

/* uses `translate` (not `transform`) so it composes with the 3D tilt on cards */
.js .reveal {
  opacity: 0; translate: 0 28px; filter: blur(6px);
  transition: opacity .9s var(--ease), translate 1s var(--ease-out), filter .9s var(--ease), transform .7s var(--ease-out), box-shadow .4s var(--ease);
  transition-delay: var(--rd, 0ms);
}
.js .reveal.is-visible { opacity: 1; translate: none; filter: none; }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--on-dark);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.chip-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; flex: none;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

/* spotlight that follows the pointer — shared by cards */
[data-spotlight] { --mx: 50%; --my: 50%; }
