/* Bảng màu theo layout: #F8F0DF #B8C9A5 #6D8767 #E8A6BC #765168 */
:root {
  --cream: #F8F0DF;
  --cream-2: #FDF8EE;
  --sage: #B8C9A5;
  --leaf: #6D8767;
  --pink: #E8A6BC;
  --pink-soft: #F5D3DD;
  --plum: #765168;
  --ink: #5A3A50;          /* chữ trên nền hồng: đủ tương phản 4.5:1 */
  --radius: 22px;
  --line: 2.5px solid var(--plum);
  --f-head: "Itim", "Baloo 2", system-ui, sans-serif;
  --f-display: "Baloo 2", "Itim", system-ui, sans-serif;
  --f-body: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 17px/1.65 var(--f-body);
  min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 400; color: var(--plum); line-height: 1.2; margin: 0; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
main { flex: 1; padding-bottom: 56px; }

/* ---------- Header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 18px auto 0; padding: 8px 10px 8px 8px;
  border: var(--line); border-radius: 999px; background: var(--cream-2);
  position: relative; z-index: 20;
}
.logo {
  font-family: var(--f-head); font-size: 26px; color: var(--plum); text-decoration: none;
  min-width: 118px; height: 54px; display: grid; place-items: center; padding: 0 22px;
  background: url("cloud.svg") center / 100% 100% no-repeat;
}
.logo img { max-height: 40px; width: auto; }
.nav { display: flex; gap: 6px; }
.nav a {
  font-family: var(--f-head); font-size: 19px; text-decoration: none;
  padding: 6px 16px; border-radius: 999px; transition: background .2s;
}
.nav a:hover { background: var(--pink-soft); }
.nav a[aria-current="page"] { background: var(--pink); color: var(--ink); }
.burger, .nav-close { display: none; background: none; border: 0; color: var(--plum); cursor: pointer; padding: 8px; }
.burger svg, .nav-close svg { width: 28px; height: 28px; }

/* ---------- Khung trang (frame) ---------- */
.frame {
  position: relative; margin-top: 28px; padding: 40px clamp(18px, 4vw, 56px) 64px;
  border: var(--line); border-radius: var(--radius); background: var(--cream-2); overflow: hidden;
}
.frame::before, .frame::after {           /* lá trang trí 2 góc dưới */
  content: ""; position: absolute; bottom: -10px; width: 150px; height: 150px;
  background: url("leaves.svg") no-repeat bottom left / contain; pointer-events: none;
  transform-origin: bottom left; animation: sway 6s ease-in-out infinite;
}
.frame::before { left: -14px; }
.frame::after { right: -14px; transform: scaleX(-1); transform-origin: bottom center; animation-name: sway-r; }
.frame > * { position: relative; z-index: 1; }

.page-title {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: clamp(32px, 5vw, 46px); margin-bottom: 28px; text-align: center;
}
.page-title::before, .page-title::after {
  content: ""; width: 20px; height: 28px; flex: none; background: url("spark.svg") center / contain no-repeat;
}
.page-title::after { transform: scaleX(-1); }

/* ---------- Ảnh & ô ảnh mẫu ---------- */
.ph, .thumb {
  display: block; width: 100%; aspect-ratio: 4 / 3; border: var(--line); border-radius: 16px;
  background: var(--pink-soft); object-fit: cover;
}
.ph {
  background: var(--pink-soft) url("placeholder.svg") center / 46% no-repeat;
}

/* ---------- Home ---------- */
.hero { text-align: center; padding-top: 24px; overflow: hidden; }
.hero-title {
  font-family: var(--f-display); font-weight: 800; letter-spacing: .02em;
  font-size: clamp(40px, 11vw, 140px); line-height: .9; color: var(--plum);
  display: inline-flex; align-items: center; gap: 18px; text-transform: uppercase;
}
.hero-title::before, .hero-title::after {
  content: ""; width: 30px; height: 44px; background: url("spark.svg") center / contain no-repeat;
}
.hero-title::after { transform: scaleX(-1); }
.ribbon {
  display: inline-block; margin-top: 10px; transform: rotate(-3deg);
  font-family: var(--f-head); font-size: clamp(20px, 3vw, 30px); color: var(--plum);
  padding: 4px 30px; border: var(--line); border-radius: 14px; background: var(--cream-2);
  box-shadow: 0 5px 0 var(--pink-soft);
}
.hero-art { width: min(520px, 92%); margin: -6px auto -70px; position: relative; z-index: 0; isolation: isolate; }
.hero-art img { width: 100%; aspect-ratio: 400 / 340; object-fit: contain; }
.bush {
  position: absolute; bottom: 30px; width: 70%; aspect-ratio: 1; z-index: -1;
  background: url("leaves.svg") bottom left / contain no-repeat; animation: sway 7s ease-in-out infinite;
}
.bush.l { left: -48%; }
.bush.r { right: -48%; transform: scaleX(-1); animation-name: sway-r; }
.hill {
  position: relative; z-index: 2; background: var(--cream-2);
  border-top: var(--line); border-radius: 50% 50% 0 0 / 70px 70px 0 0;
  margin: 0 calc(-1 * clamp(18px, 4vw, 56px)); padding: 46px clamp(18px, 4vw, 56px) 8px;
}
.hello { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; }
.intro { max-width: 620px; margin: 0 auto 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-head); font-size: 20px; text-decoration: none;
  background: var(--plum); color: #fff; border: 0; border-radius: 999px; padding: 10px 26px;
  transition: transform .2s, box-shadow .2s; box-shadow: 0 4px 0 #5a3a50;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #5a3a50; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.card {
  display: block; text-decoration: none; text-align: center; font-family: var(--f-head); font-size: 20px;
  border: var(--line); border-radius: 18px; background: var(--pink-soft); padding: 14px 14px 10px;
  transition: transform .25s;
}
.card:hover { transform: translateY(-4px) rotate(-1deg); }
.card .ph, .card .thumb { border: 0; aspect-ratio: 16 / 9; margin-bottom: 6px; background-color: transparent; }
.flower {
  position: absolute; width: 46px; height: 46px; background: url("flower.svg") center / contain no-repeat;
  animation: float 7s ease-in-out infinite; pointer-events: none; z-index: 1;
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 40px; align-items: start; }
.about h2 { font-size: 34px; }
.pill {
  display: inline-block; font-family: var(--f-head); font-size: 17px;
  background: var(--pink); color: var(--ink); border-radius: 999px; padding: 2px 16px; margin: 6px 0 14px;
}
.tools { margin-top: 44px; border: var(--line); border-radius: 18px; padding: 34px 20px 20px; position: relative; }
.tools h3 {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  background: var(--sage); color: #3f5539; border: var(--line); border-radius: 999px; padding: 0 22px; font-size: 22px;
}
.tools ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.tools li { text-align: center; font-size: 14px; width: 84px; }
.tools .ico {
  width: 62px; height: 62px; margin: 0 auto 6px; border: var(--line); border-radius: 14px;
  background: var(--pink-soft); display: grid; place-items: center; overflow: hidden;
  font-family: var(--f-head); font-size: 22px; color: var(--plum);
}
.tools .ico img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Portfolio ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 30px; }
.chip {
  font: 19px var(--f-head); color: var(--ink); background: var(--cream-2); cursor: pointer;
  border: var(--line); border-radius: 999px; padding: 4px 26px; transition: background .2s;
}
.chip:hover { background: var(--pink-soft); }
.chip[aria-pressed="true"] { background: var(--pink); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work { border: 0; padding: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.work .ph, .work .thumb { transition: transform .25s; }
.work:hover .ph, .work:hover .thumb { transform: scale(1.03) rotate(-.6deg); }
.work span.cap { display: block; font-family: var(--f-head); font-size: 18px; margin-top: 8px; color: var(--plum); }
.empty { text-align: center; grid-column: 1 / -1; }

/* Chi tiết tác phẩm */
dialog.detail {
  width: min(1000px, 100% - 32px); max-height: 92vh; border: var(--line); border-radius: var(--radius);
  background: var(--cream-2); color: var(--ink); padding: 28px; overflow: auto;
}
dialog.detail::backdrop { background: rgb(118 81 104 / .45); }
.detail-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; align-items: center; }
.detail-media { position: relative; }
.detail-media .thumb, .detail-media .ph { aspect-ratio: auto; max-height: 72vh; object-fit: contain; min-height: 280px; }
.detail h2 { font-size: 32px; }
.detail .meta { font-size: 15px; opacity: .85; margin: 4px 0 12px; }
.round {
  width: 44px; height: 44px; border-radius: 50%; border: var(--line); background: var(--cream-2); color: var(--plum);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.round svg { width: 22px; height: 22px; }
.detail-media .prev, .detail-media .next { position: absolute; top: 50%; transform: translateY(-50%); }
.detail-media .prev { left: -22px; }
.detail-media .next { right: -22px; }
.detail .close { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 26px; max-width: 900px; margin: 0 auto; }
.project { display: grid; grid-template-columns: 260px 1fr auto; gap: 26px; align-items: center; }
.project h2 { font-size: 26px; margin-bottom: 6px; }
.project p { margin: 0; }
.go {
  width: 46px; height: 46px; border-radius: 50%; background: var(--pink); color: #fff;
  display: grid; place-items: center; transition: transform .2s; text-decoration: none;
}
.go:hover { transform: translateX(4px); }
.go svg { width: 22px; height: 22px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr auto 1fr; gap: 40px; align-items: center; max-width: 820px; margin: 0 auto; }
.contact .env { width: 260px; max-width: 100%; height: auto; justify-self: end; animation: float 6s ease-in-out infinite; }
.contact .sep { width: 2.5px; align-self: stretch; background: var(--plum); opacity: .5; }
.contact ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact a {
  display: flex; align-items: center; gap: 16px; font-family: var(--f-head); font-size: 22px; text-decoration: none;
  padding: 4px 10px; border-radius: 12px; transition: background .2s;
}
.contact .off { display: flex; align-items: center; gap: 16px; font-family: var(--f-head); font-size: 22px; padding: 4px 10px; opacity: .6; }
.contact .off small { font-size: 14px; }
.contact a:hover { background: var(--pink-soft); }
.contact svg { width: 30px; height: 30px; flex: none; color: var(--plum); }

/* ---------- Footer ---------- */
.site-foot { text-align: center; font-size: 14px; padding: 18px 16px 26px; color: var(--plum); }

/* ---------- Hiệu ứng ---------- */
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes sway-r { 0%, 100% { transform: scaleX(-1) rotate(0); } 50% { transform: scaleX(-1) rotate(3deg); } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .burger, .nav-close { display: block; }
  .nav {
    position: fixed; inset: 0; z-index: 50; background: var(--cream-2);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 40px 36px;
    visibility: hidden; opacity: 0; transition: opacity .25s, visibility .25s;
  }
  .nav.open { visibility: visible; opacity: 1; }
  .nav a { font-size: 26px; }
  .nav-close { position: absolute; top: 22px; right: 22px; }
  .cards, .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .about, .detail-body { grid-template-columns: 1fr; }
  .about { justify-items: center; text-align: center; gap: 20px; }
  .about .ph, .about .thumb { max-width: 300px; }
  .project { grid-template-columns: 1fr auto; }
  .project > :first-child { grid-column: 1 / -1; }
  .contact { grid-template-columns: 1fr; justify-items: center; gap: 24px; }
  .contact .env { justify-self: center; max-width: 180px; }
  .contact .sep { display: none; }
  dialog.detail { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0; border: 0; padding: 64px 16px 24px; }
  .detail-media .prev { left: 6px; }
  .detail-media .next { right: 6px; }
  .detail .close { top: 14px; right: 14px; }
  .frame::before, .frame::after { width: 90px; height: 90px; }
}
@media (max-width: 480px) {
  .hero-title::before, .hero-title::after { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card .ph, .card .thumb { aspect-ratio: 21 / 9; }
}
