:root {
  --bg: #0e0d0b;
  --bg-2: #171512;
  --line: #2a2620;
  --text: #f1ece3;
  --muted: #9b9387;
  --accent: #ff8a1f;
  --accent-ink: #160b00;
  --live: #4ade80;
  --build: #facc15;
  --grid: rgba(255,255,255,.035);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f1e7;
  --bg-2: #ede6d8;
  --line: #d9cfbd;
  --text: #1a1611;
  --muted: #6b6255;
  --accent: #e5650a;
  --accent-ink: #fff8f0;
  --live: #15803d;
  --build: #a16207;
  --grid: rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f1e7; --bg-2: #ede6d8; --line: #d9cfbd; --text: #1a1611; --muted: #6b6255;
    --accent: #e5650a; --accent-ink: #fff8f0; --live: #15803d; --build: #a16207;
    --grid: rgba(0,0,0,.04); color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text);
  font: 17px/1.65 var(--display);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); }

/* ---- top bar ---- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; font: 500 14px var(--mono);
}
.top .brand { text-decoration: none; letter-spacing: -.01em; }
.top .brand b { color: var(--accent); }
.top nav { display: flex; gap: 18px; align-items: center; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }
.lang-btn {
  display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  text-decoration: none; font: 500 12px var(--mono); height: 34px; align-items: stretch;
}
.lang-btn span { display: grid; place-items: center; padding: 0 8px; color: var(--muted); }
.lang-btn span.on { background: var(--accent); color: var(--accent-ink); }
.lang-btn:hover { border-color: var(--muted); }
.theme-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
}
.theme-btn:hover { color: var(--text); border-color: var(--muted); }
.theme-btn svg { width: 16px; height: 16px; }
:root .i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .i-sun { display: block; }
  :root:not([data-theme]) .i-moon { display: none; }
}

/* ---- hero ---- */
.hero { padding: 64px 0 72px; }
.who { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.who img {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  border: 2px solid var(--accent); transform: rotate(-4deg);
}
.who .meta { font: 13px/1.5 var(--mono); color: var(--muted); }
.who .meta strong { color: var(--text); font-weight: 500; display: block; font-size: 14px; }

h1 {
  font-weight: 800; letter-spacing: -.04em; line-height: .98;
  font-size: clamp(44px, 9vw, 92px); margin: 0 0 28px;
}
h1 .hl { color: var(--accent); }
html[lang="vi"] h1 { line-height: 1.08; } /* room for stacked diacritics */
h1 .strike { position: relative; color: var(--muted); white-space: nowrap; }
h1 .strike::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 54%;
  height: .09em; background: var(--accent); transform: rotate(-3deg);
}
.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 620px; margin: 0 0 34px; }
.lede b { color: var(--text); font-weight: 500; }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  font: 13px var(--mono); padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-2); margin-bottom: 30px; max-width: 100%;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; position: relative; }
.dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--live); opacity: 0; animation: ping 2s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.4); opacity: 0; } }

.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 500 15px var(--mono); padding: 12px 18px; border-radius: 10px;
  border: 1px solid var(--line); transition: transform .15s ease, background .15s ease, border-color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-2px); border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 4px 4px 0 var(--text); }
.btn.primary:hover { box-shadow: 6px 6px 0 var(--text); }

/* ---- sections ---- */
section { padding: 56px 0; border-top: 1px dashed var(--line); }
.label {
  font: 500 13px var(--mono); color: var(--accent); letter-spacing: .04em;
  margin: 0 0 8px;
}
h2 { font-size: clamp(28px, 4.4vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 0 0 30px; }

/* projects */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; text-decoration: none; transition: transform .18s ease, border-color .18s ease;
}
a.card:hover { transform: translateY(-3px); border-color: var(--accent); }
a.card:hover .go { color: var(--accent); transform: translate(2px,-2px); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.card .tag { font: 12px var(--mono); color: var(--muted); }
.card p { margin: 0; color: var(--muted); font-size: 16px; flex: 1; }
.go { color: var(--muted); transition: transform .18s, color .18s; display: flex; }
.status { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-live { color: var(--live); } .s-building { color: var(--build); }
.s-paused, .s-sunset { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font: 11px var(--mono); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.hura { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 26px; margin-bottom: 20px;
  border: 1px solid var(--accent); border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-2)), var(--bg-2) 60%); }
.hura-mark { width: 64px; height: 64px; border-radius: 16px; background: #fffaf3; border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.hura-mark img { width: 44px; height: 44px; display: block; }
.hura-kicker { font: 500 12px var(--mono); color: var(--accent); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.hura h3 { font-size: 26px; letter-spacing: -.03em; margin: 0 0 8px; }
.hura-body > p { color: var(--muted); margin: 0 0 14px; max-width: 620px; }
.hura-points { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font: 13px var(--mono); }
.hura-points li::before { content: "✓ "; color: var(--live); }
@media (max-width: 560px) { .hura { grid-template-columns: 1fr; padding: 20px; gap: 14px; } }
.chip.hot { border-color: var(--accent); color: var(--accent); }
.plat { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }

/* hero stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 44px 0 0; background: var(--line);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stats div { background: var(--bg-2); padding: 16px 18px; display: flex; flex-direction: column-reverse; }
.stats dt { font: 12px/1.4 var(--mono); color: var(--muted); }
.stats dd { margin: 0 0 4px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* all products list */
.sub { font-size: 20px; letter-spacing: -.02em; margin: 44px 0 14px; }
.pfilter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pfilter button { font: 500 13px var(--mono); color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; transition: color .15s, border-color .15s, background .15s; }
.pfilter button span { opacity: .6; }
.pfilter button:hover { color: var(--text); border-color: var(--muted); }
.pfilter button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
.mcard { display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2);
  text-decoration: none; transition: border-color .18s, transform .18s; }
.mcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.mcard[hidden] { display: none; }
.mcard .mtop { display: flex; justify-content: space-between; align-items: center; }
.mcard .myear { font: 12px var(--mono); color: var(--muted); }
.mcard strong { font-size: 17px; letter-spacing: -.01em; line-height: 1.3; }
.mcard .pd { color: var(--muted); font-size: 14px; line-height: 1.5; }
.mcard .chips { margin-top: auto; padding-top: 4px; }

/* timeline */
.tl-year { display: grid; grid-template-columns: 120px 1fr; gap: 20px; border-top: 1px solid var(--line); padding-top: 6px; }
.tl-y { padding-top: 12px; }
.tl-y span { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.tl-y small { font: 12px var(--mono); color: var(--muted); }
.tl .log li { grid-template-columns: 54px 92px 1fr; }
.tl .log li:last-child { border-bottom: 0; }
.tl .log a { text-decoration: none; }
.tl .log a:hover { color: var(--accent); }
@media (max-width: 600px) {
  .tl-year { grid-template-columns: 1fr; gap: 0; }
  .tl .log li { grid-template-columns: auto 1fr; }
}

/* log */
.log { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 14px; }
.log li {
  display: grid; grid-template-columns: 104px 78px 1fr; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.log time { color: var(--muted); }
.log .k { font-size: 12px; }
.k-ship { color: var(--live); } .k-win { color: var(--accent); } .k-fail { color: #f87171; }
.k-note, .k-metric { color: var(--build); }
.log .t { font-family: var(--display); font-size: 16px; }
@media (max-width: 600px) {
  .log li { grid-template-columns: auto 1fr; row-gap: 4px; }
  .log .t { grid-column: 1 / -1; }
}

/* about */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.about p { margin: 0 0 18px; }
.about p:last-child { margin: 0; }
.about .muted { color: var(--muted); }
.about a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.facts { font: 14px/1.6 var(--mono); border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--bg-2); align-self: start; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0 0 14px; }
.facts dd:last-child { margin: 0; }
@media (max-width: 720px) { .about { grid-template-columns: 1fr; gap: 28px; } }

/* contact */
.contact h2 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; letter-spacing: -.04em; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 14px var(--mono); padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
  transition: color .15s, border-color .15s;
}
.socials a:hover { color: var(--text); border-color: var(--accent); }
.socials svg { width: 18px; height: 18px; }

footer { padding: 30px 0 50px; font: 13px var(--mono); color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px dashed var(--line); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot::after { animation: none; }
  .btn, .card, .go { transition: none; }
}
@media (max-width: 360px) { .top nav a.hide-xs { display: none; } }
@media (max-width: 560px) {
  .top nav a.hide-sm { display: none; }
  .top nav { gap: 12px; }
  .hero { padding: 36px 0 56px; }
  .log li { padding: 12px 0; }
}
