/* Modern Scandinavian Design System */
:root {
  --color-black: #0a0a0a;
  --color-dark-gray: #1a1a1a;
  --color-mid-gray: #555555;
  --color-light-gray: #e0e0e0;
  --color-white: #ffffff;
  --color-accent: #333333;
  --font-primary: "Space Grotesk", sans-serif;
  --font-logo: "Poppins", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Optimize animations globally */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Improve animation performance */
.animate-element {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-white);
  color: var(--color-black);
  height: 100vh;
  overflow: hidden;
  position: relative;
  cursor: default;
}

/* Canvas for Three.js */
#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* Noise overlay for texture */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.02; /* Reduced opacity to make grid more visible */
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAP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eqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==");
  pointer-events: none;
}

/* Logo Container */
.logo-container {
  position: absolute;
  top: -80%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-image {
  height: 30px;
  width: auto;
  display: block;
  transform: translateZ(0);
}

.logo-text {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  font-weight: 400; /* Changed to Poppins Regular weight */
  letter-spacing: 0.05em;
  color: var(--color-black);
  transform: translateZ(0);
}

.logo::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.logo:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.logo:hover .logo-image {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.logo:hover .logo-text {
  color: var(--color-accent);
  transition: color 0.3s ease;
}

/* Content */
.content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 900px;
  width: 100%;
  padding: 0 2rem;
  height: 80vh;
  position: relative;
}

.content-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr 1fr auto;
  grid-template-areas:
    "logo logo"
    "heading heading"
    "left right"
    "bottom bottom";
  gap: 1rem;
}

/* Position containers */
.logo-container {
  grid-area: logo;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.heading-container {
  grid-area: heading;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.left-container {
  grid-area: left;
  display: flex;
  justify-content: center;
  align-items: center;
}

.right-container {
  grid-area: right;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 20%;
  transform: translate(-50%, 0);
  width: 100%;
  z-index: 5;
}

.bottom-container {
  grid-area: bottom;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-text {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  text-align: center;
  max-width: 80%;
}

.highlight {
  color: var(--color-accent);
  position: relative;
  font-weight: 400;
}

.line {
  width: 120px;
  height: 1px;
  background-color: var(--color-mid-gray);
  margin: 2rem auto;
  transform-origin: center;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* AI Text Box Animation */
.ai-text-box {
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 400;
  color: var(--color-mid-gray);
  will-change: opacity, transform;
  height: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  backface-visibility: hidden;
  transform: translateZ(0);
  position: relative;
  z-index: 2;
}

.fixed-text {
  color: var(--color-mid-gray);
}

.changing-text {
  color: var(--color-accent);
  font-weight: 500;
  min-width: 10ch;
  text-align: center;
  transform: translateZ(0);
}

.cursor-blink {
  display: inline-block;
  animation: blink 1s infinite;
  color: var(--color-accent);
  font-weight: 300;
  transform: translateZ(0);
}

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

/* Performance optimizations */
#background-canvas {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Poppins font class */
.poppins-regular {
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* Social links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-light-gray);
  border-radius: 50%;
  color: var(--color-mid-gray);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.coming-soon {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  font-weight: 400;
  color: var(--color-mid-gray);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  will-change: transform;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    overflow: hidden;
    height: 100vh;
  }

  .content {
    height: 100vh;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Keep the exact same layout as desktop */
  .content-inner {
    /* No changes to grid layout - keep exactly as desktop */
    height: 100%;
    width: 100%;
    max-width: 100%;
  }

  .container {
    padding: 0;
    height: 100vh;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  /* Ensure text sizes are consistent */
  .main-text {
    font-size: 3rem; /* Match desktop exactly */
  }

  .ai-text-box {
    font-size: 1.2rem; /* Match desktop exactly */
  }

  .coming-soon {
    font-size: 1rem; /* Match desktop exactly */
  }

  /* Precise positioning to match desktop */
  .logo-container {
    position: absolute;
    top: 10%;
    left: 0;
    width: 100%;
    text-align: center;
  }

  .heading-container {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    text-align: center;
  }

  .right-container {
    position: absolute;
    top: 60%;
    left: 0;
    width: 100%;
    text-align: center;
  }

  .left-container {
    position: absolute;
    top: 70%;
    left: 0;
    width: 100%;
    text-align: center;
  }

  .bottom-container {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 100%;
    text-align: center;
  }

  /* Adjust canvas for better mobile performance */
  #background-canvas {
    will-change: transform;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  /* Ensure text sizes are appropriate for mobile */
  .main-text {
    font-size: 3rem; /* Match desktop exactly */
  }

  .ai-text-box {
    font-size: 1.4rem; /* Increased as requested */
    white-space: nowrap; /* Keep on single line */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem; /* Increased as requested */
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .fixed-text {
    white-space: nowrap;
  }

  .changing-text {
    white-space: nowrap;
    min-width: 6ch; /* Ensure enough space for text */
  }

  .coming-soon {
    font-size: 0.85rem; /* Smaller for mobile */
    letter-spacing: 0.15em; /* Slightly tighter letter spacing */
  }

  .fixed-text,
  .changing-text,
  .cursor-blink {
    display: inline-block;
  }

  /* Keep logo size consistent */
  .logo-image {
    height: 30px; /* Match desktop */
  }

  .logo-text {
    font-size: 1.5rem; /* Match desktop */
  }

  /* Keep social icons consistent */
  .social-icon {
    width: 36px; /* Match desktop */
    height: 36px; /* Match desktop */
  }

  /* Precise positioning to match desktop */
  .logo-container {
    top: 10%;
  }

  .heading-container {
    top: 45%; /* Adjusted as requested */
  }

  .right-container {
    top: 26%; /* Adjusted as requested */
  }

  .left-container {
    top: 58%; /* Adjusted as requested */
  }

  .bottom-container {
    bottom: 25%; /* Move social icons higher */
  }

  .social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Increase spacing between icons */
  }
}

/* Regular cursor */
body {
  cursor: default;
}

.cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background-color: var(--color-black);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

.cursor-follower {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
}
