/* ===========================================================
   Portfolio — Vi Khánh Ly
   Nhập môn Công nghệ số & Ứng dụng Trí tuệ nhân tạo
   =========================================================== */

:root{
  --cream:#FDF8F6;
  --blush:#FBEEF0;
  --blush-2:#F6E2E7;
  --rose:#C9788C;
  --rose-deep:#A85870;
  --mauve:#6E4553;
  --lavender:#B8A0C9;
  --lavender-soft:#EFE6F4;
  --gold:#D4A574;
  --sage:#A8BFA5;
  --ink:#4A3C42;
  --muted:#8A757D;
  --line:#EFDFE3;
  --white:#FFFFFF;

  --r-sm:12px;
  --r:20px;
  --r-lg:28px;
  --r-xl:36px;

  --sh-sm:0 2px 10px rgba(140,90,105,.06);
  --sh:0 8px 30px rgba(140,90,105,.09);
  --sh-lg:0 18px 50px rgba(140,90,105,.13);

  --serif:'Playfair Display', Georgia, serif;
  --sans:'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,*::before,*::after{box-sizing:border-box;}

html{scroll-behavior:smooth;}

body{
  margin:0;
  font-family:var(--sans);
  font-size:16.5px;
  line-height:1.75;
  color:var(--ink);
  background:var(--cream);
  -webkit-font-smoothing:antialiased;
}

/* soft ambient wash behind everything */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(760px 520px at 88% -6%, rgba(201,120,140,.13), transparent 62%),
    radial-gradient(620px 460px at -8% 12%, rgba(184,160,201,.13), transparent 60%),
    radial-gradient(700px 500px at 50% 108%, rgba(212,165,116,.10), transparent 62%);
  pointer-events:none;
}

img{max-width:100%;height:auto;display:block;}

a{color:var(--rose-deep);text-decoration:none;}
a:hover{text-decoration:underline;}

/* ---------------- Layout ---------------- */
.wrap{width:min(1080px,92vw);margin-inline:auto;}
.wrap-narrow{width:min(880px,92vw);margin-inline:auto;}

section{padding:64px 0;}

/* ---------------- Header / Nav ---------------- */
.site-header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(253,248,246,.88);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  font-family:var(--serif);
  font-size:1.12rem;
  font-weight:700;
  color:var(--mauve);
  text-decoration:none;
  white-space:nowrap;
}
.brand:hover{color:var(--rose);}
.nav-links{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
}
.nav-links a{
  padding:8px 14px;
  border-radius:999px;
  color:var(--muted);
  font-size:.93rem;
  font-weight:500;
  transition:background .25s ease, color .25s ease;
}
.nav-links a:hover{
  background:var(--blush);
  color:var(--mauve);
  text-decoration:none;
}
.nav-links a.active{
  background:linear-gradient(135deg,var(--rose),var(--lavender));
  color:#fff;
  box-shadow:0 4px 14px rgba(201,120,140,.3);
}

/* ---------------- Typography ---------------- */
h1,h2,h3,h4{
  font-family:var(--serif);
  color:var(--mauve);
  line-height:1.28;
  margin:0 0 .5em;
  font-weight:700;
}
h1{font-size:clamp(2.1rem,4.6vw,3.3rem);letter-spacing:-.4px;}
h2{font-size:clamp(1.55rem,2.9vw,2.15rem);}
h3{font-size:clamp(1.16rem,1.9vw,1.42rem);}
h4{font-size:1.05rem;font-family:var(--sans);font-weight:600;}
p{margin:0 0 1.05em;}

.lead{font-size:1.1rem;color:var(--muted);line-height:1.85;}

.eyebrow{
  display:inline-block;
  font-family:var(--sans);
  font-size:.74rem;
  font-weight:600;
  letter-spacing:2.2px;
  text-transform:uppercase;
  color:var(--rose);
  background:var(--blush);
  border:1px solid var(--blush-2);
  padding:6px 16px;
  border-radius:999px;
  margin-bottom:18px;
}

.section-head{margin-bottom:38px;}
.section-head p{max-width:62ch;color:var(--muted);margin-bottom:0;}

/* decorative divider */
.divider{
  display:flex;align-items:center;justify-content:center;gap:12px;
  margin:8px 0 0;
}
.divider::before,.divider::after{
  content:"";height:1px;width:70px;
  background:linear-gradient(90deg,transparent,var(--blush-2));
}
.divider::after{background:linear-gradient(90deg,var(--blush-2),transparent);}
.divider span{color:var(--rose);font-size:.8rem;}

/* ---------------- Hero ---------------- */
.hero{
  padding:76px 0 60px;
  position:relative;
  overflow:hidden;
}
.hero-grid{
  display:flex;
  justify-content:center;
  text-align:center;
}
.hero-copy{max-width:760px;}
.hero .eyebrow{margin-bottom:20px;}
.hero h1{margin-bottom:.34em;}
.hero h1 .accent{
  background:linear-gradient(120deg,var(--rose),var(--lavender));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  font-style:italic;
}
.hero-sub{
  font-size:1.14rem;
  color:var(--muted);
  max-width:60ch;
  margin-inline:auto;
  line-height:1.85;
}
.hero-meta{
  display:flex;flex-wrap:wrap;gap:9px;
  margin:26px 0 30px;
  justify-content:center;
}
.hero .btn-row{justify-content:center;}
.chip{
  display:inline-flex;align-items:center;gap:7px;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 15px;
  font-size:.87rem;
  color:var(--mauve);
  box-shadow:var(--sh-sm);
}
.chip i{font-style:normal;}

/* ---------------- Buttons ---------------- */
.btn{
  display:inline-flex;align-items:center;gap:9px;
  padding:12px 26px;
  border-radius:999px;
  font-size:.95rem;
  font-weight:600;
  font-family:var(--sans);
  border:1px solid transparent;
  cursor:pointer;
  transition:transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.btn:hover{text-decoration:none;transform:translateY(-2px);}
.btn-primary{
  background:linear-gradient(135deg,var(--rose),var(--lavender));
  color:#fff;
  box-shadow:0 8px 22px rgba(201,120,140,.34);
}
.btn-primary:hover{box-shadow:0 12px 30px rgba(201,120,140,.42);}
.btn-ghost{
  background:var(--white);
  color:var(--mauve);
  border-color:var(--line);
  box-shadow:var(--sh-sm);
}
.btn-ghost:hover{background:var(--blush);box-shadow:var(--sh);}
.btn-row{display:flex;flex-wrap:wrap;gap:12px;}

/* ---------------- Cards ---------------- */
.card{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:30px;
  box-shadow:var(--sh-sm);
  transition:transform .3s ease, box-shadow .3s ease;
}
.card:hover{transform:translateY(-4px);box-shadow:var(--sh);}

.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:22px;}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:22px;}

/* goal cards on home */
.goal-card{position:relative;overflow:hidden;}
.goal-card::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:4px;
  background:linear-gradient(180deg,var(--rose),var(--lavender));
}
.goal-num{
  font-family:var(--serif);
  font-size:2.2rem;
  color:var(--blush-2);
  line-height:1;
  margin-bottom:6px;
}

/* ---------------- Project cards ---------------- */
.proj-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px;}
.proj{
  display:flex;flex-direction:column;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  overflow:hidden;
  box-shadow:var(--sh-sm);
  transition:transform .3s ease, box-shadow .3s ease;
}
.proj:hover{transform:translateY(-5px);box-shadow:var(--sh-lg);}
.proj-top{
  padding:22px 26px;
  background:linear-gradient(135deg,var(--blush),var(--lavender-soft));
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:14px;
}
.proj-badge{
  width:44px;height:44px;flex:none;
  border-radius:14px;
  display:grid;place-items:center;
  background:#fff;
  color:var(--rose);
  font-family:var(--serif);
  font-weight:700;
  font-size:1.1rem;
  box-shadow:var(--sh-sm);
}
.proj-top small{
  display:block;
  font-size:.7rem;letter-spacing:1.6px;text-transform:uppercase;color:var(--muted);
}
.proj-top strong{
  font-family:var(--serif);font-size:1.06rem;color:var(--mauve);font-weight:700;
  line-height:1.35;display:block;
}
.proj-body{padding:24px 26px;flex:1;display:flex;flex-direction:column;}
.proj-body p{color:var(--muted);font-size:.95rem;margin-bottom:16px;}
.tags{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:20px;}
.tag{
  font-size:.76rem;
  background:var(--blush);
  color:var(--rose-deep);
  border:1px solid var(--blush-2);
  padding:4px 11px;
  border-radius:999px;
}
.proj-body .btn{margin-top:auto;align-self:flex-start;}

/* ---------------- Detail page bits ---------------- */
.page-head{
  padding:52px 0 34px;
  border-bottom:1px solid var(--line);
  margin-bottom:44px;
  background:linear-gradient(180deg,var(--blush) 0%, transparent 100%);
}
.crumb{
  font-size:.85rem;color:var(--muted);margin-bottom:14px;
}
.crumb a{color:var(--rose);}

.meta-bar{
  display:flex;flex-wrap:wrap;gap:10px;margin-top:20px;
}

.box{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:26px 28px;
  box-shadow:var(--sh-sm);
  margin-bottom:24px;
}
.box h3{margin-top:0;}

.callout{
  background:linear-gradient(135deg,var(--blush),var(--lavender-soft));
  border:1px solid var(--blush-2);
  border-radius:var(--r);
  padding:24px 28px;
  margin:26px 0;
}
.callout h4{color:var(--mauve);margin-top:0;}
.callout p:last-child{margin-bottom:0;}

.note{
  border-left:3px solid var(--rose);
  background:var(--blush);
  border-radius:0 var(--r-sm) var(--r-sm) 0;
  padding:14px 20px;
  color:var(--mauve);
  font-size:.95rem;
  margin:20px 0;
}
.note p:last-child{margin-bottom:0;}

ul.pretty,ol.pretty{padding-left:0;list-style:none;margin:0 0 1.1em;}
ul.pretty li{
  position:relative;padding-left:26px;margin-bottom:9px;
}
ul.pretty li::before{
  content:"";position:absolute;left:4px;top:.65em;
  width:7px;height:7px;border-radius:50% 0 50% 50%;
  background:linear-gradient(135deg,var(--rose),var(--lavender));
  transform:rotate(20deg);
}
ol.pretty{counter-reset:n;}
ol.pretty li{
  position:relative;padding-left:38px;margin-bottom:11px;counter-increment:n;
}
ol.pretty li::before{
  content:counter(n);
  position:absolute;left:0;top:.1em;
  width:24px;height:24px;border-radius:50%;
  display:grid;place-items:center;
  background:linear-gradient(135deg,var(--rose),var(--lavender));
  color:#fff;font-size:.76rem;font-weight:600;
}

/* ---------------- Tables ---------------- */
.table-scroll{
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:var(--r);
  background:var(--white);
  box-shadow:var(--sh-sm);
  margin-bottom:24px;
}
table{
  width:100%;
  border-collapse:collapse;
  font-size:.92rem;
  min-width:560px;
}
thead th{
  background:linear-gradient(135deg,var(--blush),var(--lavender-soft));
  color:var(--mauve);
  font-family:var(--sans);
  font-weight:600;
  text-align:left;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
tbody td{
  padding:13px 16px;
  border-bottom:1px solid #F7EEF1;
  vertical-align:top;
  color:var(--ink);
}
tbody tr:last-child td{border-bottom:none;}
tbody tr:nth-child(even){background:#FEFBFA;}
td strong{color:var(--mauve);}

.pill{
  display:inline-block;padding:3px 11px;border-radius:999px;
  font-size:.76rem;font-weight:600;white-space:nowrap;
}
.pill-high{background:#EAF3E8;color:#5C7A55;}
.pill-mid{background:#FBF0E2;color:#9A7239;}
.pill-top{background:var(--lavender-soft);color:#6B5280;}

/* ---------------- Prompt ladder ---------------- */
.ladder{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:26px;}
.rung{
  border:1px solid var(--line);
  border-radius:var(--r);
  background:var(--white);
  padding:20px 22px;
  box-shadow:var(--sh-sm);
  display:flex;flex-direction:column;
}
.rung-tag{
  font-size:.7rem;letter-spacing:1.5px;text-transform:uppercase;
  font-weight:600;margin-bottom:12px;
  display:inline-block;padding:4px 10px;border-radius:999px;align-self:flex-start;
}
.rung-1 .rung-tag{background:#F4EEF0;color:var(--muted);}
.rung-2 .rung-tag{background:var(--blush);color:var(--rose-deep);}
.rung-3 .rung-tag{background:linear-gradient(135deg,var(--rose),var(--lavender));color:#fff;}
.rung-3{border-color:var(--blush-2);box-shadow:var(--sh);}
.rung pre{
  margin:0;
  font-family:var(--sans);
  font-size:.88rem;
  line-height:1.65;
  white-space:pre-wrap;
  word-wrap:break-word;
  color:var(--ink);
}

/* ---------------- Gallery (Bài 1) ---------------- */
.gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:22px;}
.shot{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--r);
  overflow:hidden;
  box-shadow:var(--sh-sm);
  transition:transform .3s ease, box-shadow .3s ease;
}
.shot:hover{transform:translateY(-3px);box-shadow:var(--sh);}
.shot img{
  width:100%;
  border-bottom:1px solid var(--line);
  background:#F7F4F5;
}
.shot figcaption{
  padding:14px 18px;
  font-size:.9rem;
  color:var(--muted);
}
.shot figcaption b{
  display:block;color:var(--mauve);font-weight:600;margin-bottom:2px;
  font-size:.95rem;
}

/* file tree */
.tree{
  background:#4A3C42;
  color:#F6E9EC;
  border-radius:var(--r);
  padding:22px 26px;
  font-family:'Consolas','Courier New',monospace;
  font-size:.9rem;
  line-height:1.9;
  overflow-x:auto;
  box-shadow:var(--sh);
  margin-bottom:24px;
}
.tree .dir{color:#F0B7C4;font-weight:600;}
.tree .file{color:#D9CDD1;}
.tree .cmt{color:#9C858C;font-style:italic;}

/* ---------------- PDF embed ---------------- */
.pdf-wrap{
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  overflow:hidden;
  box-shadow:var(--sh);
  background:var(--white);
}
.pdf-bar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:14px 20px;
  background:linear-gradient(135deg,var(--blush),var(--lavender-soft));
  border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.pdf-bar span{font-size:.9rem;color:var(--mauve);font-weight:600;}
.pdf-wrap object,.pdf-wrap iframe{
  width:100%;
  height:720px;
  border:0;
  display:block;
}
.pdf-fallback{padding:30px;text-align:center;color:var(--muted);}

/* ---------------- Timeline (tổng kết) ---------------- */
.timeline{position:relative;padding-left:38px;}
.timeline::before{
  content:"";position:absolute;left:11px;top:6px;bottom:6px;width:2px;
  background:linear-gradient(180deg,var(--rose),var(--lavender),var(--blush-2));
  border-radius:2px;
}
.tl-item{position:relative;margin-bottom:28px;}
.tl-item::before{
  content:"";position:absolute;left:-33px;top:6px;
  width:12px;height:12px;border-radius:50%;
  background:#fff;border:3px solid var(--rose);
  box-shadow:0 0 0 4px var(--blush);
}
.tl-item h4{margin-bottom:4px;color:var(--mauve);font-family:var(--serif);font-size:1.1rem;font-weight:700;}
.tl-item p{margin-bottom:0;color:var(--muted);font-size:.96rem;}

/* stat strip */
.stats{
  display:grid;grid-template-columns:repeat(4,1fr);gap:18px;
}
.stat{
  text-align:center;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:24px 14px;
  box-shadow:var(--sh-sm);
}
.stat b{
  display:block;
  font-family:var(--serif);
  font-size:2rem;
  background:linear-gradient(135deg,var(--rose),var(--lavender));
  -webkit-background-clip:text;background-clip:text;color:transparent;
  line-height:1.1;
}
.stat span{font-size:.83rem;color:var(--muted);}

/* CTA band */
.band{
  background:linear-gradient(135deg,var(--blush),var(--lavender-soft));
  border:1px solid var(--blush-2);
  border-radius:var(--r-xl);
  padding:46px 40px;
  text-align:center;
}
.band h2{margin-bottom:.4em;}
.band p{max-width:56ch;margin-inline:auto;color:var(--muted);}

/* prev/next */
.pager{
  display:flex;justify-content:space-between;gap:14px;
  padding:30px 0 0;
  border-top:1px solid var(--line);
  margin-top:44px;
}
.pager a{
  font-size:.92rem;color:var(--muted);font-weight:500;
  display:inline-flex;align-items:center;gap:8px;
}
.pager a:hover{color:var(--rose);text-decoration:none;}

/* ---------------- Footer ---------------- */
.site-footer{
  margin-top:70px;
  border-top:1px solid var(--line);
  background:linear-gradient(180deg,transparent,var(--blush));
  padding:44px 0 30px;
}
.foot-grid{
  display:flex;justify-content:space-between;gap:26px;flex-wrap:wrap;
  margin-bottom:26px;
}
.foot-grid h4{font-family:var(--serif);color:var(--mauve);margin-bottom:10px;font-size:1.05rem;font-weight:700;}
.foot-grid p{color:var(--muted);font-size:.9rem;margin-bottom:0;max-width:38ch;}
.foot-links{display:flex;flex-direction:column;gap:6px;}
.foot-links a{color:var(--muted);font-size:.9rem;}
.foot-links a:hover{color:var(--rose);}
.foot-bottom{
  text-align:center;
  padding-top:22px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:.84rem;
}
.foot-bottom .heart{color:var(--rose);}

/* ---------------- Responsive ---------------- */
@media (max-width:960px){
  .grid-3,.ladder{grid-template-columns:1fr;}
  .stats{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:760px){
  .proj-grid,.gallery,.grid-2{grid-template-columns:1fr;}
  .nav{flex-direction:column;align-items:flex-start;gap:10px;}
  .nav-links{gap:2px;}
  .nav-links a{padding:7px 11px;font-size:.87rem;}
  section{padding:48px 0;}
  .pdf-wrap object,.pdf-wrap iframe{height:520px;}
  .band{padding:34px 24px;}
  .box{padding:22px 20px;}
}
@media (max-width:420px){
  .stats{grid-template-columns:1fr;}
}

/* ---------------- Print ---------------- */
@media print{
  .site-header,.pager,.site-footer,.btn{display:none;}
  body{background:#fff;}
  body::before{display:none;}
}
