/* The home page shares everything with the other marketing pages (src/style/marketing.css). What only it needs: */

[data-marketing][data-page="home"] {
  /* ---------- Hero: the headline, and a reel of what Nova Flex makes ---------- */

  [data-component="hero"][data-variant="reel"] {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;

    @media (max-width: 60rem) {
      grid-template-columns: 1fr;
      gap: 40px;
    }

    [data-slot="hero-copy"] h1 {
      font-size: 44px;
      line-height: 1.1;
      letter-spacing: -0.03em;
      margin-bottom: 24px;
      text-wrap: balance;

      @media (max-width: 60rem) {
        font-size: 34px;
      }
    }

    [data-slot="hero-copy"] > p {
      max-width: 36rem;
      color: var(--color-text);
    }
  }
}

[data-marketing][data-page="home"] {
  /* Made with Nova Flex: viewer images of real AI-made models, three across, captions under each. */
  [data-component="showcase"] {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 20px;

    @media (max-width: 60rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (max-width: 40rem) {
      grid-template-columns: 1fr;
    }

    figure {
      margin: 0;
    }

    img {
      display: block;
      width: 100%;
      height: auto;
      border: 1px solid var(--color-border-weak);
      border-radius: 6px;
      background: #fff;
    }

    figcaption {
      margin-top: 10px;
      font-size: 0.8125rem;
      line-height: 1.55;
      color: var(--color-text);
    }
  }
}

[data-marketing][data-page="home"] {
  /* The formats, near the end of the page, set as a drawing register: one cell per file type, the extension as the type itself. */
  [data-component="formats"] {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-background);

    > header,
    > footer {
      padding: 10px 14px;
      font-size: 0.75rem;
      line-height: 1.5;
      color: var(--color-text-weak);
    }

    > header {
      border-bottom: 1px solid var(--color-border);
    }

    ul {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));

      @media (max-width: 60rem) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    li {
      padding: 10px 14px 12px;
      border-bottom: 1px solid var(--color-border-weak);
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;

      border-right: 1px solid var(--color-border-weak);
    }

    strong {
      font-size: 24px;
      line-height: 1.1;
      letter-spacing: -0.02em;
      color: var(--color-text-strong);

      @media (max-width: 60rem) {
        font-size: 24px;
      }
    }

    li span {
      font-size: 0.75rem;
      line-height: 1.4;
      color: var(--color-text);
    }

    /* .rvt is not written yet: a dimmed, full-width pending row, not a file the product makes today. */
    li[data-soon] {
      grid-column: 1 / -1;
      border-right: none;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 6px 14px;
      background: var(--color-background-weak);

      strong {
        color: var(--color-text-weak);
      }

      span:last-child {
        margin-left: auto;
      }
    }
  }

  /* The live app demo (component/demo-frame.tsx): right under the hero, so no rule between them. */
  [data-section="demo"] {
    padding-top: 0;
    border-top: none;
  }

  [data-section="newsletter"] {
    padding-top: 0;
    border-top: none;
  }

  [data-section="privacy"] [data-slot="section-title"] {
    margin-bottom: 0;
  }

  /* Disciplines and checks: a plain two-column definition list, the discipline on the left. */
  [data-component="disciplines"] {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--color-border-weak);

    li {
      display: grid;
      grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
      gap: 24px;
      padding: 18px 0;
      border-bottom: 1px solid var(--color-border-weak);

      @media (max-width: 50rem) {
        grid-template-columns: 1fr;
        gap: 6px;
      }
    }

    h3 {
      font-size: 1rem;
      margin: 0;
    }

    p {
      margin: 0;
      line-height: 170%;
    }
  }

  /* The hero's reel: one picture at a time, each fading into the next. */
  [data-component="hero-reel"] {
    margin: 0;

    [data-slot="stage"] {
      position: relative;
      aspect-ratio: 3 / 2;
      overflow: hidden;
      border: 1px solid var(--color-border-weak);
      border-radius: 8px;
      background: #fff;
    }

    img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      opacity: 0;
      transition: opacity 900ms ease;

      &[data-current] {
        opacity: 1;
      }

      @media (prefers-reduced-motion: reduce) {
        transition: none;
      }
    }

    figcaption {
      min-height: 3.2em;
      margin-top: 12px;
      font-size: 0.8125rem;
      line-height: 1.55;
      color: var(--color-text);
    }

    [data-slot="dots"] {
      display: flex;
      gap: 8px;
      margin-top: 8px;

      button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--color-border);
        cursor: pointer;
      }

      button[aria-current="true"] {
        background: var(--color-text-strong);
      }

      button:focus-visible {
        outline: 2px solid var(--color-accent);
        outline-offset: 2px;
      }
    }
  }

  /* Made with Nova Flex: what it makes, by kind, one tab at a time. */
  [data-component="work-gallery"] {
    [role="tablist"] {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 16px;
    }

    [role="tab"] {
      padding: 6px 14px;
      border: 1px solid var(--color-border);
      border-radius: 4px;
      background: var(--color-background);
      color: var(--color-text-strong);
      font: inherit;
      font-size: 0.875rem;
      cursor: pointer;

      &:hover {
        background: var(--color-background-weak);
      }

      &[aria-selected="true"] {
        background: var(--color-background-strong);
        border-color: var(--color-background-strong);
        color: var(--color-text-inverted);
      }

      &:focus-visible {
        outline: 2px solid var(--color-accent);
        outline-offset: 2px;
      }
    }

    [data-slot="tab-body"] {
      max-width: 44rem;
      margin: 0 0 20px;
      line-height: 1.6;
      color: var(--color-text);
    }
  }

  [data-section="formats"] {
    padding-top: 0;
    border-top: none;
  }
}
