/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Kanit', sans-serif;
  overflow: hidden;
}

/* ===== macOS DESKTOP ===== */
#macos-desktop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, #1a0533 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, #0d1f3c 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, #1a0a2e 0%, transparent 50%),
    linear-gradient(135deg, #0d0d1a 0%, #1a1040 40%, #0d1a2e 100%);
  z-index: 0;
}
#macos-desktop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.1) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 15%, rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 40%, rgba(255,255,255,0.08) 0%, transparent 100%);
}

/* ===== macOS WINDOW ===== */
#macos-window {
  position: fixed;
  inset: 12px;
  z-index: 10;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 30px 80px rgba(0,0,0,0.7),
    0 8px 24px rgba(0,0,0,0.5);
  animation: windowOpen 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
#macos-window.minimized {
  animation: windowMinimize 0.4s cubic-bezier(0.4,0,1,1) forwards;
  pointer-events: none;
}
@keyframes windowMinimize {
  to { opacity: 0; transform: scale(0.6) translateY(60px); }
}

/* ===== TITLE BAR ===== */
#macos-titlebar {
  flex-shrink: 0;
  height: 44px;
  background: rgba(30, 30, 36, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 100;
  -webkit-app-region: drag;
  user-select: none;
}

#macos-traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  width: 64px;
}
.traffic-light {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  outline: none;
  cursor: pointer !important;
  position: relative;
  transition: filter 0.15s;
  flex-shrink: 0;
}
#tl-close  { background: #FF5F57; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2); }
#tl-min    { background: #FEBC2E; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2); }
#tl-max    { background: #28C840; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2); }
.traffic-light:hover { filter: brightness(1.15); }
.traffic-light:active { filter: brightness(0.85); }

/* Icons on hover */
#macos-traffic-lights:hover #tl-close::after  { content: '×'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: rgba(0,0,0,0.6); line-height: 1; }
#macos-traffic-lights:hover #tl-min::after    { content: '−'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: rgba(0,0,0,0.5); line-height: 1; }
#macos-traffic-lights:hover #tl-max::after    { content: '↔'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 8px; color: rgba(0,0,0,0.5); line-height: 1; }

#macos-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
}
.macos-titlebar-right { width: 64px; }

/* ===== WINDOW CONTENT ===== */
#macos-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
}
#macos-content::-webkit-scrollbar { width: 8px; }
#macos-content::-webkit-scrollbar-track { background: transparent; }
#macos-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}
#macos-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

#root {
  background: #0C0C0C;
  color: #D7E2EA;
  overflow-x: clip;
  position: relative;
}

/* ===== GRADIENT HEADING ===== */
.hero-heading {
  background: linear-gradient(180deg, #646973 0%, #BBCCD7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  width: 100%;
}

/* ===== CONTACT BUTTON ===== */
.contact-btn {
  display: inline-block;
  padding: 12px 36px;
  border-radius: 999px;
  background: linear-gradient(123deg, #18011F 7%, #B600A8 37%, #7621B0 72%, #BE4C00 100%);
  box-shadow: 0px 4px 4px rgba(181,1,167,0.25), inset 4px 4px 12px #7721B1;
  outline: 2px solid white;
  outline-offset: -3px;
  color: white;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: clamp(0.75rem, 1.2vw, 1rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.contact-btn:hover { opacity: 0.85; transform: translateY(-2px); }

/* ===== LIVE / VIEW BUTTON ===== */
.live-btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 999px;
  border: 2px solid #D7E2EA;
  color: #D7E2EA;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: clamp(0.75rem, 1.1vw, 0.95rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}
.live-btn:hover { background: rgba(215,226,234,0.1); }

/* ===== HERO SECTION ===== */
.hero-section {
  height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  position: relative;
  padding: 0 clamp(16px, 4vw, 48px);
}

.hero-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: clamp(20px, 3vw, 36px);
  width: 100%;
}
.hero-nav a {
  color: #D7E2EA;
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(0.8rem, 1.4vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: opacity 0.2s;
}
.hero-nav a:hover { opacity: 0.7; }

.hero-heading-wrap {
  overflow: hidden;
  margin-top: clamp(-24px, -2vw, 8px);
}
.hero-section .hero-heading {
  font-size: clamp(12vw, 17.5vw, 17.5vw);
  display: block;
}

/* Portrait */
.hero-portrait {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 10;
  width: clamp(220px, 38vw, 500px);
  pointer-events: none;
}
.hero-portrait img {
  width: 100%;
  display: block;
  pointer-events: auto;
}
.hero-avatar-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  color: rgba(215,226,234,0.3);
  letter-spacing: -0.02em;
}

/* Skills icons */
.hero-skills {
  margin-top: auto;
  padding-bottom: clamp(16px, 2.5vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 14px);
}
.skills-label {
  color: rgba(215, 226, 234, 0.5);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
  text-align: left;
  padding-left: clamp(4px, 1vw, 8px);
}
.skills-row {
  display: flex;
  gap: clamp(8px, 1.2vw, 14px);
  flex-wrap: wrap;
}
.skills-row img {
  width: clamp(48px, 5.5vw, 68px);
  height: clamp(48px, 5.5vw, 68px);
  object-fit: contain;
  border-radius: 12px;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}
.skills-row img:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* Bottom bar */
.hero-bottom {
  padding-bottom: clamp(28px, 3vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.hero-desc {
  color: #D7E2EA;
  font-weight: 300;
  font-size: clamp(0.7rem, 1.3vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  max-width: clamp(140px, 18vw, 240px);
  padding-left: clamp(4px, 1vw, 8px);
}

/* ===== MARQUEE SECTION ===== */
.marquee-section {
  background: #0C0C0C;
  padding: clamp(60px, 8vw, 120px) 0 clamp(20px, 3vw, 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.marquee-track { overflow: hidden; }
.marquee-inner {
  display: flex;
  gap: 12px;
  will-change: transform;
}
.marquee-inner img,
.marquee-inner video {
  width: 420px;
  height: 270px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(30, 30, 40, 0.5);
}

/* ===== ABOUT SECTION ===== */
.about-section {
  background: #0C0C0C;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(60px, 8vw, 120px) clamp(16px, 5vw, 48px);
}
.about-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  max-width: 700px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.about-heading {
  font-size: clamp(3rem, 12vw, 140px) !important;
  white-space: nowrap;
}
.about-text {
  color: #D7E2EA;
  font-weight: 500;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  line-height: 1.7;
  max-width: 560px;
}

/* Decorative corner images */
.about-deco {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.about-deco-tl { width: clamp(90px, 15vw, 210px); top: 4%; left: clamp(8px, 4vw, 60px); }
.about-deco-bl { width: clamp(75px, 13vw, 180px); bottom: 8%; left: clamp(16px, 10vw, 120px); }
.about-deco-tr { width: clamp(90px, 15vw, 210px); top: 4%; right: clamp(8px, 4vw, 60px); }
.about-deco-br { width: clamp(100px, 16vw, 220px); bottom: 8%; right: clamp(16px, 10vw, 120px); }

/* Animated text */
.animated-text { position: relative; }
.char-wrap { position: relative; display: inline-block; }
.char-real { position: absolute; top: 0; left: 0; opacity: 0.2; }
.char-placeholder { visibility: hidden; }

/* ===== SERVICES SECTION ===== */
.services-section {
  background: #ffffff;
  border-radius: clamp(30px, 5vw, 60px) clamp(30px, 5vw, 60px) 0 0;
  padding: clamp(60px, 8vw, 120px) clamp(16px, 6vw, 80px);
  color: #0C0C0C;
}
.services-heading {
  background: linear-gradient(180deg, #3a3a3a 0%, #0C0C0C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  font-size: clamp(3rem, 12vw, 140px);
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 80px);
  white-space: nowrap;
}
.services-list {
  max-width: 900px;
  margin: 0 auto;
}
.service-item {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(24px, 3vw, 48px) 0;
  border-bottom: 1px solid rgba(12,12,12,0.15);
}
.service-item:first-child { border-top: 1px solid rgba(12,12,12,0.15); }
.service-num {
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 100px);
  color: #0C0C0C;
  line-height: 1;
  flex-shrink: 0;
  width: clamp(60px, 10vw, 130px);
}
.service-content { flex: 1; padding-top: clamp(4px, 0.8vw, 12px); }
.service-name {
  display: block;
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.9rem);
  text-transform: uppercase;
  color: #0C0C0C;
  margin-bottom: 8px;
}
.service-desc {
  font-weight: 300;
  font-size: clamp(0.8rem, 1.4vw, 1.15rem);
  color: #0C0C0C;
  opacity: 0.6;
  line-height: 1.6;
  max-width: 600px;
}

/* ===== PROJECTS SECTION ===== */
.projects-section {
  background: #0C0C0C;
  border-radius: clamp(30px, 5vw, 60px) clamp(30px, 5vw, 60px) 0 0;
  margin-top: clamp(-28px, -3vw, -40px);
  position: relative;
  z-index: 10;
  padding: clamp(60px, 8vw, 120px) clamp(16px, 5vw, 48px) clamp(40px, 6vw, 80px);
}
.projects-heading {
  font-size: clamp(3rem, 12vw, 140px) !important;
  text-align: center;
  margin-bottom: clamp(40px, 5vw, 60px);
  white-space: nowrap;
}

/* Projects stack — normal scrolling with sticky headers */
.projects-stack {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.project-sticky {
  position: relative;
}

/* Card with header + image grid */
.project-card {
  position: relative;
  border: 2px solid #D7E2EA;
  border-radius: clamp(24px, 4vw, 50px);
  background: #0C0C0C;
  overflow: visible;
}

/* Sticky card header */
.card-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(30, 30, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(14px, 2vw, 24px) clamp(16px, 2.5vw, 32px);
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(215,226,234,0.1);
  border-radius: clamp(22px, 3.8vw, 46px) clamp(22px, 3.8vw, 46px) 16px 16px;
  margin: -2px -2px 0 -2px;
  width: calc(100% + 4px);
}

.card-num {
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 90px);
  background: linear-gradient(180deg, #646973 0%, #BBCCD7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  flex-shrink: 0;
}
.card-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-category {
  font-weight: 300;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  color: rgba(215,226,234,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.card-title {
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.8rem);
  color: #D7E2EA;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Image masonry inside card body */
.card-grid {
  columns: 8;
  column-gap: clamp(6px, 1vw, 12px);
  padding: clamp(16px, 2.5vw, 32px);
}
@media (max-width: 1400px) { .card-grid { columns: 7; } }
@media (max-width: 1100px) { .card-grid { columns: 6; } }
@media (max-width: 850px) { .card-grid { columns: 5; } }
@media (max-width: 600px) { .card-grid { columns: 4; } }
@media (max-width: 400px) { .card-grid { columns: 3; } }

/* Card 01 (amazon) — smaller images */
#card0 ~ .card-grid,
#card0 .card-grid {
  columns: 8;
}
@media (max-width: 1400px) { #card0 ~ .card-grid, #card0 .card-grid { columns: 7; } }
@media (max-width: 1100px) { #card0 ~ .card-grid, #card0 .card-grid { columns: 6; } }
@media (max-width: 850px) { #card0 ~ .card-grid, #card0 .card-grid { columns: 5; } }
@media (max-width: 600px) { #card0 ~ .card-grid, #card0 .card-grid { columns: 4; } }
@media (max-width: 400px) { #card0 ~ .card-grid, #card0 .card-grid { columns: 3; } }

/* Card 02 (posters) — medium-large images */
#card1 .card-grid {
  columns: 5;
}
@media (max-width: 1400px) { #card1 .card-grid { columns: 5; } }
@media (max-width: 1100px) { #card1 .card-grid { columns: 4; } }
@media (max-width: 850px) { #card1 .card-grid { columns: 3; } }
@media (max-width: 600px) { #card1 .card-grid { columns: 2; } }
@media (max-width: 400px) { #card1 .card-grid { columns: 2; } }

/* Card 04 (holiday) — medium-large images */
#card3 .card-grid {
  columns: 5;
}
@media (max-width: 1400px) { #card3 .card-grid { columns: 5; } }
@media (max-width: 1100px) { #card3 .card-grid { columns: 4; } }
@media (max-width: 850px) { #card3 .card-grid { columns: 3; } }
@media (max-width: 600px) { #card3 .card-grid { columns: 2; } }
@media (max-width: 400px) { #card3 .card-grid { columns: 2; } }

.card-grid img {
  width: 100%;
  height: auto;
  margin-bottom: clamp(6px, 1vw, 12px);
  border-radius: clamp(10px, 1.5vw, 20px);
  cursor: zoom-in;
  display: block;
  position: relative;
  will-change: transform;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-grid img:hover {
  transform: translateY(-22px) scale(1.06) !important;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Shine overlay via pseudo via wrapper — injected in JS */
.card-img-wrap {
  position: relative;
  display: block;
  border-radius: inherit;
  overflow: hidden;
}
.card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--tilt-shine, transparent);
  border-radius: inherit;
  pointer-events: none;
  transition: background 0.05s;
  z-index: 2;
}

/* Card 03 (cabinet) — infinite carousel */
#card2 .card-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(8px, 1.2vw, 16px);
  overflow: hidden;
  columns: unset;
  padding: clamp(16px, 2.5vw, 32px);
}

#card2 .card-grid .carousel-track {
  display: flex;
  gap: clamp(8px, 1.2vw, 16px);
  animation: carousel-scroll 20s linear infinite;
  will-change: transform;
}

#card2 .card-grid img {
  flex: 0 0 auto;
  width: clamp(200px, 28vw, 320px);
  height: clamp(280px, 38vw, 420px);
  object-fit: cover;
  margin-bottom: 0;
  border-radius: clamp(10px, 1.5vw, 20px);
}

@keyframes carousel-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.card-grid img:hover {
  transform: scale(1.03);
  opacity: 0.92;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
  background: #0C0C0C;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 28px);
  padding: clamp(60px, 8vw, 120px) clamp(16px, 5vw, 48px);
  text-align: center;
}
.contact-heading {
  font-size: clamp(3rem, 12vw, 140px) !important;
  white-space: nowrap;
}
.contact-sub {
  color: rgba(215,226,234,0.6);
  font-weight: 300;
  font-size: clamp(0.85rem, 1.5vw, 1.2rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.contact-btn-lg {
  padding: 16px 52px;
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  margin-top: clamp(8px, 1.5vw, 16px);
}
.contact-footer {
  color: rgba(215,226,234,0.25);
  font-weight: 300;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  margin-top: clamp(24px, 3vw, 40px);
  letter-spacing: 0.05em;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  object-fit: contain;
  animation: lbIn 0.3s ease;
}
@keyframes lbIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 2px solid rgba(215,226,234,0.4);
  color: #D7E2EA;
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(215,226,234,0.1); }

/* ===== FADE-IN ANIMATIONS ===== */
.fade-in, .fade-in-x {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in { transform: translateY(30px); }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-x.visible { opacity: 1; transform: translateX(0) !important; }

/* ===== QR MODAL (iOS Frosted Glass) ===== */
.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.qr-modal.active { display: flex; }

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: qrFadeIn 0.3s ease;
}

.qr-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  font-size: clamp(4rem, 14vw, 12rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 2px rgba(215, 226, 234, 0.35);
  text-stroke: 2px rgba(215, 226, 234, 0.35);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: none;
}

.qr-modal.active .qr-bg-text {
  animation: qrTextSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes qrTextSlideUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(80px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%);
  }
}

.qr-content {
  position: relative;
  z-index: 1;
  animation: qrScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.qr-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 360px;
  position: relative;
  overflow: hidden;
}

.qr-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.95));
  z-index: -1;
}

.qr-card img {
  width: clamp(200px, 50vw, 280px);
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.qr-hint {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: center;
}

.qr-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.qr-close:hover { background: rgba(255, 255, 255, 0.25); }

@keyframes qrFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes qrScaleIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== CUSTOM CURSOR ===== */
* { cursor: none !important; }

#custom-cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  top: -6px;
  left: -6px;
  transition:
    width 0.25s cubic-bezier(0.34,1.56,0.64,1),
    height 0.25s cubic-bezier(0.34,1.56,0.64,1),
    top 0.25s cubic-bezier(0.34,1.56,0.64,1),
    left 0.25s cubic-bezier(0.34,1.56,0.64,1),
    background 0.25s ease,
    backdrop-filter 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow:
    0 0 0 0.5px rgba(255,255,255,0.4),
    0 2px 8px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.6);
  mix-blend-mode: normal;
}
#custom-cursor.hover {
  width: 44px;
  height: 44px;
  top: -22px;
  left: -22px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.35),
    0 4px 20px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
#custom-cursor.clicking {
  width: 8px;
  height: 8px;
  top: -4px;
  left: -4px;
  background: rgba(255,255,255,1);
}
#custom-cursor-dot {
  display: none;
}

/* ===== SPOTLIGHT CANVAS ===== */
#spotlight-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: screen;
}

/* ===== IMAGE SHIMMER ===== */
.shimmer-wrap {
  overflow: hidden;
  position: relative;
}
.shimmer-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.18) 50%,
    transparent 70%
  );
  animation: shimmer-scan 0.6s ease forwards;
  pointer-events: none;
  border-radius: inherit;
}
@keyframes shimmer-scan {
  0%   { left: -100%; }
  100% { left: 160%; }
}

/* ===== SKILLS TILT TRANSITION ===== */
.skills-row img {
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s !important;
  will-change: transform;
}

/* ===== DYNAMIC ISLAND ===== */
#dynamic-island {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%) scaleX(0.4) scaleY(0.6);
  z-index: 99990;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center top;
}
#dynamic-island.show {
  opacity: 1;
  transform: translateX(-50%) scaleX(1) scaleY(1);
  pointer-events: auto;
}
#di-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(18, 18, 20, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.07);
  white-space: nowrap;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.01em;
}
#di-icon { font-size: 15px; line-height: 1; }

/* ===== LIQUID GLASS NAV ===== */
.hero-nav {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-nav.glass {
  position: fixed !important;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  padding: 10px 28px !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(255,255,255,0.05);
  gap: clamp(16px, 3vw, 36px);
  z-index: 9999;
  /* Liquid rainbow shimmer */
  --shimmer-x: 50%;
  --shimmer-y: 50%;
}
.hero-nav.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at var(--shimmer-x) var(--shimmer-y),
    rgba(182, 0, 168, 0.12) 0%,
    rgba(118, 33, 176, 0.08) 40%,
    transparent 70%
  );
  pointer-events: none;
  transition: background 0.1s;
}
.hero-nav.glass a {
  color: rgba(255,255,255,0.85) !important;
  font-size: 13px !important;
  letter-spacing: 0.06em;
}
.hero-nav.glass a:hover {
  opacity: 1 !important;
  color: #fff !important;
}

/* ===== HAPTIC BUTTON PULSE ===== */
.contact-btn, .live-btn {
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s !important;
}
.contact-btn:active, .live-btn:active {
  transform: scale(0.94) !important;
}
.btn-pulse {
  animation: hapticPulse 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes hapticPulse {
  0%   { transform: scale(1); }
  20%  { transform: scale(0.93); }
  50%  { transform: scale(1.04); }
  75%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* ===== FOCUS RING (SF style) ===== */
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.6), 0 0 0 1px rgba(10, 132, 255, 0.9) !important;
  border-radius: 6px;
}

/* ===== SPRING SCROLL BOUNCE ===== */
#macos-content {
  overscroll-behavior-y: contain;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero-section .hero-heading { font-size: 15vw; }
  .hero-portrait { width: 60vw; }
  .about-deco-tl, .about-deco-bl, .about-deco-tr, .about-deco-br { display: none; }
  .services-heading, .about-heading, .projects-heading, .contact-heading {
    font-size: clamp(2.5rem, 14vw, 60px) !important;
  }
}

@media (max-width: 480px) {
  .card-top { gap: 8px; }
  .card-num { font-size: 2.2rem; }
}
