/* ══════════════════════════════════════════════════════════════
   Nhật Phan Portfolio — real semantic build
   Design 1366×1996 · Figma NHAT-PHAN-PORTFOLIO
   Assets: original Figma image fills + 4× node renders
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand-red: #e9251f;
  --ink:       #000000;
}

html { scroll-behavior: smooth; }

body {
  background: #f4f1ea;
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Full-width wrapper, each section handles its own bg */
.site {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

img { display: block; }


/* ════════════ NAVBAR — full-width bg, 1366 content ════════════ */
.navbar {
  position: relative;
  width: 100%;
  height: 174px;
  background: #ffffff;
  z-index: 30;
}
.navbar-inner {
  width: 1366px;
  height: 174px;
  margin: 0 auto;
  position: relative;
}

/* Logo — Figma: bitmap x46 y5 167×167 */
.logo {
  position: absolute;
  left: 46px;
  top: 5px;
  width: 167px;
  height: 167px;
  display: block;
  transition: transform .25s ease;
}
.logo img { width: 167px; height: 167px; }
.logo:hover { transform: scale(1.05); }

/* Nav links — real Montserrat text over Figma vector positions */
.nav-link {
  position: absolute;
  top: 72px;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .15px;
  transition: color .2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--brand-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover { color: var(--brand-red); }
.nav-link:hover::after { transform: scaleX(1); }

/* Figma group bbox x-positions */
.nav-link--work    { left: 649px; }
.nav-link--about   { left: 736px; }
.nav-link--chipheo { left: 830px; }
.nav-link--gallery { left: 1010px; }
.nav-link--cv      { left: 1110px; }

/* Social icons */
.nav-social__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-social__btn:hover { transform: translateY(-2px) scale(1.08); }
.nav-social__btn--linkedin { left: 1207px; top: 72px; width: 32px; height: 32px; }
.nav-social__btn--email    { left: 1269px; top: 71px; width: 41px; height: 32px; }
.nav-social__btn img { width: 100%; height: 100%; }


/* ════════════ HERO — full-width bg, 1366 content ════════════ */
.hero {
  position: relative;
  width: 100%;
  height: 799px;
  background-color: #f4f1ea;
  z-index: 10;
}
.hero-inner {
  width: 1366px;
  height: 799px;
  margin: 0 auto;
  position: relative;
  background-image: url(../img/bg_paper.webp);
  background-size: 1365px 947px;
  background-position: 0 -74px;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* ── Centre illustration — Figma Frame 14: x456 y236 → hero y62 ── */
.hero-illustration {
  position: absolute;
  left: 456px;
  top: 62px;
  width: 480px;
  height: 626px;
  z-index: 5;
  pointer-events: none;
  height: 615px;
}
.hero-slide {
  position: absolute;
  left: 0;
  top: 0;
  width: 480px;
  height: 615px;
  opacity: 0;
  transition: opacity .8s ease;
}
.hero-slide--active {
  opacity: 1;
}

/* ── Floating menu items ─────────────────────────────────────── */
.menu-item {
  position: absolute;
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.34, 1.3, .64, 1);
  z-index: 8;
}
.menu-item:hover {
  transform: scale(1.09);
  z-index: 20;
}

/* idle floating wrapper (separate element so hover-scale composes) */
.menu-item__inner {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  animation: float 4.6s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.menu-item__icon {
  position: absolute;
  left: 0; top: 0;
  transition: filter .3s ease;
}
.menu-item:hover .menu-item__icon {
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .25));
}

/* labels — Montserrat 700 16px / 19.5 lh, centred, Figma exact */
.menu-item__label {
  position: absolute;
  font-size: 16px;
  line-height: 19.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  transition: color .25s ease;
}
.menu-item:hover .menu-item__label { color: var(--brand-red); }

/* Per-item geometry — union box (left/top/w/h), icon + label offsets.
   Coords are hero-relative (Figma y − 174). */

/* WORK    icon x235 y310(→136) 101×101 · label "WORK" */
.menu-item--work        { left: 235px; top: 136px; width: 101px; height: 132px; }
.menu-item--work    .menu-item__icon  { width: 101px; height: 101px; }
.menu-item--work    .menu-item__label { left: 22px; top: 112px; width: 56px; }

/* RESUME  icon x147 y530(→356) 110×114 */
.menu-item--resume      { left: 147px; top: 356px; width: 110px; height: 134px; }
.menu-item--resume  .menu-item__icon  { width: 110px; height: 114px; }
.menu-item--resume  .menu-item__label { left: 6px;  top: 114px; width: 72px; }

/* ABOUT   icon x237 y727(→553) 95×128 */
.menu-item--about       { left: 237px; top: 553px; width: 95px;  height: 149px; }
.menu-item--about   .menu-item__icon  { width: 95px;  height: 128px; }
.menu-item--about   .menu-item__label { left: 13px; top: 129px; width: 61px; }

/* CHÍ PHÈO  icon x1080 y377(→203) 99×109 · label full-width 161 */
.menu-item--chipheo     { left: 1058px; top: 203px; width: 161px; height: 138px; }
.menu-item--chipheo .menu-item__icon  { left: 22px; width: 99px;  height: 109px; }
.menu-item--chipheo .menu-item__label { left: 0;   top: 118px; width: 161px; }

/* GALLERY  icon x1076 y637(→463) 125×87 */
.menu-item--gallery     { left: 1076px; top: 463px; width: 125px; height: 118px; }
.menu-item--gallery .menu-item__icon  { width: 125px; height: 87px; }
.menu-item--gallery .menu-item__label { left: 23px; top: 98px;  width: 78px; }




/* ════════════ Reduced-motion ════════════ */
@media (prefers-reduced-motion: reduce) {
  .menu-item__inner { animation: none; }
  html { scroll-behavior: auto; }
}

/* ════════════ RESPONSIVE — Mobile reflow ════════════ */
.menu-items-grid {
  display: contents;
}

@media (max-width: 1024px) {
  .navbar { height: auto; }
  .navbar-inner {
    width: 100%;
    height: auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .logo { position: static; width: 60px; height: 60px; }
  .logo img { width: 60px; height: 60px; }
  .nav-link { position: static; font-size: 14px; margin: 0 6px; }
  .nav-menu { display: flex; align-items: center; }
  .nav-social { display: flex; gap: 8px; align-items: center; }
  .nav-social__btn { position: static; width: 28px; height: 28px; }

  .hero {
    height: auto;
    background: transparent;
  }
  .hero-inner {
    width: 100%;
    height: auto;
    background-image: none !important;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px 40px;
    overflow: visible;
  }
  .site {
    background-image: url(../img/bg_paper.webp);
    background-size: 100% 100%;
    background-position: top center;
    background-repeat: no-repeat;
  }

  /* Illustration — big and centered, show first */
  .hero-illustration {
    position: relative;
    left: auto; top: auto;
    width: 70vw;
    max-width: 380px;
    height: auto;
    aspect-ratio: 480 / 615;
    margin: 0 auto 30px;
    order: -1;
  }
  .hero-slide {
    width: 100%; height: 100%;
  }

  /* Menu items — grid 3+2 */
  .menu-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
    justify-items: center;
    width: 100%;
    max-width: 400px;
  }
  .menu-item {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .menu-item__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .menu-item__icon {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 80px !important;
    height: auto !important;
  }
  .menu-item__label {
    position: relative !important;
    left: auto !important;
    top: 6px !important;
    width: auto !important;
    font-size: 12px;
  }

  /* Row 2 (2 items) — use subgrid-like centering via 6-col trick */
  .menu-items-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .menu-item:nth-child(1) { grid-column: 1 / 3; }
  .menu-item:nth-child(2) { grid-column: 3 / 5; }
  .menu-item:nth-child(3) { grid-column: 5 / 7; }
  .menu-item:nth-child(4) { grid-column: 2 / 4; }
  .menu-item:nth-child(5) { grid-column: 4 / 6; }
}

@media (max-width: 480px) {
  .navbar-inner { padding: 10px 12px; }
  .logo { width: 44px; height: 44px; }
  .logo img { width: 44px; height: 44px; }
  .nav-link { font-size: 11px; margin: 0 3px; }
  .nav-social__btn { width: 22px; height: 22px; }

  .hero-inner { padding: 20px 16px 30px; }
  .hero-illustration { width: 75vw; max-width: 300px; margin-bottom: 24px; }
  .menu-items-grid { gap: 16px 12px; max-width: 340px; }
  .menu-item__icon { width: 65px !important; }
  .menu-item__label { font-size: 10px; }
}
