/* ==================== MASTHEAD — White frosted glass ==================== */
.masthead-bg {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  z-index: 200;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  pointer-events: none;
}

.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 201;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  height: 30px;
  width: auto;
  border-radius: 6px;
}
.brand-name {
  font-family: var(--font-primary);
  font-size: 17px;
  font-weight: 500;
  color: var(--near-black);
  letter-spacing: -0.01em;
}

.masthead-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 400;
  color: var(--charcoal);
  padding: 7px 16px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(0,0,0,0.12);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  display: inline-block;
}
.nav-pill:hover {
  color: var(--near-black);
  border-color: rgba(0,0,0,0.28);
  background: rgba(0,0,0,0.04);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: var(--r-pill);
  padding: 3px;
}
.lang-toggle button {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  color: rgba(0,0,0,0.45);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-toggle button.active {
  background: var(--near-black);
  color: var(--white);
}

/* =====================================================
   SLIDE 1 — HERO: 1 ảnh full màn hình, 7 dots
   ===================================================== */
#hero {
  background: var(--black);
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* Two stacked full-screen images — crossfade between them */
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}
.hero-img.behind  { z-index: 1; opacity: 1; }
.hero-img.front   { z-index: 2; opacity: 1; transition: opacity 0.7s ease; }
.hero-img.fading  { opacity: 0; }

/* Dark overlay so text pops */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0.4)  50%,
    rgba(0,0,0,0.6)  100%
  );
}

/* ---------- carousel controls ---------- */
.hero-carousel-controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-arrow {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.28);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.hero-arrow:hover { background: rgba(255,255,255,0.28); transform: scale(1.06); }
.hero-arrow:active { transform: scale(0.96); }
.hero-arrow svg { width: 16px; height: 16px; }

.hero-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease;
}
.hero-dot.active {
  background: var(--white);
  transform: scale(1.3);
}
.hero-dot:hover:not(.active) {
  background: rgba(255,255,255,0.6);
}

/* ---------- center copy ---------- */
.hero-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  pointer-events: none;
  width: 90%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
}

.hero-title {
  font-family: var(--font-primary);
  font-size: clamp(56px, 8vw, 108px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--white);
  text-shadow: 0 2px 32px rgba(0,0,0,0.3);
}

.hero-subtitle {
  font-family: var(--font-primary);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 300;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.01em;
}

.hero-cta {
  pointer-events: all;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: var(--near-black);
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 500;
  height: 56px;
  padding: 0 32px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-3);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.hero-cta:hover {
  background: var(--cream-beige);
  box-shadow: var(--shadow-4);
  transform: translateY(-2px);
}
.hero-cta svg { width: 16px; height: 16px; }



/* =====================================================
   TEXT SLIDES — Shared
   ===================================================== */
.text-slide-inner {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 56px 40px;
}

.text-content {
  max-width: 680px;
  width: 100%;
}
/* no enter animation — content visible immediately */

.exhibit-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}
.exhibit-label.candimate { color: #5E6B00; }
.exhibit-label.pydinary  { color: #2850A8; }

.text-content h2 {
  font-family: var(--font-primary);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--charcoal);
  margin-bottom: 12px;
}

.project-tagline {
  font-family: var(--font-primary);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 300;
  font-style: italic;
  color: var(--gray-medium);
  margin-bottom: 24px;
  line-height: 1.3;
}

.desc-p {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.72;
  color: var(--charcoal);
  margin-bottom: 12px;
  opacity: 0.85;
}
.desc-p strong { font-weight: 500; color: var(--near-black); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--cream-dark);
  background: rgba(255,255,255,0.6);
  color: var(--gray-medium);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chip:hover {
  background: var(--white);
  border-color: var(--cream-tan);
  color: var(--charcoal);
}

.action-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border-radius: var(--r-pill);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: var(--shadow-2);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.btn-cta svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-cta-primary-dark { background: var(--near-black); color: var(--white); }
.btn-cta-primary-dark:hover { background: var(--charcoal); }
.btn-cta-outline-dark { background: transparent; color: var(--charcoal); border: 1.5px solid var(--cream-dark); }
.btn-cta-outline-dark:hover { background: var(--cream-tan); border-color: var(--cream-tan); }
.btn-cta-white { background: var(--white); color: var(--near-black); }
.btn-cta-white:hover { background: var(--cream-beige); }
.btn-cta-outline-white { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.3); }
.btn-cta-outline-white:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

/* =====================================================
   SLIDE 2 — CANDIMATE TEXT
   ===================================================== */
#candimate-text {
  background: var(--cream-beige);
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Large decorative shapes for Candimate — all sides */
.candimate-deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.candimate-deco .cd1 {
  position: absolute;
  width: 220px; height: 220px;
  background: rgba(72,240,139,0.22);
  border-radius: 50%;
  top: -40px; left: -60px;
}
.candimate-deco .cd2 {
  position: absolute;
  width: 170px; height: 170px;
  background: rgba(255,226,141,0.32);
  border-radius: 50% 40% 60% 30% / 40% 60% 30% 50%;
  bottom: 60px; left: 20px;
  animation: morphBlob 11s ease-in-out infinite alternate;
}
.candimate-deco .cd3 {
  position: absolute;
  width: 130px; height: 130px;
  background: rgba(94,155,255,0.18);
  border-radius: var(--r-card);
  top: 80px; right: 40px;
  transform: rotate(18deg);
}
.candimate-deco .cd4 {
  position: absolute;
  width: 90px; height: 90px;
  background: rgba(242,103,235,0.14);
  border-radius: 50%;
  bottom: 120px; right: 80px;
}
.candimate-deco .cd5 {
  position: absolute;
  width: 100px; height: 100px;
  background: rgba(72,240,139,0.15);
  border-radius: 50%;
  top: 50%; right: -20px;
  transform: translateY(-50%);
}
.candimate-deco .cd6 {
  position: absolute;
  width: 80px; height: 80px;
  background: rgba(255,226,141,0.25);
  border-radius: var(--r-card);
  bottom: -20px; right: 220px;
  transform: rotate(-12deg);
}

/* =====================================================
   SLIDE 3 — CANDIMATE VISUAL
   ===================================================== */
#candimate-visual {
  background: var(--cream-tan);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 72px;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.visual-eyebrow {
  position: absolute;
  top: 96px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 5;
  color: #5E6B00;
}

.photo-stack {
  position: relative;
  width: min(92vw, 1020px);
  height: min(72vh, 620px);
  z-index: 5;
}
.photo-stack img {
  position: absolute;
  border-radius: 10px;
  border: 6px solid var(--white);
  box-shadow: var(--shadow-4);
  object-fit: cover;
  aspect-ratio: 16/10;
  height: auto;
  will-change: transform;
}
.photo-stack .p1 {
  width: 60%; top: 4%; left: 2%;
  transform: rotate(-4deg);
  z-index: 2;
}
.photo-stack .p2 {
  width: 55%; bottom: 2%; right: 2%;
  transform: rotate(5deg);
  z-index: 1;
}

/* =====================================================
   SLIDE 4 — PYDINARY TEXT — WHITE background
   ===================================================== */
#pydinary-text {
  background: var(--white);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Light shape decorations on white bg */
.pydinary-deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.pydinary-deco .pd1 {
  position: absolute;
  width: 240px; height: 240px;
  background: rgba(94,155,255,0.12);
  border-radius: 50%;
  top: -50px; right: -50px;
}
.pydinary-deco .pd2 {
  position: absolute;
  width: 160px; height: 160px;
  background: rgba(255,189,249,0.15);
  border-radius: 50% 40% 60% 30% / 40% 60% 30% 50%;
  bottom: 80px; left: 20px;
  animation: morphBlob 13s ease-in-out infinite alternate;
}
.pydinary-deco .pd3 {
  position: absolute;
  width: 100px; height: 100px;
  background: rgba(72,240,139,0.10);
  border-radius: var(--r-card);
  top: 40%; left: 10px;
  transform: rotate(-22deg);
}
.pydinary-deco .pd4 {
  position: absolute;
  width: 120px; height: 120px;
  background: rgba(113,130,255,0.09);
  border-radius: 50%;
  top: 70px; right: 120px;
}
.pydinary-deco .pd5 {
  position: absolute;
  width: 80px; height: 80px;
  background: rgba(255,226,141,0.18);
  border-radius: var(--r-card);
  bottom: -20px; right: 280px;
  transform: rotate(14deg);
}

#pydinary-text .text-slide-inner { position: relative; z-index: 10; }
#pydinary-text .text-content h2 { color: var(--near-black); }
#pydinary-text .exhibit-label.pydinary { color: #2850A8; }
#pydinary-text .project-tagline { color: var(--gray-medium); }
#pydinary-text .desc-p { color: var(--charcoal); }
#pydinary-text .desc-p strong { color: var(--near-black); }
#pydinary-text .chip {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.10);
  color: var(--gray-medium);
}
#pydinary-text .chip:hover {
  background: rgba(0,0,0,0.06);
  color: var(--charcoal);
}

/* =====================================================
   SLIDE 5 — PYDINARY VISUAL (WHITE BG, LARGE IMAGES)
   ===================================================== */
#pydinary-visual {
  position: relative;
  background: var(--white);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 40px;
  min-height: 100vh;
  min-height: 100dvh;
}

/* remove aurora elements */
.pydinary-aurora-bg,
.pydinary-aurora-glow { display: none; }

#pydinary-visual .visual-eyebrow { color: #2850A8; }

.glass-stack {
  position: relative;
  width: min(96vw, 1200px);
  height: min(80vh, 720px);
  z-index: 5;
}
.glass-stack img {
  position: absolute;
  border-radius: 20px;
  border: 6px solid var(--white);
  box-shadow: var(--shadow-4);
  object-fit: cover;
  aspect-ratio: 16/10;
  height: auto;
  will-change: transform;
}
.glass-stack .p1 { width: 55%; top: 2%;  left: 0%;  transform: rotate(-3deg); z-index: 3; }
.glass-stack .p2 { width: 50%; top: 8%;  right: 0%; transform: rotate(4deg);  z-index: 2; }
.glass-stack .p3 { width: 48%; bottom: 0%; left: 24%; transform: rotate(-2deg); z-index: 1; }

/* =====================================================
   SLIDE 6 — PLAYGROUND + FOOTER
   Google Labs layout: physics playground fills top,
   wordmark sits right against playground (no gap)
   ===================================================== */
#footer-slide {
  background: var(--cream-beige);
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Physics playground — fills most of the slide */
.playground-area {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--cream-beige);
}

#matter-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.playground-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 2;
  text-align: center;
  white-space: nowrap;
}
.hint-fade { animation: hintFade 2.5s ease-out 2s forwards; opacity: 1; }
@keyframes hintFade { to { opacity: 0; } }

/* Divider between playground and wordmark */
.footer-divider {
  width: 100%;
  height: 1px;
  background: var(--near-black);
  flex-shrink: 0;
}

/* Sub-navigation row */
.footer-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 48px;
  flex-shrink: 0;
  background: var(--cream-beige);
}
.footer-subnav-label {
  font-family: var(--font-primary);
  font-size: 12px;
  color: var(--gray-medium);
}
.footer-subnav-links { display: flex; gap: 24px; }
.footer-subnav-link {
  font-family: var(--font-primary);
  font-size: 12px;
  color: var(--charcoal);
  transition: color 0.18s ease;
  position: relative;
}
.footer-subnav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--near-black);
  transition: width 0.2s ease;
}
.footer-subnav-link:hover::after { width: 100%; }
.footer-subnav-link:hover { color: var(--near-black); }

/* Giant wordmark — fills exactly to bottom like Google Labs
   sits directly below playground with no gap */
.footer-wordmark-area {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 32px 0 32px;
  overflow: hidden;
  background: var(--cream-beige);
  line-height: 1;
}

.footer-wordmark {
  font-family: var(--font-primary);
  font-size: clamp(80px, 14.5vw, 220px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.88;
  color: var(--near-black);
  white-space: nowrap;
  user-select: none;
  /* Scale to fill viewport width */
  width: 100%;
  overflow: hidden;
}

/* Bottom copyright bar */
.footer-bottom-divider {
  width: 100%; height: 1px;
  background: var(--cream-dark);
  flex-shrink: 0;
}
.footer-copyright {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 48px;
  flex-shrink: 0;
  background: var(--cream-beige);
}
.footer-copyright-text {
  font-family: var(--font-primary);
  font-size: 10px;
  color: var(--gray-medium);
  letter-spacing: 0.02em;
}
.footer-copyright-right { display: flex; gap: 20px; }
.footer-copyright-right a {
  font-family: var(--font-primary);
  font-size: 10px;
  color: var(--gray-medium);
  transition: color 0.18s ease;
}
.footer-copyright-right a:hover { color: var(--near-black); }

/* =====================================================
   SHAPE FIELD — Cursor parallax
   ===================================================== */
.shape-field { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.cursor-shape { transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); position: absolute; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .photo-stack  { width: 92vw; height: 60vh; }
  .glass-stack  { width: 92vw; height: 62vh; }
  .visual-eyebrow { top: 88px; }
  .masthead { padding: 0 24px; }
  .hs-flower1, .hs-flower2 { display: none; }
}

@media (max-width: 640px) {
  .masthead { padding: 0 16px; }
  .masthead-nav { display: none; }
  .text-slide-inner { padding: 72px 24px 32px; }
  .text-content h2 { font-size: 40px; }
  .footer-wordmark { font-size: clamp(52px, 16vw, 100px); }
  .footer-subnav { padding: 12px 24px; }
  .footer-copyright { padding: 10px 24px; }
  .footer-wordmark-area { padding: 0 20px; }
  .photo-stack, .glass-stack {
    width: 90vw; height: auto;
    display: flex; flex-direction: column;
    align-items: center; gap: 16px; position: static;
  }
  .photo-stack img, .glass-stack img {
    position: static; width: 82%;
    transform: none !important; opacity: 1 !important;
  }
  .visual-eyebrow { position: static; margin-bottom: 16px; }
  #candimate-visual, #pydinary-visual {
    flex-direction: column; padding-top: 88px;
    padding-bottom: 24px; overflow-y: auto; justify-content: flex-start;
  }
  .playground-area { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
