/* ducdinh://blog — shared theme (matches ducdinh.com tokens) */
:root {
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 980px;
  --bg: #05070a;
  --panel: #0a0f16;
  --panel-2: #0e1622;
  --line: rgba(148, 163, 184, 0.13);
  --line-2: rgba(148, 163, 184, 0.26);
  --text: #e6edf3;
  --text-2: #9fb0c0;
  --text-3: #6f8194;
  --ok: #4ade80;
  --warn: #f5b544;
  --err: #f87171;
  --info: #38bdf8;
  --acc: #4ade80;
  --acc-ink: #04160a;
  --acc-soft: rgba(74, 222, 128, 0.14);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--acc); color: var(--acc-ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }

/* atmosphere */
.backdrop { position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(70% 50% at 78% 6%, rgba(74, 222, 128, 0.08), transparent 62%),
    radial-gradient(60% 45% at 12% 96%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--bg);
}
.gridlines { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 85%);
  opacity: 0.55;
}

/* header hud */
.header { position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.hud { max-width: var(--maxw); margin: 0 auto; padding: 0.7rem clamp(1rem, 3vw, 2rem);
  display: flex; align-items: center; gap: 1rem; font-family: var(--mono); font-size: 0.76rem; }
.hud .id { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 700; }
.hud .id .blip { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.hud .sep { width: 1px; height: 16px; background: var(--line-2); }
.hud .meta { color: var(--text-3); }
.hud .spacer { flex: 1; }
.hud .nav { display: flex; gap: 0.15rem; }
.hud .nav a { padding: 0.4rem 0.6rem; border-radius: 7px; color: var(--text-3); transition: color 0.2s, background 0.2s; }
.hud .nav a:hover { color: var(--text); background: var(--panel-2); }
.hud .nav a[aria-current='true'] { color: var(--acc); }

/* layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.hero { padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero .tag { font-family: var(--mono); font-size: 0.72rem; color: var(--acc); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
.hero h1 em { font-style: normal; color: var(--acc); }
.hero .subtitle { margin-top: 1.2rem; font-size: 1.06rem; color: var(--text-2); max-width: 640px; }

.module-head { display: flex; align-items: baseline; gap: 1rem; margin: 0 0 1.6rem; border-bottom: 1px solid var(--line); padding-bottom: 0.9rem; }
.module-head .idx { font-family: var(--mono); font-size: 0.76rem; color: var(--acc); letter-spacing: 0.08em; }
.module-head h2 { font-size: clamp(1.25rem, 2.6vw, 1.7rem); letter-spacing: -0.02em; }
.module-head .hint { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }
section.module { padding: clamp(1.5rem, 4vw, 2.5rem) 0; }

/* post cards */
.post-list { display: flex; flex-direction: column; }
.post-card { display: grid; grid-template-columns: 48px 1fr; gap: 1.2rem; padding: 1.6rem 0;
  border-bottom: 1px solid var(--line); transition: background 0.2s, border-color 0.2s; }
a.post-card:hover { background: var(--acc-soft); margin: 0 -1.2rem; padding: 1.6rem 1.2rem; border-radius: 10px; border-color: transparent; }
.post-card .num { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); padding-top: 0.25rem; }
.post-card h3 { font-size: 1.2rem; letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.post-card h3 em { font-style: normal; color: var(--acc); }
.post-card .desc { font-size: 0.95rem; color: var(--text-2); }
.post-card .meta { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-top: 0.7rem;
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-3); letter-spacing: 0.04em; }
.badge { padding: 0.16rem 0.55rem; border-radius: 999px; font-family: var(--mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.09em; border: 1px solid var(--line-2); color: var(--text-2); }
.badge.acc { border-color: rgba(74, 222, 128, 0.4); color: var(--acc); background: var(--acc-soft); }
.badge.soon { border-color: var(--line); color: var(--text-3); }
.post-card.is-soon { opacity: 0.5; cursor: default; }

/* article */
.article { padding: 1rem 0 3rem; }
.article .meta-row { display: flex; gap: 1.2rem; flex-wrap: wrap; font-family: var(--mono);
  font-size: 0.72rem; color: var(--text-3); margin-top: 1.4rem; }
.article h2 { font-size: clamp(1.3rem, 2.8vw, 1.7rem); margin: 2.6rem 0 1rem; letter-spacing: -0.02em; }
.article h2 .idx { font-family: var(--mono); font-size: 0.78rem; color: var(--acc); margin-right: 0.6rem; }
.article h3 { font-size: 1.1rem; margin: 1.8rem 0 0.7rem; }
.article p { color: var(--text-2); margin: 0.9rem 0; }
.article p strong, .article li strong { color: var(--text); font-weight: 600; }
.article a { color: var(--acc); border-bottom: 1px solid rgba(74, 222, 128, 0.35); }
.article ul, .article ol { margin: 0.9rem 0 0.9rem 1.3rem; color: var(--text-2); }
.article li { margin: 0.35rem 0; }
.article code { font-family: var(--mono); font-size: 0.84em; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.1rem 0.4rem; color: var(--text); }
.article pre { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.2rem; overflow-x: auto; margin: 1.1rem 0; }
/* phones: wide tables scroll inside their own box instead of widening the page */
@media (max-width: 600px) { .article table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; } }
.article pre code { background: none; border: 0; padding: 0; font-size: 0.82rem; line-height: 1.7; color: var(--text-2); }
.article table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.9rem; }
.article th { text-align: left; font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line-2); }
.article td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.article td:first-child { color: var(--text); }
.callout { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--acc);
  border-radius: 10px; padding: 1rem 1.2rem; margin: 1.4rem 0; }
.callout p { margin: 0.3rem 0; }
.callout .label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc); }

.article figure { margin: 1.8rem 0; }
.article figure img { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.article figcaption { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); }

/* footer */
footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.6rem clamp(1rem, 3vw, 2rem);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-3); }
.footer-inner a:hover { color: var(--acc); }

@media (max-width: 640px) {
  .hud .meta, .hud .sep { display: none; }
  .post-card { grid-template-columns: 32px 1fr; gap: 0.8rem; }
  .article table { font-size: 0.82rem; }
  .article th, .article td { padding: 0.45rem 0.4rem; }
}
