/* Avanza AI Studio v70 — immersive demo entry
   Scope: #agent invitation and the opt-in full-viewport demo experience only. */

.agent-demo {
  position: relative;
  isolation: isolate;
  min-height: min(960px, 100svh);
  display: grid;
  align-items: center;
  padding-block: clamp(110px, min(10vw, 15svh), 176px) !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -18%, rgba(255,255,255,.12), transparent 34%),
    radial-gradient(circle at 8% 90%, rgba(255,255,255,.055), transparent 28%),
    linear-gradient(145deg, #17191d 0%, #090a0c 58%, #050607 100%);
}

.agent-demo::before {
  opacity: .13;
}

.demo-launch-glow {
  position: absolute;
  z-index: -1;
  width: clamp(420px, 42vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.demo-launch-glow-left {
  left: -26%;
  bottom: -53%;
  background: radial-gradient(circle, rgba(255,255,255,.065), transparent 67%);
}

.demo-launch-glow-right {
  top: -48%;
  right: -25%;
  background: radial-gradient(circle, rgba(255,255,255,.085), transparent 66%);
}

.demo-launch-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(360px, .76fr) minmax(600px, 1.24fr);
  gap: clamp(52px, 7vw, 118px);
  align-items: center;
}

.demo-launch-copy {
  min-width: 0;
}

.demo-launch-copy .chapter-label {
  margin-bottom: clamp(20px, 2vw, 30px);
}

.demo-launch-copy h2 {
  max-width: 720px;
  color: #fff;
  font-size: clamp(3.25rem, min(5.15vw, 7.8svh), 6rem);
  line-height: .94;
  letter-spacing: -.072em;
  text-wrap: balance;
}

.demo-launch-lede {
  max-width: 610px;
  margin-top: clamp(25px, 2.5vw, 38px);
  color: rgba(255,255,255,.58);
  font-size: clamp(.93rem, 1vw, 1.08rem);
  line-height: 1.72;
}

.demo-launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(30px, 3vw, 46px);
}

.demo-launch-actions .button {
  margin: 0;
}

.demo-launch-primary,
.demo-launch-secondary {
  border: 0;
  cursor: pointer;
}

.demo-launch-primary {
  display: inline-flex;
  min-width: min(100%, 265px);
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: #0a0b0d;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,.26), inset 0 1px 0 #fff;
  transition: transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease, background .2s ease;
}

.demo-launch-primary i {
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
}

.demo-launch-primary:hover,
.demo-launch-primary:focus-visible {
  background: #f2f2f0;
  box-shadow: 0 24px 58px rgba(0,0,0,.34), inset 0 1px 0 #fff;
  transform: translateY(-2px);
}

.demo-launch-secondary {
  color: rgba(255,255,255,.76);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.demo-launch-secondary:hover,
.demo-launch-secondary:focus-visible {
  color: #fff;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
  transform: translateY(-1px);
}

.demo-launch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 23px;
  margin-top: clamp(25px, 2.4vw, 36px);
  color: rgba(255,255,255,.42);
  font-size: clamp(.62rem, .64vw, .72rem);
  font-weight: 600;
}

.demo-launch-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-launch-meta i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
}

.demo-launch-preview {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: clamp(26px, 2.1vw, 36px);
  color: #fff;
  text-align: left;
  background:
    radial-gradient(circle at 75% 15%, rgba(255,255,255,.09), transparent 30%),
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
  box-shadow: 0 58px 130px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.11);
  cursor: pointer;
  transform: perspective(1400px) rotateY(-2.2deg) rotateX(1deg);
  transform-origin: center;
  transition: transform .55s cubic-bezier(.16,1,.3,1), border-color .3s ease, box-shadow .4s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.demo-launch-preview::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 22%, rgba(255,255,255,.075) 44%, transparent 62%);
  content: "";
  opacity: .55;
  transform: translateX(-68%);
  transition: transform .8s cubic-bezier(.16,1,.3,1), opacity .3s ease;
  pointer-events: none;
}

.demo-launch-preview:hover,
.demo-launch-preview:focus-visible {
  border-color: rgba(255,255,255,.27);
  box-shadow: 0 70px 155px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.15);
  transform: perspective(1400px) rotateY(0) rotateX(0) translateY(-5px);
}

.demo-launch-preview:hover::after,
.demo-launch-preview:focus-visible::after {
  opacity: .9;
  transform: translateX(72%);
}

.demo-launch-preview:focus-visible {
  outline: 2px solid rgba(255,255,255,.86);
  outline-offset: 5px;
}

.demo-preview-bar {
  display: flex;
  min-height: clamp(66px, 5vw, 80px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px clamp(16px, 1.35vw, 23px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.025);
}

.demo-preview-brand,
.demo-preview-live {
  display: flex;
  align-items: center;
}

.demo-preview-brand {
  gap: 12px;
}

.demo-preview-brand > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(255,255,255,.065);
}

.demo-preview-brand img {
  width: 25px;
}

.demo-preview-brand strong {
  font-size: clamp(.75rem, .76vw, .88rem);
  letter-spacing: -.025em;
}

.demo-preview-live {
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: rgba(255,255,255,.54);
  font-size: .6rem;
  font-weight: 700;
}

.demo-preview-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #eef0ed;
  box-shadow: 0 0 0 5px rgba(255,255,255,.06);
}

.demo-preview-content {
  display: grid;
  min-height: clamp(430px, min(35vw, 55svh), 585px);
  place-items: center;
  align-content: center;
  padding: clamp(34px, 4vw, 70px) clamp(20px, 3.4vw, 58px);
  text-align: center;
}

.demo-preview-orb {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  box-shadow: 0 20px 44px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.1);
}

.demo-preview-orb img {
  width: 33px;
}

.demo-preview-content > small {
  color: rgba(255,255,255,.4);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.demo-preview-content > strong {
  max-width: 690px;
  margin-top: 11px;
  font-size: clamp(1.55rem, min(2.3vw, 3.6svh), 2.45rem);
  line-height: 1.04;
  letter-spacing: -.052em;
}

.demo-preview-query {
  display: flex;
  width: min(100%, 590px);
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 12px 13px 12px 20px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 19px;
  color: rgba(255,255,255,.69);
  font-size: clamp(.68rem, .72vw, .82rem);
  line-height: 1.45;
  text-align: left;
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.demo-preview-query i {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #0a0b0d;
  font-size: .95rem;
  font-style: normal;
  background: #fff;
}

.demo-preview-results {
  display: grid;
  width: min(100%, 590px);
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 11px;
}

.demo-preview-results > span {
  min-width: 0;
  padding: 14px 13px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 14px;
  text-align: left;
  background: rgba(255,255,255,.025);
}

.demo-preview-results small,
.demo-preview-results strong {
  display: block;
}

.demo-preview-results small {
  color: rgba(255,255,255,.31);
  font-size: .42rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.demo-preview-results strong {
  margin-top: 7px;
  overflow: hidden;
  color: rgba(255,255,255,.72);
  font-size: clamp(.59rem, .62vw, .71rem);
  line-height: 1.4;
  text-overflow: ellipsis;
}

.demo-preview-enter {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px clamp(17px, 1.4vw, 24px);
  border-top: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.82);
  font-size: clamp(.68rem, .7vw, .8rem);
  font-weight: 700;
  background: rgba(0,0,0,.1);
}

.demo-preview-enter i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  font-style: normal;
  background: rgba(255,255,255,.055);
  transition: transform .35s cubic-bezier(.16,1,.3,1), background .2s ease;
}

.demo-launch-preview:hover .demo-preview-enter i,
.demo-launch-preview:focus-visible .demo-preview-enter i {
  color: #0a0b0d;
  background: #fff;
  transform: translate(2px, -2px);
}

/* Full-viewport experience */
body.demo-experience-open {
  overflow: hidden;
}

.demo-experience {
  position: fixed;
  z-index: 3000;
  inset: 0;
  height: 100dvh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% -15%, rgba(255,255,255,.075), transparent 35%),
    #07080a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.992);
  transition: opacity .34s ease, transform .48s cubic-bezier(.16,1,.3,1), visibility 0s linear .48s;
}

.demo-experience.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

.demo-experience-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.demo-experience-header {
  position: relative;
  z-index: 4;
  display: grid;
  min-height: clamp(66px, 5.1vw, 82px);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 10px clamp(16px, 2.1vw, 36px);
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(7,8,10,.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.demo-experience-back {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  font: inherit;
  font-size: clamp(.67rem, .7vw, .78rem);
  font-weight: 650;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.demo-experience-back:hover,
.demo-experience-back:focus-visible {
  border-color: rgba(255,255,255,.22);
  color: #fff;
  background: rgba(255,255,255,.08);
  transform: translateX(-2px);
}

.demo-experience-title {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 11px;
}

.demo-experience-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}

.demo-experience-mark img {
  width: 23px;
}

.demo-experience-title > span:last-child {
  display: grid;
}

.demo-experience-title small,
.demo-experience-note small {
  color: rgba(255,255,255,.36);
  font-size: .48rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.demo-experience-title strong {
  margin-top: 4px;
  font-size: clamp(.73rem, .78vw, .9rem);
  letter-spacing: -.025em;
}

.demo-experience-note {
  display: grid;
  justify-self: end;
  text-align: right;
}

.demo-experience-note span {
  color: rgba(255,255,255,.73);
  font-size: clamp(.62rem, .65vw, .73rem);
  font-weight: 650;
}

.demo-experience-note small {
  margin-top: 4px;
  letter-spacing: 0;
}

.demo-experience-canvas {
  min-height: 0;
  padding: clamp(10px, 1.15vw, 20px);
}

.demo-experience .agent-console {
  display: grid;
  width: min(100%, 1800px);
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 0 auto;
  overflow: hidden;
  border-radius: clamp(20px, 1.5vw, 28px);
  background:
    radial-gradient(circle at 84% 0%, rgba(255,255,255,.05), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.018));
  box-shadow: 0 34px 100px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.09);
}

.demo-experience .agent-console-body,
.demo-experience .agent-workspace {
  min-height: 0;
  height: 100%;
}

.demo-experience .agent-workspace {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.demo-experience .agent-chat-thread {
  min-height: 0;
  max-height: none;
  height: 100%;
  padding: clamp(20px, 2vw, 34px);
}

.demo-experience .agent-empty-state {
  min-height: 100%;
  padding-block: clamp(24px, 2.7vh, 48px);
}

.demo-experience .agent-starter-grid {
  width: min(100%, 980px);
}

.demo-experience .agent-message-main {
  width: min(100%, 1040px);
}

.demo-experience .agent-console-footer {
  min-height: 45px;
}

@media (max-width: 1120px) {
  .agent-demo {
    min-height: auto;
  }

  .demo-launch-layout {
    grid-template-columns: 1fr;
    gap: clamp(48px, 7vw, 76px);
    text-align: center;
  }

  .demo-launch-copy {
    justify-self: center;
  }

  .demo-launch-copy .chapter-label,
  .demo-launch-actions,
  .demo-launch-meta {
    justify-content: center;
  }

  .demo-launch-copy h2,
  .demo-launch-lede {
    margin-inline: auto;
  }

  .demo-launch-preview {
    width: min(100%, 920px);
    justify-self: center;
    transform: none;
  }
}

@media (max-width: 720px) {
  .agent-demo {
    padding-block: 96px !important;
  }

  .demo-launch-copy h2 {
    font-size: clamp(3.05rem, 13.5vw, 4.2rem);
  }

  .demo-launch-actions {
    display: grid;
    width: 100%;
  }

  .demo-launch-actions .button {
    width: 100%;
    justify-content: center;
  }

  .demo-launch-primary {
    justify-content: space-between !important;
  }

  .demo-launch-meta {
    display: grid;
    justify-content: start;
    width: fit-content;
    margin-inline: auto;
    text-align: left;
  }

  .demo-preview-content {
    min-height: 420px;
    padding-inline: 16px;
  }

  .demo-preview-results {
    grid-template-columns: 1fr;
  }

  .demo-preview-results > span:nth-child(n+2) {
    display: none;
  }

  .demo-experience-header {
    min-height: 64px;
    grid-template-columns: auto 1fr auto;
    padding-inline: 10px;
  }

  .demo-experience-back {
    width: 42px;
    min-height: 42px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .demo-experience-back span:last-child,
  .demo-experience-note span,
  .demo-experience-note small,
  .demo-experience-title small {
    display: none;
  }

  .demo-experience-title {
    justify-self: start;
  }

  .demo-experience-note {
    width: 34px;
  }

  .demo-experience-canvas {
    padding: 0;
  }

  .demo-experience .agent-console {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .demo-experience .agent-console-topbar {
    min-height: 60px;
  }

  .demo-experience .agent-console-footer {
    display: none;
  }

  .demo-experience .agent-chat-thread {
    padding: 20px 14px;
  }

  .demo-experience .agent-empty-state {
    padding-block: 28px;
  }
}

@media (max-width: 430px) {
  .demo-preview-bar {
    padding-inline: 13px;
  }

  .demo-preview-brand > strong {
    font-size: .72rem;
  }

  .demo-preview-live {
    width: 31px;
    height: 31px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .demo-preview-content > strong {
    font-size: 1.65rem;
  }

  .demo-preview-query {
    min-height: 60px;
    padding-left: 15px;
  }

  .demo-experience-title strong {
    font-size: .7rem;
  }

  .demo-experience-mark {
    width: 35px;
    height: 35px;
  }

  .demo-experience .agent-console-brand strong {
    font-size: .75rem;
  }

  .demo-experience .agent-empty-state h3 {
    font-size: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-launch-preview,
  .demo-launch-preview::after,
  .demo-preview-enter i,
  .demo-launch-primary,
  .demo-experience {
    transition: none !important;
  }
}

/* Mobile application chrome: keep one clear header instead of repeating the brand twice. */
@media (max-width: 720px) {
  .demo-experience .agent-console-topbar {
    display: none;
  }

  .demo-experience-note {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%;
    background: rgba(255,255,255,.035);
  }

  .demo-experience-note::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #eef0ed;
    box-shadow: 0 0 0 5px rgba(255,255,255,.06);
    content: "";
  }
}
