/* vuducnam.dev — Ember Terminal */
:root {
  --bg: #110C0A;
  --bg-2: #140E0B;
  --surface: #1A1310;
  --surface-2: #150F0C;
  --line: #2A1F19;
  --line-2: #33261F;
  --line-3: #4A372C;
  --text: #F4ECE4;
  --muted: #B9A89B;
  --dim: #8F7E72;
  --accent: #FF6B2C;
  --ember: #FF8F40;
  --amber: #FFC15E;
  --core: #FFE9BD;
  --crimson: #E5473A;
  --link: #FFB98F;
  --on-accent: #170D08;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --hand: 'Caveat', 'Segoe Script', cursive;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: #FFD9C2; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p, figure, ol, ul { margin: 0; }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 40px; }
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 20;
  padding: 10px 14px; border-radius: 6px;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.skip:focus { left: 16px; color: var(--on-accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(17, 12, 10, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; padding-block: 12px; }
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand b { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; font-family: var(--mono); font-size: 13px; }
.nav-links a { color: var(--muted); padding-block: 12px; }
.nav-links a:hover { color: var(--text); }
.nav-end { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; padding: 2px; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--mono); font-size: 12px; }
.lang a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 40px; padding: 0 12px; border-radius: 999px; color: var(--muted);
}
.lang a:hover { color: var(--text); }
.lang a[aria-current] { background: var(--line); color: var(--text); font-weight: 700; }
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer;
}
.mobile-menu { display: flex; flex-direction: column; padding-bottom: 12px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 15px; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--text); }
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a span:last-child { color: var(--dim); }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (min-width: 761px) {
  .mobile-menu { display: none !important; }
}

/* ---------- Sections ---------- */
main > section { border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section.alt { background: var(--bg-2); }
.label { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember); }
.h2 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.h3-mono { margin-top: 18px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.intro { max-width: 760px; gap: 18px; }
.lead { max-width: 36em; font-size: 17px; color: var(--muted); text-wrap: pretty; }
.body { max-width: 34em; font-size: 18px; color: var(--muted); text-wrap: pretty; }

/* ---------- Hero ---------- */
.hero {
  background-image: radial-gradient(rgba(255, 107, 44, 0.10) 1px, transparent 1.3px);
  background-size: 22px 22px;
}
.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  align-items: center;
  padding-block: clamp(48px, 8vw, 104px);
}
.hero-copy { gap: 26px; }
.prompt { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.prompt .cmd { color: var(--dim); }
.prompt .host { color: var(--ember); }
.cursor {
  display: inline-block; width: 9px; height: 17px; margin-left: 6px; vertical-align: -3px;
  background: var(--accent); animation: blink 1.1s steps(1) infinite;
}
h1 { font-size: clamp(48px, 8vw, 96px); line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.role { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; font-weight: 600; }
.role span { color: var(--ember); }
.signature {
  margin-top: -6px; font-family: var(--hand); font-size: 46px; line-height: 1; font-weight: 700;
  color: var(--amber); transform: rotate(-4deg); transform-origin: left center;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px;
  border: 1px solid var(--line-3); border-radius: 6px;
  color: var(--text); font-weight: 600; font-size: 15px;
  transition: border-color .2s ease, filter .2s ease;
}
.btn:hover { color: var(--text); border-color: var(--ember); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-primary:hover { color: var(--on-accent); border-color: var(--accent); filter: brightness(1.08); }
.meta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ---------- Fire panel ---------- */
.fire {
  justify-self: center; width: 100%; max-width: 520px; min-width: 0; overflow: hidden;
  border: 1px solid #5A3524; border-radius: 10px; background: #130C09;
  box-shadow: 0 0 0 1px rgba(255, 107, 44, 0.08), 0 30px 80px -30px rgba(255, 80, 30, 0.45);
}
.fire-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px;
}
.fire-head strong { color: var(--amber); letter-spacing: 0.06em; }
.fire-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.fire-stage {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 18px; min-height: 460px; padding: 48px 16px 28px; overflow: hidden;
}
.flame {
  font-family: var(--mono); font-size: clamp(12px, 1.75vw, 22px); line-height: 1.02; font-weight: 700; white-space: pre;
  filter: drop-shadow(0 0 22px rgba(255, 107, 44, 0.45));
  transform-origin: 50% 100%; animation: flicker 3.4s ease-in-out infinite;
}
.t0 { color: #B8392F; } .t1 { color: var(--crimson); } .t2 { color: var(--accent); }
.t3 { color: var(--ember); } .t4 { color: var(--amber); } .t5 { color: var(--core); }
.spark {
  position: absolute; bottom: 110px; width: 4px; height: 4px; border-radius: 1px;
  background: var(--amber); opacity: 0; animation: rise 3s ease-out infinite;
}
.spark.t1b { background: var(--crimson); } .spark.t3b { background: var(--ember); } .spark.t5b { background: var(--core); }
.fuel { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.fuel-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.fuel ul {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; max-width: 420px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 107, 44, 0.85), 0 0 22px rgba(229, 71, 58, 0.5);
}
.fire-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 1px; background: var(--line); border-top: 1px solid var(--line);
}
.fire-stats div { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: #130C09; }
.fire-stats strong { font-family: var(--mono); font-size: 20px; line-height: 1.25; color: var(--ember); }
.fire-stats span { font-size: 13px; line-height: 1.45; color: var(--muted); }
@media (max-width: 560px) {
  .fire-stage { min-height: 380px; padding-top: 32px; }
  .fire-stats { grid-template-columns: 1fr; }
  .fire-stats div { flex-direction: row; align-items: baseline; gap: 14px; padding: 14px 16px; }
  .fire-stats strong { flex: 0 0 132px; font-size: 18px; }
}
.fire figcaption { padding: 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.fire figcaption strong { color: var(--text); }

/* ---------- About ---------- */
.side { list-style: none; padding: 0; counter-reset: side; }
.side li { display: flex; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.side li:last-child { border-bottom: 1px solid var(--line); }
.side li::before {
  counter-increment: side; content: counter(side, lower-alpha) ".";
  flex: 0 0 auto; padding-top: 3px; font-family: var(--mono); font-size: 13px; color: var(--ember);
}
.code { min-width: 0; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.code-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.code-head a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.code pre { margin: 0; padding: 18px 16px 22px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.9; }
.k { color: var(--ember); } .p { color: var(--dim); } .v { color: var(--text); } .c { color: var(--dim); font-style: italic; }

/* ---------- Capabilities ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.cap { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; }
.cap .slug { font-family: var(--mono); font-size: 13px; color: var(--ember); }
.cap h3 { font-size: 21px; line-height: 1.3; font-weight: 700; }
.cap p { font-size: 15px; color: var(--muted); text-wrap: pretty; }
.cap .tech { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--dim); }
.products-wrap { gap: 16px; }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.product {
  display: flex; flex-direction: column; gap: 10px; padding: 24px 28px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text);
  transition: border-color .2s ease, transform .2s ease;
}
a.product:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.product-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-name { font-size: 24px; line-height: 1.2; font-weight: 700; }
.product-tag { font-family: var(--mono); font-size: 12px; color: var(--amber); white-space: nowrap; }
.product-body { font-size: 15px; color: var(--muted); }
.product-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--ember); }

/* ---------- Thinking ---------- */
.principles { list-style: none; padding: 0; counter-reset: p; }
.principles li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.principles li:last-child { border-bottom: 1px solid var(--line); }
.principles li::before {
  counter-increment: p; content: counter(p, decimal-leading-zero);
  flex: 0 0 72px; font-family: var(--mono); font-size: 32px; line-height: 1.1; font-weight: 700; color: var(--accent);
}
.principles h3 { flex: 1 1 280px; font-size: 22px; line-height: 1.35; font-weight: 700; }
.principles p { flex: 1 1 380px; color: var(--muted); text-wrap: pretty; }

/* ---------- Contact & footer ---------- */
main > .contact-section { border-bottom: 0; }
.contact { display: flex; flex-direction: column; gap: 26px; padding-block: clamp(72px, 10vw, 128px); }
.contact h2 { max-width: 15em; font-size: clamp(34px, 5.4vw, 64px); line-height: 1.06; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.contact .btn { overflow-wrap: anywhere; }
.signoff {
  margin-top: 18px; font-family: var(--hand); font-size: 34px; line-height: 1.1; font-weight: 700;
  color: var(--amber); transform: rotate(-3deg); transform-origin: left center;
}
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px;
  padding-block: 24px 32px; font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.site-footer a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--muted); }

.notfound { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 32px; }

/* ---------- Motion ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes flicker {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  30% { transform: scaleY(1.03) skewX(-0.6deg); opacity: 0.93; }
  62% { transform: scaleY(0.985) skewX(0.5deg); opacity: 1; }
}
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(var(--dx, 10px), -300px); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 44, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(255, 107, 44, 0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .flame, .pulse { animation: none; }
  .spark { display: none; }
}
