:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-hover: #1f2530;
  --bg-code: #1c2230;
  --border: #2a3140;
  --border-soft: #1e2430;
  --text: #e8eaed;
  --text-muted: #9ba2ac;
  --text-subtle: #6b7380;
  --accent: #f5b942;
  --accent-warm: #ff9e3d;
  --accent-soft: rgba(245, 185, 66, 0.12);
  --link: #ffd089;
  --max-w: 740px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 3px rgba(245, 185, 66, 0.18);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle warm glow at top of page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 185, 66, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 158, 61, 0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #1a1300; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
  margin: 1.8em 0 0.6em;
  color: #f5f6f8;
  letter-spacing: -0.015em;
}
h1 { font-size: 2.2rem; margin-top: 0.4em; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin: 1em 0; }

code {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 5px;
  color: #f5d27b;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1em 1.3em;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.3em 0;
  position: relative;
  box-shadow: var(--shadow-sm);
}
pre::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-warm));
  border-radius: var(--radius) 0 0 var(--radius);
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: 1.4em auto;
  box-shadow: var(--shadow-md);
}

blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  margin: 1.2em 0;
  padding: 0.7em 1.2em;
  color: var(--text);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.2em 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}
th, td {
  padding: 0.7em 0.9em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
th { background: var(--bg-elev); font-weight: 600; }

ul, ol { padding-left: 1.4em; }
li { margin: 0.35em 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.95em 1.3em;
  display: flex;
  align-items: center;
  gap: 1.3em;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.01em;
  transition: opacity var(--transition);
}
.brand:hover { opacity: 0.85; }
.nav-links {
  display: flex;
  gap: 1.4em;
  align-items: center;
  margin-left: auto;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
  position: relative;
  padding: 0.3em 0;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--accent);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  border-radius: 2px;
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  font-size: 0.78rem;
}
.lang-switch button {
  background: transparent;
  color: var(--text-muted);
  border: 0;
  padding: 0.3em 0.75em;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  transition: all var(--transition);
}
.lang-switch button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #1a1300;
  box-shadow: 0 2px 8px rgba(245, 185, 66, 0.25);
}
.lang-switch button:hover:not(.active) { color: var(--text); }

.nav-toggle {
  display: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: auto;
  transition: all var(--transition);
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.2em 1.3em 4em;
}

.hero {
  padding: 3.2em 0 2.4em;
  margin-bottom: 2.2em;
  display: flex;
  gap: 1.6em;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}
.avatar {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
  color: #1a1300;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 24px rgba(245, 185, 66, 0.25);
}
.hero-text { flex: 1; min-width: 0; }
.hero h1 {
  font-size: 2.3rem;
  margin: 0 0 0.35em;
  background: linear-gradient(135deg, #fff, #c4c8d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-style: italic;
  margin: 0 0 0.4em;
  line-height: 1.55;
}
.hero .tagline-vi {
  color: var(--text-subtle);
  font-size: 0.92rem;
  margin: 0;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 2em 0 1.2em;
}

/* ---------- Post cards ---------- */
.posts { list-style: none; padding: 0; margin: 0; }
.post-card {
  border: 1px solid var(--border-soft);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 1.5em 1.7em;
  margin-bottom: 1em;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-warm));
  opacity: 0;
  transition: opacity var(--transition);
}
.post-card:hover {
  border-color: var(--border);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.post-card:hover::before { opacity: 1; }
.post-card .date {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-card h2 {
  margin: 0.4em 0 0.45em;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.post-card h2 a {
  color: var(--text);
}
.post-card h2 a:hover { color: var(--accent); }
.post-card .excerpt {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.65;
}
.post-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.9em;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  transition: gap var(--transition);
}
.post-card:hover .read-more { gap: 0.55em; }
.post-card .read-more:hover { color: var(--link); }

/* ---------- Post page ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-bottom: 1.6em;
}
.breadcrumb a { color: var(--text-subtle); }
.breadcrumb a:hover { color: var(--accent); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2.2em;
  padding-bottom: 1.2em;
  border-bottom: 1px solid var(--border-soft);
}
.post-meta .date {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  padding: 0.25em 0.7em;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 2.8em;
  padding: 0.7em 1.3em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
.back-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(-3px);
}

.callout {
  background: var(--accent-soft);
  border: 1px solid rgba(245, 185, 66, 0.25);
  border-radius: var(--radius);
  padding: 1.1em 1.3em;
  margin: 1.4em 0;
  font-size: 0.93rem;
  color: var(--text);
}
.callout strong { color: var(--accent); }

/* ---------- About / Contact ---------- */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  margin: 1.2em 0 2em;
  padding: 1.6em 1.7em;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.profile-section > div { margin: 0 !important; }
.profile-section .label {
  display: inline-block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3em;
}
.profile-section .value {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.55;
}
.profile-section .value a { font-weight: 500; }

.skill-list {
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55em;
}
.skill-list li {
  margin: 0;
  padding: 0.55em 0.9em;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.skill-list li:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 4.5em;
  padding: 2.2em 1.3em;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.86rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  h1 { font-size: 1.8rem; }
  .hero { padding: 2.2em 0 2em; gap: 1.1em; }
  .hero h1 { font-size: 1.85rem; }
  .avatar { width: 60px; height: 60px; font-size: 1.3rem; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0.8em 0 0.4em;
    gap: 0.4em;
    border-top: 1px solid var(--border-soft);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.5em 0; }
  .nav-links .lang-switch { align-self: flex-start; margin-top: 0.4em; }
  .nav-inner { flex-wrap: wrap; }
  .container { padding: 1.5em 1.1em 3em; }
  .post-card { padding: 1.2em 1.3em; }
  .profile-section { padding: 1.3em 1.4em; }
  .skill-list { grid-template-columns: 1fr; }
}

/* Smooth focus states for keyboard users */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

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