/* Config & Variables */
:root {
    /* Palette */
    --bg: #080808;
    --text-muted: #444;
    --text-light: #e5e5e5;
    --accent: #00ff95; /* Starting hue 155 - cycles through rainbow on scroll */
  
    /* Timeline Scopes */
    timeline-scope: --s1, --s2, --s3, --s4;
  }
  
  /* Base / Reset */
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text-light);
    font-family: "Manrope", sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }
  
  /* Layout: Sticky Visuals (Right) */
  .sticky-visual {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100vh;
    display: grid;
    place-items: center;
    z-index: 10;
    pointer-events: none;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .shape-container {
    position: absolute;
    width: 400px;
    height: 400px;
    display: grid;
    place-items: center;
    opacity: 0;
  
    /* Entry/Exit Animation */
    animation-name: shape-fade;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Timeline Linkages */
  .shape-1 {
    animation-timeline: --s1;
  }
  .shape-2 {
    animation-timeline: --s2;
  }
  .shape-3 {
    animation-timeline: --s3;
  }
  .shape-4 {
    animation-timeline: --s4;
  }
  
  /* Layout: Content (Left) */
  .content {
    width: 50%;
    padding-bottom: 20vh;
    position: relative;
    z-index: 20;
  }
  
  header {
    height: 90vh;
    display: flex;
    align-items: center;
    padding-left: 10vw;
  }
  
  .scroll-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10vw;
    padding-right: 2rem;
  
    /* View Timeline Source */
    view-timeline-axis: block;
    view-timeline-inset: 40% 40%;
  }
  
  /* Section IDs */
  .s1 {
    view-timeline-name: --s1;
  }
  .s2 {
    view-timeline-name: --s2;
  }
  .s3 {
    view-timeline-name: --s3;
  }
  .s4 {
    view-timeline-name: --s4;
  }
  
  .closing-section {
    height: 60vh;
    display: flex;
    align-items: center;
    padding-left: 10vw;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10vh;
  }
  
  /* Components: Typography */
  h1 {
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 300;
    margin: 0;
    color: var(--accent);
    opacity: 0.8;
  }
  
  .title-large {
    display: block;
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-light);
    line-height: 1;
  }

  .subtitle {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 1.3rem;
    margin-top: 1.5rem;
    font-weight: 400;
    max-width: 400px;
    line-height: 1.5;
    /* Gradient spanning ~54° from starting hue (155 = #00ff95) - 60% of full range */
    background: linear-gradient(
      90deg,
      hsl(155, 100%, 50%),  /* mint/seafoam (start) */
      hsl(173, 100%, 50%),  /* cyan */
      hsl(191, 100%, 50%),  /* sky blue */
      hsl(209, 100%, 50%)   /* gentle blue */
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* Notify Button */
  .notify-btn {
    margin-top: 2rem;
    padding: 0.9rem 2rem;
    font-family: "Manrope", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .notify-btn:hover {
    background: var(--accent);
    color: var(--bg);
    transform: translateY(-2px);
  }

  /* Modal Overlay */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .modal-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Modal Content */
  .modal-content {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
  }

  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  .modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
  }

  .modal-close:hover {
    color: var(--text-light);
  }

  .modal-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
  }

  .modal-subtitle {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 2rem 0;
  }

  /* Signup Form */
  .signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .signup-input {
    padding: 1rem;
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    outline: none;
    transition: border-color 0.2s ease;
  }

  .signup-input::placeholder {
    color: var(--text-muted);
  }

  .signup-input:focus {
    border-color: var(--accent);
  }

  .signup-submit {
    padding: 1rem;
    font-family: "Manrope", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--accent);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .signup-submit:hover:not(:disabled) {
    background: var(--text-light);
  }

  .signup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .signup-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.4em;
  }

  .signup-message.success {
    color: #4ade80;
  }

  .signup-message.error {
    color: #ff0000;
  }
  
  .focus-text {
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-muted);
    margin: 0;
    max-width: 500px;
    letter-spacing: -0.02em;
  
    /* Magnify Effect */
    animation: content-focus linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
  
  .description {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1.5rem;
    max-width: 420px;
    line-height: 1.7;
    font-weight: 300;
    border-left: 2px solid var(--accent);
    padding-left: 1.5rem;
  
    /* Sync with Header */
    animation: content-focus linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
  
  .closer {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    max-width: 500px;
  }
  .closer strong {
    display: block;
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
  }
  .closer p {
    margin: 0 0 1rem 0;
    line-height: 1.7;
  }
  .closer p:last-child {
    margin-bottom: 0;
  }
  
  /* Components: Shapes (CSS Art) */
  /* 1. Circle Outline */
  .circle-outline {
    width: 300px;
    height: 300px;
    border: 2px solid var(--text-light);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.05);
  }
  
  /* 2. Textured Stone */
  .stone-block {
    width: 250px;
    height: 350px;
    background: linear-gradient(135deg, #333, #111);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
  }
  .stone-block::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
  }
  
  /* 3. Grid */
  .grid-lines {
    width: 300px;
    height: 300px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
  }
  .grid-box {
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  .grid-box:nth-child(1) {
    border-top: 0;
    border-left: 0;
  }
  .grid-box:nth-child(4) {
    border-bottom: 0;
    border-right: 0;
  }
  
  /* 4. Balance */
  .balance {
    width: 300px;
    height: 300px;
    position: relative;
  }
  .b-circle {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    mix-blend-mode: exclusion;
  }
  .b-1 {
    background: #fff;
    top: 20%;
    left: 20%;
  }
  .b-2 {
    background: #666;
    bottom: 20%;
    right: 20%;
  }
  
  /* 5. Light Orb */
  .light-orb {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(
      circle at 30% 30%,
      var(--accent),
      transparent 60%
    );
    filter: blur(40px);
    opacity: 0.6;
  }
  
  /* 6. End Line */
  .end-line {
    width: 2px;
    height: 300px;
    background: var(--text-light);
    position: relative;
  }
  .end-line::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 1px;
    background: var(--text-light);
  }
  
  /* Components: Progress Indicators */
  
  /* Desktop: Vertical Line on Border */
  .desktop-progress {
    position: absolute;
    left: -1px;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    transform-origin: top;
    transform: scaleY(0);
    animation: progress-grow linear;
    animation-timeline: scroll();
    z-index: 20;
  }
  
  /* Mobile: Circular Widget */
  .mobile-progress {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
  }
  
  .mobile-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
  }
  
  .progress-circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: circle-grow linear;
    animation-timeline: scroll();
  }
  
  .track-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
  }
  
  /* Keyframes */
  @keyframes shape-fade {
    entry 0% {
      opacity: 0;
      transform: translateY(40px) scale(0.9);
    }
    entry 100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
    exit 0% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
    exit 100% {
      opacity: 0;
      transform: translateY(-40px) scale(1.1);
    }
  }
  
  @keyframes content-focus {
    0% {
      filter: blur(12px);
      opacity: 0;
      transform: scale(0.8) translateY(40px);
      border-color: transparent;
    }
    45%,
    55% {
      filter: blur(0);
      opacity: 1;
      transform: scale(1) translateY(0);
      color: var(--text-light);
      border-color: var(--accent);
    }
    100% {
      filter: blur(12px);
      opacity: 0;
      transform: scale(0.95) translateY(-40px);
      border-color: transparent;
    }
  }
  
  @keyframes progress-grow {
    to {
      transform: scaleY(1);
    }
  }
  
  @keyframes circle-grow {
    to {
      stroke-dashoffset: 0;
    }
  }
  
  /* When JS drives scroll effects, disable CSS scroll-timeline animations
     (WebKit/iOS renders its cover ranges incorrectly). */
  .js-scroll-fx .focus-text,
  .js-scroll-fx .description {
    animation: none;
    color: var(--text-light);
    will-change: filter, opacity, transform;
  }

  .js-scroll-fx .description {
    border-color: var(--accent);
  }

  /* Shape visibility driven by JS */
  .js-scroll-fx .shape-container {
    animation: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .js-scroll-fx .shape-container.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

/*  Responsive Design  */
  @media (max-width: 768px) {
    .sticky-visual {
      opacity: 0.1;
      width: 100%;
      z-index: -1;
      border-left: none;
    }
  
    .content {
      width: 100%;
    }
    .scroll-section {
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
    header {
      padding-left: 1.5rem;
    }
  
    /* Adjust Typography */
    .focus-text {
      font-size: 2rem;
    }
    .title-large {
      font-size: 3.5rem;
    }
    .subtitle {
      font-size: 1rem;
    }
    .notify-btn {
      padding: 0.8rem 1.5rem;
      font-size: 0.8rem;
    }
    .modal-content {
      padding: 2rem;
      margin: 1rem;
    }
    .modal-title {
      font-size: 1.5rem;
    }
  
    /* Toggle Progress Indicators */
    .desktop-progress {
      display: none;
    }
    .mobile-progress {
      display: block;
    }
  }
  