/* -------------------------------------- */
/* GLOBAL RESET & BASE */
/* -------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: #000000; 
  color: #fff;
  min-height: 100vh;
  height: auto; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;

  overflow-x: hidden;
}

.overlay {
  position: absolute;
  inset: 0;
  /* CRITICAL FIX: Background image now here */
  background: url("background.jpg") center/cover no-repeat;
  z-index: 0; /* Lowest stacking layer */
}

/* -------------------------------------- */
/* CONTAINER & LOGO */
/* -------------------------------------- */
.container {
  z-index: 1;
  padding: clamp(1rem, 3vw, 2rem);
  max-width: 1200px;
  width: 100%;
  text-align: center;
  flex-grow: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto; 
}

.corner-logo {
  position: fixed;
  top: -8px;
  left: -20px;
  margin: 10px;
  width: clamp(100px, 10vw, 150px);
  z-index: 100;
}

/* -------------------------------------- */
/* CONTENT SPLIT LAYOUT */
/* -------------------------------------- */
.content-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  
  /* Z-index fix for text visibility */
  position: relative; 
  z-index: 2; 
  
  margin-top: clamp(4rem, 10vh, 6rem); /* Balanced top margin */
  width: 100%;
}

.left-col {
  width: 100%;
  text-align: center;
  overflow: visible;
  flex-shrink: 0;  
}

/* CRITICAL: Hide the mobile break on large screens (Default) */
.mobile-break {
    display: none;
}

/* CRITICAL FIX: The wrapper provides a fixed width to prevent layout shift */
.h1-wrapper {
  display: inline-block;     
  white-space: nowrap;
  width: 23ch;           /* Text (22ch) + 1ch buffer */
  height: auto;         
  line-height: 1.3;      
  position: relative;    
}

.right-col {
  max-width: 450px;
  width: 90%; 
  flex: none; 
  background: rgba(0, 0, 0, 0.65);
  padding: clamp(1rem, 2.5vw, 1.8rem);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  text-align: left;
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  line-height: 1.5;
  margin-top: clamp(5rem, 15vh, 8rem); /* Good separation from H1 */
}

/* -------------------------------------- */
/* HEADER & ANIMATION (Desktop) */
/* -------------------------------------- */
h1 {
  font-family: "Source Code Pro", monospace;
  font-weight: 400;
  font-size: clamp(1.8rem, 6vw, 5rem);
  line-height: 1.3;
  color: #1a412b; /* Change this to a light color (e.g., #A4F275 or #FFF) for visibility if needed */
  text-shadow: 1px 1px 4px rgba(255, 255, 255, 0.2);
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  
  border-right: none; 
  width: auto; 
  
  /* Uses the desktop typing animation */
  animation: typing 3.8s steps(22, end) 0s forwards;
  
  position: relative; 
  top: -0.05em; 
}

/* Cursor style for desktop */
.h1-wrapper::after {
    content: '';
    display: inline-block;
    vertical-align: top;
    height: 1em;
    width: 3px; 
    background: #1a412b; /* Match H1 color or use a light color */
    margin-left: 2px;
    animation: blinkCursor 0.75s step-end infinite 3.8s; 
}

/* Desktop typing animation (single line) */
@keyframes typing {
  from { width: 0ch; }
  to { width: 22ch; }
}

@keyframes blinkCursor {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

/* Mobile typing animation (multi-line) - Defined here but only used in media query */
@keyframes typing-wrap {
  from { width: 0; }
  to { width: 100%; }
}

.blinking-dots {
  opacity: 0;
  animation: showDots 0.1s forwards 3.6s, blinkDots 1s infinite 3.7s;
}

@keyframes showDots { to { opacity: 1; } }

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

@keyframes typing-mobile {
  from { width: 0ch; }
  to { width: 17ch; }
}

/* -------------------------------------- */
/* TEXT & FORMS */
/* -------------------------------------- */
p {
  margin-bottom: clamp(1rem, 3vw, 2.5rem);
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  max-width: 450px;
}

.form-description {
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 0;
}

.form-label {
  font-size: clamp(0.75rem, 1.5vw, 0.8rem);
}

.subscribe-form input[type="email"] {
  padding: clamp(0.6rem, 2vw, 1rem);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: clamp(0.85rem, 2vw, 1rem);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkbox-container input[type="checkbox"] {
  width: 1.2em;
  height: 1.2em;
  accent-color: #77b255;
  cursor: pointer;
}

.checkbox-label {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
}

.subscribe-form button[type="submit"] {
  padding: clamp(0.6rem, 2vw, 0.8rem) clamp(0.8rem, 3vw, 1rem);
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  border-radius: 6px;
  font-weight: 600;
  color: black;
  background-color: #fff;
  border: none;
  transition: background-color 0.3s ease;
}

.subscribe-form button[type="submit"]:hover {
  background-color: #7ea664;
}

/* -------------------------------------- */
/* FOOTER */
/* -------------------------------------- */
.main-footer {
  width: 100%;
  padding: clamp(1rem, 3vw, 2rem);
  text-align: center;
  z-index: 1;
  margin-top: auto; 
}

.footer-separator {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  width: 80%;
  max-width: 1000px;
  margin: 0 auto 1.5rem auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.socials a {
  color: #fff;
  margin: 0 0.8rem;
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(0.85rem, 2vw, 1rem);
}

.socials a:hover {
  color: #77b255;
}

.contact-email,
.copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
  margin: 0;
}

/* -------------------------------------- */
/* RESPONSIVE FIXES (Mobile CSS Changes) */
/* -------------------------------------- */
@media (max-width: 600px) {
  body {
    background-attachment: scroll;
    height: auto;
    min-height: 100vh;
  }
  
  .content-split {
    gap: 1.5rem;
    margin-top: clamp(3rem, 10vh, 5rem); 
  }
  
  /* 1. Show the <br> tags on mobile */
  .mobile-break {
      display: block; 
  }
  
 .h1-wrapper {
      /* Use the single-line settings from desktop, but with smaller values */
      display: block;
      margin: 0 auto;
      
      white-space: normal; /* CRITICAL: Force text on a single line for animation */
      overflow: visible;    /* CRITICAL: Hide un-typed text */
      width: 100%;         /* CRITICAL: The full width of the final typed text (approx) */ 
      height: auto;       /* Keep height fixed */
  }

  h1 {
      /* CRITICAL FIX 3: Revert to inline-block/hidden text */
      display: block; 
      white-space: normal;
      overflow: visible;
      text-align: center;
      animation: none;
      width: auto;
      opacity: 1;
      font-weight: 600;
  }
  
  /* 5. Hide the single-line cursor replacement (::after) */
  .h1-wrapper::after {
      display: none;
  }
  
  h1 {
      /* This replaces the typing animation with a simple fade-in */
      opacity: 0;
      animation: fadeIn 1.5s ease-out 0.5s forwards;
  }

  @keyframes fadeIn {
      to { opacity: 1; }
  }
  
  .blinking-dots {
      opacity: 1;
      animation: showDots 0.1s forwards 2s, blinkDots 1s infinite 2.1s;
  }

  /* ------------------------------------ */
  
  .right-col {
    max-width: 90%;
    width: 320px; 
    padding: 1rem;
    margin-top: 2rem;

    max-width: 320px;
    width: 90vw;
    margin: 2rem auto 0 auto;
  }

  .corner-logo {
    width: 90px;
    top: 10px;
  }
  
  .subscribe-form button {
    width: 100%;
  }
}
