/* Avanza AI Studio v38 — viewport-scaled three-part hero composition */

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero {
  display: flex;
  height: 100svh;
  min-height: 0;
  max-height: 100svh;
  align-items: stretch;
  overflow: hidden;
  padding-top: clamp(96px, 12.8svh, 126px);
  padding-bottom: clamp(14px, 2.5svh, 30px);
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-grid {
  display: grid;
  width: min(calc(100% - (var(--gutter) * 2)), 1540px);
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(150px, 1fr) minmax(500px, min(48vw, 700px)) minmax(150px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "chaos copy calm";
  align-items: center;
  align-content: center;
  gap: clamp(4px, 1.45vw, 28px);
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-copy {
  grid-area: copy;
  width: 100%;
  max-width: 700px;
  align-self: center;
  justify-self: center;
  margin: 0;
  padding: 0;
  text-align: center;
  transform: translateY(clamp(8px, 2.1svh, 24px));
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 {
  display: grid;
  max-width: 700px;
  gap: .025em;
  margin-inline: auto;
  font-size: clamp(2.9rem, min(4.9vw, 8svh), 4.95rem);
  line-height: 1.015;
  letter-spacing: -.062em;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 .hero-phrase {
  white-space: nowrap;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-text {
  max-width: 620px;
  margin: clamp(14px, 2.35svh, 25px) auto 0;
  font-size: clamp(.88rem, min(1.02vw, 2.15svh), 1.06rem);
  line-height: clamp(1.48, 1.58, 1.62);
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions {
  display: flex;
  justify-content: center;
  gap: clamp(8px, .8vw, 13px);
  margin-top: clamp(15px, 2.45svh, 27px);
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions .button {
  min-height: clamp(47px, 6.1svh, 54px);
  padding-inline: clamp(18px, 1.45vw, 24px);
  font-size: clamp(.75rem, .82vw, .84rem);
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 360px;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  align-self: center;
  margin: 0;
  opacity: 1;
  transform: translateY(clamp(8px, 2.1svh, 24px));
  isolation: isolate;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank::before {
  position: absolute;
  z-index: -1;
  width: 115%;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,255,255,.22) 50%, transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank-chaos {
  grid-area: chaos;
  justify-self: end;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank-calm {
  grid-area: calm;
  justify-self: start;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
  display: grid;
  width: clamp(150px, min(21vw, 36svh), 350px);
  max-width: 100%;
  aspect-ratio: 1;
  align-self: center;
  place-items: center;
  transform: none;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-calm .hero-sculpture-piece {
  transform: none;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-state-label,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-chaos .hero-state-label,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-calm .hero-state-label {
  align-self: end;
  margin: clamp(-10px, -1svh, -4px) 0 0;
  color: #747880;
  font-size: clamp(.58rem, min(.72vw, 1.45svh), .7rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .13em;
  text-align: center;
  text-transform: uppercase;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-transition-flow,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-transition-core,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-transition-trail {
  display: none !important;
}

@media (max-width: 1120px) and (min-width: 901px) {
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-grid {
    grid-template-columns: minmax(142px, 1fr) minmax(470px, 52vw) minmax(142px, 1fr);
    gap: clamp(2px, .7vw, 10px);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 {
    font-size: clamp(2.75rem, min(4.8vw, 7.8svh), 3.55rem);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-text {
    max-width: 550px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
    width: clamp(142px, min(20.5vw, 32svh), 230px);
  }
}

@media (max-width: 900px) {
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero {
    padding-top: clamp(82px, 10.8svh, 100px);
    padding-bottom: clamp(8px, 1.4svh, 14px);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-grid {
    width: min(calc(100% - (var(--gutter) * 2)), 760px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "copy copy"
      "chaos calm";
    align-content: center;
    gap: clamp(8px, 1.5svh, 16px) clamp(12px, 5vw, 42px);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-copy {
    transform: none;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 {
    max-width: 650px;
    font-size: clamp(2.45rem, min(8.3vw, 7.2svh), 4rem);
    line-height: 1.025;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-text {
    max-width: 590px;
    margin-top: clamp(12px, 1.8svh, 18px);
    font-size: clamp(.86rem, min(2.05vw, 1.95svh), .98rem);
    line-height: 1.55;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions {
    margin-top: clamp(13px, 1.9svh, 19px);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank {
    max-width: 280px;
    align-self: start;
    transform: none;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank-chaos {
    justify-self: end;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank-calm {
    justify-self: start;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
    width: clamp(112px, min(31vw, 24svh), 230px);
  }
}

@media (max-width: 620px) {
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-grid {
    width: min(calc(100% - 28px), 520px);
    gap: clamp(7px, 1.2svh, 11px) 8px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 {
    max-width: 390px;
    gap: .055em;
    font-size: clamp(2.25rem, min(10.7vw, 6.6svh), 3.15rem);
    line-height: 1.045;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-text {
    max-width: 420px;
    font-size: clamp(.82rem, 3.55vw, .92rem);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions {
    display: grid;
    width: min(100%, 334px);
    gap: 8px;
    margin-inline: auto;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions .button {
    width: 100%;
    min-height: clamp(44px, 5.8svh, 49px);
    padding-block: 0;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank {
    max-width: 190px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
    width: clamp(102px, min(39vw, 21svh), 168px);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-state-label,
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-chaos .hero-state-label,
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-calm .hero-state-label {
    margin-top: -5px;
    font-size: clamp(.52rem, 2.3vw, .6rem);
    letter-spacing: .1em;
  }
}

@media (max-height: 720px) and (min-width: 901px) {
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero {
    padding-top: clamp(88px, 13svh, 100px);
    padding-bottom: 10px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-copy,
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank {
    transform: translateY(5px);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 {
    font-size: clamp(2.55rem, min(4.6vw, 7.25svh), 3.45rem);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-text {
    margin-top: 13px;
    line-height: 1.48;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions {
    margin-top: 14px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
    width: clamp(140px, min(20vw, 30svh), 215px);
  }
}

@media (max-height: 700px) and (max-width: 900px) {
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero {
    padding-top: 78px;
    padding-bottom: 6px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-grid {
    gap: 5px 8px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero h1 {
    font-size: clamp(2.1rem, min(9.7vw, 6.2svh), 2.75rem);
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-text {
    margin-top: 9px;
    line-height: 1.44;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions {
    margin-top: 10px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-actions .button {
    min-height: 42px;
  }

  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
    width: clamp(92px, min(36vw, 18svh), 128px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-video {
    animation: none;
  }
}

/* Neutralize the v37 display-contents descriptor implementation now that each sculpture is a direct hero-grid item. */
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-state {
  display: grid !important;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-chaos .hero-sculpture-piece,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-calm .hero-sculpture-piece,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-state-label,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-chaos .hero-state-label,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-calm .hero-state-label {
  grid-area: auto !important;
  justify-self: center;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-state-label,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-chaos .hero-state-label,
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank.hero-sculpture-calm .hero-state-label {
  width: auto;
}

/* Keep both sculpture frames geometrically equal while allowing the chaotic form to overflow visually. */
body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-piece {
  overflow: visible;
}

body[data-build="avanza-ai-studio-v31-first-screen-hero"] .hero-flank .hero-sculpture-video {
  position: absolute;
  top: 50%;
  left: 50%;
  height: auto;
  translate: -50% -50%;
}
