/* ==========================================================================
   LEO WANG · 王家彬 — EDITORIAL PORTFOLIO
   Inspired by Dennis Snellenberg · PP Neue Montreal + Noto Sans SC
   Palette: #999D9E · #FFFFFF · #1C1D20 · #455CE9
   ========================================================================== */

@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/ppneuemontreal-book.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/ppneuemontreal-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --gray-hero: #999D9E;
  --white: #FFFFFF;
  --dark: #1C1D20;
  --dark-soft: #26272B;
  --blue: #455CE9;
  --blue-deep: #334BD3;
  --muted: #868A8E;
  --tile-bg: #E7E8EA;
  --line-light: rgba(28, 29, 32, 0.16);
  --line-dark: rgba(255, 255, 255, 0.2);

  --font-main: "PP Neue Montreal", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", sans-serif;
  --ease-expo: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--dark);
}

body {
  font-family: var(--font-main);
  font-weight: 400;
  color: var(--dark);
  background-color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.container {
  width: min(1320px, calc(100% - clamp(40px, 10vw, 180px)));
  margin-inline: auto;
}

/* ==========================================================================
   INTRO LOADER CURTAIN
   ========================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #141517;
  color: var(--white);
  display: grid;
  place-items: center;
  transition: transform 0.95s var(--ease-expo), border-radius 0.95s var(--ease-expo);
}

.loader.done {
  transform: translateY(-104%);
  border-bottom-left-radius: 42% 18%;
  border-bottom-right-radius: 42% 18%;
  pointer-events: none;
}

.loader-word {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(10px);
  animation: loaderWordIn 0.45s var(--ease-out) 0.1s forwards;
}

.loader-word i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  display: inline-block;
}

@keyframes loaderWordIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   FLOATING MAGNETIC HAMBURGER & SLIDE DRAWER MENU
   ========================================================================== */
.menu-btn-wrap {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 500;
  transform: scale(0);
  transition: transform 0.45s var(--ease-expo);
}

.menu-btn-wrap.visible,
body.menu-open .menu-btn-wrap {
  transform: scale(1);
}

.menu-btn {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

body.menu-open .menu-btn {
  background: var(--blue);
  border-color: var(--blue);
}

.burger,
.burger.btn-text {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger i {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.4s var(--ease-expo);
}

body.menu-open .burger i:first-child {
  transform: translateY(3.2px) rotate(45deg);
}

body.menu-open .burger i:last-child {
  transform: translateY(-3.2px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 440;
  background: rgba(12, 13, 16, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease-out);
}

body.menu-open .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

.menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100vw);
  z-index: 460;
  background: var(--dark);
  color: var(--white);
  transform: translateX(104%);
  transition: transform 0.72s var(--ease-expo);
  display: flex;
}

body.menu-open .menu {
  transform: translateX(0);
}

.menu-inner {
  width: 100%;
  padding: 120px clamp(40px, 6vw, 84px) 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
  margin-bottom: 28px;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-link {
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.18;
  transition: color 0.25s ease, transform 0.35s var(--ease-out);
}

.menu-link:hover {
  color: var(--blue);
  transform: translateX(10px);
}

.menu-foot a {
  font-size: 1rem;
  color: var(--white);
  opacity: 0.88;
  transition: opacity 0.25s ease;
}

.menu-foot a:hover {
  opacity: 1;
}

/* ==========================================================================
   SHARED MAGNETIC FILL BUTTONS (.circle-btn, .pill, .menu-btn)
   ========================================================================== */
.btn-fill {
  position: absolute;
  left: -10%;
  top: 102%;
  width: 120%;
  height: 160%;
  border-radius: 50%;
  background: var(--blue);
  pointer-events: none;
  transition: top 0.48s var(--ease-expo);
  z-index: 1;
}

.circle-btn.blue .btn-fill {
  background: var(--blue-deep);
}

.circle-btn:hover .btn-fill,
.pill:hover .btn-fill,
.menu-btn:hover .btn-fill {
  top: -30%;
}

.btn-text {
  position: relative;
  z-index: 2;
  display: inline-block;
  pointer-events: none;
}

.circle-btn {
  position: relative;
  width: clamp(148px, 12.5vw, 182px);
  height: clamp(148px, 12.5vw, 182px);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 1.02rem;
  font-weight: 400;
  color: var(--white);
  overflow: hidden;
  cursor: pointer;
}

.circle-btn.dark {
  background: var(--dark);
}

.circle-btn.blue {
  background: var(--blue);
}

/* ==========================================================================
   01 / HERO SECTION (#999D9E)
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  max-height: 1120px;
  background: radial-gradient(circle at 50% 58%, #9DA1A2 0%, #999D9E 52%, #8F9394 100%);
  color: var(--white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px clamp(24px, 4vw, 56px);
}

/* Top-left rotating © Code by 王家彬 / Leo Wang */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--white);
}

.logo-copy {
  display: inline-block;
  transition: transform 0.55s var(--ease-expo);
}

.logo:hover .logo-copy {
  transform: rotate(360deg);
}

.logo-window {
  position: relative;
  overflow: hidden;
  height: 1.35em;
  display: inline-block;
}

.logo-roll {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  white-space: nowrap;
  transition: transform 0.52s var(--ease-expo);
}

.logo:hover .logo-roll {
  transform: translateY(-50%);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 42px);
}

.nav-link {
  position: relative;
  padding: 8px 4px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--white);
}

.nav-link .dot {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  transform: translateX(-50%) scale(0);
  transition: transform 0.3s var(--ease-expo);
}

.nav-link:hover .dot {
  transform: translateX(-50%) scale(1);
}

.hero-inner {
  position: relative;
  flex: 1;
  width: 100%;
}

/* Full-bleed cinematic monochrome landscape poster */
.hero-visual {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background: #2B2E31;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 20, 23, 0.38) 0%,
    rgba(22, 24, 28, 0.16) 38%,
    rgba(22, 24, 28, 0.22) 68%,
    rgba(16, 18, 21, 0.48) 100%
  );
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  transform: scale(1.06);
  filter: grayscale(100%) contrast(1.06) brightness(0.94);
  will-change: transform;
}

/* Iconic left-edge dark pill with rotating globe */
.hero-location {
  position: absolute;
  left: 0;
  top: 28%;
  z-index: 6;
  background: var(--dark);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 16px 14px 36px;
  border-radius: 0 999px 999px 0;
}

.loc-text {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  line-height: 1.42;
}

.loc-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}

.loc-globe {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gray-hero);
  color: var(--white);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.loc-globe svg {
  width: 38px;
  height: 38px;
  animation: globeTilt 14s linear infinite;
}

.meridian {
  animation: meridianPulse 5.4s ease-in-out infinite alternate;
}
.meridian.m2 {
  animation-delay: -1.8s;
}
.meridian.m3 {
  animation-delay: -3.6s;
}

@keyframes globeTilt {
  0% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
  100% { transform: rotate(-12deg); }
}

@keyframes meridianPulse {
  0% { rx: 2px; }
  100% { rx: 21px; }
}

/* Right-side degree & major statement */
.hero-role {
  position: absolute;
  right: clamp(28px, 8vw, 140px);
  top: 26%;
  z-index: 6;
  color: var(--white);
}

.role-arrow {
  width: 20px;
  height: 20px;
  margin-bottom: 30px;
}

.hero-role p {
  font-size: clamp(1.32rem, 1.9vw, 1.95rem);
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: -0.01em;
}

/* Giant bottom infinite marquee ("Leo Wang —") */
.hero-marquee {
  position: absolute;
  left: 0;
  bottom: 2.2vh;
  width: 100%;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
}

.marquee-group span {
  font-size: clamp(6.2rem, 13.8vw, 15.2rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.03em;
  padding-right: 0.28em;
  color: var(--white);
  white-space: nowrap;
}

/* ==========================================================================
   02 / ABOUT & MANIFESTO (#FFFFFF)
   ========================================================================== */
.about {
  background: var(--white);
  color: var(--dark);
  padding: clamp(110px, 14vw, 200px) 0 clamp(60px, 7vw, 100px);
  position: relative;
  z-index: 10;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(36px, 7vw, 110px);
  align-items: start;
}

.about-statement {
  font-size: clamp(2.25rem, 3.6vw, 3.45rem);
  font-weight: 400;
  line-height: 1.34;
  letter-spacing: -0.02em;
}

.about-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 8px;
}

.about-bio {
  font-size: clamp(1rem, 1.08vw, 1.12rem);
  line-height: 1.85;
  color: var(--dark);
  opacity: 0.84;
  max-width: 420px;
}

.about-side .circle-btn {
  margin-top: clamp(44px, 6vw, 76px);
  align-self: flex-end;
}

/* Line & Fade Scroll Reveal Primitives */
.reveal-line {
  display: block;
  overflow: hidden;
}

.reveal-line > span {
  display: inline-block;
  transform: translateY(108%);
  transition: transform 0.85s var(--ease-out);
}

.is-visible .reveal-line > span,
.reveal-line.is-visible > span {
  transform: translateY(0);
}

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   03 / FOCUS 4-ROW HOVER SHOWCASE (#FFFFFF)
   ========================================================================== */
.focus {
  background: var(--white);
  color: var(--dark);
  padding: clamp(40px, 6vw, 80px) 0 clamp(90px, 11vw, 160px);
  position: relative;
  z-index: 10;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 34px;
}

.focus-list {
  list-style: none;
  border-top: 1px solid var(--line-light);
}

.focus-list:hover .focus-row {
  opacity: 0.36;
}

.focus-list .focus-row:hover {
  opacity: 1;
}

.focus-row {
  border-bottom: 1px solid var(--line-light);
  padding: clamp(34px, 4.3vw, 58px) clamp(12px, 3.2vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.8s var(--ease-out);
}

.row-title h3 {
  font-size: clamp(2rem, 4.3vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.06;
  transition: transform 0.45s var(--ease-out);
}

.row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 6px;
  transition: transform 0.45s var(--ease-out);
}

.row-zh {
  font-size: 1.02rem;
  font-weight: 400;
  color: var(--dark);
}

.row-tools {
  font-size: 0.86rem;
  color: var(--muted);
}

.focus-row:hover .row-title h3 {
  transform: translateX(-14px);
}

.focus-row:hover .row-meta {
  transform: translateX(14px);
}

.row-thumb {
  display: none;
}

/* Cursor-Following Floating Preview Window */
.preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 312px;
  pointer-events: none;
  z-index: 60;
  will-change: transform;
}

.preview-scale {
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: scale(0);
  transition: transform 0.46s var(--ease-expo);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.24);
}

.preview.active .preview-scale {
  transform: scale(1);
}

.preview-slider {
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.55s var(--ease-expo);
}

.preview-slide {
  width: 100%;
  height: 312px;
  flex-shrink: 0;
  background: var(--bg, #1C1D20);
  padding: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.preview-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   04 / HORIZONTAL SLIDING GALLERY & CURVED ARCH TRANSITION
   ========================================================================== */
.gallery {
  position: relative;
  background: var(--white);
  padding-top: 20px;
  padding-bottom: clamp(70px, 9vw, 130px);
  overflow: hidden;
  z-index: 10;
}

.slide-row {
  display: flex;
  gap: clamp(18px, 2.2vw, 32px);
  width: 130vw;
  margin-left: -15vw;
  margin-bottom: clamp(18px, 2.2vw, 32px);
  will-change: transform;
}

.tile {
  flex: 1 0 24vw;
  min-width: 260px;
  background: var(--tile-bg);
  padding: clamp(16px, 1.9vw, 28px);
  overflow: hidden;
}

.tile img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: grayscale(18%) contrast(1.03);
  transition: transform 0.6s var(--ease-out);
}

.tile:hover img {
  transform: scale(1.035);
}

/* Signature curved arch overhanging the dark footer */
.curve-wrap {
  position: relative;
  width: 100%;
  height: 0;
  z-index: 12;
}

.curve {
  position: absolute;
  left: -10%;
  top: 0;
  width: 120%;
  height: 96px;
  background: var(--white);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  box-shadow: 0 42px 50px rgba(0, 0, 0, 0.35);
  transform-origin: top center;
  will-change: transform;
}

/* ==========================================================================
   05 / DARK CHARCOAL FOOTER (#1C1D20)
   ========================================================================== */
.footer {
  position: relative;
  background: var(--dark);
  color: var(--white);
  padding: clamp(130px, 15vw, 210px) 0 42px;
  z-index: 5;
}

.footer-head {
  position: relative;
  padding-bottom: clamp(56px, 7vw, 92px);
}

.footer-title {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 28px);
}

.footer-avatar {
  width: clamp(56px, 5.6vw, 84px);
  height: clamp(56px, 5.6vw, 84px);
  border-radius: 50%;
  overflow: hidden;
  background: var(--gray-hero);
  flex-shrink: 0;
}

.footer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.35);
}

.footer-head h2 {
  font-size: clamp(3.2rem, 7.2vw, 6.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.footer-arrow {
  position: absolute;
  right: 12px;
  bottom: clamp(68px, 8vw, 108px);
  width: 22px;
  height: 22px;
}

.footer-divider {
  position: relative;
  width: 100%;
  height: 1px;
  background: var(--line-dark);
  margin-bottom: clamp(56px, 7vw, 92px);
}

.footer-divider .circle-btn {
  position: absolute;
  right: clamp(24px, 9vw, 130px);
  top: 50%;
  transform: translateY(-50%);
}

.footer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.pill {
  position: relative;
  overflow: hidden;
  padding: 22px 42px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  font-size: 1.02rem;
  color: var(--white);
  transition: border-color 0.35s ease;
}

.pill:hover {
  border-color: var(--blue);
}

.footer-bottom {
  width: min(1440px, calc(100% - clamp(40px, 6vw, 100px)));
  margin: clamp(90px, 11vw, 150px) auto 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.meta-group {
  display: flex;
  gap: clamp(28px, 4vw, 56px);
  flex-wrap: wrap;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.94rem;
}

.meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.meta-right {
  text-align: right;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 24px);
  z-index: 800;
  background: var(--white);
  color: var(--dark);
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   RESPONSIVE REFINEMENTS
   ========================================================================== */
@media (max-width: 960px) {
  .hero-location {
    display: none;
  }

  .hero-role {
    left: 28px;
    right: auto;
    top: auto;
    bottom: 24vh;
  }

  .hero-visual {
    height: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-side .circle-btn {
    align-self: flex-start;
  }

  .preview {
    display: none;
  }

  .focus-row {
    flex-direction: column;
    align-items: flex-start;
    padding-inline: 0;
  }

  .row-meta {
    align-items: flex-start;
    text-align: left;
  }

  .row-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin-top: 14px;
  }

  .footer-divider .circle-btn {
    right: 16px;
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .menu-btn-wrap {
    transform: scale(1);
    top: 18px;
    right: 18px;
  }

  .menu-btn {
    width: 60px;
    height: 60px;
  }

  .meta-right {
    text-align: left;
  }
}
