/* ============================================
   COSMOS CLONE - EXACT DESIGN
   ============================================ */

:root {
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --text-secondary: #a8a8a8;
  --text-muted: #6a6a7a;
  --border: color-mix(in oklch, black 10%, transparent);
  --accent: #0023ff;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   Fonts
   ============================================ */

@font-face {
  font-family: 'Diorama';
  src: url('fonts/Diorama.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'BDO Grotesk';
  src: url('fonts/BDOGrotesk-Light.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'BDO Grotesk';
  src: url('fonts/BDOGrotesk-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'BDO Grotesk';
  src: url('fonts/BDOGrotesk-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

/* ============================================
   Global
   ============================================ */

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

html {
  scroll-behavior: auto;
  overscroll-behavior: none;
}

html.lenis, html.lenis body {
  height: auto;
}

body {
  font-family: 'BDO Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================
   Animation Keyframes
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

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

@keyframes blurUp {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

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

/* Stagger animation states */
.animate-in {
  animation: fadeInUp 0.8s var(--ease-expo) forwards;
}

.animate-in-stagger-1 { animation-delay: 0.1s; }
.animate-in-stagger-2 { animation-delay: 0.2s; }
.animate-in-stagger-3 { animation-delay: 0.3s; }
.animate-in-stagger-4 { animation-delay: 0.4s; }
.animate-in-stagger-5 { animation-delay: 0.5s; }
.animate-in-stagger-6 { animation-delay: 0.6s; }
.animate-in-stagger-7 { animation-delay: 0.7s; }
.animate-in-stagger-8 { animation-delay: 0.8s; }

a {
  color: inherit;
  text-decoration: none;
  transition: all 300ms var(--ease-expo);
}

/* ============================================
   Header
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: none;
  padding: 1.5rem 2rem;
  backdrop-filter: blur(64px);
  scroll-snap-align: none;
  transition: background-color 0s linear, border-color 0s linear;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  white-space: nowrap;
  color: var(--text);
  transition: color 0s linear;
}

.logo-img {
  width: 65px;
  height: 65px;
}

.nav {
  display: flex;
  gap: 3rem;
  flex: 1;
  margin-left: 2rem;
}

.nav a {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.nav a:hover {
  color: var(--text);
}

.auth {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.login {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.login:hover {
  color: var(--text);
}

.signup {
  font-size: 0.95rem;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  transition: all 300ms ease;
}

.signup:hover {
  background: #0035ff;
  box-shadow: 0 8px 20px rgba(0, 35, 255, 0.3);
  transform: translateY(-1px);
}

/* ============================================
   Snap Sections
   ============================================ */

.snap-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}


/* ============================================
   Gallery Backdrop - Scattered Layout
   ============================================ */

.gallery-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.gallery-backdrop img {
  position: absolute;
  object-fit: cover;
  border-radius: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: fadeIn 0.8s var(--ease-expo) forwards;
  pointer-events: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 5;
  will-change: transform, opacity;
}

/* ============================================
   Scattered Pop-in Gallery (Philosophy Section 2)
   ============================================ */

.gallery-pop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.gallery-pop img {
  position: absolute;
  object-fit: cover;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.gallery-pop img.pop-visible {
  opacity: 1;
  transform: scale(1);
}

.gallery-pop img.pop-faded {
  opacity: 0.25;
  transform: scale(0.97);
}

.gallery-pop img.pop-ghost {
  opacity: 0.1;
  transform: scale(0.94);
}

/* Position images in a ring around center text — vw-based sizing scales with viewport */
.gallery-backdrop img:nth-child(1)  { top: 2vh;  left: -2vw;  width: 13vw; height: 17vw; animation-delay: 0.1s; }
.gallery-backdrop img:nth-child(2)  { top: 5vh;  left: 18vw;  width: 11vw; height: 14vw; animation-delay: 0.15s; }
.gallery-backdrop img:nth-child(3)  { top: 3vh;  left: 42vw;  width: 10vw; height: 13vw; animation-delay: 0.2s; }
.gallery-backdrop img:nth-child(4)  { top: 2vh;  right: -1vw;  width: 12vw; height: 16vw; animation-delay: 0.25s; }
.gallery-backdrop img:nth-child(5)  { top: 30vh; left: -3vw;  width: 14vw; height: 18vw; animation-delay: 0.3s; }
.gallery-backdrop img:nth-child(6)  { top: 25vh; left: 10vw;  width: 10vw; height: 13vw; animation-delay: 0.35s; }
.gallery-backdrop img:nth-child(7)  { top: 28vh; right: -2vw;  width: 13vw; height: 17vw; animation-delay: 0.4s; }
.gallery-backdrop img:nth-child(8)  { top: 50vh; right: 2vw;   width: 11vw; height: 15vw; animation-delay: 0.45s; }
.gallery-backdrop img:nth-child(9)  { bottom: 18vh; left: 5vw;  width: 12vw; height: 16vw; animation-delay: 0.5s; }
.gallery-backdrop img:nth-child(10) { bottom: 14vh; left: 25vw; width: 10vw; height: 13vw; animation-delay: 0.55s; }
.gallery-backdrop img:nth-child(11) { bottom: 8vh;  left: 42vw; width: 11vw; height: 14vw; animation-delay: 0.6s; }
.gallery-backdrop img:nth-child(12) { bottom: 16vh; right: 5vw; width: 13vw; height: 17vw; animation-delay: 0.65s; }
.gallery-backdrop img:nth-child(13) { bottom: 3vh;  right: -1vw; width: 12vw; height: 15vw; animation-delay: 0.7s; }
.gallery-backdrop img:nth-child(14) { top: 62vh; left: 0vw;     width: 11vw; height: 14vw; animation-delay: 0.75s; }
.gallery-backdrop img:nth-child(15) { top: 55vh; left: 30vw;    width: 10vw; height: 13vw; animation-delay: 0.8s; }

/* ============================================
   Hero
   ============================================ */

.hero {
  background: var(--bg);
  min-height: 100vh;
  overflow: visible;
}

.hero-content {
  max-width: 900px;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  pointer-events: all;
  width: 90%;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.hero h1 {
  font-family: 'BDO Grotesk', sans-serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
  text-wrap: balance;
  will-change: transform, opacity;
}

.hero p {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 400ms var(--ease-expo);
  box-shadow: 0 8px 20px rgba(0, 35, 255, 0.3);
}

.btn:hover {
  background: #0035ff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 35, 255, 0.4);
}

/* ============================================
   Philosophy Sections
   ============================================ */

.philosophy-section {
  position: relative;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.philosophy-light {
  background: #ffffff;
  color: #000;
}

.philosophy-light .block {
  color: #000;
}

.philosophy-gradient {
  background: #ffffff;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.philosophy-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: 0 1rem;
  border-radius: 24px;
  background: linear-gradient(180deg, #1a2a6e 0%, #2840a8 30%, #4a6ad4 55%, #c8d4f0 80%, #ffffff 100%);
  z-index: 0;
}

.philosophy-content {
  position: relative;
  z-index: 50;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  pointer-events: all;
  will-change: transform, opacity;
  text-align: center;
}

.philosophy-double {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.block {
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.block-1,
.block-2,
.block-5,
.block-7 {
  font-family: 'BDO Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 400;
}

.block-3,
.block-8 {
  font-size: 2.5rem;
  color: inherit;
}

.block-4,
.block-6 {
  font-size: 1.1rem;
  color: inherit;
  max-width: 600px;
  line-height: 1.8;
  margin-left: auto;
  margin-right: auto;
}

/* Inline cycling circle */
.inline-circle {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  vertical-align: middle;
  margin: 0 0.1em;
}

.inline-circle img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.inline-circle img.circle-active {
  opacity: 1;
}

/* Scattered text layout for gradient section */

.philosophy-scattered {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-items: center;
}

.text-line {
  font-family: 'BDO Grotesk', sans-serif;
  font-size: 4rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -1px;
  will-change: transform;
}

.text-line.line-1 {
  align-self: flex-start;
  margin-top: 2rem;
  margin-right: auto;
  margin-left: 5%;
}

.text-line.line-2 {
  align-self: center;
  margin-left: 25%;
}

.text-line.line-3 {
  align-self: center;
  margin-right: 15%;
}

.text-line.line-4 {
  align-self: center;
  margin-left: 20%;
  font-size: 3.5rem;
}

.text-line.line-5 {
  align-self: flex-end;
  margin-bottom: 2rem;
  margin-right: 8%;
}

/* ============================================
   CTA
   ============================================ */

/* ============================================
   Final CTA
   ============================================ */

.cta-final {
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-final-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.cta-final-heading {
  font-family: 'BDO Grotesk', sans-serif;
  font-size: 3.5rem;
  font-weight: 400;
  color: #000;
  letter-spacing: -1px;
}

.cta-final-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  color: #fff;
  font-family: 'BDO Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 400;
  padding: 2.5rem 5rem;
  border-radius: 100px;
  transition: transform 400ms var(--ease-expo), box-shadow 400ms var(--ease-expo);
  letter-spacing: -0.5px;
}

.cta-final-btn:hover {
  transform: scale(1.025);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Footer (single row)
   ============================================ */

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: #ffffff;
  color: #888;
  font-size: 0.8rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: #000;
}

.footer-copy {
  color: #aaa;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.footer-group-label {
  font-weight: 700;
  color: #000;
}

.footer-links a {
  color: #999;
  font-size: 0.8rem;
}

.footer-links a:hover {
  color: #000;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .header {
    padding: 1rem 1.25rem;
  }

  .header-content {
    gap: 1rem;
  }

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

  /* Hero keeps full height so absolute positioning works */
  .hero {
    min-height: 100svh;
  }

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

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  /* Philosophy sections keep full height for scroll animations */
  .snap-section {
    min-height: 100svh;
    padding: 2rem 1.25rem;
  }

  .philosophy-content {
    padding: 2rem 1rem;
  }

  .philosophy-double {
    gap: 1.5rem;
  }

  .block {
    font-size: 1.25rem;
  }

  .block-1,
  .block-2,
  .block-5,
  .block-7 {
    font-size: 1.75rem;
  }

  .block-3,
  .block-8 {
    font-size: 1.5rem;
  }

  .block-4,
  .block-6 {
    margin-left: 0;
    font-size: 1rem;
  }

  /* Scattered text — center-aligned on mobile, parallax provides movement */
  .text-line {
    font-size: 2.2rem;
  }

  .text-line.line-1 {
    align-self: center;
    margin: 0;
    margin-top: 1rem;
  }

  .text-line.line-2 {
    align-self: center;
    margin: 0;
  }

  .text-line.line-3 {
    align-self: center;
    margin: 0;
  }

  .text-line.line-4 {
    align-self: center;
    margin: 0;
    font-size: 2rem;
  }

  .text-line.line-5 {
    align-self: center;
    margin: 0;
    margin-bottom: 1rem;
  }

  /* Gradient rounded corners smaller on mobile */
  .philosophy-gradient::before {
    margin: 0 0.5rem;
    border-radius: 16px;
  }

  /* CTA */
  .cta-final {
    min-height: 100svh;
  }

  .cta-final-heading {
    font-size: 2.2rem;
    padding: 0 1rem;
  }

  .cta-final-btn {
    font-size: 1.3rem;
    padding: 1.5rem 2.5rem;
  }

  /* Footer */
  .footer-row {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem 1rem;
  }

  /* Gallery backdrop — show fewer, smaller images on mobile */
  .gallery-backdrop img {
    border-radius: 8px;
  }

  /* Hide images 8-15 on mobile to reduce clutter */
  .gallery-backdrop img:nth-child(n+8) {
    display: none;
  }

  /* Reposition remaining 7 images around edges, smaller */
  .gallery-backdrop img:nth-child(1)  { top: 3vh;  left: 2vw;   width: 22vw; height: 28vw; }
  .gallery-backdrop img:nth-child(2)  { top: 2vh;  right: 2vw;  left: auto; width: 20vw; height: 26vw; }
  .gallery-backdrop img:nth-child(3)  { top: 35vh; left: -2vw;  width: 18vw; height: 23vw; }
  .gallery-backdrop img:nth-child(4)  { top: 32vh; right: -2vw; left: auto; width: 20vw; height: 26vw; }
  .gallery-backdrop img:nth-child(5)  { bottom: 12vh; left: 3vw; top: auto; width: 20vw; height: 26vw; }
  .gallery-backdrop img:nth-child(6)  { bottom: 8vh; right: 2vw; left: auto; top: auto; width: 18vw; height: 23vw; }
  .gallery-backdrop img:nth-child(7)  { top: 8vh;  left: 38vw;  width: 18vw; height: 23vw; }

  /* Pop gallery — reduce image count visually */
  .gallery-pop img {
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.75rem 1rem;
  }

  .logo-img {
    width: 36px;
    height: 36px;
  }

  .auth {
    gap: 0.5rem;
  }

  .login,
  .signup {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
  }

  .block {
    font-size: 1.1rem;
  }

  .block-1,
  .block-2,
  .block-5,
  .block-7 {
    font-size: 1.4rem;
  }

  .block-3,
  .block-8 {
    font-size: 1.2rem;
  }

  .text-line {
    font-size: 1.75rem;
  }

  .text-line.line-4 {
    font-size: 1.6rem;
  }

  .cta-final-heading {
    font-size: 1.75rem;
  }

  .cta-final-btn {
    font-size: 1.1rem;
    padding: 1.2rem 2rem;
  }
}
