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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  background: #0a0a0a;
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.icon {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none;
}

/* Floating Classroom Chat Owl */
.floating-owl {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  width: 95px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  display: block;
  text-decoration: none;
  cursor: pointer;
  animation: owlFloat 3.5s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

@keyframes owlFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.floating-owl-img {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  filter: drop-shadow(0 6px 14px rgba(14, 178, 187, 0.4));
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.3s ease;
  will-change: transform, filter;
  pointer-events: auto;
}

.floating-owl:hover .floating-owl-img {
  transform: scale(1.12) rotate(4deg);
  filter: drop-shadow(0 12px 24px rgba(14, 178, 187, 0.65)) drop-shadow(0 0 10px rgba(0, 123, 255, 0.4));
}

.floating-owl:active .floating-owl-img {
  transform: scale(0.95);
}

.floating-owl:focus-visible {
  outline: 2px dashed #0eb2bb;
  outline-offset: 6px;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .floating-owl {
    top: 16px;
    left: 16px;
    width: 72px;
  }
}

@media (max-width: 480px) {
  .floating-owl {
    top: 12px;
    left: 12px;
    width: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-owl {
    animation: none;
  }
  .floating-owl-img {
    transition: none;
  }
}

/* Navigation */
.nav {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(17, 17, 17, 0.8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid #2a2a2a;
}

.nav.top-zero {
  top: 0 !important;
  transition: top 0.3s ease; /* Smooth transition when banner closes */
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(90deg, #0eb2bb, #007bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  transition: transform 0.3s;
}

.nav-logo:hover {
  transform: scale(1.05);
}

.nav-links {
  display: none;
  gap: 32px;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
}

.nav-link:hover {
  color: #0eb2bb;
  transform: scale(1.1);
}

.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  color: #ccc;
  padding: 8px;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu {
  display: none;
  padding: 16px 0;
}

.mobile-menu.active {
  display: block;
}

.mobile-link {
  display: block;
  padding: 12px 24px;
  color: #ccc;
  text-decoration: none;
  transition: all 0.3s;
}

.mobile-link:hover {
  color: #fff;
  background: #2a2a2a;
  border-radius: 8px;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-content {
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

@media (min-width: 768px) {
  .hero-content {
    flex-direction: row;
  }
}

.hero-image {
  flex-shrink: 0;
  animation: scaleIn 0.8s ease 0.2s both;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-image img {
  width: 256px;
  height: 256px;
  border-radius: 50%;
  border: 4px solid #0eb2bb;
  box-shadow: 0 0 30px rgba(14, 178, 187, 0.3);
  object-fit: cover;
}

.hero-text {
  flex: 1;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-text {
    text-align: left;
  }
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(90deg, #0eb2bb, #007bff, #006666);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  animation: fadeIn 0.8s ease 0.3s both;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 64px;
  }
}

.hero-subtitle {
  font-size: 24px;
  margin-bottom: 16px;
  animation: fadeIn 1s ease 0.5s both;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 32px;
  }
}

.hero-tagline {
  font-size: 18px;
  color: #999;
  margin-bottom: 32px;
  animation: fadeIn 1s ease 0.7s both;
}

.hero-social {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
  animation: fadeIn 1s ease 0.9s both;
}

@media (min-width: 768px) {
  .hero-social {
    justify-content: flex-start;
  }
}

.social-link {
  padding: 12px;
  background: #2a2a2a;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.social-link:hover {
  background: rgba(14, 178, 187, 0.2);
  border-color: #0eb2bb;
  transform: scale(1.1);
}

.hero-btn {
  padding: 12px 32px;
  background: linear-gradient(90deg, #0eb2bb, #007bff);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  animation: fadeIn 1s ease 1.1s both;
}

.hero-btn:hover {
  box-shadow: 0 8px 20px rgba(14, 178, 187, 0.5);
  transform: scale(1.05);
}

/* Desktop: scale the hero up with the viewport so it fills the screen */
@media (min-width: 1024px) {
  .hero {
    padding: 48px clamp(24px, 4vw, 96px);
  }

  .hero-content {
    width: 100%;
    max-width: 1800px;
    justify-content: center;
    gap: clamp(48px, 5vw, 96px);
  }

  .hero-image img {
    width: clamp(320px, min(26vw, 60vh), 600px);
    height: clamp(320px, min(26vw, 60vh), 600px);
    border-width: clamp(4px, 0.35vw, 8px);
    box-shadow: 0 0 60px rgba(14, 178, 187, 0.3);
  }

  .hero-text {
    flex: 0 1 auto;
  }

  .hero-title {
    font-size: clamp(64px, 6.5vw, 160px);
    margin-bottom: clamp(24px, 2vw, 40px);
  }

  .hero-subtitle {
    font-size: clamp(32px, 2.8vw, 68px);
    margin-bottom: clamp(16px, 1.4vw, 28px);
  }

  .hero-tagline {
    font-size: clamp(18px, 1.6vw, 32px);
    margin-bottom: clamp(32px, 2.6vw, 52px);
  }

  .hero-social {
    gap: clamp(16px, 1.4vw, 28px);
    margin-bottom: clamp(32px, 2.6vw, 52px);
  }

  .hero-social .social-link {
    padding: clamp(14px, 1.2vw, 24px);
  }

  .hero-social .icon {
    width: clamp(24px, 2vw, 42px);
    height: clamp(24px, 2vw, 42px);
  }

  .hero-btn {
    padding: clamp(14px, 1.1vw, 22px) clamp(36px, 3vw, 64px);
    font-size: clamp(18px, 1.4vw, 28px);
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: #999;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* Sections */
.section {
  padding: 128px 24px;
}

.section-alt {
  background: rgba(255, 255, 255, 0.02);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 56px;
  }
}

.section-subtitle {
  color: #999;
  max-width: 640px;
  margin: 0 auto;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: rgba(42, 42, 42, 0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #3a3a3a;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-card:hover {
  border-color: #555;
  transform: translateY(-4px);
}

.project-title-row {
  display: flex;
  margin-bottom: 12px;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.project-title-row .project-title {
  margin-bottom: 0;
  flex: 1;
}

.project-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.project-desc {
  color: #999;
  margin-bottom: 16px;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  font-size: 12px;
  color: #ccc;
  transition: background 0.3s;
}

.tag:hover {
  background: rgba(255, 255, 255, 0.1);
}

.project-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

/* A gallery that is filled from a folder stays hidden until the folder has
   images. scripts/update-galleries.mjs writes the list into data-images. */
.btn-gallery[data-gallery-dir][data-images=""],
.btn-gallery[data-gallery-dir]:not([data-images]) {
  display: none;
}

.btn-primary {
  background: linear-gradient(90deg, #0eb2bb, #007bff);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(14, 178, 187, 0.5);
  transform: scale(1.05);
}

.btn-secondary {
  background: #3a3a3a;
  color: white;
}

.btn-secondary:hover {
  background: #4a4a4a;
}

.project-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Skills */
.skills-svg-container {
  max-width: 800px;
  margin: 0 auto;
}

.tech-stack-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.band-bg-1 {
  fill: #1a1a1a;
  stroke: #333;
}

.band-bg-2 {
  fill: #222;
  stroke: #333;
}

.band-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #2a2a2a;
}

.chip .tag-icon {
  font-size: 20px;
  height: 20px;
  width: auto;
  margin: 0;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
}

.chip:hover .tag-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.chip span {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.chip .tag-icon.invert-img {
  filter: invert(1);
}

@media (prefers-color-scheme: light) {
  .band-bg-1 {
    fill: #ffffff;
    stroke: #e7e7e5;
  }

  .band-bg-2 {
    fill: #f5f5f3;
    stroke: #e7e7e5;
  }

  .eyebrow {
    color: #b3b3ae;
  }

  .chip {
    background: #ffffff;
    border: 1px solid #e7e7e5;
  }

  .chip span {
    color: #151515;
  }

  .chip .tag-icon.invert-img {
    filter: none;
  }
}

/* Footer */
.footer {
  padding: 48px 24px;
  border-top: 1px solid #2a2a2a;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #999;
}

.footer-left .heart {
  color: #ef4444;
  fill: #ef4444;
}

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

.footer-link {
  padding: 8px;
  color: #999;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.footer-link:hover {
  color: white;
  background: #2a2a2a;
}
@media (prefers-color-scheme: light) {
  body {
    background: #f9f9f9;
    color: #222;
  }
  .nav {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid #e0e0e0;
  }
  .nav-link,
  .mobile-menu-btn,
  .mobile-link,
  .hero-tagline,
  .section-subtitle,
  .project-desc,
  .footer-left,
  .footer-link {
    color: #555;
  }
  .mobile-link:hover,
  .footer-link:hover {
    color: #111;
    background: #eaeaea;
  }
  .social-link {
    background: #eaeaea;
    color: #333;
  }
  .social-link:hover {
    background: rgba(14, 178, 187, 0.1);
  }
  .btn-secondary {
    background: #eaeaea;
    color: #333;
  }
  .btn-secondary:hover {
    background: #d4d4d4;
  }
  .project-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e0e0e0;
  }
  .skill-card {
    background: #f9f9f9;
    border: 2px solid #999;
    box-shadow:
      0 15px 0 #d0d0d0,
      0 20px 15px rgba(0, 0, 0, 0.1);
  }
  .skill-title {
    color: #222;
  }
  .project-card:hover {
    border-color: #bbb;
  }
  .skill-card:hover {
    box-shadow:
      0 17px 0 #d0d0d0,
      0 22px 20px rgba(0, 0, 0, 0.15);
  }
  .tag {
    background: rgba(0, 0, 0, 0.05);
    color: #555;
  }
  .tag:hover {
    background: rgba(0, 0, 0, 0.1);
  }
  .section-alt {
    background: rgba(0, 0, 0, 0.03);
  }
  .footer {
    border-top: 1px solid #e0e0e0;
  }
  
  .tag-icon {
    filter: grayscale(100%) opacity(0.7);
  }
  .tag-icon:hover {
    filter: grayscale(0%) opacity(1);
  }
  .skill-tags .tag-icon,
  .chip .tag-icon {
    filter: none;
  }
  .skill-tags .tag-icon:hover,
  .chip:hover .tag-icon {
    filter: none;
  }
}

/* Lightbox Styles */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox.hidden {
  display: none !important;
}
#lightboxBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}
#lightboxContent {
  position: relative;
  z-index: 10000;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#lightboxHeader {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: white;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
}
#lightboxClose,
#lightboxPrev,
#lightboxNext {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 2rem;
}
#lightboxPrev {
  position: absolute;
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
}
#lightboxNext {
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox-counter {
  margin-right: 15px;
}
.lightbox-img-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

@media (max-width: 768px) {
  #lightboxPrev {
    left: 10px;
    text-shadow: 0 0 5px black;
  }
  #lightboxNext {
    right: 10px;
    text-shadow: 0 0 5px black;
  }
  .nav {
    display: none !important;
  }
}

/* Access Modal Styles */
.access-modal {
  padding: 2rem;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  text-align: center;
  margin: auto;
}
.access-modal-title {
  margin-bottom: 1rem;
  color: #1f2937;
  font-size: 1.5rem;
}
.access-modal-desc {
  margin-bottom: 1.5rem;
  color: #4b5563;
  line-height: 1.5;
}
.access-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.access-modal-link {
  text-decoration: none;
}

.tag-icon {
  font-size: 24px;
  height: 24px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4)) grayscale(100%) opacity(0.7);
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.tag-icon:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.8)) grayscale(0%) opacity(1);
}

.skill-tags .tag-icon {
  font-size: 48px;
  height: 48px;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
  opacity: 1;
}

.skill-tags .tag-icon:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

img.tag-icon.invert-img {
  filter: invert(0.8) grayscale(100%) opacity(0.7);
}

img.tag-icon.invert-img:hover {
  filter: invert(1) grayscale(0%) opacity(1);
}

.skill-tags img.tag-icon.invert-img {
  filter: invert(1);
  opacity: 1;
}

/* --- Scroll Animation Enhancements --- */
.animate-hidden {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.animate-hidden.slide-up {
  transform: translateY(40px);
}

.animate-hidden.slide-left {
  transform: translateX(40px);
}

.animate-hidden.slide-right {
  transform: translateX(-40px);
}

.animate-hidden.scale-up {
  transform: scale(0.85);
}

.animate-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1) !important;
}

/* --- Pop Supply: client work, shown in its own brand with a live window into the site --- */
.project-card.pop-card {
  --pop-navy: #0f1729;
  --pop-red: #da2b30;
  --pop-red-dark: #b91f24;
  --pop-light: #f4f5f6;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--pop-navy);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid rgba(244, 245, 246, 0.12);
  border-top: 3px solid var(--pop-red);
  border-radius: 6px;
  color: var(--pop-light);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  cursor: default;
}

.project-card.pop-card:hover {
  border-color: rgba(218, 43, 48, 0.55);
  border-top-color: var(--pop-red);
  box-shadow: 0 20px 48px rgba(218, 43, 48, 0.18);
}

/* Browser window */
.pop-window {
  margin: 16px 16px 0;
  overflow: hidden;
  border: 1px solid rgba(244, 245, 246, 0.14);
  border-radius: 8px;
  background: #0b1120;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.pop-window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 10px;
  background: #1b2436;
  border-bottom: 1px solid rgba(244, 245, 246, 0.08);
}

.pop-window-dots {
  display: flex;
  gap: 6px;
}

.pop-window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.pop-window-dots span:nth-child(2) {
  background: #febc2e;
}

.pop-window-dots span:nth-child(3) {
  background: #28c840;
}

.pop-window-url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 24px;
  min-width: 0;
  border-radius: 6px;
  background: rgba(244, 245, 246, 0.07);
  font-size: 12px;
  color: rgba(244, 245, 246, 0.75);
}

.pop-window-url .icon {
  width: 12px;
  height: 12px;
}

.pop-window-open {
  display: flex;
  color: rgba(244, 245, 246, 0.6);
  transition: color 0.2s ease;
}

.pop-window-open:hover,
.pop-window-open:focus-visible {
  color: var(--pop-light);
}

.pop-window-open .icon {
  width: 16px;
  height: 16px;
}

/* The page shows the home screenshot until the live site has loaded. */
.pop-window-view {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--pop-navy) url("assets/pop-supply/01_home.webp") top left /
    100% auto no-repeat;
}

.pop-window-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.pop-window-view.is-loaded .pop-window-frame {
  opacity: 1;
}

/* Card text */
.pop-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 24px 24px;
}

.project-title.pop-title {
  margin-bottom: 16px;
  line-height: 0;
}

.pop-logo {
  display: block;
  height: 36px;
  width: auto;
}

.project-desc.pop-desc {
  color: rgba(244, 245, 246, 0.8);
}

.btn.pop-btn {
  padding: 11px 20px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
}

.btn.pop-btn-primary {
  background: var(--pop-red);
  color: #fff;
}

.btn.pop-btn-primary:hover {
  background: var(--pop-red-dark);
  box-shadow: 0 8px 22px rgba(218, 43, 48, 0.4);
  transform: translateY(-1px);
}

.btn.pop-btn-primary .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.btn.pop-btn-primary:hover .icon {
  transform: translateX(3px);
}

.btn.pop-btn-outline {
  background: transparent;
  border: 1px solid rgba(244, 245, 246, 0.4);
  color: var(--pop-light);
}

.btn.pop-btn-outline:hover {
  background: rgba(244, 245, 246, 0.08);
  border-color: rgba(244, 245, 246, 0.75);
}

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

.pop-note {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(244, 245, 246, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .pop-window-frame {
    transition: none;
  }
}

/* --- Showcase layout: every project is a full-width, two-part case study --- */
.projects-grid {
  grid-template-columns: 1fr;
  gap: 40px;
}

.project-card.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  padding: 0;
  height: clamp(580px, 85vh, 860px);
  cursor: default;
}

.project-card.showcase.showcase-flip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr);
}

/* Large showcases hold still on hover; the live sites inside take the pointer. */
.project-card.showcase:hover {
  transform: none;
}

.project-card.showcase.showcase-flip > :first-child {
  order: 2;
}

.showcase-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 40px 44px;
}

.showcase-text .project-title {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
}

.showcase-text .project-logo {
  width: 64px;
  height: 64px;
}

.showcase-text .project-title-row {
  margin-bottom: 18px;
  align-items: center;
}

.showcase-text .project-desc {
  font-size: 17px;
  margin-bottom: 22px;
}

.showcase-text .project-tags {
  gap: 12px;
  margin-bottom: 30px;
}

.showcase-text .tag-icon {
  font-size: 28px;
}

.showcase-text .btn {
  padding: 12px 22px;
  font-size: 15px;
}

.showcase-text .btn:focus-visible,
.shot-open:focus-visible,
.show-win-open:focus-visible {
  outline: 2px solid #0eb2bb;
  outline-offset: 3px;
}

/* Pop Supply: window fills the visual column */
.project-card.pop-card.showcase {
  border-radius: 8px;
}

.project-card.pop-card.showcase .pop-window {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 32px 0 32px 32px;
  border-radius: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.project-card.pop-card.showcase .pop-window-bar {
  flex: none;
  height: 40px;
}

.project-card.pop-card.showcase .pop-window-view {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}

.project-card.pop-card.showcase .pop-body {
  justify-content: center;
  padding: 40px 44px;
}

.project-card.pop-card.showcase .pop-logo {
  height: 52px;
}

.project-card.pop-card.showcase .project-title.pop-title {
  margin-bottom: 22px;
}

.project-card.pop-card.showcase .btn.pop-btn {
  padding: 13px 22px;
}

.project-card.pop-card.showcase .pop-note {
  margin-top: 20px;
}

/* Visual column for the portfolio-styled cards */
.showcase-visual {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(14, 178, 187, 0.28), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(0, 123, 255, 0.26), transparent 55%),
    #101417;
}

.showcase-visual-live {
  padding: 32px;
}

.show-win {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #0b0e10;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
}

.showcase-visual-live .show-win {
  flex: 1;
  min-width: 0;
}

.show-win-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  background: #1d2327;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.show-win-dots {
  display: flex;
  gap: 6px;
}

.show-win-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.show-win-dots span:nth-child(2) {
  background: #febc2e;
}

.show-win-dots span:nth-child(3) {
  background: #28c840;
}

.show-win-url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.show-win-open {
  display: flex;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.show-win-open:hover {
  color: #fff;
}

.show-win-open .icon {
  width: 16px;
  height: 16px;
}

.show-win-view {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #3279e8 url("assets/classroom-chat-banner1.png") center / cover no-repeat;
}

.live-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 1100px;
  height: 800px;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.show-win-view.is-loaded .live-frame {
  opacity: 1;
}

/* Screenshot collages */
.shot-open {
  position: relative;
  flex: 1;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: zoom-in;
}

.shot {
  position: absolute;
  display: block;
  overflow: hidden;
  transition: transform 0.4s ease;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-back {
  top: 7%;
  right: -6%;
  width: 62%;
  opacity: 0.85;
}

.shot-front {
  left: 6%;
  bottom: 8%;
  width: 76%;
}

.shot-open:hover .shot-front,
.shot-open:focus-visible .shot-front {
  transform: translateY(-6px);
}

.shot-open:hover .shot-back,
.shot-open:focus-visible .shot-back {
  transform: translate(6px, 4px);
}

.shot-game {
  border: 6px solid #1c1f24;
  border-radius: 14px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.game-a {
  top: 7%;
  left: 5%;
  width: 66%;
  z-index: 2;
}

.game-b {
  right: 4%;
  top: 28%;
  width: 42%;
  z-index: 3;
}

.game-c {
  left: 12%;
  bottom: 7%;
  width: 40%;
  z-index: 1;
}

.showcase-visual-game {
  background:
    radial-gradient(circle at 80% 10%, rgba(180, 80, 255, 0.28), transparent 55%),
    radial-gradient(circle at 10% 95%, rgba(14, 178, 187, 0.25), transparent 55%),
    #0d0f14;
}

.shot-open:hover .game-a,
.shot-open:focus-visible .game-a {
  transform: translateY(-6px);
}

.shot-open:hover .game-b,
.shot-open:focus-visible .game-b {
  transform: translate(6px, 4px);
}

/* Mega Chess: three phones, the game board in front */
.showcase-visual-phones {
  background:
    radial-gradient(circle at 50% 30%, rgba(98, 140, 44, 0.45), transparent 60%),
    radial-gradient(circle at 15% 95%, rgba(14, 178, 187, 0.18), transparent 55%),
    #0e140b;
}

.phone {
  position: absolute;
  display: block;
  overflow: hidden;
  top: 50%;
  height: 76%;
  aspect-ratio: 1080 / 2220;
  border: 7px solid #111;
  border-radius: 30px;
  background: #111;
  box-shadow: 0 26px 55px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 0.4s ease;
}

.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 23px;
}

.phone-center {
  left: 50%;
  height: 84%;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.phone-left {
  left: 50%;
  z-index: 1;
  transform: translate(-120%, -46%) rotate(-7deg);
}

.phone-right {
  left: 50%;
  z-index: 1;
  transform: translate(20%, -46%) rotate(7deg);
}

.shot-open:hover .phone-center,
.shot-open:focus-visible .phone-center {
  transform: translate(-50%, -52%);
}

.shot-open:hover .phone-left,
.shot-open:focus-visible .phone-left {
  transform: translate(-127%, -46%) rotate(-9deg);
}

.shot-open:hover .phone-right,
.shot-open:focus-visible .phone-right {
  transform: translate(27%, -46%) rotate(9deg);
}

@media (max-width: 1023px) {
  .project-card.showcase {
    height: auto;
    min-height: 520px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }

  .project-card.showcase.showcase-flip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .showcase-text,
  .project-card.pop-card.showcase .pop-body {
    padding: 28px 26px;
  }

  .project-card.pop-card.showcase .pop-window {
    margin: 22px 0 22px 22px;
  }

  .showcase-visual-live {
    padding: 22px;
  }
}

@media (max-width: 767px) {
  .projects-grid {
    gap: 28px;
  }

  .project-card.showcase,
  .project-card.showcase.showcase-flip {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .project-card.showcase.showcase-flip > :first-child {
    order: 0;
  }

  .showcase-visual {
    aspect-ratio: 4 / 3;
  }

  .showcase-visual-live {
    padding: 16px;
  }

  .project-card.pop-card.showcase .pop-window {
    margin: 16px 16px 0;
  }

  .project-card.pop-card.showcase .pop-window-view {
    flex: none;
    aspect-ratio: 1 / 1;
  }

  .showcase-visual-live {
    aspect-ratio: 1 / 1;
  }

  .showcase-text,
  .project-card.pop-card.showcase .pop-body {
    padding: 24px 20px 26px;
  }

  .project-card.pop-card.showcase .pop-logo {
    height: 40px;
  }
}

/* Phones: a tall window shows the live sites' own mobile layout. */
@media (max-width: 480px) {
  .project-card.pop-card.showcase .pop-window-view,
  .showcase-visual-live {
    aspect-ratio: 3 / 4;
  }
}

@media (prefers-color-scheme: light) {
  .showcase-visual {
    background:
      radial-gradient(circle at 20% 15%, rgba(14, 178, 187, 0.22), transparent 55%),
      radial-gradient(circle at 85% 90%, rgba(0, 123, 255, 0.18), transparent 55%),
      #e8f1f4;
  }

  .showcase-visual-game {
    background:
      radial-gradient(circle at 80% 10%, rgba(180, 80, 255, 0.18), transparent 55%),
      radial-gradient(circle at 10% 95%, rgba(14, 178, 187, 0.2), transparent 55%),
      #eceaf3;
  }

  .showcase-visual-phones {
    background:
      radial-gradient(circle at 50% 30%, rgba(98, 140, 44, 0.28), transparent 60%),
      radial-gradient(circle at 15% 95%, rgba(14, 178, 187, 0.16), transparent 55%),
      #eaf0e3;
  }

  .show-win {
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 24px 50px rgba(30, 50, 70, 0.28);
  }

  .shot-game {
    box-shadow: 0 20px 40px rgba(30, 30, 60, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-frame,
  .shot {
    transition: none;
  }

  .shot-open:hover .shot,
  .shot-open:focus-visible .shot {
    transform: none;
  }

  .shot-open:hover .phone-center,
  .shot-open:focus-visible .phone-center {
    transform: translate(-50%, -50%);
  }

  .shot-open:hover .phone-left,
  .shot-open:focus-visible .phone-left {
    transform: translate(-120%, -46%) rotate(-7deg);
  }

  .shot-open:hover .phone-right,
  .shot-open:focus-visible .phone-right {
    transform: translate(20%, -46%) rotate(7deg);
  }
}
