/* =========================================================
   Hieu Pham — terminal/console profile  ·  shared styles
   ========================================================= */

/* cross-document smooth transitions (progressive enhancement) */
@view-transition{ navigation:auto; }


/* ---------- theme tokens ---------- */
:root{
  --desk:#e8e8e6;
  --paper:#ffffff;
  --ink:#161616;
  --ink-soft:#6f6f6c;
  --line:#161616;
  --line-soft:#e6e6e3;
  --red:#E5251F;
  --code-bg:#f5f5f2;
  --bar:rgba(255,255,255,.82);
  --sel:rgba(229,37,31,.16);
  --dot:#161616;
  --mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r:13px;
  --maxw:1060px;
}
html[data-theme="dark"]{
  --desk:#040404;
  --paper:#0d0d0d;
  --ink:#ededed;
  --ink-soft:#8c8c8c;
  --line:#ededed;
  --line-soft:#222220;
  --red:#ff3d33;
  --code-bg:#161614;
  --bar:rgba(13,13,13,.82);
  --sel:rgba(255,61,51,.22);
  --dot:#ededed;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; background:var(--desk); }
@media (prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } }

body{
  margin:0;
  min-height:100vh;
  font-family:var(--mono);
  background:var(--desk);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  transition:background .4s ease, color .4s ease;
  font-feature-settings:"calt" 1;
}
::selection{ background:var(--sel); }
a{ color:inherit; text-decoration:none; }

/* generative particle backdrop */
#field{
  position:fixed; inset:0; z-index:0;
  width:100%; height:100%;
  pointer-events:none;
}

/* ---------- window frame ---------- */
.win{
  position:relative; z-index:1;
  max-width:var(--maxw);
  margin:30px auto 56px;
  background:var(--paper);
  border:1px solid var(--line-soft);
  border-radius:var(--r);
  box-shadow:0 1px 0 rgba(0,0,0,.04), 0 30px 60px -28px rgba(0,0,0,.35);
  overflow:clip;
  transition:background .4s ease, border-color .4s ease;
}
html[data-theme="dark"] .win{ box-shadow:0 0 0 1px rgba(255,255,255,.02), 0 40px 80px -30px rgba(0,0,0,.8); }

.titlebar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; gap:14px;
  padding:12px 16px;
  background:var(--bar);
  -webkit-backdrop-filter:saturate(1.4) blur(10px);
  backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--line-soft);
}
.lights{ display:flex; gap:8px; }
.lights i{ width:12px; height:12px; border-radius:50%; display:block; border:1px solid rgba(0,0,0,.18); }
.lights i:nth-child(1){ background:var(--red); border-color:transparent; }
.lights i:nth-child(2){ background:transparent; }
.lights i:nth-child(3){ background:transparent; }
html[data-theme="dark"] .lights i{ border-color:rgba(255,255,255,.22); }

.tb-path{ font-size:12.5px; color:var(--ink-soft); letter-spacing:.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tb-path b{ color:var(--ink); font-weight:500; }
.tb-spacer{ margin-left:auto; }

.tb-nav{ display:flex; gap:4px; }
.tb-nav a{
  font-size:12.5px; padding:5px 10px; border-radius:7px; color:var(--ink-soft);
  transition:.16s ease;
}
.tb-nav a:hover{ color:var(--ink); background:color-mix(in srgb, var(--ink) 7%, transparent); }
.tb-nav a[aria-current="page"]{ color:var(--red); }

.iconbtn{
  font-family:var(--mono); font-size:12.5px;
  display:inline-flex; align-items:center; gap:7px;
  padding:5px 10px; cursor:pointer; color:var(--ink-soft);
  background:transparent; border:1px solid var(--line-soft); border-radius:8px;
  transition:.16s ease;
}
.iconbtn:hover{ color:var(--ink); border-color:var(--ink); }
.iconbtn .glyph{ font-size:13px; line-height:1; }

/* ---------- terminal body ---------- */
.term{ padding:30px clamp(18px,4vw,46px) 54px; }

.line{ font-size:14px; line-height:1.7; }
.prompt{ display:flex; gap:9px; align-items:baseline; flex-wrap:wrap; margin-top:30px; }
.prompt:first-child{ margin-top:0; }
.prompt .u{ color:var(--ink-soft); }
.prompt .u b{ color:var(--ink); font-weight:500; }
.prompt .arr{ color:var(--red); font-weight:700; }
.prompt .cmd{ color:var(--ink); font-weight:500; }
.prompt .cmd .flag{ color:var(--ink-soft); }

.caret{
  display:inline-block; width:8px; height:1.05em; transform:translateY(2px);
  background:var(--red); margin-left:2px;
  animation:blink 1.05s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

/* output block (always visible; the typewriter above is the reveal) */
.out{
  margin:10px 0 4px; padding:2px 0 2px 20px;
  border-left:2px solid var(--line-soft);
}

.muted{ color:var(--ink-soft); }
.red{ color:var(--red); }
.sub{ font-size:13px; color:var(--ink-soft); }

/* ---------- hero / kinetic name ---------- */
.hero-name{
  font-size:clamp(46px, 11vw, 116px);
  line-height:.9; letter-spacing:-.02em; margin:2px 0 0;
  font-weight:800;
}
.hero-name .ch{
  display:inline-block;
  font-variation-settings:"wght" 760;
  animation:weight-in .9s cubic-bezier(.2,.7,.2,1) both;
  transition:font-variation-settings .35s ease, transform .35s ease;
}
.hero-name .ch:hover{ font-variation-settings:"wght" 200; transform:translateY(-4px); }
@keyframes weight-in{
  0%{ font-variation-settings:"wght" 130; transform:translateY(14px); }
  100%{ font-variation-settings:"wght" 760; transform:none; }
}
@media (prefers-reduced-motion:reduce){
  .hero-name .ch{ animation:none; opacity:1; }
}
.hero-role{ font-size:clamp(14px,2vw,17px); margin-top:18px; color:var(--ink); font-weight:500; }
.hero-tag{ font-size:14px; color:var(--ink-soft); margin-top:6px; min-height:1.4em; }

/* ---------- roles / listing ---------- */
.dirlist{ display:grid; gap:2px; font-size:13.5px; }
.dirlist .row{ display:grid; grid-template-columns:140px 1fr; gap:18px; padding:9px 0; align-items:baseline; border-bottom:1px dashed var(--line-soft); }
.dirlist .row:last-child{ border-bottom:none; }
.dirlist .perm{ color:var(--ink-soft); }
.dirlist .name{ color:var(--red); font-weight:600; }
.dirlist .desc{ color:var(--ink); }
.dirlist .desc small{ color:var(--ink-soft); display:block; margin-top:3px; }

/* skills */
.chips{ display:flex; flex-wrap:wrap; gap:9px; }
.chip{
  font-size:12.5px; font-weight:500; padding:6px 12px;
  border:1px solid var(--line-soft); border-radius:999px; color:var(--ink);
  background:transparent; cursor:default; transition:.16s ease; will-change:transform;
}
.chip:hover{ border-color:var(--red); color:var(--red); transform:translateY(-2px); }
.chip[data-active="true"]{ background:var(--red); color:#fff; border-color:var(--red); }

.skill-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.skill{ }
.skill .k{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px; }
.skill .k b{ font-weight:600; }
.skill .k span{ color:var(--ink-soft); }
.bar{ height:6px; border-radius:6px; background:var(--code-bg); overflow:hidden; }
.bar i{ display:block; height:100%; width:0; background:var(--red); border-radius:6px; transition:width 1.1s cubic-bezier(.2,.7,.2,1); }

/* quote */
.quote{
  font-size:clamp(19px,3vw,28px); font-weight:600; line-height:1.32; letter-spacing:-.01em;
  border-left:3px solid var(--red); padding:4px 0 4px 20px; margin:6px 0; color:var(--ink);
}
.quote em{ color:var(--red); font-style:normal; }

/* projects */
.proj-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.card{
  border:1px solid var(--line-soft); border-radius:11px; padding:18px; background:var(--paper);
  transition:.2s ease; position:relative; overflow:hidden;
}
.card:hover{ transform:translateY(-4px); border-color:var(--ink); }
.card .hash{ color:var(--red); font-size:12px; }
.card h4{ font-size:16px; margin:8px 0 8px; font-weight:700; }
.card p{ font-size:13px; color:var(--ink-soft); margin:0; line-height:1.55; }
.card .meta{ font-size:11.5px; color:var(--ink-soft); margin-top:14px; display:flex; gap:8px; flex-wrap:wrap; }

/* placeholder */
.plh{
  border:1px dashed var(--line); border-radius:10px; min-height:120px;
  display:flex; align-items:center; justify-content:center; text-align:center;
  font-size:11.5px; color:var(--ink-soft); padding:14px;
  background:repeating-linear-gradient(45deg, transparent 0 9px, color-mix(in srgb, var(--ink) 7%, transparent) 9px 11px);
}

/* footer */
.term-foot{
  margin-top:46px; padding-top:20px; border-top:1px solid var(--line-soft);
  display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap;
  font-size:12px; color:var(--ink-soft);
}
.term-foot a:hover{ color:var(--red); }

/* generic entrance — transform only, opacity stays 1 so content can never strand */
.reveal{ animation:rise .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise{ from{ transform:translateY(18px); } to{ transform:none; } }
@media (prefers-reduced-motion:reduce){ .reveal{ animation:none; } }

/* ---------- writing index ---------- */
.page-head{ margin-bottom:8px; }
.feature{
  display:grid; grid-template-columns:1.5fr 1fr; gap:24px; align-items:center;
  border:1px solid var(--line-soft); border-radius:12px; padding:22px; margin:18px 0 6px;
  transition:.2s ease;
}
.feature:hover{ border-color:var(--ink); }
.feature .tagline{ font-size:11.5px; color:var(--red); letter-spacing:.06em; }
.feature h2{ font-size:clamp(20px,3vw,28px); line-height:1.15; margin:8px 0 12px; font-weight:700; }
.feature p{ color:var(--ink-soft); font-size:13.5px; line-height:1.6; margin:0 0 14px; }

.postlist{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.post-card{
  border:1px solid var(--line-soft); border-radius:12px; padding:20px; background:var(--paper);
  transition:.2s ease; display:flex; flex-direction:column;
}
.post-card:hover{ transform:translateY(-4px); border-color:var(--ink); }
.post-card .pmeta{ font-size:11.5px; color:var(--ink-soft); }
.post-card h3{ font-size:18px; line-height:1.25; margin:9px 0 10px; font-weight:700; }
.post-card p{ font-size:13px; color:var(--ink-soft); line-height:1.55; margin:0 0 14px; flex:1; }
.post-card .ptags{ display:flex; gap:7px; flex-wrap:wrap; }
.ptag{ font-size:11.5px; color:var(--ink-soft); }
.ptag::before{ content:"#"; color:var(--red); }
.post-card.hide{ display:none; }

/* ---------- post / reading view ---------- */
.progress{ position:fixed; top:0; left:0; height:3px; background:var(--red); width:0; z-index:60; }
.article{ max-width:680px; margin:0 auto; }
.article .ameta{ font-size:12px; color:var(--ink-soft); }
.article h1{ font-size:clamp(28px,5vw,42px); line-height:1.1; letter-spacing:-.02em; margin:14px 0 26px; font-weight:800; }
.article p{ font-size:16px; line-height:1.78; margin:0 0 22px; }
.article h2{ font-size:21px; margin:38px 0 14px; font-weight:700; }
.article .quote{ margin:30px 0; }
.codeblock{
  position:relative; background:var(--code-bg); border:1px solid var(--line-soft);
  border-radius:10px; margin:26px 0; overflow:hidden;
}
.codeblock .chead{ display:flex; align-items:center; justify-content:space-between; padding:9px 14px; border-bottom:1px solid var(--line-soft); font-size:11.5px; color:var(--ink-soft); }
.codeblock pre{ margin:0; padding:16px 18px; overflow:auto; font-size:13px; line-height:1.7; }
.codeblock .cp{ cursor:pointer; color:var(--ink-soft); border:1px solid var(--line-soft); background:transparent; border-radius:6px; padding:3px 9px; font-family:var(--mono); font-size:11px; }
.codeblock .cp:hover{ color:var(--red); border-color:var(--red); }
.tok-key{ color:var(--red); }
.tok-str{ color:var(--ink); font-weight:600; }
.tok-com{ color:var(--ink-soft); font-style:italic; }
.tok-fn{ font-weight:700; }
.art-tags{ display:flex; gap:9px; flex-wrap:wrap; margin:30px 0; padding-top:22px; border-top:1px solid var(--line-soft); }
.art-nav{ display:flex; justify-content:space-between; gap:14px; font-size:13px; }
.art-nav a:hover{ color:var(--red); }

@media (max-width:760px){
  .feature{ grid-template-columns:1fr; }
  .postlist{ grid-template-columns:1fr; }
  .dirlist .row{ grid-template-columns:1fr; gap:4px; }
  .tb-path{ display:none; }
}
