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

:root {
  /* Page Theme - Darker/Blacker as requested */
  --bg-color: #050505; /* Almost black */
  --text-color: #e0e0e0; /* Brighter text for page content */
  
  /* Game Theme - Kept as Chrome Dino Reference */
  --game-bg: #202124;
  --game-fg: #ACACAC; /* The specific gray from the reference */
  
  --accent-color: #535353;
  --secondary-accent: #83888f;
  --shadow-color: rgba(0, 0, 0, 0.8);
  --hover-shadow: rgba(255, 255, 255, 0.2);
  --glow-color: rgba(255, 255, 255, 0.3);
  --focus-color: #ffffff;
}

html, body {
  height: 100%;
}

body {
  overflow: hidden; /* prevent browser scrollbars; JS will scale content to fit */
}

/* 
@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #f7f7f7;
    --text-color: #535353;
    --accent-color: #535353;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --hover-shadow: rgba(0, 0, 0, 0.5);
  }
} 
*/

@font-face {
  font-family: 'Press Start 2P';
  src: url('../font/PressStart2P-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: 'Press Start 2P', monospace, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Video Background Container */
.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

/* Professional dark gradient overlay on video */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.4) 0%, transparent 60%),
              radial-gradient(ellipse at bottom, rgba(0, 0, 0, 0.5) 0%, transparent 60%),
              linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(5, 5, 10, 0.9) 100%);
  pointer-events: none;
}

/* Fallback gradient if video doesn't load */
.video-background {
  background: linear-gradient(135deg, #050505 0%, #1a1a1a 100%);
}

/* Content Appearance Animation */
.content-container > *,
.footer {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

body.content-loaded .content-container > *,
body.content-loaded .footer {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for appearance */
body.content-loaded .content-container > *:nth-child(1) { transition-delay: 0.1s; } /* Logo */
body.content-loaded .content-container > *:nth-child(2) { transition-delay: 0.2s; } /* Text */
body.content-loaded .content-container > *:nth-child(3) { transition-delay: 0.3s; } /* Mission */
body.content-loaded .content-container > *:nth-child(4) { transition-delay: 0.4s; } /* Services */
body.content-loaded .content-container > *:nth-child(5) { transition-delay: 0.5s; } /* Social */
body.content-loaded .content-container > *:nth-child(6) { transition-delay: 0.6s; } /* CTA */
body.content-loaded .content-container > *:nth-child(7) { transition-delay: 0.7s; } /* Game */
body.content-loaded .footer { transition-delay: 0.8s; }

/* Loading Screen - Professional Nutshell Animation */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Nutshell Cracking Animation */
.nutshell-loader {
  position: relative;
  width: 80px;
  height: 80px;
  animation: float 3s ease-in-out infinite;
}

.shell-part {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid var(--text-color);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.shell-top {
  top: 0;
  left: 0;
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
  animation: crackTop 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.shell-bottom {
  bottom: 0;
  right: 0;
  clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
  animation: crackBottom 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.crack-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--text-color), transparent);
  animation: crackPulse 2s ease-in-out infinite;
}

@keyframes crackTop {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-3px, -3px) rotate(-5deg);
  }
}

@keyframes crackBottom {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(3px, 3px) rotate(5deg);
  }
}

@keyframes crackPulse {
  0%, 100% {
    opacity: 0.3;
    width: 60px;
  }
  50% {
    opacity: 1;
    width: 70px;
  }
}

.loading-text {
  font-size: clamp(10px, 2vw, 12px);
  color: var(--text-color);
  letter-spacing: 2px;
  animation: pulse 1.5s ease-in-out infinite;
  text-transform: uppercase;
}

.loading-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--text-color), transparent);
  background-size: 200% 100%;
  animation: loadingProgress 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes loadingProgress {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Focus States for Accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--focus-color);
  outline-offset: 4px;
  border-radius: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

.main-wrapper {
  position: relative;
  z-index: 2;
  /* Let content flow; avoid vertical-centering which creates large empty space */
  /* keep full viewport height so footer can be pushed to the bottom */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* horizontal padding only; top spacing handled by content-container to ensure
     consistent space that survives transforms */
  padding: 0 clamp(10px, 1.8vh, 16px);
  overflow: visible;
}

.content-container {
  text-align: center;
  animation: fadeInUp 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vh, 18px);
  /* ensure there is always some visible space above the logo so it's not
     clipped when the page is transformed/scaled */
  /* increase top padding to ensure the logo (and its float) stays fully visible */
  padding-top: clamp(36px, 6vh, 110px); /* larger top padding to avoid clipping */
}

/* Parallax layers for depth */
.content-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  animation: parallaxFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes parallaxFloat {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(2%, 2%);
  }
  50% {
    transform: translate(0, 4%);
  }
  75% {
    transform: translate(-2%, 2%);
  }
}

.logo-container {
  display: inline-block;
  /* use a milder float for the logo so it doesn't animate out of view */
  animation: logoFloat 3s ease-in-out infinite, fadeIn 1s ease-out 0.3s both;
  position: relative;
}

.logo-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: -1;
}

.logo-container:hover::after {
  opacity: 1;
}

 .logo {
  width: 100%;
  max-width: clamp(160px, 28vw, 270px);
  height: auto;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              filter 0.3s ease;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.15));
}

.logo-container:hover .logo {
  transform: scale(1.06) rotate(1deg);
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
}

.text-wrapper {
  position: relative;
  min-height: clamp(60px, 10vh, 75px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 1s ease-out 0.6s both;
  width: 100%;
}

.text-wrapper::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: scanLine 4s ease-in-out infinite;
}

@keyframes scanLine {
  0%, 100% {
    transform: translateY(-50px);
    opacity: 0;
  }
  50% {
    transform: translateY(50px);
    opacity: 1;
  }
}

h2#transformed-sentence {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: transparent;
  color: var(--text-color);
  padding: clamp(10px, 2.5vw, 20px);
  border: 2px solid var(--text-color);
  font-size: clamp(14px, 2.8vw, 26px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8),
              0 0 20px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  letter-spacing: 3px;
}

h1#original-sentence {
  font-size: clamp(18px, 3.8vw, 34px);
  margin: 0;
  text-align: center;
  line-height: 1.6;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
  animation: glitch 5s infinite;
  cursor: pointer;
  padding: clamp(12px, 2.2vw, 22px);
  position: relative;
  z-index: 1;
  letter-spacing: 2px;
}

h1#original-sentence:hover {
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.35),
               0 0 25px rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}

h1#original-sentence.hovered {
  opacity: 0;
  transform: scale(0.95);
}

h2#transformed-sentence.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1.05);
}

@keyframes glitch {
  0%, 90%, 100% {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
  }
  92% {
    text-shadow: 2px 0 5px rgba(255, 255, 255, 0.6),
                 -2px 0 5px rgba(200, 200, 200, 0.4);
    transform: translate(1px, 0);
  }
  94% {
    text-shadow: -2px 0 5px rgba(255, 255, 255, 0.6),
                 2px 0 5px rgba(200, 200, 200, 0.4);
    transform: translate(-1px, 0);
  }
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 4vw, 35px);
  position: relative;
  width: 100%;
}

.social-icons::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.social-icons a:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.9s both; }
.social-icons a:nth-child(2) { animation: fadeInUp 0.6s ease-out 1s both; }
.social-icons a:nth-child(3) { animation: fadeInUp 0.6s ease-out 1.1s both; }
.social-icons a:nth-child(4) { animation: fadeInUp 0.6s ease-out 1.2s both; }

.social-icons a {
  color: var(--text-color);
  font-size: clamp(28px, 5.5vw, 44px);
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icons a i {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
  opacity: 0.85;
  transform: scale(1);
  display: block;
  will-change: transform, filter;
}

.social-icons a:hover i {
  transform: scale(1.4);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.7));
  opacity: 1;
}

.social-icons a:hover i.fa-facebook {
  color: #1877f2;
}

.social-icons a:hover i.fa-instagram {
  color: #e4405f;
}

.social-icons a:hover i.fa-linkedin {
  color: #0077b5;
}

.social-icons a:hover i.fa-vimeo-v {
  color: #1ab7ea;
}

.social-icons a:active i {
  transform: scale(1.25);
}

/* Mission Statement */
.mission-section {
  width: 100%;
  max-width: 800px;
  animation: fadeInUp 1s ease-out 0.7s both;
  position: relative;
  padding: clamp(12px, 2vh, 18px) 0;
}

.mission-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.mission-text {
  font-size: clamp(9px, 1.8vw, 12px);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  letter-spacing: 1.5px;
  line-height: 1.8;
  margin: 0;
  padding: 0 clamp(15px, 3vw, 30px);
  text-transform: uppercase;
  font-style: italic;
}

/* Services Preview */
.services-preview {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(25px, 5vw, 50px); /* Increased gap for better spacing */
  flex-wrap: wrap;
  animation: fadeInUp 1s ease-out 0.9s both;
  position: relative;
  padding: clamp(10px, 2vh, 16px) 0; /* slightly increased vertical padding */
}

.services-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 10px); /* small increase so items breathe */
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.service-item:hover {
  transform: scale(1.15);
}

.service-icon {
  font-size: clamp(18px, 3.6vw, 32px); /* slightly larger so it's readable */
  color: var(--text-color);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.18));
  transition: all 0.22s ease;
}

.service-item:hover .service-icon {
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
  transform: translateY(-3px);
}

.service-name {
  font-size: clamp(7px, 1.1vw, 9px); /* slightly larger for readability */
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-align: center;
}

/* Call to Action */
.cta-section {
  width: 100%;
  max-width: 700px;
  animation: fadeInUp 1s ease-out 1.1s both;
  position: relative;
  padding: clamp(15px, 2.5vh, 20px) 0;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.cta-subtitle {
  font-size: clamp(9px, 1.8vw, 12px);
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  letter-spacing: 2px;
  margin: 0;
  text-transform: uppercase;
  animation: pulse 3s ease-in-out infinite;
}

.game-container {
  width: 100%;
  max-width: 1200px;
  animation: fadeInUp 1s ease-out 1.3s both;
  position: relative;
}

.game-container::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.game-instructions {
  text-align: center;
  font-size: clamp(8px, 1.7vw, 11px);
  color: var(--text-color);
  margin-bottom: clamp(12px, 2vh, 16px);
  opacity: 0.7;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 400;
  transition: opacity 0.3s ease;
}

.game-instructions:hover {
  opacity: 1;
}

.game-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: visible;
  padding: clamp(6px, 1vh, 10px) 0;
}

#gameCanvas {
  width: 100%;
  max-width: 1200px;
  height: auto;
  aspect-ratio: 4/1;
  background-color: transparent;
  border: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

.game-info {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: clamp(8px, 1.5vw, 12px);
  color: var(--text-color);
  text-shadow: 0 0 5px var(--shadow-color);
}

/* Contact Widget - Modern Glassmorphism Style */
.contact-widget {
  position: fixed;
  bottom: clamp(25px, 4vh, 40px);
  right: clamp(25px, 4vh, 40px);
  z-index: 1200; /* keep contact widget above game controls */
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 15px;
}

.contact-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 19px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  -webkit-animation: contactPulse 2s ease-in-out infinite;
  animation: contactPulse 2s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

@-webkit-keyframes contactPulse {
  0%, 100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.35);
    -webkit-box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
  }
  50% {
    -webkit-transform: scale(1.08);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.55);
    -webkit-box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
  }
}

@keyframes contactPulse {
  0%, 100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.35);
    -webkit-box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
  }
  50% {
    -webkit-transform: scale(1.08);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.55);
    -webkit-box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
  }
}

.contact-btn i {
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: block;
  opacity: 0.8;
}

.contact-btn:hover {
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.35);
  animation-play-state: paused;
}

.contact-btn:hover i {
  opacity: 1;
}

.contact-btn:active {
  -webkit-transform: scale(0.98);
  -ms-transform: scale(0.98);
  transform: scale(0.98);
}

.contact-widget.active .contact-btn {
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 45px rgba(255, 255, 255, 0.4);
  animation: none;
}

.contact-widget.active .contact-btn i {
  opacity: 1;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

.contact-options {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.85) rotateX(15deg);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  align-items: flex-end;
  transform-origin: bottom right;
  perspective: 1000px;
}

.contact-widget.active .contact-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1) rotateX(0deg);
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  padding: 10px 18px;
  border-radius: 18px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(50px) translateY(10px) scale(0.85);
  box-shadow: none;
  position: relative;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
}

.contact-option:hover {
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateX(-8px) scale(1.05);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.contact-option:active {
  transform: translateX(-5px) scale(1.02);
}

.contact-widget.active .contact-option {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

.contact-widget.active .contact-option:nth-child(1) {
  transition-delay: 0.15s;
}

.contact-widget.active .contact-option:nth-child(2) {
  transition-delay: 0.08s;
}

.contact-option i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.contact-option:hover i {
  transform: scale(1.15);
}

/* Sound Widget - Modern Glassmorphism Style */
.sound-widget {
  position: fixed;
  top: clamp(25px, 4vh, 40px);
  left: clamp(25px, 4vh, 40px);
  z-index: 1000;
}

.sound-toggle-btn {
  padding: 11px 14px;
  min-width: 48px;
  height: auto;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.05);
  color: rgba(255, 255, 255, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-size: 16px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-box-shadow: none;
  box-shadow: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.sound-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.sound-toggle-btn:active {
  -webkit-transform: scale(0.98);
  -ms-transform: scale(0.98);
  transform: scale(0.98);
}

.sound-toggle-btn.muted {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(180, 180, 180, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sound-toggle-btn.muted:hover {
  background: rgba(0, 0, 0, 0.15);
  color: rgba(200, 200, 200, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Tablet Styles */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .contact-widget {
    bottom: 20px;
    right: 20px;
  }

  .contact-btn {
    width: 64px;
    height: 64px;
    font-size: 18px;
  }

  .sound-widget {
    top: 20px;
    left: 20px;
  }

  .services-preview {
    gap: clamp(18px, 4vw, 35px);
  }
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
  .game-instructions {
    font-size: clamp(7px, 2vw, 10px);
  }

  .main-wrapper {
    max-height: 100vh;
    overflow: hidden;
    justify-content: center;
    padding-top: clamp(12px, 3vh, 20px);
  }

  .services-preview {
    gap: clamp(16px, 3.5vw, 30px);
  }

  .service-icon {
    font-size: clamp(22px, 5vw, 32px);
  }

  .contact-widget {
    bottom: 15px;
    right: 15px;
  }

  .contact-btn {
    width: 56px;
    height: 56px;
    font-size: 16px;
  }

  .contact-option {
    padding: 8px 14px;
    font-size: 9px;
    gap: 10px;
  }

  .contact-option i {
    font-size: 13px;
  }

  .sound-widget {
    top: 15px;
    left: 15px;
  }

  .sound-toggle-btn {
    padding: 9px 11px;
    min-width: 44px;
    font-size: 14px;
  }
}

/* Small Mobile Styles */
@media screen and (max-width: 480px) {
  .contact-widget {
    bottom: 12px;
    right: 12px;
  }

  .contact-btn {
    width: 52px;
    height: 52px;
    font-size: 15px;
  }

  .contact-option {
    padding: 7px 12px;
    font-size: 8px;
    gap: 8px;
  }

  .contact-option i {
    font-size: 12px;
  }

  .sound-widget {
    top: 12px;
    left: 12px;
  }

  .sound-toggle-btn {
    padding: 8px 10px;
    min-width: 40px;
    font-size: 13px;
  }
}

/* Footer */
.footer {
  padding: clamp(8px, 1.6vh, 12px) 20px;
  /* make bottom spacing very small per request */
  padding-bottom: clamp(4px, 1vh, 8px);
  text-align: center;
  position: relative;
  animation: fadeIn 1s ease-out 1.6s both;
  margin-top: auto; /* push footer to the bottom of the main-wrapper */
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 10px);
  align-items: center;
}

.footer-text {
  font-size: clamp(8px, 1.5vw, 11px);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 1px;
  margin: 0;
}

.footer-tagline {
  font-size: clamp(9px, 1.8vw, 12px);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 2px;
  margin: 0;
  font-style: italic;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    filter: blur(3px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(0.5deg);
  }
  50% {
    transform: translateY(-12px) rotate(0deg);
  }
  75% {
    transform: translateY(-8px) rotate(-0.5deg);
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-4px) rotate(0.5deg);
  }
  50% {
    transform: translateY(-6px) rotate(0deg);
  }
  75% {
    transform: translateY(-4px) rotate(-0.5deg);
  }
}

@media screen and (max-width: 768px) {
  .main-wrapper {
    padding: clamp(12px, 3vw, 18px);
  }

  .content-container {
    gap: clamp(8px, 1.8vh, 14px);
  }

  h1#original-sentence {
    font-size: clamp(14px, 4vw, 22px);
    line-height: 1.8;
  }

  h2#transformed-sentence {
    font-size: clamp(12px, 3.5vw, 20px);
    padding: clamp(8px, 1.8vw, 14px);
  }

  .social-icons {
    gap: clamp(18px, 4.5vw, 28px);
  }

  .social-icons a {
    font-size: clamp(26px, 6vw, 38px);
  }

  .game-wrapper {
    padding: clamp(6px, 1.5vh, 10px) 0;
  }

  .logo {
    max-width: clamp(130px, 40vw, 230px);
  }
}

@media screen and (max-width: 480px) {
  .main-wrapper {
    padding: clamp(10px, 2.5vw, 15px);
  }

  .content-container {
    gap: clamp(6px, 1.2vh, 10px);
  }

  h1#original-sentence {
    font-size: clamp(13px, 5vw, 19px);
  }

  .social-icons {
    gap: clamp(16px, 4vw, 24px);
  }

  .social-icons a {
    font-size: clamp(24px, 6.5vw, 34px);
  }

  .game-wrapper {
    padding: 6px 0;
  }
}

@media screen and (min-width: 1920px) {
  .content-container {
    max-width: 1500px;
    gap: clamp(16px, 2.5vh, 24px);
  }

  .social-icons {
    gap: clamp(28px, 4.5vw, 42px);
  }

  .social-icons a {
    font-size: clamp(38px, 6vw, 50px);
  }
}

@media screen and (max-height: 700px) and (min-width: 769px) {
  .content-container {
    gap: clamp(6px, 1.5vh, 12px);
  }

  .text-wrapper {
    min-height: clamp(45px, 7vh, 55px);
  }

  .social-icons {
    gap: clamp(16px, 3.5vw, 28px);
  }

  .footer {
    padding: clamp(10px, 1.8vh, 14px) 20px;
  }
}

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

/* Fallbacks for older Safari / browsers without modern CSS features */
@supports not (gap: 1rem) {
  /* Provide equivalent spacing when flex gap is unsupported */
  .services-preview { margin-left: -12px; margin-right: -12px; }
  .service-item { margin: 0 12px; }

  .social-icons { margin-left: -12px; margin-right: -12px; }
  .social-icons a { margin: 0 12px; }

  /* Safe fallback for content container gaps */
  .content-container > * { margin-bottom: 12px; }
}

@supports not (aspect-ratio: 4 / 1) {
  /* The canvas aspect-ratio is handled via JS when CSS support is missing. */
  /* Keep a visual fallback to avoid overflow */
  #gameCanvas { height: auto; }
}

/* Mobile game controls */
.mobile-game-controls {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  /* raise controls a bit so they don't overlap footer/chat */
  bottom: calc(max(12px, env(safe-area-inset-bottom, 12px)) + 64px);
  display: flex;
  gap: 12px;
  z-index: 1002;
  pointer-events: auto;
}

.mobile-game-btn {
  min-width: 84px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.45);
  color: var(--text-color);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
  touch-action: manipulation;
}

.mobile-game-btn:active { transform: scale(0.98); }

/* Improve touch behavior for anchors and buttons on iPhone */
a, button {
  -webkit-tap-highlight-color: rgba(0,0,0,0.12);
  touch-action: manipulation;
}

/* Ensure social anchors are clickable over transformed contexts */
.social-icons a, .contact-btn, .logo-container a {
  pointer-events: auto;
  z-index: 30;
}

/* Larger touch targets for tablets (iPad portrait and larger) */
@media (min-width: 768px) {
  .mobile-game-btn {
    min-width: 110px;
    height: 60px;
    font-size: 16px;
    border-radius: 12px;
  }
}

/* Split/thumb layout for iPad Pro and large tablets (place buttons left/right corners)
   The container gets class `split` from JS when screen >= 1024px */
.mobile-game-controls.split {
  left: 0;
  transform: none;
  width: 100%;
  display: block;
  pointer-events: none; /* allow buttons to be individually positioned */
}
.mobile-game-controls.split .mobile-game-btn {
  position: fixed;
  bottom: calc(max(12px, env(safe-area-inset-bottom, 12px)) + 6px);
  pointer-events: auto;
  background: rgba(0,0,0,0.55);
}
.mobile-game-controls.split .mobile-game-btn.jump {
  left: calc(env(safe-area-inset-left, 16px) + 12px);
}
.mobile-game-controls.split .mobile-game-btn.duck {
  /* move duck button leftwards to avoid overlapping contact widget */
  right: calc(env(safe-area-inset-right, 16px) + 92px);
}

/* Make icons larger inside the buttons */
.mobile-game-btn i {
  font-size: 18px;
}

@media (min-width: 1024px) {
  .mobile-game-btn i { font-size: 22px; }
  .mobile-game-btn { min-width: 64px; height: 64px; border-radius: 999px; }
}

