/* @import url('https://api.fontshare.com/v2/css?f[]=satoshi@1,900,700,500,301,701,300,501,401,901,400&display=swap'); */

@import url('css/satoshi.css');

:root {
  --fw: 1440; /* Desktop Figma viewport width */
  --fh: 1024; /* Desktop Figma viewport height */

  /* Dynamic Layout & Positioning (scales with viewport) */
  --content-left: calc(580 / var(--fw) * 100vw); 
  /* --content-left: 580px; */
  --content-width: calc(750 / var(--fw) * 100vw);
  --bg-width: calc(1820.8 / var(--fw) * 100vw);
  --form-width: calc(435 / var(--fw) * 100vw);

  /* Dynamic Typography (scales proportionally) */
  --font-title: 48px;
  --font-desc: 24px;
  --font-base: 16px;
  
  /* Dynamic Line Heights (maintain Figma ratios) */
  --line-height-title: calc(65 / 48); /* 1.354 */
  --line-height-desc: calc(36 / 24); /* 1.5 */
  --line-height-base: calc(22 / 16); /* 1.375 */

  /* Dynamic Spacing (scales with viewport) */
  --gap-hero-figma: 48px;
  --gap-hero: calc(var(--gap-hero-figma) - (var(--font-title) * (var(--line-height-title) - 1) / 2) - (var(--font-desc) * (var(--line-height-desc) - 1) / 2));
  --padding-container: 64px;
  
  /* Dynamic Form Elements (scale proportionally to maintain text-box ratio) */
  --form-height: 48px;
  --input-width: 320px;
  --button-width: 115px;
  --form-font-size: 16px;
  --form-padding: 16px;
  
  /* Colors & Transitions */
  --color-primary: #005945;
  --color-primary-hover: #047857;
  --color-primary-disabled: #004a3a;
  --color-accent: #F2B234;
  --color-bg-dark: #001410;
  --color-white: #FFFFFF;
  --color-black: #000000;
  --transition-fast: 0.3s ease;
  --transition-medium: 0.5s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

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

body {
  font-family: 'Satoshi-Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-bg-dark);
  color: var(--color-white);
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}


.bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  transition: opacity var(--transition-slow);
}

.bg-default { background-image: url('images/bg_default.webp'); opacity: 1; }
.bg-focus { background-image: url('images/bg_focus.webp'); opacity: 0; }
.bg-result { background-image: url('images/bg_result.webp'); opacity: 0; }


.main-container {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 100vh;
}


.logo {
  position: fixed;
  z-index: 10;
  top: var(--padding-container);
  left: var(--padding-container);
  width: 122px;
  height: 80px;
}
.logo-light, .logo-dark { position: absolute; top: 0; left: 0; opacity: 1; transition: opacity var(--transition-slow); width: 100%; height: auto; }
.logo-dark { opacity: 0; width: 100%; height: auto;}
.logo img { width: 100%; height: auto; object-fit: contain; }


.hero-section {
  position: absolute;
  left: var(--content-left);
  width: var(--content-width);
  max-width: 750px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  gap: var(--gap-hero);
}

.hero-title {
  width: 100%;
  font-family: 'Satoshi-Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: var(--font-title);
  line-height: var(--line-height-title);
  letter-spacing: -0.01em;
  color: var(--color-white);
  opacity: 0.8;
  margin: 0;
  flex: none;
  order: 0;
  align-self: stretch;
  flex-grow: 0;
  transition: color var(--transition-slow);
}

.hero-description {
  width: 100%;
  font-family: 'Satoshi-Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 300;
  font-size: var(--font-desc);
  line-height: var(--line-height-desc);
  letter-spacing: -0.01em;
  color: var(--color-white);
  opacity: 0.8;
  margin: 0;
  flex: none;
  align-items: center;
  position:relative;
  order: 1;
  align-self: stretch;
  flex-grow: 0;
  transition: color var(--transition-slow);
}


.email-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  width: var(--form-width);
  height: var(--form-height);
  align-self: flex-start;
  flex: none;
  order: 2;
  flex-grow: 0;
}

.email-input {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 var(--form-padding);
  gap: calc(10 / var(--fw) * 100vw);
  width: var(--input-width);
  max-width: 320px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 0;
  border: none;
  outline: none;
  color: var(--color-white);
  font-family: 'Satoshi-Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  font-size: var(--form-font-size);
  line-height: var(--line-height-base);
  letter-spacing: -0.01em;
  text-align: left;
  flex: none;
  order: 0;
  flex-grow: 0;
  transition: all var(--transition-fast);
}
.email-input::placeholder { 
  color: var(--color-white); 
  opacity: 0.4; 
  font-weight: 500;
}

.join-button {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 var(--form-padding);
  gap: calc(10 / var(--fw) * 100vw);
  height: 100%;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  font-family: 'Satoshi-Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  font-size: var(--form-font-size);
  line-height: var(--line-height-base);
  letter-spacing: -.16px;
  text-align: center;
  white-space: nowrap;
  opacity: 0.8;
  flex: none;
  order: 1;
  flex-grow: 0;
  transition: background var(--transition-slow);
}
.join-button:hover { background: var(--color-primary-hover); opacity: 1; }


.footer {
  position: fixed;
  z-index: 10;
  /* bottom: 64px;  */
  bottom: 32px;
  left: var(--padding-container);
  font-size: var(--font-base);
  line-height: var(--line-height-base);
  opacity: 0.3;
}

.ticker {
  position: absolute;
  z-index: 15;
  left: 0;
  top: calc(-54 / var(--fh) * 100vh);
  padding: 10px;
  background: var(--color-accent);
  color: var(--color-black);
  font-weight: 700;
  font-size: var(--font-base);
  line-height: var(--line-height-base);
  opacity: 0;
  transition: opacity var(--transition-medium);
}
.ticker.show { opacity: 1; }



.hero-description-mobile {
  display: none;
}

.hero-description-desktop {
  display: block;
}


.state-focus .email-input { background: rgba(255, 255, 255, 0.6); color: var(--color-black); }
.state-focus .email-input::placeholder { color: var(--color-black); opacity: 0.4; }
.state-message .hero-title, .state-message .hero-description,
.state-result .hero-title, .state-result .hero-description { color: var(--color-black); }
.state-message .email-input, .state-result .email-input { display: none !important; }
.state-result .email-form { visibility: hidden; }


@media (max-width: 1200px) and (orientation: portrait) {
  :root {
    /* Adjust proportions for smaller screens */
    --content-left: 0;
    --content-width: 100%;
    --font-title: clamp(1.5rem, 5vw, 3rem);
    --font-desc: clamp(1rem, 3vw, 1.5rem);
    --font-base: clamp(0.875rem, 2.5vw, 1rem);
    --gap-hero-figma: clamp(1.5rem, 4vw, 3rem);
    --gap-hero: calc(var(--gap-hero-figma) - (var(--font-title) * (var(--line-height-title) - 1) / 2) - (var(--font-desc) * (var(--line-height-desc) - 1) / 2));
    --padding-container: clamp(1rem, 4vw, 2rem);
    --form-height: clamp(2.75rem, 4vw, 3rem);
    --form-width: 100%;
    --tablet-hero-right: clamp(40px, 8vw, 120px);
  }

  .bg-layer {
    width: 150vw;
    left: -100px; 
  }

  .main-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--padding-container);
  }

  .email-form {
    width: auto;
    align-self: flex-start
  }

  .hero-section {
    position: absolute;
    left: auto;
    right: var(--tablet-hero-right);
    bottom: 500px;
    transform: none;
    width: 100%;
    max-width: 500px;
    align-items: center;
  }

  /* iPad Mini specific adjustments */
  @media (max-width: 900px) and (min-width: 768px) {
    :root {
      --tablet-hero-right: clamp(30px, 6vw, 60px);
    }
  }

  /* iPad Pro specific adjustments */
  @media (min-width: 1000px) and (max-width: 1200px) {
    :root {
      --tablet-hero-right: clamp(80px, 10vw, 140px);
    }
  }

    /* Show mobile description, hide desktop description */
  .hero-description-desktop {
      display: none;
    }
  
  .hero-description-mobile {
      display: block;
    }
}

/* Responsive Breakpoint: Mobile */
@media (max-width: 600px) {
  :root {
    --mobile-fw: 402; /* Mobile Figma width */
    --mobile-fh: 874; /* Mobile Figma height */
    --mobile-content-offset: calc(94 / var(--mobile-fh) * 100vh);
    
    
    --font-title: calc(32 / var(--mobile-fw) * 100vw); /* 32px at 402px */
    --font-desc: calc(16 / var(--mobile-fw) * 100vw); /* 16px at 402px */
    --font-base: calc(12 / var(--mobile-fw) * 100vw); /* 12px footer */
    
    
    --gap-hero-figma: calc(48 / var(--mobile-fw) * 100vw); /* 48px gap */
    --gap-hero: calc(var(--gap-hero-figma) - (var(--font-title) * (var(--line-height-title) - 1) / 2) - (var(--font-desc) * (var(--line-height-desc) - 1) / 2));
    --padding-container: 32px; 
    
    
    --form-font-size: calc(16 / var(--mobile-fw) * 100vw); /* 16px scales with mobile width */
    --form-padding: calc(16 / var(--mobile-fw) * 100vw); /* 16px padding scales */
    --form-height: calc(48 / var(--mobile-fw) * 100vw); /* 48px height scales */
    --mobile-hero-width: calc(402 / var(--mobile-fw) * 100vw); /* Full mobile width */
    --mobile-hero-height: calc(226 / var(--mobile-fh) * 100vh); /* Hero height scales with viewport height */
    --mobile-content-width: calc(338 / var(--mobile-fw) * 100vw); /* Content width after padding */
    
    
    --mobile-input-width: calc(223 / var(--mobile-fw) * 100vw);
    
    
    --mobile-footer-bottom: 16px;

    --hero-to-kb: calc(80 / var(--mobile-fh) * 100vh);
    --hero-bottom: 102px;
    --bg-shift: calc(105 / var(--mobile-fh) * 100vh);  
  }

  body {
    min-height: 100dvh;
    padding: 0; /* Remove all padding */
    margin: 0;
  }

  
  .bg-layer {
    width: calc(100vw + 52px); 
    height: 100dvh; /* Fill entire dynamic viewport height */
    left: -52px; 
    top: 0;
    background-size: cover;
    background-position: left center;
  }
  
  
  .bg-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -17px; /* Compensate for bg offset */
    width: calc(100vw + 86px);
    height: 100dvh; /* Fill entire dynamic viewport height */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
  }

  .state-focus.not-safari-browser.keyboard-visible.keyboard-visible.keyboard-significant .bg-layer{
    top: calc(var(--keyboard-height) - var(--bg-shift));
  }
  .state-focus.safari-browser.keyboard-visible.keyboard-significant .bg-layer{
    top: calc(var(--keyboard-height) - var(--bg-shift));
  }

  .state-focus.not-safari-browser.keyboard-visible.keyboard-significant .hero-section{
    /* bottom: calc(var(--hero-to-kb)); */
    bottom: calc(var(--hero-to-kb) - var(--hero-padding-bottom));
  }
  .state-focus.safari-browser.keyboard-significant .hero-section{
    /* bottom: var(--hero-to-kb); */
    bottom: calc(var(--hero-to-kb) - var(--hero-padding-bottom));
  }


  .state-focus.not-safari-browser.keyboard-visible.keyboard-visible.keyboard-significant .logo{
    top: calc(var(--keyboard-height) + 32px);
  }

  .state-focus.safari-browser.keyboard-visible.keyboard-significant .logo{
    top: calc(var(--keyboard-height) + 32px);
  }
  .state-focus .footer, .state-default.keyboard-visible.keyboard-significant .footer{
    bottom: -100px;
  }

  .state-message .hero-section, .state-result .hero-section {
    top: calc(50% - var(--mobile-hero-height)/2 + var(--mobile-content-offset) - 1vh + 30px);
  }

  .state-result .hero-title, .state-result .hero-description,
  .state-message .hero-title, .state-message .hero-description{
    color: var(--color-white);
  }

  .bg-default { background-image: url('images/bg_default_mobile.webp'); }
  .bg-focus { background-image: url('images/bg_focus_mobile.webp'); }
  .bg-result { background-image: url('images/bg_result_mobile.webp'); }

  
  .main-container {
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: 100dvh;
    position: relative;
    overflow: hidden; /* Prevent any overflow that might cause gaps */
  }

  
  .hero-section {
    top: auto;
    position: absolute;
    left: 0;
    height: var(--mobile-hero-height); /* Scales with viewport height */
    /* bottom: calc(50% - 130px);  */
    bottom: 102px;
    text-align: left;
    align-items: flex-start;
    padding: 0 var(--padding-container); /* Dynamic padding */
    gap: calc(var(--gap-hero) - 10px);
  }

  
  .footer {
    position: fixed;
    bottom: var(--mobile-footer-bottom); /* 166px from bottom in Figma mobile specs */
    left: var(--padding-container); /* Dynamic left padding */
    font-size: var(--font-base); /* Scales with viewport */
    line-height: calc(16 / var(--mobile-fw) * 100vw); /* Dynamic line height */
    opacity: 0.2;
  }

  
  .logo {
    top: 32px;
    left: 32px;
    width: 98px;
    height: 32px; 
  }

  .ticker {
    left: var(--padding-container);
    top: -45px;
    width: auto;
    max-width: calc(100vw - 2 * var(--padding-container));
    font-size: var(--font-base);
    padding: 10px;
  }
  
  
  .email-form {
    flex-direction: row;
    gap: 0;
    height: var(--form-height); 
    width: var(--mobile-content-width); 
    align-self: stretch;
  }
  
  .email-input {
    width: var(--mobile-input-width); 
    flex-grow: 1;
    height: 100%;
    padding: 0 var(--form-padding); 
    font-size: var(--form-font-size); 
    line-height: calc(22 / var(--mobile-fw) * 100vw); 
  }
  
  .join-button {
    height: 100%;
    padding: 0 var(--form-padding); 
    flex-grow: 0;
    font-size: var(--form-font-size);
    line-height: calc(22 / var(--mobile-fw) * 100vw);
  }

  /* Minimum sizes for very small screens */
  @media (max-width: 350px) {
    :root {
      --font-title: clamp(1.25rem, calc(32 / var(--mobile-fw) * 100vw), 2rem);
      --font-desc: clamp(0.875rem, calc(16 / var(--mobile-fw) * 100vw), 1rem);
      --form-font-size: clamp(0.875rem, calc(16 / var(--mobile-fw) * 100vw), 1rem);
      --form-height: clamp(2.5rem, calc(48 / var(--mobile-fw) * 100vw), 3rem);
    }
  }

  /* Maximum sizes for larger mobile screens */
  @media (min-width: 500px) and (max-width: 600px) {
    :root {
      --font-title: clamp(calc(32 / var(--mobile-fw) * 100vw), 2rem, 2.5rem);
      --font-desc: clamp(calc(16 / var(--mobile-fw) * 100vw), 1rem, 1.25rem);
      --form-font-size: clamp(calc(16 / var(--mobile-fw) * 100vw), 1rem, 1.125rem);
    }
  }


  .hero-description-desktop {
    display: none;
  }

  .hero-description-mobile {
    display: block;
  }

}


.loading { position: relative; padding-left: 50px; padding-right: 50px;}
.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(16 / var(--fw) * 100vw);
  height: calc(16 / var(--fw) * 100vw);
  border: calc(2 / var(--fw) * 100vw) solid transparent;
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }


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