/* ============================================================
   Danny Poo Portfolio — style.css
   ============================================================ */

/* 1. Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;900&family=Exo+2:wght@300;600&display=swap');

/* 2. CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 3. Root Variables */
:root {
  --black:     #000000;
  --nearblack: #121211;
  --red:       #F9241B;
  --white:     #FFFFFF;
  --cream:     #FAF3F0;
  --yellow:    #FFDC22;
  --grey:      #848383;

  --font-heading: 'Orbitron', sans-serif;
  --font-body:    'Exo 2', sans-serif;

  --nav-h:     80px;
  --container: 1140px;
}

/* 4. Base */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--nearblack);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5em;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 5. Headings */
h1 {
  font-family: var(--font-heading);
  font-size: 4.6rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--font-heading);
  font-size: 3.1rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
}

h4 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
}

/* 6. Body Copy */
p {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5em;
  letter-spacing: 0.01em;
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

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

sup {
  font-size: 0.6em;
  vertical-align: super;
}

ul, ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

li {
  line-height: 1.5em;
  margin-bottom: 0.4em;
}

img {
  width: 100%;
  display: block;
}

video {
  width: 100%;
  display: block;
}

figure {
  margin: 0;
}

figcaption {
  font-size: 1rem;
  color: var(--grey);
  margin-top: 8px;
  line-height: 1.5em;
}

/* 7. Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

/* 8. Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nearblack);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  display: block;
  height: 62px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--red);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity 0.15s;
}

.nav-links a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* 9. Page Content */
.page-content {
  padding-top: var(--nav-h);
}

/* 10. VPN Notice */
.vpn-notice {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--grey);
  text-align: left;
  padding: 16px 0;
  letter-spacing: 0.01em;
  margin-bottom: 0;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* 11. Hero Banner */
.hero-banner {
  width: 100%;
  display: block;
  margin: 24px 0;
}

/* 12. Ticker — container width, no full-bleed */
.ticker-wrap {
  max-width: var(--container);
  margin: 0 auto;
  overflow: hidden;
  background: var(--nearblack);
  padding: 16px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.ticker {
  display: flex;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

.ticker span {
  padding: 0 32px;
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--white);
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 13. Home Hero */
.home-hero {
  padding: 48px 0 80px;
}

/* Hero heading: H1 tag, red */
.hero-heading {
  color: var(--red);
  margin-bottom: 32px;
  max-width: 900px;
}

/* 14. CTA Links (About & Résumé) — H2, italic, underline */
.cta-buttons {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.cta-link {
  font-family: var(--font-heading);
  font-size: 3.1rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
  font-style: italic;
  text-decoration: underline;
  color: var(--red);
  display: inline-block;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-link:hover {
  opacity: 0.7;
  transform: translateX(4px);
}

/* 15. Brand Logos — centered */
.brand-logos {
  text-align: center;
}

.brand-logos-label {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--white);
  letter-spacing: 0.01em;
  display: block;
  margin-bottom: 20px;
}

.brand-logos-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.brand-logos-row img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: inline-block;
  /* full color — no filter */
}

/* ============================================================
   16. Project Sections — Base
   ============================================================ */
.project-section {
  width: 100%;
  padding: 80px 0;
}

/* Per-section backgrounds */
.section-lego            { background: var(--yellow); color: var(--black); }
.section-gogoro          { background: var(--nearblack); color: var(--white); }
.section-alipayeu        { background: var(--white); color: var(--black); }
.section-alipayhk        { background: var(--red); color: var(--white); }
.section-extraterrestrially { background: var(--nearblack); color: var(--white); }
.section-playground      { background: var(--cream); color: var(--black); }
.section-htc             { background: var(--nearblack); color: var(--white); }
.section-snkrs           { background: var(--cream); color: var(--black); }
.section-gifs            { background: var(--nearblack); color: var(--white); }

/* 17. Section Heading — styled at H1 size regardless of tag */
.section-heading {
  font-family: var(--font-heading);
  font-size: 4.6rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}

/* Heading colors per section */
.section-lego            .section-heading { color: var(--black); }
.section-gogoro          .section-heading { color: var(--red); }
.section-alipayeu        .section-heading { color: var(--black); }
.section-alipayhk        .section-heading { color: var(--white); }
.section-extraterrestrially .section-heading { color: var(--red); }
.section-playground      .section-heading { color: var(--red); }
.section-htc             .section-heading { color: var(--white); }
.section-snkrs           .section-heading { color: var(--red); }
.section-gifs            .section-heading { color: var(--red); }

/* 18. LEGO — 50/50 video | body layout */
.project-50-50 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

/* 19. Stacked media block */
.p-media {
  width: 100%;
  margin-bottom: 40px;
}

/* 20. Body block (LEGO uses this directly in right column) */
.p-body {
  width: 100%;
}

/* 21. Body split — 50/50: titles left, content right (non-LEGO sections) */
.body-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.body-titles {
  display: flex;
  flex-direction: column;
}

.body-content {
  display: flex;
  flex-direction: column;
}

/* 22. Meta text — each on its own line, P2 Bold */
.p-meta {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.5em;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.p-meta strong {
  font-weight: 600;
}

/* 23. Description text — P2, extra top margin for spacing from title block */
.p-desc {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.5em;
  letter-spacing: 0.01em;
  margin-top: 0;
  margin-bottom: 0;
}

/* Extra line spacing between last body title and body text (LEGO stacked layout) */
.p-body .p-desc {
  margin-top: 32px;
}

/* 24. See More — H4, right-aligned */
.see-more-wrap {
  text-align: right;
  margin-top: 24px;
}

.see-more {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.see-more:hover {
  opacity: 0.7;
  transform: translateX(6px);
}

/* See More colors per section */
.section-lego            .see-more { color: var(--black); }
.section-gogoro          .see-more { color: var(--red); }
.section-alipayeu        .see-more { color: var(--red); }
.section-alipayhk        .see-more { color: var(--white); }
.section-extraterrestrially .see-more { color: var(--red); }
.section-playground      .see-more { color: var(--black); }
.section-htc             .see-more { color: var(--red); }
.section-snkrs           .see-more { color: var(--red); }

/* 25. Video Wrap */
.video-wrap {
  width: 100%;
  overflow: hidden;
}

.video-wrap video {
  width: 100%;
  display: block;
}

/* 26. Filmstrip Carousel */
.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--black);
}

.carousel-track {
  display: flex;
  height: 100%;
  align-items: center;
  transition: transform 0.6s ease;
  will-change: transform;
}

.carousel-track img {
  height: 100%;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: var(--white);
  border: none;
  width: 48px;
  height: 72px;
  font-size: 1.4rem;
  font-family: var(--font-body);
  font-weight: 300;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(0, 0, 0, 0.75);
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

/* On light-bg sections, darken the arrow overlay slightly differently */
.section-alipayeu .carousel-prev,
.section-alipayeu .carousel-next,
.section-playground .carousel-prev,
.section-playground .carousel-next,
.section-snkrs .carousel-prev,
.section-snkrs .carousel-next {
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
}

/* Legacy slideshow (for project detail pages) */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.slides img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: none;
}

.slides img:first-child {
  display: block;
}

.slides-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.slides-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: block;
  transition: background 0.2s;
  flex-shrink: 0;
}

.slides-dots span.active {
  background: var(--white);
}

/* 27. GIF Grid — no gaps, 7 columns */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-top: 40px;
}

.gif-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 28. Footer */
.footer {
  background: var(--nearblack);
  text-align: center;
  padding: 60px 24px;
}

.footer img {
  display: inline-block;
  width: auto;
  height: 56px;
}

.footer a {
  display: inline-block;
}

/* ============================================================
   29. Detail Page Utilities (used by project pages)
   ============================================================ */

.section {
  padding: 64px 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey);
  margin-bottom: 24px;
  line-height: 1em;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.meta-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey);
  display: block;
  margin-bottom: 4px;
  line-height: 1em;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item span:last-child {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--white);
}

.project-intro {
  max-width: 720px;
  margin-bottom: 40px;
}

.project-intro p {
  font-size: 1.2rem;
  line-height: 1.5em;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  padding: 48px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 64px;
}

.project-nav a {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--white);
  text-decoration: none;
  font-size: 1.2rem;
  transition: opacity 0.15s;
}

.project-nav a:hover {
  opacity: 0.7;
}

.hero-img {
  width: 100%;
  display: block;
  margin-bottom: 32px;
}

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

.img-grid a {
  display: block;
  overflow: hidden;
}

.img-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

.img-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.img-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.img-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-bottom: 16px;
}

.embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

/* About page */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}

.about-photo {
  width: 100%;
}

.key-stats {
  list-style: none;
  padding-left: 0;
  margin: 24px 0;
}

.key-stats li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.2rem;
  line-height: 1.5em;
}

.key-stats li::before {
  content: "→ ";
  font-weight: 600;
}

/* Spacing helpers */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-64 { margin-top: 64px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }

/* ============================================================
   30. Lego Detail Page
   ============================================================ */

/* Section with decorative background GIF */
.section-with-gif {
  position: relative;
  overflow: hidden;
}

.section-with-gif > .container {
  position: relative;
  z-index: 1;
}

.bg-gif {
  position: absolute;
  width: 264px;
  height: auto;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
  /* position set per-section via inline style */
}

/* Lego hero section */
.lego-hero-inner {
  padding: 80px 0 40px;
}

.lego-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 48px;
}

.lego-qr {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 24px 0 8px;
  border-radius: 8px;
}

/* Achievements list — H4 style (Orbitron 900 2rem) */
.lego-achievements {
  list-style: disc;
  padding-left: 1.5em;
  margin: 0;
}

.lego-achievements li {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2em;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.lego-achievements li:last-child {
  margin-bottom: 0;
}

/* Brick rows (Background section) */
.brick-rows {
  margin-top: 40px;
}

.brick-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 40px;
}

.brick-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Homepage V3 media strip */
.lego-v3-strip {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin: 40px 0;
  overflow-x: auto;
}

/* Yellow video in strip: constrained to ~green-video width, with extra left gap */
.lego-v3-strip .video-wrap {
  flex: 0 0 480px;
  margin-left: 24px;
}

.lego-phone {
  display: block;
  flex-shrink: 0;
  width: auto;
  object-fit: contain;
}

.lego-phone-sm { height: 260px; }
.lego-phone-md { height: 320px; }
.lego-phone-lg { height: 380px; }

/* State labels */
.lego-state-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  margin-top: 40px;
  display: block;
}

/* 4-column media grid */
.media-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

/* 3-column media grid */
.media-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

/* 2-column media grid */
.media-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

/* Thumbnail Carousel (one image at a time + thumbnails below) */
.thumb-carousel {
  width: 100%;
  margin-top: 40px;
}

.thumb-carousel-main {
  width: 100%;
  height: 520px;
  background: var(--black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.thumb-carousel-main img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.thumb-carousel-main img.tc-active {
  opacity: 1;
}

.thumb-carousel-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  /* hide scrollbar */
  scrollbar-width: none;
}

.thumb-carousel-thumbs::-webkit-scrollbar {
  display: none;
}

.thumb-carousel-thumbs img {
  height: 72px;
  width: 72px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  display: block;
}

.thumb-carousel-thumbs img.tc-active {
  opacity: 1;
}

/* Center-aligned thumb strip (Campaign Hub) */
.thumb-carousel-thumbs.tc-centered {
  justify-content: center;
}

/* CDS thumbnail carousel — landscape display */
.thumb-carousel.tc-landscape .thumb-carousel-main {
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Parallax banner */
.parallax-banner {
  width: 100%;
  min-height: 56vh;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ============================================================
   31. Project Page Shared Utilities
   ============================================================ */

/* ---- Custom Video Player ---- */
.video-player {
  position: relative;
  display: block;
  overflow: hidden;
  background: #000;
  line-height: 0;
}

.video-player video {
  display: block;
  width: 100%;
  cursor: default;
}

.vp-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.video-player:hover .vp-overlay,
.video-player.vp-paused .vp-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Center play/pause button */
.vp-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 56px;
  height: 56px;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.vp-center-btn svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

/* Bottom bar */
.vp-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
}

.vp-seek {
  flex: 1;
  height: 4px;
  cursor: pointer;
  accent-color: #fff;
  min-width: 0;
}

.vp-time {
  font-size: 0.72rem;
  color: #fff;
  white-space: nowrap;
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.vp-mute-btn,
.vp-fs-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vp-mute-btn svg,
.vp-fs-btn svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.vp-vol-slider {
  width: 56px;
  height: 4px;
  cursor: pointer;
  accent-color: #fff;
  flex-shrink: 0;
}

/* Prev / Next page navigation (H3 style, space-between) */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Full-bleed banner video (HTC top) — matches parallax-hero height */
.banner-video-wrap {
  position: relative;
  width: 100%;
  min-height: 70vh;
  overflow: hidden;
}

.banner-video-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140%;
  object-fit: cover;
  display: block;
}

/* Scroll-driven parallax hero banner (AlipayEU / HK top) */
.parallax-hero {
  width: 100%;
  min-height: 70vh;
  background-size: cover;
  background-position: center 0px;
  background-repeat: no-repeat;
}

/* Gogoro 50/50 content grid */
.gogoro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: stretch;
}

.gogoro-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gogoro-left video {
  width: 100%;
  display: block;
}

.gogoro-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* HTC 50/50 split: video left + square grid right */
.split-50 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.split-50 video {
  width: 100%;
  display: block;
}

/* Square-crop asset grid — 3 columns */
.square-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.square-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Square-crop asset grid — 4 columns (UI Stuff) */
.square-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.square-grid-4 img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Cascading 2-column image grid (AlipayEU / HK) */
.cascade-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.cascade-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cascade-col--offset {
  margin-top: 60px;
}

.cascade-col img {
  width: 100%;
  height: auto;
  display: block;
}

.cascade-caption {
  font-size: 1rem;
  margin-top: 8px;
  opacity: 0.75;
}

/* Horizontal GIF row — equal square crops */
.gif-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.gif-row img {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* App download buttons (AlipayHK) */
.app-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 28px 56px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  text-decoration: none;
  transition: opacity 0.15s;
  min-width: 220px;
}

.btn-app:hover {
  opacity: 0.8;
}

/* AlipayEU — Components in Motion horizontal row */
.motion-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.motion-states {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}

.motion-states img {
  width: 88px;
  height: auto;
  display: block;
}

.motion-blue {
  flex-shrink: 0;
}

.motion-blue img {
  width: 260px;
  height: auto;
  display: block;
}

.motion-fields {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}

.motion-fields img {
  width: 180px;
  height: auto;
  display: block;
}

/* ============================================================
   31b. Mobile Nav — Hamburger button + overlay
        Hidden on desktop, shown on mobile via media query
   ============================================================ */

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--red);
  z-index: 1001;
  position: relative;
}

.nav-burger-icon {
  font-size: 2.8rem;
  font-weight: 200;
  line-height: 1;
  display: block;
  transition: transform 0.3s ease;
  font-style: normal;
}

.nav-burger.is-open .nav-burger-icon {
  transform: rotate(45deg);
}

.nav-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--white);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

@keyframes navLinkIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navLinkOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(16px);
  }
}

.nav-overlay a {
  color: var(--red);
  font-size: 2.6rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
  opacity: 0;
}

.nav-overlay.is-open a {
  animation: navLinkIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.nav-overlay.is-open a:nth-child(1) { animation-delay: 0.08s; }
.nav-overlay.is-open a:nth-child(2) { animation-delay: 0.15s; }
.nav-overlay.is-open a:nth-child(3) { animation-delay: 0.22s; }

.nav-overlay.is-closing a {
  animation: navLinkOut 0.2s ease forwards;
}

.nav-overlay.is-closing a:nth-child(1) { animation-delay: 0s; }
.nav-overlay.is-closing a:nth-child(2) { animation-delay: 0.04s; }
.nav-overlay.is-closing a:nth-child(3) { animation-delay: 0.08s; }

/* ============================================================
   32. Media Queries
   ============================================================ */

@media (max-width: 1024px) {
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .img-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2.8rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.8rem; }
  h4 { font-size: 1.4rem; }

  .section-heading {
    font-size: 2.8rem;
  }

  .hero-heading {
    font-size: 2.8rem;
  }

  .cta-link {
    font-size: 2rem;
  }

  .container,
  .nav-inner {
    padding: 0 20px;
  }

  .vpn-notice {
    padding-left: 20px;
    padding-right: 20px;
  }

  .project-50-50,
  .body-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .gif-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .img-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand-logos-row {
    gap: 24px;
  }

  .brand-logos-row img {
    height: 36px;
  }

  .see-more {
    font-size: 1.4rem;
  }

  .project-section {
    padding: 60px 0;
  }

  .nav-logo img {
    height: 44px;
  }

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

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

  /* --- Hamburger: show burger, hide text links --- */
  .nav-links {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  /* Raise nav above overlay so burger remains clickable */
  .nav {
    z-index: 1002;
  }

  /* --- Global: disable parallax on mobile --- */
  .parallax-hero {
    background-attachment: scroll;
    min-height: 40vh;
  }

  .parallax-banner {
    background-attachment: scroll;
    background-size: cover;
    min-height: 30vh;
  }

  /* Disable JS-driven parallax translate on banner video */
  .banner-video-wrap video {
    transform: none !important;
    height: 100%;
    position: absolute;
  }

  /* --- Homepage: hero heading — prevent truncation --- */
  .hero-heading {
    white-space: normal;
    overflow: visible;
    word-break: break-word;
  }

  /* --- Lego: hero grid → single column --- */
  .lego-hero-grid {
    grid-template-columns: 1fr;
  }

  /* Center QR code and scan label on mobile */
  .lego-qr {
    margin-left: auto;
    margin-right: auto;
  }

  .lego-qr + p {
    text-align: center;
  }

  /* Scale down bg-gif and push to right edge */
  .bg-gif {
    width: 211px !important;
    right: -16px !important;
  }

  /* --- Lego: brick rows → reduce gap --- */
  .brick-row {
    gap: 16px;
    margin-bottom: 16px;
  }

  /* --- Lego: v3 strip → video on top, phones equal-size row below --- */
  .lego-v3-strip {
    flex-wrap: wrap;
    overflow: visible;
  }

  .lego-v3-strip .video-wrap {
    order: -1;
    flex: 0 0 100%;
    margin-left: 0;
  }

  .lego-phone {
    flex: 1;
    min-width: 0;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    object-position: top;
    height: auto !important;
  }

  .lego-phone-sm,
  .lego-phone-md,
  .lego-phone-lg {
    height: auto;
  }

  /* --- Lego: reduce gap between campaign hub and design system banner --- */
  .ds-banner-top {
    padding-top: 48px !important;
  }

  /* --- Lego: member hub → 1 video per row --- */
  .media-4col {
    grid-template-columns: 1fr;
  }

  /* --- Lego: campaign hub → stacked --- */
  .media-2col {
    grid-template-columns: 1fr;
  }

  /* --- Gogoro: grid → single column, all full width --- */
  .gogoro-grid {
    grid-template-columns: 1fr;
  }

  .gogoro-left,
  .gogoro-right {
    width: 100%;
  }

  .gogoro-right img {
    width: 100%;
    height: auto;
  }

  /* --- AlipayHK + HTC: split-50 → single column --- */
  .split-50 {
    grid-template-columns: 1fr;
  }

  .split-50 .embed-wrap,
  .split-50 iframe {
    width: 100%;
  }

  /* --- AlipayEU: Components in Motion → custom stacking --- */
  .motion-row {
    flex-direction: column;
    gap: 32px;
  }

  /* 3 status GIFs stay side by side */
  .motion-states {
    width: 100%;
    justify-content: space-between;
  }

  .motion-states img {
    flex: 1;
    width: auto;
    max-width: 30%;
  }

  /* Blue gif: full width */
  .motion-blue {
    width: 100%;
  }

  .motion-blue img {
    width: 100%;
    height: auto;
  }

  /* Text field GIFs: each on its own row */
  .motion-fields {
    flex-direction: column;
    width: 100%;
    gap: 24px;
  }

  .motion-fields img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }

  .section-heading {
    font-size: 2.2rem;
  }

  .hero-heading {
    font-size: 2.2rem;
  }

  .cta-link {
    font-size: 1.6rem;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .gif-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* ============================================================
   33. Contact Nav Button
   ============================================================ */

/* .nav-contact inherits all styles from .nav-links a */


/* ============================================================
   35. Focus Visible States
   ============================================================ */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.section-lego :focus-visible,
.section-alipayeu :focus-visible,
.section-playground :focus-visible,
.section-snkrs :focus-visible {
  outline-color: var(--black);
}

/* ============================================================
   36. Micro-Interaction Upgrades
   ============================================================ */

/* Carousel button click feedback */
.carousel-prev:active,
.carousel-next:active {
  transform: translateY(-50%) scale(0.9);
}

/* Brand logos */
.brand-logos-row img {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  cursor: default;
}

.brand-logos-row img:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

/* Nav logo */
.nav-logo {
  transition: opacity 0.2s;
}

.nav-logo:hover {
  opacity: 0.75;
}

/* 4th nav overlay link (Contact) */
.nav-overlay.is-open a:nth-child(4) { animation-delay: 0.29s; }
.nav-overlay.is-closing a:nth-child(4) { animation-delay: 0.12s; }

/* ============================================================
   37. Hero Entrance Animation (index.html)
   ============================================================ */

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-banner  { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.hero-heading { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both; }
.cta-buttons  { animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.85s both; }
.brand-logos  { animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.05s both; }

/* ============================================================
   38. Section Scroll Reveal
   js-animate class added by JS enables these states.
   Without JS: everything renders normally (progressive enhancement).
   ============================================================ */

/* Section content — starts hidden, revealed by JS adding .in-view */
.js-animate .project-section .section-heading {
  opacity: 0;
  transform: translateX(-56px) translateY(32px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-animate .project-section .p-media,
.js-animate .project-section .p-body,
.js-animate .project-section .body-split,
.js-animate .project-section .gif-grid {
  opacity: 0;
  transform: translateY(72px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Revealed states */
.js-animate .project-section .section-heading.in-view {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

.js-animate .project-section .p-media.in-view,
.js-animate .project-section .p-body.in-view,
.js-animate .project-section .body-split.in-view,
.js-animate .project-section .gif-grid.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   39. Prefers-Reduced-Motion — disable all custom animations
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .hero-banner, .hero-heading, .cta-buttons, .brand-logos {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .js-animate .project-section .section-heading,
  .js-animate .project-section .p-media,
  .js-animate .project-section .p-body,
  .js-animate .project-section .body-split,
  .js-animate .project-section .gif-grid,
  .js-animate .sr-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .see-more:hover,
  .cta-link:hover {
    transform: none;
  }
}

/* ============================================================
   40. About page — mailto link
   ============================================================ */

.about-mailto {
  color: inherit;
  text-decoration: underline;
  transition: color 0.2s;
}

.about-mailto:hover {
  color: var(--red);
}

/* ============================================================
   41. Detail page scroll reveal — generic sr-item classes
   ============================================================ */

.js-animate .sr-item {
  opacity: 0;
  transform: translateY(72px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-animate .sr-item--left {
  transform: translateX(-56px) translateY(32px);
}

.js-animate .sr-item.in-view {
  opacity: 1;
  transform: none;
}
