@layer reset, base, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 81px;
  }
  body, h1, p, ul { margin: 0; }
  ul { padding: 0; list-style: none; }
  img, svg { display: block; }
  a { color: inherit; text-decoration: none; }
}

@layer base {
  :root {
    color-scheme: light;
    --ink: #0b1220;
    --muted: #58667d;
    --blue: #0668e1;
    --blue-light: #58aeff;
    --blue-deep: #2346c8;
    --canvas: #f7faff;
    --line: #dce6f3;
    --display: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    --body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  html {
    min-width: 320px;
    background: var(--canvas);
  }

  body {
    min-width: 320px;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  main { flex: 1; }
  ::selection { color: #fff; background: var(--blue); }
  :focus-visible { outline: 3px solid rgba(6, 104, 225, 0.42); outline-offset: 4px; }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
  }

  .skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff;
    background: var(--ink);
    transform: translateY(-160%);
    transition: transform 160ms ease;
  }

  .skip-link:focus { transform: translateY(0); }
}

@layer components {
  .site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(220, 230, 243, 0.9);
    background: rgba(247, 250, 255, 0.96);
    box-shadow: 0 6px 20px rgba(11, 18, 32, 0.06);
    backdrop-filter: blur(18px);
  }

  .header__inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .brand {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 12px;
  }

  .brand__mark {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .brand__name {
    font-family: "Nunito Sans", "Avenir Next", Avenir, "Segoe UI", sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.035em;
  }

  .explore-disclosure {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .explore-trigger {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-inline: 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition:
      color 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease,
      box-shadow 160ms ease;
  }

  .explore-trigger svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
  }

  .explore-trigger:hover {
    color: var(--blue-deep);
    background: rgba(6, 104, 225, 0.06);
  }

  .explore-trigger[aria-expanded="true"] {
    color: var(--blue-deep);
    border-color: var(--line);
    background: #fff;
    box-shadow: 0 3px 12px rgba(11, 18, 32, 0.08);
  }

  .explore-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
  .explore-trigger:focus-visible { outline-color: var(--blue-deep); }

  .explore-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    left: 0;
    width: 280px;
    max-width: calc(100vw - 32px);
    display: grid;
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.9) inset,
      0 18px 44px rgba(11, 18, 32, 0.14);
    backdrop-filter: blur(18px);
    animation: explore-panel-in 160ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .explore-panel[hidden] { display: none; }

  @keyframes explore-panel-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .explore-link {
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 9px 11px;
    border-radius: 11px;
    color: var(--ink);
    text-decoration: none;
    transition: color 140ms ease, background-color 140ms ease;
  }

  .explore-link:hover,
  .explore-link:focus-visible {
    color: var(--blue-deep);
    background: rgba(6, 104, 225, 0.07);
  }

  .explore-link:focus-visible {
    outline-width: 2px;
    outline-offset: -2px;
  }

  .explore-link span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .explore-link small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
  }

  .header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .header-login,
  .header-signup {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition:
      border-color 160ms ease,
      background-color 160ms ease,
      box-shadow 120ms cubic-bezier(0.16, 1, 0.3, 1),
      transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-login {
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
    box-shadow: 0 3px 0 rgba(11, 18, 32, 0.1);
  }

  .header-signup {
    border: 1px solid var(--blue);
    color: #fff;
    background: var(--blue);
    box-shadow: 0 3px 0 var(--blue-deep);
  }

  .header-login:hover {
    border-color: rgba(6, 104, 225, 0.35);
    box-shadow: 0 1px 0 rgba(11, 18, 32, 0.1);
    transform: translateY(2px);
  }

  .header-signup:hover {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: 0 1px 0 var(--blue-deep);
    transform: translateY(2px);
  }

  .header-login:active,
  .header-signup:active {
    box-shadow: none;
    transform: translateY(3px);
  }

  .header-login:focus-visible,
  .header-signup:focus-visible {
    outline-color: var(--blue-deep);
  }

  @media (prefers-reduced-motion: reduce) {
    .explore-trigger svg,
    .header-login:hover,
    .header-login:active,
    .header-signup:hover,
    .header-signup:active {
      transform: none;
    }
  }

  @media (max-width: 500px) {
    .header__inner { gap: 10px; }
    .brand__name,
    .explore-disclosure { display: none; }
    .header-actions {
      margin-left: auto;
      gap: 8px;
    }
    .header-login,
    .header-signup {
      padding-inline: 13px;
      font-size: 13px;
    }
  }

  .hero {
    position: relative;
    isolation: isolate;
    min-height: calc(100svh - 46px);
    overflow: hidden;
    background:
      radial-gradient(circle at 86% 36%, rgba(88, 174, 255, 0.14), transparent 33%),
      linear-gradient(180deg, #f9fbff 0%, var(--canvas) 100%);
  }

  .hero::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      90deg,
      rgba(247, 250, 255, 1) 0%,
      rgba(247, 250, 255, 1) 38%,
      rgba(247, 250, 255, 0.72) 48%,
      rgba(247, 250, 255, 0.12) 57%,
      rgba(247, 250, 255, 0) 64%
    );
  }

  .hero__content {
    position: relative;
    z-index: 2;
    min-height: calc(100svh - 46px);
    display: flex;
    align-items: center;
    padding-block: clamp(64px, 8vh, 104px);
  }

  .hero__copy { max-width: 680px; }

  .hero h1 {
    max-width: 680px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(44px, 4.6vw, 56px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.025em;
    text-wrap: balance;
  }

  .hero h1 span { display: block; }
  .hero-title__accent { color: var(--blue); }
  .hero-title__base {
    color: var(--ink);
    font-weight: 700;
  }
  .hero h1 strong { font-weight: inherit; }

  .hero__lead {
    max-width: 680px;
    margin-top: 28px;
    color: var(--muted);
    font-size: clamp(17px, 1.5vw, 19px);
    line-height: 1.7;
    letter-spacing: -0.005em;
  }

  .hero__lead-line { display: block; }

  .hero__lead-line + .hero__lead-line { margin-top: 8px; }

  .hero-term-rotator {
    min-width: 9.45em;
    height: 1.3em;
    display: inline-grid;
    overflow: hidden;
    margin-left: 0.28em;
    vertical-align: 0.05em;
    color: var(--blue);
    font-weight: 700;
    line-height: 1.3;
  }

  .hero-term {
    grid-area: 1 / 1;
    white-space: nowrap;
  }

  .hero-term:not(.is-active) { display: none; }

  .hero-term-rotator.is-enhanced .hero-term {
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(0.55em);
    transition:
      opacity 360ms cubic-bezier(0.16, 1, 0.3, 1),
      transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-term-rotator.is-enhanced .hero-term.is-active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .hero-term-rotator.is-enhanced .hero-term.is-leaving {
    visibility: visible;
    opacity: 0;
    transform: translateY(-0.55em);
  }

  .primary-action {
    width: fit-content;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 34px;
    padding-inline: 24px;
    border: 1px solid var(--blue);
    border-radius: 999px;
    color: #fff;
    background: var(--blue);
    box-shadow:
      0 5px 0 var(--blue-deep),
      0 5px 0 1px rgba(11, 18, 32, 0.04);
    font-weight: 760;
    letter-spacing: -0.01em;
    transition:
      transform 120ms cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 120ms;
  }

  .primary-action:hover {
    background: var(--blue);
    border-color: var(--blue);
    box-shadow:
      0 3px 0 var(--blue-deep),
      0 3px 0 1px rgba(11, 18, 32, 0.04);
    transform: translateY(2px);
  }

  .primary-action:active {
    box-shadow: 0 0 0 var(--blue-deep);
    transform: translateY(5px);
  }

  .primary-action:focus-visible { outline-color: var(--blue-deep); }

  .primary-action svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .primary-action:hover svg { transform: translateX(3px); }

  @media (prefers-reduced-motion: reduce) {
    .primary-action:hover,
    .primary-action:active,
    .primary-action:hover svg {
      transform: none;
    }
  }

  .hero__animation {
    position: absolute;
    z-index: 0;
    top: 50%;
    right: clamp(24px, 4vw, 72px);
    width: min(43vw, 620px);
    aspect-ratio: 1;
    pointer-events: none;
    opacity: 1;
    filter: none;
    transform: translateY(-50%);
  }

  @media (min-width: 901px) {
    .hero,
    .hero__content {
      min-height: calc(100svh - 78px);
    }

    .hero__copy {
      width: min(52%, 600px);
    }

    .hero__animation {
      right: max(clamp(24px, 4vw, 72px), calc((100vw - 1180px) / 2));
      width: min(43vw, 560px, calc(100svh - 126px));
    }
  }

  .animation-poster,
  .lottie-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .animation-poster {
    object-fit: contain;
    opacity: 1;
    transition: opacity 180ms ease;
  }

  .lottie-canvas {
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .hero__animation.is-ready .animation-poster { opacity: 0; }
  .hero__animation.is-ready .lottie-canvas { opacity: 1; }
  .lottie-canvas svg { display: block; width: 100% !important; height: 100% !important; }

  .subject-showcase {
    position: relative;
    z-index: 2;
    padding: 0;
    scroll-margin-top: 28px;
    color: var(--ink);
    background: var(--canvas);
  }

  .subject-showcase__header {
    padding: 40px 0 20px;
    text-align: center;
    background: var(--canvas);
  }

  .subject-showcase__surface {
    padding: 24px 0 72px;
    border-top: 1px solid rgba(220, 230, 243, 0.82);
    background:
      radial-gradient(circle at 10% 20%, rgba(88, 174, 255, 0.2), transparent 32%),
      radial-gradient(circle at 90% 18%, rgba(157, 125, 255, 0.14), transparent 28%),
      linear-gradient(135deg, #f8fbff 0%, #eef6ff 52%, #f7f3ff 100%);
  }

  .subject-showcase h2 {
    margin: 0;
    color: var(--ink);
    font-family: Inter, var(--body);
    font-size: clamp(32px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
  }

  .subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 270px));
    align-items: start;
    gap: 48px;
    max-width: 906px;
    margin: 0 auto;
  }

  .subject-grid__item { min-width: 0; }

  .subject-artwork {
    width: 100%;
    aspect-ratio: 1;
    display: block;
    line-height: 0;
  }

  .subject-artwork img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .subject-grid__item:nth-child(7) .subject-artwork,
  .subject-grid__item:nth-child(8) .subject-artwork {
    overflow: hidden;
  }

  .subject-grid__item:nth-child(7) .subject-artwork img,
  .subject-grid__item:nth-child(8) .subject-artwork img {
    transform: scale(1.12);
    transform-origin: center;
  }

  @media (max-width: 600px) {
    .subject-showcase { padding: 0; }
    .subject-showcase__header { padding: 28px 0 14px; }
    .subject-showcase__surface { padding: 16px 0 48px; }

    .subject-grid {
      grid-template-columns: 1fr;
      gap: 18px;
      margin-top: 0;
    }

    .subject-artwork {
      max-width: 300px;
      margin-inline: auto;
    }
  }

  .site-footer {
    position: relative;
    z-index: 3;
    border-top: 1px solid rgba(220, 230, 243, 0.76);
    color: #7a879b;
    background: rgba(247, 250, 255, 0.94);
  }

  .site-footer__inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 650;
  }
}

@layer responsive {
  @media (max-width: 900px) {
    .hero {
      min-height: auto;
      background:
        radial-gradient(circle at 50% 78%, rgba(88, 174, 255, 0.14), transparent 36%),
        linear-gradient(180deg, #f9fbff 0%, var(--canvas) 100%);
    }

    .hero::after {
      background: linear-gradient(
        180deg,
        rgba(247, 250, 255, 1) 0%,
        rgba(247, 250, 255, 1) 44%,
        rgba(247, 250, 255, 0.65) 52%,
        rgba(247, 250, 255, 0.08) 62%,
        rgba(247, 250, 255, 0) 70%
      );
    }

    .hero__content {
      min-height: 856px;
      align-items: flex-start;
      padding-block: 72px 310px;
    }

    .hero__copy { max-width: 700px; }
    .hero h1 { max-width: 720px; font-size: clamp(40px, 4.7vw, 46px); }
    .hero__lead { max-width: 650px; }

    .hero__animation {
      top: auto;
      right: auto;
      bottom: -55px;
      left: 50%;
      width: min(68vw, 520px);
      opacity: 0.78;
      transform: translateX(-50%);
      -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 100%);
      mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 100%);
    }
  }

  @media (max-width: 600px) {
    html { scroll-padding-top: 71px; }

    .container { width: calc(100% - 32px); }
    .header__inner { min-height: 68px; }
    .brand__mark { width: 40px; height: 40px; }
    .brand__name { font-size: 23px; }

    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
    }

    .hero::after { display: none; }

    .hero__content {
      grid-row: 1;
      min-height: auto;
      align-items: flex-start;
      padding-block: 40px 0;
    }

    .hero h1 {
      font-size: clamp(32px, 8.5vw, 36px);
      line-height: 1.12;
      letter-spacing: -0.025em;
    }

    .hero__lead {
      margin-top: 18px;
      font-size: 16px;
      line-height: 1.55;
    }

    .hero__lead-line + .hero__lead-line { margin-top: 6px; }

    .primary-action {
      min-height: 52px;
      width: 100%;
      margin-top: 24px;
    }

    .hero__animation {
      position: relative;
      grid-row: 2;
      top: auto;
      right: auto;
      bottom: auto;
      left: auto;
      justify-self: center;
      width: min(96vw, 370px);
      margin: calc(28px - min(19.872vw, 77px)) auto 8px;
      opacity: 1;
      transform: none;
      -webkit-mask-image: none;
      mask-image: none;
    }

    .site-footer__inner { min-height: 58px; }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    .hero-term-rotator.is-enhanced .hero-term { transform: none; }
    .lottie-canvas { display: none; }
    .hero__animation.is-ready .animation-poster { opacity: 1; }
  }
}


@layer components {
  .beta-access {
    scroll-margin-top: 96px;
    padding: clamp(72px, 9vw, 112px) 0;
    border-top: 1px solid rgba(220, 230, 243, 0.9);
    text-align: center;
    background: #ffffff;
  }

  .beta-access__inner { max-width: 760px; }

  .beta-access__eyebrow {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .beta-access h2 {
    margin-top: 12px;
    font-size: clamp(34px, 5vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.035em;
  }

  .beta-access__copy {
    max-width: 620px;
    margin: 20px auto 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
  }

  .beta-access__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
  }

  .beta-access__actions .primary-action { margin-top: 0; }
  .beta-access__login { min-height: 56px; padding-inline: 24px; }

  @media (max-width: 600px) {
    .beta-access__actions { align-items: stretch; flex-direction: column; }
    .beta-access__actions .primary-action,
    .beta-access__login { width: 100%; }
  }
}
