@layer sections {
  /* SECTION 2: THE EARTH JOURNEY (jy-) */
  .jy {
    position: relative;
    background-color: var(--c-navy-950);
    color: var(--c-white);
    overflow: hidden;
    /* Pinned trigger container */
    min-block-size: 100svh;
  }

  .jy__pin {
    position: relative;
    inline-size: 100vw;
    block-size: 100svh;
    overflow: hidden;
    background: linear-gradient(180deg, var(--c-navy-950) 0%, var(--c-navy-900) 100%);
  }

  /* Earth Stage Container (Section 2.4, 2.6) */
  .jy__earth {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.6s var(--ease-out);
    will-change: opacity, transform;
  }

  .jy.is-ready .jy__earth {
    opacity: 1;
  }

  /* Side mode Farsi mirroring: Earth on right in Farsi, on left in English (Section 2.3) */
  @media (min-aspect-ratio: 1/1) and (min-width: 700px) {
    html[dir='rtl'] .jy__earth {
      transform: scaleX(-1);
    }
    html[dir='ltr'] .jy__earth {
      transform: none;
    }
  }

  .jy__still {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: left center;
    opacity: 1;
    transition: opacity 0.6s var(--ease-out);
    -webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - 60px), transparent 100%);
    mask-image: linear-gradient(to right, black 0%, black calc(100% - 60px), transparent 100%);
  }

  html[dir='rtl'] .jy__still {
    object-position: right center;
  }

  .jy.has-canvas .jy__still {
    opacity: 0;
    pointer-events: none;
  }

  .jy__canvas {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    display: block;
  }

  /* Horizontal Track (Section 2.3) */
  .jy__track {
    display: flex;
    flex-direction: row;
    inline-size: 400vw;
    block-size: 100%;
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 2;
    will-change: transform;
  }

  /* Individual Panels */
  .jy__panel {
    flex: 0 0 100vw;
    inline-size: 100vw;
    block-size: 100svh;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-inline: var(--gutter);
  }

  /* Side Mode Padding (Desktop / Landscape) */
  @media (min-aspect-ratio: 1/1) and (min-width: 700px) {
    .jy__panel {
      padding-inline-start: 24vw;
      padding-inline-end: clamp(40px, 8vw, 120px);
    }
  }

  @media (min-aspect-ratio: 1/1) and (min-width: 700px) and (max-width: 1023px) {
    .jy__panel {
      padding-inline-start: 20vw;
    }
  }


  /* Typography & Composition within Panels */
  .jy__kicker {
    font-size: var(--fs-label);
    color: var(--c-green-500);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    font-weight: 600;
    margin-block-end: var(--s-3);
  }

  .jy__title {
    color: var(--c-white);
    font-size: var(--fs-h2);
    font-weight: 700;
    line-height: var(--lh-head);
    margin-block-end: var(--s-4);
    max-inline-size: 34rem;
  }

  .jy__text {
    color: rgba(255, 255, 255, 0.78);
    font-size: var(--fs-lead);
    line-height: var(--lh-body);
    max-inline-size: 34rem;
    margin-block-end: var(--s-6);
  }

  /* Panel 1 Special Composition */
  .jy__p1-content {
    max-inline-size: 38rem;
    position: relative;
    z-index: 3;
  }

  .jy__p1-title {
    font-size: clamp(2.25rem, 1.2rem + 3.4vw, 4.75rem);
    max-inline-size: 16ch;
    line-height: 1.05;
  }

  html[lang='fa'] .jy__p1-title {
    line-height: 1.25;
  }

  .jy__actions {
    display: flex;
    align-items: center;
    gap: var(--s-5);
    flex-wrap: wrap;
  }

  .jy__cta2 {
    color: var(--c-white);
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--fs-small);
    font-weight: 600;
    transition: color var(--d-fast) var(--ease-out);
  }

  .jy__cta2:hover {
    color: var(--c-green-500);
  }

  /* Giant Background Wordmark */
  .jy__wordmark {
    position: absolute;
    inset-block-end: -0.15em;
    inset-inline-start: 12vw;
    font-size: 11vw;
    font-weight: 700;
    font-style: italic;
    color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
    user-select: none;
    line-height: 1;
    z-index: 1;
    white-space: nowrap;
    text-transform: uppercase;
  }

  html[lang='fa'] .jy__wordmark {
    font-size: 13vw;
    font-weight: 800;
    font-style: normal;
    inset-inline-start: 16vw;
  }


  /* Scroll Cue */
  .jy__cue {
    position: absolute;
    inset-block-end: var(--s-6);
    inset-inline-end: var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--fs-label);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    transition: opacity var(--d-base) var(--ease-out);
    z-index: 3;
    pointer-events: none;
  }

  .jy__cue-line {
    inline-size: 1px;
    block-size: 48px;
    background: linear-gradient(180deg, var(--c-green-500) 0%, rgba(0, 166, 81, 0) 100%);
    animation: jy-cue-pulse 2s ease-in-out infinite;
    transform-origin: top;
  }

  @keyframes jy-cue-pulse {
    0%   { transform: scaleY(0.2); opacity: 0.3; }
    50%  { transform: scaleY(1);   opacity: 1; }
    100% { transform: scaleY(0.2); opacity: 0.3; }
  }

  /* Panel 2: Two Columns & Checks */
  .jy__p2-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
    max-inline-size: 58rem;
  }

  @media (max-width: 899px) {
    .jy__p2-grid {
      grid-template-columns: 1fr;
      gap: var(--s-5);
    }
  }

  .jy__checklist {
    display: flex;
    flex-direction: column;
  }

  .jy__check-row {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding-block: var(--s-4);
    border-block-end: 1px solid rgba(255, 255, 255, 0.18);
  }

  .jy__check-row:first-child {
    border-block-start: 1px solid rgba(255, 255, 255, 0.18);
  }

  .jy__check-num {
    font-size: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
    font-weight: 700;
    color: var(--c-green-500);
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  .jy__check-label {
    font-size: var(--fs-lead);
    color: var(--c-white);
    font-weight: 500;
  }

  /* Panel 3: Process Line */
  .jy__p3-content {
    max-inline-size: 46rem;
  }

  .jy__process {
    position: relative;
    margin-block-start: var(--s-7);
    padding-block: var(--s-4);
  }

  .jy__process-track {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 0;
    inline-size: 100%;
    block-size: 2px;
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%);
    z-index: 1;
  }

  .jy__process-fill {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 0;
    inline-size: 100%;
    block-size: 2px;
    background-color: var(--c-green-500);
    transform: translateY(-50%) scaleX(0);
    transform-origin: inline-start;
    transition: transform 0.2s linear;
    z-index: 2;
  }

  .jy__process-nodes {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 3;
  }

  .jy__process-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
  }

  .jy__node-label {
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    white-space: nowrap;
  }

  .jy__node-dot {
    inline-size: 16px;
    block-size: 16px;
    border-radius: 50%;
    background-color: var(--c-navy-900);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: background-color var(--d-fast) var(--ease-out),
                border-color var(--d-fast) var(--ease-out),
                transform var(--d-fast) var(--ease-out);
  }

  .jy__process-node.is-active .jy__node-dot {
    background-color: var(--c-green-500);
    border-color: var(--c-white);
    transform: scale(1.2);
  }

  /* Panel 4: Across Iran & Stats */
  .jy__p4-content {
    max-inline-size: 52rem;
  }

  .jy__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-6);
    margin-block-start: var(--s-7);
    margin-block-end: var(--s-5);
  }

  .jy__stat {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    position: relative;
    padding-inline-start: var(--s-5);
    border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
  }

  .jy__stat-val {
    font-size: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
    font-weight: 800;
    color: var(--c-white);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: 2px;
  }

  .jy__stat-val .stat-plus {
    font-size: 0.6em;
    color: var(--c-green-500);
    font-weight: 700;
    direction: ltr !important;
  }

  .jy__stat-label {
    font-size: var(--fs-small);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
  }

  .jy__demo-note {
    font-size: var(--fs-label);
    color: rgba(255, 255, 255, 0.45);
  }


  /* Segment Indicator (Section 2.7) */
  .jy__index {
    position: absolute;
    inset-block-end: var(--s-6);
    inset-inline-start: var(--gutter);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    z-index: 4;
  }


  .jy__segments {
    display: flex;
    gap: 6px;
  }

  .jy__segment {
    inline-size: 56px;
    block-size: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
  }

  .jy__segment-fill {
    position: absolute;
    inset: 0;
    background-color: var(--c-green-500);
    transform: scaleX(0);
    transform-origin: inline-start;
    transition: transform 0.15s linear;
  }

  .jy__counter {
    font-size: var(--fs-label);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    direction: ltr !important;
    font-variant-numeric: tabular-nums;
  }

  /* ========================================================
     BOTTOM MODE (PHONES & PORTRAIT TABLETS) (Section 2.3 & 2.5)
     Condition: not all and (min-aspect-ratio: 1/1) and (min-width: 700px)
     ======================================================== */
  @media not all and (min-aspect-ratio: 1/1) and (min-width: 700px) {
    /* Earth Stage & Still Fallback */
    .jy__earth {
      transform: none !important; /* No mirroring on phones in both languages */
    }

    html[dir='rtl'] .jy__earth {
      transform: none !important;
    }

    .jy__still {
      object-fit: contain;
      object-position: center bottom;
      -webkit-mask-image: linear-gradient(to top, black 0%, black 80%, transparent 100%);
      mask-image: linear-gradient(to top, black 0%, black 80%, transparent 100%);
    }

    html[dir='rtl'] .jy__still {
      object-position: center bottom;
    }

    /* 4-Segment Indicator (Top under header) */
    .jy__index {
      inset-block-start: clamp(82px, 10.5svh, 96px);
      inset-block-end: auto;
      inset-inline-start: var(--gutter);
      gap: clamp(8px, 2.5vw, 14px);
    }

    .jy__segments {
      gap: clamp(3px, 1vw, 6px);
    }

    .jy__segment {
      inline-size: clamp(36px, 11vw, 56px);
      block-size: 3px;
    }

    .jy__counter {
      font-size: clamp(0.7rem, 0.65rem + 0.3svh, 0.8rem);
    }

    /* Panels Layout: Content centered in top 68svh, bottom 32svh free for Earth */
    .jy__panel {
      padding-block-start: clamp(120px, 15svh, 142px);
      padding-block-end: 32svh;
      padding-inline: var(--gutter);
      justify-content: flex-start;
      box-sizing: border-box;
      height: 100svh;
      max-height: 100svh;
      overflow: hidden;
    }

    .jy__p1-content,
    .jy__p2-grid,
    .jy__p3-content,
    .jy__p4-content {
      max-inline-size: 100%;
      inline-size: 100%;
      max-block-size: calc(68svh - 120px);
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
    }

    /* Responsive Typography using svh units down to 360x640 */
    .jy__kicker {
      font-size: clamp(0.6875rem, 0.6rem + 0.25svh, 0.75rem);
      margin-block-end: clamp(0.35rem, 0.8svh, 0.55rem);
    }

    .jy__title {
      font-size: clamp(1.2rem, 0.92rem + 1.4svh, 1.7rem);
      line-height: 1.25;
      margin-block-end: clamp(0.4rem, 1svh, 0.75rem);
      max-inline-size: 100%;
    }

    html[lang='fa'] .jy__title {
      line-height: 1.35;
    }

    .jy__text {
      font-size: clamp(0.78rem, 0.7rem + 0.35svh, 0.9rem);
      line-height: 1.45;
      margin-block-end: clamp(0.6rem, 1.4svh, 1.1rem);
      max-inline-size: 100%;
    }

    /* Panel 1 Composition: no wordmark, h1, full-width button, text link below */
    .jy__p1-title {
      font-size: clamp(1.35rem, 1rem + 1.8svh, 2rem);
      max-inline-size: 20ch;
      line-height: 1.15;
      margin-block-end: clamp(0.4rem, 1svh, 0.75rem);
    }

    html[lang='fa'] .jy__p1-title {
      line-height: 1.35;
    }

    .jy__p1-content .jy__text {
      margin-block-end: clamp(0.85rem, 1.8svh, 1.4rem);
    }

    .jy__actions {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: clamp(8px, 1.4svh, 12px);
      inline-size: 100%;
    }

    .jy__actions .btn {
      inline-size: 100%;
      justify-content: center;
      padding-block: clamp(9px, 1.4svh, 13px);
      font-size: clamp(0.85rem, 0.78rem + 0.3svh, 0.95rem);
    }

    .jy__cta2 {
      justify-content: center;
      align-self: center;
      padding-block: clamp(3px, 0.6svh, 6px);
      font-size: clamp(0.8rem, 0.74rem + 0.3svh, 0.88rem);
    }

    .jy__wordmark,
    .jy__cue {
      display: none !important;
    }

    /* Panel 2 Composition: Checklist rows */
    .jy__p2-grid {
      display: flex;
      flex-direction: column;
      gap: clamp(6px, 1.2svh, 14px);
    }

    .jy__checklist {
      display: flex;
      flex-direction: column;
      inline-size: 100%;
    }

    .jy__check-row {
      display: flex;
      align-items: center;
      gap: var(--s-3);
      padding-block: clamp(4px, 0.8svh, 7px);
      border-block-end: 1px solid rgba(255, 255, 255, 0.18);
    }

    .jy__check-num {
      font-size: clamp(1.15rem, 0.85rem + 1.1svh, 1.45rem);
      line-height: 1;
    }

    .jy__check-label {
      font-size: clamp(0.82rem, 0.74rem + 0.4svh, 0.95rem);
    }

    /* Panel 3 Composition: Nodes in a row with labels below dots */
    .jy__process {
      position: relative;
      margin-block-start: clamp(6px, 1.2svh, 16px);
      padding-block: 0;
      inline-size: 100%;
    }

    .jy__process-track {
      inset-block-start: 7px;
      transform: translateY(-50%);
    }

    .jy__process-fill {
      inset-block-start: 7px;
      transform: translateY(-50%) scaleX(0);
    }

    .jy__process-nodes {
      display: flex;
      justify-content: space-between;
      position: relative;
      z-index: 3;
    }

    .jy__process-node {
      display: flex;
      flex-direction: column-reverse;
      align-items: center;
      gap: clamp(4px, 0.7svh, 8px);
    }

    .jy__node-dot {
      inline-size: 14px;
      block-size: 14px;
      border-radius: 50%;
      background-color: var(--c-navy-900);
      border: 2px solid rgba(255, 255, 255, 0.4);
    }

    .jy__node-label {
      font-size: clamp(0.66rem, 0.6rem + 0.3svh, 0.78rem);
      white-space: normal;
      text-align: center;
    }

    /* Panel 4 Composition: Statistics stacked in 3 rows */
    .jy__stats {
      display: flex;
      flex-direction: column;
      gap: clamp(4px, 0.7svh, 8px);
      margin-block-start: clamp(6px, 1.2svh, 14px);
      margin-block-end: clamp(5px, 0.9svh, 10px);
      inline-size: 100%;
    }

    .jy__stat {
      display: flex;
      flex-direction: row;
      align-items: baseline;
      justify-content: space-between;
      border-inline-start: none;
      border-block-end: 1px solid rgba(255, 255, 255, 0.15);
      padding-inline-start: 0;
      padding-block-end: clamp(3px, 0.6svh, 6px);
    }

    .jy__stat-val {
      font-size: clamp(1.35rem, 1rem + 1.5svh, 2.1rem);
      line-height: 1;
    }

    .jy__stat-label {
      font-size: clamp(0.74rem, 0.68rem + 0.3svh, 0.84rem);
      text-align: end;
    }

    .jy__demo-note {
      font-size: clamp(0.62rem, 0.58rem + 0.2svh, 0.7rem);
      display: block;
    }
  }

  /* Reduced Motion Fallback (Section 2.8) */
  @media (prefers-reduced-motion: reduce) {
    .jy__pin {
      block-size: auto !important;
      overflow: visible !important;
    }

    .jy__track {
      position: static !important;
      inline-size: 100% !important;
      flex-direction: column !important;
      transform: none !important;
    }

    .jy__panel {
      inline-size: 100% !important;
      min-block-size: 100svh !important;
      padding-inline: var(--gutter) !important;
      padding-block: var(--section-pad) !important;
    }

    .jy__earth {
      opacity: 1 !important;
    }

    .jy__canvas {
      display: none !important;
    }

    .jy__still {
      opacity: 0.4 !important;
      display: block !important;
    }

    .jy__cue,
    .jy__index {
      display: none !important;
    }
  }
}
