/* AISLAND homepage composition. Device frames share their original screen geometry. */
html { scroll-padding-top: 28px; }

.container { width: min(1440px, calc(100% - 88px)); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.header { border-bottom: 1px solid #e8edf5; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 24px;
}
.brand img { width: 118px; }
.nav { display: flex; gap: clamp(16px, 3vw, 55px); align-items: center; }
.nav a, .nav-download { font-size: 14px; font-weight: 620; }
.nav a:hover, .text-link:hover { color: var(--accent); }
.nav-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  padding: 8px 0 8px 8px;
}
.nav-download svg { width: 16px; height: 16px; transform: rotate(-35deg); }
.menu-toggle { display: none; }

.hero { padding: clamp(22px, 4.2vw, 66px) 0 52px; }
.masthead {
  position: relative;
  margin: 0 auto;
  aspect-ratio: 1200 / 250;
  max-width: 1330px;
  background: linear-gradient(171deg, #0c37bf 0%, #1460ff 62%, #5794ff 100%);
  mask: url("./assets/wordmark.svg") center / contain no-repeat;
}
.hero-layout {
  display: grid;
  grid-template-columns: minmax(158px, 1fr) minmax(0, 3.6fr) minmax(168px, 1fr);
  align-items: end;
  gap: 12px;
  position: relative;
  margin-top: 20px;
  isolation: isolate;
}
.hero-copy, .hero-get { z-index: 1; padding-bottom: 40px; }
.hero-statement {
  font-size: clamp(23px, 2.5vw, 40px);
  font-weight: 690;
  line-height: 1.2;
  letter-spacing: -.045em;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 0;
}
.hero-explore { margin-top: 15px; }
.hero-get { justify-self: end; align-self: center; }
.hero-actions { display: grid; gap: 10px; }
.hero-actions .interactive-hover-button, .hero-actions .button-fallback {
  width: 100%;
  min-width: 156px;
  white-space: nowrap;
  font-size: 13px;
}
.button-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.button-fallback.secondary { background: #fff; color: var(--text); border-color: var(--border); }

.hero-product {
  margin: 0;
  position: relative;
  min-width: 0;
  isolation: isolate;
}
.device-composition {
  position: relative;
  padding: 28px 5% 26px 0;
  margin-inline: -2%;
  isolation: isolate;
}
.device-composition::before {
  content: "";
  position: absolute;
  inset: -16% -7% -9%;
  z-index: -1;
  background: radial-gradient(ellipse at 51% 62%, #d7e7ff, #edf4ff 38%, transparent 70%);
  pointer-events: none;
}
.hero-mac {
  width: 94%;
  transform: translate3d(var(--mac-x, 0px), var(--mac-y, 0px), 0) rotate(-3deg);
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}
.hero-phone {
  position: absolute;
  width: 22%;
  right: 3%;
  bottom: 3%;
  transform: translate3d(var(--phone-x, 0px), var(--phone-y, 0px), 0) rotate(8deg);
  filter: drop-shadow(0 16px 16px #152c6339);
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}

/* Scroll progress reveals the actual expanded capture from the screen edge. */
.experience { background: #f1f6ff; }
.experience.is-scrollable { min-height: 155svh; }
.experience-sticky { padding: clamp(24px, 5vh, 55px) 0 28px; }
.is-scrollable .experience-sticky { position: sticky; top: 0; }
.experience-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 28px;
  margin-bottom: 22px;
}
h2 {
  font-size: clamp(34px, 4.15vw, 63px);
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -.052em;
  margin: 0;
}
h2 span { color: var(--accent); }
.experience-stage {
  height: min(56svh, 510px);
  min-height: 200px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(ellipse at 52% 92%, #5e93eb, transparent 77%), #e1edff;
}
.experience-monitor {
  width: min(76%, 840px);
  height: 94%;
  align-self: end;
  padding: 6px 6px 0;
  background: linear-gradient(180deg, #5a6270 0, #111827 6%);
  border-radius: 17px 17px 0 0;
  box-shadow: 0 16px 55px #10295948;
}
.experience-screen {
  position: relative;
  height: 100%;
  background: linear-gradient(150deg, #d2e6ff, #86b8fd 58%, #477bdc);
  overflow: hidden;
  border-radius: 11px 11px 0 0;
}
.island-preview {
  --open: 1;
  position: relative;
  width: min(65%, 43svh, 448px);
  margin-inline: auto;
  filter: drop-shadow(0 12px 20px #0a18344a);
}
.preview-expanded {
  width: 100%;
  height: auto;
  opacity: min(1, calc(var(--open) * 2.8));
  clip-path: inset(0 0 calc((1 - var(--open)) * 94%) 0 round 0 0 14px 14px);
  transform: scaleX(calc(.55 + var(--open) * .45));
  transition: transform .36s ease, clip-path .36s ease, opacity .24s ease;
}
.preview-collapsed {
  position: absolute;
  inset: 0 auto auto 50%;
  width: 55%;
  height: auto;
  opacity: max(0, calc(1 - var(--open) * 3));
  transform: translateX(-50%);
  transition: opacity .24s ease;
}
.island-preview.is-scrubbing img { transition: none; }
#preview-toggle {
  border: 0;
  background: #fff;
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  flex: none;
  padding: 9px 17px;
}
#preview-toggle:hover { background: var(--accent); color: #fff; }
#preview-toggle[hidden] { display: none; }


.mobile-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  align-items: center;
  gap: 36px;
  padding: 48px clamp(24px, 5vw, 80px);
  background: radial-gradient(ellipse at 70% 62%, #d9e8ff, transparent 65%), #f6f8fc;
  border-radius: 20px;
}
.mobile-story { margin-bottom: clamp(48px, 7vw, 104px); }
.mobile-story-copy .text-link { margin-top: 18px; }
.phone-zoom {
  width: min(62%, 226px);
  justify-self: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 17% / 8%;
  transform: rotate(7deg);
  filter: drop-shadow(0 20px 21px #254b7940);
  transition: transform .35s ease;
}
.phone-zoom:hover { transform: rotate(3deg) translateY(-6px); }

.download-heading .download-wordmark {
  display: inline-block;
  width: 3.45em;
  height: .72em;
  vertical-align: -.01em;
  background: var(--accent);
  mask: url("./assets/wordmark.svg") center / contain no-repeat;
}
.download-heading { text-align: left; display: flex; align-items: center; gap: 18px; }
.download-heading img { margin: 0; width: 52px; height: 52px; border-radius: 12px; }
.download-layout { margin-inline: 0; max-width: none; }
.download-row p { color: var(--text); font-size: 14px; }
.download-help { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 15px; }
.download-help a { padding-block: 10px; color: var(--accent); font-size: 14px; }
.download-help a:hover, .mobile-links a:hover { text-decoration: underline; }
.mobile-links a { font-size: 15px; min-height: 44px; }
.footer nav { font-size: 13px; color: var(--text); }

@media (max-width: 1050px) {
  .container { width: calc(100% - 56px); }
  .hero-layout { grid-template-columns: minmax(130px, 1fr) minmax(0, 3.3fr) minmax(146px, 1fr); }
  .hero-copy, .hero-get { padding-bottom: 30px; }
  .hero-actions .interactive-hover-button, .hero-actions .button-fallback { min-width: 140px; font-size: 12px; }
}

@media (max-width: 740px) {
  .container { width: calc(100% - 36px); }
  .header-inner { min-height: 60px; gap: 14px; position: relative; flex-wrap: wrap; }
  .brand img { width: 100px; }
  .nav { order: 4; width: 100%; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; }
  .has-navigation .nav {
    display: none;
    position: absolute;
    top: calc(100% - 3px);
    right: 0;
    z-index: 5;
    width: min(280px, 100%);
    padding: 8px 14px;
    background: #fff;
    box-shadow: 0 12px 34px #21396326;
    border-radius: 13px;
  }
  .has-navigation .nav.open { display: grid; gap: 0; }
  .nav a { padding-block: 11px; }
  .has-navigation .menu-toggle {
    display: grid;
    align-content: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .menu-toggle span { display: block; width: 16px; height: 2px; background: currentColor; }
  .hero { padding: 24px 0 40px; }
  .hero-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 22px; }
  .hero-copy, .hero-get { padding-bottom: 0; }
  .hero-statement { font-size: clamp(25px, 6.5vw, 38px); }
  .hero-statement br { display: none; }
  .hero-explore { display: none; }
  .hero-get { grid-row: 2; justify-self: stretch; max-width: 390px; }
  .hero-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .hero-actions .interactive-hover-button, .hero-actions .button-fallback { min-width: 0; padding-inline: 10px; }
  .device-composition { padding-top: 9px; padding-bottom: 9px; margin-inline: 0; }
  .device-composition::before { inset-inline: 0; }
  .experience-heading { align-items: center; margin-bottom: 16px; gap: 8px; }
  .experience.is-scrollable { min-height: 142svh; }
  .experience-stage { height: min(52svh, 75vw); min-height: 165px; border-radius: 13px; }
  .experience-monitor { width: 91%; padding: 4px 4px 0; border-radius: 12px 12px 0 0; }
  .experience-screen { border-radius: 8px 8px 0 0; }
  .island-preview { width: min(76%, 48svh); }
  .mobile-story { grid-template-columns: minmax(0, 1fr) minmax(0, .83fr); gap: 16px; padding: 24px 18px 16px; }
  .mobile-story h2 { font-size: clamp(24px, 5.6vw, 36px); }
  .mobile-story-copy .text-link { margin-top: 5px; }
  .phone-zoom { width: 87%; }
  .download-section { padding: 48px 0 32px; }
  .download-heading { margin-bottom: 22px; }
  .download-heading img { width: 38px; height: 38px; border-radius: 9px; }
  .download-layout { grid-template-columns: 1fr; gap: 24px; }
  .download-row { gap: 10px; grid-template-columns: 25px minmax(0, 1fr) auto; }
  .download-row:has(> .platform-icon) > [data-hover-button] {
    width: 144px;
    justify-self: end;
  }
  .download-row:has(> .platform-icon) > [data-hover-button] > a {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
  }
  .download-row .interactive-hover-button, .download-row .button-fallback { min-width: 0; font-size: 11px; white-space: nowrap; }
  .mobile-download { padding: 20px; }
  .footer { flex-wrap: wrap; gap: 15px; padding-block: 24px; }
  .footer nav { gap: 12px; }
  .image-dialog { width: calc(100vw - 20px); }
  .image-dialog-bar { padding: 8px 10px; font-size: 10px; }
  .image-dialog-bar button { font-size: 10px; padding-inline: 9px; }
  .image-dialog-content { padding: 10px; }
}

@media (max-height: 540px) {
  .experience-sticky { padding: 16px 0 4px; }
  .experience-heading { margin-bottom: 10px; flex-direction: row; align-items: flex-end; }
  .experience-heading h2 { font-size: 26px; }
  .experience-stage { height: 54svh; min-height: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 350px) {
  .download-row { grid-template-columns: 23px 1fr; }
  .download-row > span { grid-column: 2; }
}
