/* =====================================================================
  STYLE.CSS — "Dark Atelier" design
  Warm dark background, copper/gold accents, high-contrast serif for display,
  clean sans-serif for body. Not a terminal/mono theme.

  You USUALLY DO NOT need to edit this file when updating content —
  content lives in data.js. Edit this file only to change colors/layout.
  ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..600&family=Inter:wght@400;500;600&display=swap');

:root {
  /* ---- Màu: bảng "Dark Atelier" — đen ấm + đồng/gold đậm ---- */
  --bg:        #0F0E0C;
  --bg-rise:   #15130F;
  --surface:   #1A1714;
  --fg:        #F3ECE0;
  --muted:     #9C9388;
  --muted-2:   #6E665C;
  --border:    #2C2722;
  --border-soft: #221F1A;
  --accent:    #C68A3E;
  --accent-bright: #E0A85C;
  --accent-dim: #5C4524;

  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --fg-soft: color-mix(in oklab, var(--fg) 5%, transparent);

  /* ---- Font ---- */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---- Kích thước chữ ---- */
  --fs-h1: clamp(44px, 7vw, 92px);
  --fs-h2: clamp(32px, 4.4vw, 54px);
  --fs-h3: 23px;
  --fs-lead: 19px;
  --fs-body: 16px;
  --fs-meta: 13px;

  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 104px;
  --container: 1180px;
  --gutter: 32px;

  --radius: 4px;
  --radius-lg: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 8%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 42%),
    radial-gradient(circle at 88% 0%, color-mix(in oklab, var(--accent) 5%, transparent), transparent 38%);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(56px, 7vw, var(--gap-2xl)); }
.section + .section { border-top: 1px solid var(--border-soft); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap-md); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(36px, 7vw, 88px);
  align-items: end;
  /* min-height: calc(100vh - 64px); */
  /* padding-block: clamp(40px, 6vw, 80px); */
}
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-2-1, .hero-split { grid-template-columns: 1fr; }
  .hero-split { align-items: start; }
}

.h1, h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: var(--fs-h1);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin: 0;
}
.h2, h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0;
}
.h3, h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
  margin: 0;
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 var(--gap-md);
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}
.meta { font-family: var(--font-body); font-size: var(--fs-meta); color: var(--muted); letter-spacing: 0.01em; }
.num { font-variant-numeric: tabular-nums; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 16px;
}
.topnav .logo {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--fg);
}
.topnav nav { display: flex; gap: var(--gap-lg); }
.topnav nav a { font-size: 14px; color: var(--muted); transition: color 0.15s ease; }
.topnav nav a:hover { color: var(--accent-bright); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #1A1208; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-bright); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-bright); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding-inline: 4px; }
.btn-ghost:hover { color: var(--accent-bright); }
.btn-arrow::after { content: '→'; transition: transform 0.15s ease; }
.btn-arrow:hover::after { transform: translateX(3px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: 32px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* ================= HERO STAT STRIP ================= */
.hero-stats {
  display: flex;
  gap: clamp(28px, 5vw, 56px);
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
}
.hero-stat .stat-num {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  color: var(--accent-bright);
  line-height: 1;
}
.hero-stat .stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.hero-portrait {
  position: relative;
  aspect-ratio: 4 / 5.35;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, color-mix(in oklab, var(--accent) 14%, var(--surface)), var(--bg-rise));
  overflow: hidden;
  padding: clamp(18px, 2.5vw, 28px);
}
.hero-portrait::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 26px, color-mix(in oklab, var(--fg) 3%, transparent) 26px 27px);
}
.hero-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 10%, color-mix(in oklab, var(--accent-bright) 12%, transparent), transparent 24%),
    radial-gradient(circle at 14% 82%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 28%);
  pointer-events: none;
}
.portrait-card {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}
.hero-portrait .portrait-tag {
  width: fit-content;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: color-mix(in oklab, var(--bg) 68%, transparent);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.portrait-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 11ch;
}
.portrait-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 26ch;
}
.portrait-tech {
  display: grid;
  gap: 10px;
}
.portrait-tech-group {
  padding-top: 10px;
  border-top: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
}
.portrait-tech-group-name {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.portrait-tech-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.portrait-tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 72%, transparent);
  color: var(--fg);
  font-size: 12px;
  white-space: nowrap;
}
.portrait-tech-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

/* ================= TECH STACK — proficiency bars theo nhóm ================= */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-xl);
}
@media (max-width: 920px) { .stack-groups { grid-template-columns: 1fr; gap: var(--gap-lg); } }

.stack-group-name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-bright);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.stack-item + .stack-item { margin-top: 18px; }
.stack-item-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--fg);
}
.stack-item-label .level-text { color: var(--muted-2); font-size: 12px; }
.stack-bar-track {
  height: 5px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}
.stack-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
}

/* Skill icon replacement for proficiency bars */
.stack-item-left { display: flex; align-items: center; gap: 10px; }
.skill-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  color: var(--accent);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
  border: 1px solid var(--border);
}
.skill-icon-img { width: 18px; height: 18px; display: block; }
.skill-icon.lvl-5 { color: var(--accent-bright); }
.skill-icon.lvl-4 { color: var(--accent); }
.skill-icon.lvl-3 { color: var(--accent-dim); }
.skill-icon.lvl-2 { color: var(--muted); }
.skill-icon.lvl-1 { color: #4a453f; }
.skill-icon[title] { cursor: default; }

/* ================= EXPERIENCE — timeline dọc ================= */
.timeline {
  position: relative;
  padding-left: 36px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 90%);
}
.timeline-item {
  position: relative;
  padding-bottom: var(--gap-xl);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-item:first-child::before {
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-period {
  font-size: 13px;
  color: var(--accent-bright);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: block;
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}
.timeline-card .exp-role { margin: 0; }
.timeline-card .exp-company { color: var(--accent-bright); font-size: 14px; margin: 4px 0 0; font-weight: 500; }
.timeline-card .exp-desc { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.timeline-card .exp-tag {
  position: absolute;
  top: 26px;
  right: 28px;
}
.timeline-card { position: relative; }
.exp-highlights {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}
.exp-highlights li {
  font-size: 14px;
  color: var(--fg);
  padding-left: 18px;
  position: relative;
}
.exp-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

/* ================= PROJECTS — grid 2 cột, số lớn làm họa tiết ================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-lg);
}
@media (max-width: 920px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  overflow: visible;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.project-card .project-index {
  position: absolute;
  top: -6px;
  right: 14px;
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 500;
  color: var(--fg);
  opacity: 0.045;
  line-height: 1;
  pointer-events: none;
}
.project-card .project-year {
  font-size: 12px;
  color: var(--muted-2);
}
.project-card h3 {
  margin-top: 14px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}
/* Title hover popup for repo links */
.title-wrap { position: relative; display: inline-block; cursor: default; padding-bottom: 6px; }
.repo-popup {
  position: absolute;
  left: 0;
  /* sit slightly overlapping the title to avoid a hover gap when moving the cursor */
  bottom: calc(100% - 6px);
  top: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 300;
}
.title-wrap:hover .repo-popup,
.title-wrap:focus-within .repo-popup,
.repo-popup:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.repo-popup .repo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 13px;
}
.repo-popup .repo-link:hover { border-color: var(--accent); color: var(--accent-bright); }
.repo-link-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.project-card h3 a:hover { color: var(--accent-bright); }
.project-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  position: relative;
  z-index: 1;
  max-width: 46ch;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

/* ================= PRACTICE (cách làm việc) ================= */
.feature .feature-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent-bright);
  background: var(--surface);
  margin-bottom: var(--gap-md);
}
.feature .feature-mark svg { width: 18px; height: 18px; }
.feature h3 { margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* ================= ABOUT / QUOTE ================= */
.quote {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.2;
  max-width: 24ch;
  margin: 0;
  padding-left: 28px;
  border-left: 3px solid var(--accent);
  color: var(--fg);
}
.quote-author { color: var(--muted); font-size: 14px; margin-top: var(--gap-md); }

/* ================= CONTACT / FOOTER ================= */
.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.pagefoot {
  padding-block: var(--gap-xl);
  color: var(--muted-2);
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
}
.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); }

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .topnav nav { display: none; }
  .hero-split { min-height: auto; }
  .timeline { padding-left: 28px; }
  .timeline-item::before { left: -28px; }
  .project-card .project-index { font-size: 64px; }
  .quote { padding-left: 18px; }
}
