/* NIN-01-A: the first Noesis home, isolated from existing product pages. */
.noesis-body,
.noesis-body *,
.noesis-body *::before,
.noesis-body *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: light;
  background: #d8eff8;
}

.noesis-body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: #073756;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

.noesis-body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: #d8eff8 url("../assets/backgrounds/noesis-desktop.webp") center / cover no-repeat;
}

.noesis-home {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.25rem, 3vh, 2rem) max(1.25rem, env(safe-area-inset-right)) 3rem max(1.25rem, env(safe-area-inset-left));
  align-content: start;
  justify-items: center;
}

.noesis-title {
  width: clamp(12rem, 24vw, 20rem);
  max-width: 100%;
  margin: 0;
  line-height: 1;
}

.noesis-wordmark {
  display: block;
  width: 100%;
  height: auto;
}

.noesis-subtitle {
  width: min(100%, 40rem);
  margin: 0.35rem 0 0;
  color: #003160;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

.noesis-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 70rem);
  margin-top: clamp(1rem, 2.5vh, 1.5rem);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.noesis-feature {
  --noesis-panel-padding: clamp(1rem, 1.5vw, 1.25rem);
  --noesis-feature-image-size: clamp(8rem, 34dvh, 16.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Keep the approved card height; longer captions borrow image space. */
  height: calc(var(--noesis-feature-image-size) + 2 * var(--noesis-panel-padding) + 2px + 0.75rem + 4.5rem);
  min-width: 0;
  margin: 0;
  padding: var(--noesis-panel-padding);
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 1rem;
  background: rgb(245 252 255 / 64%);
  box-shadow:
    0 0.75rem 1.8rem rgb(0 49 96 / 10%),
    inset 0 1px 0 rgb(255 255 255 / 55%);
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  text-align: center;
}

.noesis-feature-image {
  display: block;
  flex: 0 1 var(--noesis-feature-image-size);
  min-height: 0;
  width: min(100%, clamp(8rem, 34dvh, 16.5rem));
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
  object-fit: contain;
}

.noesis-feature-caption {
  flex: none;
  width: 100%;
  margin-top: 0.75rem;
  color: #003160;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-wrap: balance;
}

/* Use the glass's inner width for the wide chat asset, keeping its row height. */
.noesis-feature-image--chat {
  width: calc(100% + 2 * var(--noesis-panel-padding));
  height: clamp(8rem, 34dvh, 16.5rem);
  margin-inline: calc(-1 * var(--noesis-panel-padding));
}

.noesis-offer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(1.25rem, 3vh, 2rem);
  padding: clamp(3.5rem, 7vh, 5rem) max(1.5rem, env(safe-area-inset-right)) clamp(1.5rem, 3.5vh, 2.5rem) max(1.5rem, env(safe-area-inset-left));
}

.noesis-offer-title {
  margin: 0;
  color: #003160;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 0 rgb(255 255 255 / 65%);
}

.noesis-offer-more {
  display: flex;
  justify-content: center;
  padding-block: clamp(2.5rem, 7vh, 4rem) clamp(1rem, 3vh, 2rem);
}

.noesis-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12.5rem;
  max-width: 100%;
  text-align: center;
  text-decoration: none;
}

.noesis-information-body {
  overflow-y: auto;
}

.noesis-information-main {
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(6rem, 12vh, 8rem) max(1.5rem, env(safe-area-inset-right)) clamp(3rem, 7vh, 5rem) max(1.5rem, env(safe-area-inset-left));
}

.noesis-information-title {
  width: min(100%, 60rem);
  margin: 0 auto clamp(1.4rem, 3vh, 2.25rem);
  color: #003160;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.noesis-information-copy,
.noesis-quote-panel {
  width: min(100%, 60rem);
  margin-inline: auto;
  padding: clamp(1.25rem, 2.5vw, 2.25rem);
  border: 1px solid rgb(255 255 255 / 62%);
  border-radius: 1.25rem;
  background: rgb(245 252 255 / 42%);
  box-shadow:
    0 0.75rem 2rem rgb(0 49 96 / 7%),
    inset 0 1px 0 rgb(255 255 255 / 45%);
  backdrop-filter: blur(8px) saturate(108%);
  -webkit-backdrop-filter: blur(8px) saturate(108%);
}

.noesis-information-copy {
  color: #003160;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  font-weight: 700;
  line-height: 1.85;
  text-align: left;
  text-wrap: pretty;
}

.noesis-language-indicator {
  font: inherit;
  cursor: default;
  pointer-events: none;
}

.noesis-information-copy p {
  margin: 0;
}

.noesis-information-copy p + p {
  margin-top: 1.6em;
}

.noesis-information-more {
  margin-top: 1.6em;
}

.noesis-read-more {
  display: none;
  margin-top: 1rem;
  padding: 0.4rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.88em;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.noesis-read-more:focus-visible {
  outline: 2px solid #087c8b;
  outline-offset: 3px;
}

.noesis-information-copy a {
  color: inherit;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.noesis-presentation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-top: clamp(2rem, 4vh, 3rem);
}

.noesis-information-copy .noesis-presentation-actions .service-quote-button {
  color: #f7fff9;
}

.noesis-presentation-download {
  font-size: 0.9rem;
}

.noesis-application-example {
  width: min(55.66%, 40.073rem);
  margin: calc(clamp(3rem, 7vh, 5rem) - 8px) auto 0;
  padding-inline: clamp(0.25rem, 1vw, 0.75rem);
}

.noesis-application-link,
.noesis-application-toggle {
  display: block;
  border: 2px solid rgb(91 218 144 / 85%);
  border-radius: 0.75rem;
  box-shadow:
    0 0.65rem 1.4rem rgb(0 49 96 / 14%),
    0 0 0.7rem rgb(70 210 130 / 24%);
  transform: perspective(1800px) rotateY(-12deg);
  transform-origin: center;
  cursor: zoom-in;
}

.noesis-application-link img,
.noesis-application-toggle img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.noesis-application-link:focus-visible,
.noesis-application-toggle:focus-visible {
  outline: 3px solid #087c8b;
  outline-offset: 5px;
}

.noesis-application-mobile {
  display: none;
}

.noesis-quote-panel {
  width: min(94%, 49rem);
  padding: clamp(1.1rem, 2vw, 1.75rem);
  margin-top: clamp(2rem, 5vh, 3rem);
  color: #003160;
  background: rgb(245 252 255 / 60%);
}

.noesis-quote-form,
.noesis-quote-form .service-quote-grid {
  gap: 0.8rem;
}

.noesis-quote-form .service-quote-field {
  color: #003160;
  font-size: 0.95rem;
  line-height: 1.5;
}

.noesis-quote-form .service-quote-field em {
  color: #365c73;
}

.noesis-quote-form .service-quote-field input,
.noesis-quote-form .service-quote-field textarea {
  min-width: 0;
  border-color: rgb(0 49 96 / 25%);
  color: #003160;
  background: rgb(255 255 255 / 72%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
  font-size: 1rem;
  caret-color: #003160;
}

.noesis-quote-form .service-quote-field input {
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
}

.noesis-quote-form .service-quote-field textarea {
  height: 9.5rem;
  min-height: 8.5rem;
  padding: 0.65rem 0.75rem;
}

.noesis-quote-form .service-quote-submit {
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
}

.noesis-quote-form .service-quote-field input::placeholder,
.noesis-quote-form .service-quote-field textarea::placeholder {
  color: #49677d;
  opacity: 1;
}

.noesis-quote-form .service-quote-field input:focus,
.noesis-quote-form .service-quote-field textarea:focus {
  border-color: #087c8b;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 0 0 3px rgb(8 124 139 / 18%);
}

.noesis-quote-form .service-quote-privacy,
.noesis-quote-form .noesis-quote-note {
  margin: 0;
  color: #254c64;
  font: 500 0.83rem/1.55 system-ui, sans-serif;
}

.noesis-quote-form .service-quote-status {
  margin: 0;
  color: #254c64;
  font: 500 0.9rem/1.65 system-ui, sans-serif;
}

.noesis-quote-form .site-privacy-link {
  justify-self: start;
  max-width: 100%;
  color: #003160;
  background: rgb(255 255 255 / 48%);
  font-size: 0.85rem;
}

.noesis-quote-form .site-privacy-link:hover {
  color: #087c8b;
}

.noesis-quote-form .site-privacy-link:focus-visible,
.noesis-information-copy a:focus-visible {
  outline: 2px solid #087c8b;
  outline-offset: 3px;
}

.noesis-quote-form .service-quote-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.noesis-offer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.85rem, 1.5vw, 1.5rem);
  width: min(100%, 90rem);
  min-height: 0;
  margin-inline: auto;
}

.noesis-offer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 0;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 1rem;
  background: rgb(245 252 255 / 64%);
  box-shadow:
    0 0.75rem 1.8rem rgb(0 49 96 / 10%),
    inset 0 1px 0 rgb(255 255 255 / 55%);
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
}

.noesis-offer-column--cloud {
  background: linear-gradient(150deg, rgb(220 243 255 / 82%), rgb(155 214 246 / 76%));
}

.noesis-offer-column--private {
  background: linear-gradient(150deg, rgb(225 234 242 / 84%), rgb(161 184 200 / 78%));
}

.noesis-offer-heading {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  width: 100%;
  padding-bottom: clamp(1rem, 2.5vh, 1.5rem);
  border-bottom: 1px solid rgb(0 49 96 / 30%);
}

.noesis-offer-wordmark {
  display: block;
  flex-shrink: 1;
  min-width: 0;
  width: clamp(6.75rem, 9vw, 8rem);
  max-width: 100%;
  height: auto;
}

.noesis-offer-name {
  flex: none;
  margin: 0 0 0.3rem;
  color: #111;
  font-size: clamp(0.8rem, 1.15vw, 1rem);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.noesis-device-icons {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0.2rem auto;
  color: #003160;
}

.noesis-device-icon {
  display: block;
  width: clamp(1rem, 1.5vw, 1.25rem);
  height: clamp(1rem, 1.5vw, 1.25rem);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.noesis-offer-description {
  width: 100%;
  margin: 0;
  padding-block: clamp(1rem, 2.5vh, 1.5rem);
  border-bottom: 1px solid rgb(0 49 96 / 30%);
  color: #003160;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  font-weight: 500;
  line-height: 1.5;
}

.noesis-offer-points {
  width: 100%;
  margin: 0;
  padding: 0.25rem 0 0 1.35rem;
  color: #111;
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  font-weight: 700;
  line-height: 1.5;
  list-style: disc;
}

.noesis-offer-points li {
  padding: 0.75rem 0 0.75rem 0.2rem;
  border-bottom: 1px solid rgb(0 49 96 / 11%);
}

.noesis-offer-points li::marker {
  color: #087c8b;
  font-size: 0.8em;
}

.noesis-offer-points [data-offer-row="capacity"] {
  border-bottom: 0;
}

.noesis-offer-points li.noesis-offer-point--separated {
  margin-top: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(0 49 96 / 22%);
}

/* Shared content-sized rows align equivalent features across the three plans. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 48.01rem) {
    .noesis-offer-columns {
      grid-template-rows: auto auto repeat(7, auto) minmax(1.75rem, 1fr);
      row-gap: 0;
    }

    .noesis-offer-column {
      display: grid;
      grid-row: 1 / span 10;
      grid-template-rows: subgrid;
      align-items: stretch;
    }

    .noesis-offer-points {
      display: grid;
      grid-row: 3 / span 7;
      grid-template-rows: subgrid;
    }

    .noesis-offer-points [data-offer-row="database"] { grid-row: 1; }
    .noesis-offer-points [data-offer-row="desktop"] { grid-row: 2; }
    .noesis-offer-points [data-offer-row="capacity"] { grid-row: 3; }
    .noesis-offer-points [data-offer-row="ai"] { grid-row: 4; }
    .noesis-offer-points [data-offer-row="editor"] { grid-row: 5; }
    .noesis-offer-points [data-offer-row="mobile"] { grid-row: 6; }
    .noesis-offer-points [data-offer-row="companion"] { grid-row: 7; }
  }
}

@media (min-width: 48.01rem) {
  .noesis-offer {
    grid-template-rows: auto minmax(min-content, 1fr) auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: clamp(1.25rem, 3vh, 2rem);
    scrollbar-width: thin;
    scrollbar-color: rgb(0 49 96 / 45%) transparent;
  }

  .noesis-offer-title {
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  }

  .noesis-offer-columns {
    width: min(90%, 81rem);
    column-gap: clamp(0.765rem, 1.35vw, 1.35rem);
  }
}

.noesis-home-link {
  position: fixed;
  z-index: 10;
  top: max(1.15rem, env(safe-area-inset-top));
  left: max(1.15rem, env(safe-area-inset-left));
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.48rem 0.82rem;
  border: 1px solid rgb(207 231 255 / 36%);
  border-radius: 0.42rem;
  color: rgb(247 252 255 / 94%);
  background: rgb(12 25 38 / 52%);
  box-shadow:
    0 0.45rem 1rem rgb(0 0 0 / 20%),
    inset 0 0 0 1px rgb(155 207 255 / 9%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.noesis-home-link:hover {
  border-color: rgb(220 241 255 / 54%);
  background: rgb(16 35 52 / 64%);
  box-shadow:
    0 0.55rem 1.2rem rgb(0 0 0 / 24%),
    0 0 0.9rem rgb(131 198 255 / 12%),
    inset 0 0 0 1px rgb(181 222 255 / 14%);
  transform: translateY(-1px);
}

.noesis-home-link:focus-visible {
  outline: 2px solid rgb(213 239 255 / 86%);
  outline-offset: 3px;
}

.noesis-body .language-toggle {
  min-height: 2.75rem;
}

@media (max-width: 48rem) {
  /* As on Kingdom: natural vertical flow on mobile, not desktop slide snapping. */
  .noesis-body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .noesis-application-link {
    display: none;
  }

  .noesis-application-example {
    width: min(75.9%, 40.073rem);
  }

  .noesis-information-copy.is-collapsible:not(.is-expanded) .noesis-information-more {
    display: none;
  }

  .noesis-information-copy.is-collapsible:not(.is-expanded) .noesis-read-more {
    display: inline-block;
  }

  .noesis-application-mobile {
    display: block;
  }

  .noesis-application-toggle {
    list-style: none;
    transform: perspective(1200px) rotateY(-8deg);
    transition: transform 240ms ease;
  }

  .noesis-application-toggle::-webkit-details-marker {
    display: none;
  }

  .noesis-application-mobile[open] {
    padding-block: 11%;
  }

  .noesis-application-mobile[open] > .noesis-application-toggle {
    transform: perspective(1200px) rotateY(0deg) scale(1.35);
    cursor: zoom-out;
  }

  .noesis-home {
    height: auto;
    padding-top: max(3.5rem, calc(env(safe-area-inset-top) + 3rem));
  }

  .noesis-offer {
    /* Let the grid shrink inside narrow viewports instead of using CTA min-content. */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    padding-top: max(4.5rem, calc(env(safe-area-inset-top) + 3.5rem));
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }

  .noesis-offer-columns {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 22rem);
    row-gap: 1rem;
  }

  .noesis-offer-column {
    min-height: clamp(24rem, 64dvh, 28rem);
  }

  .noesis-body::before {
    background-image: url("../assets/backgrounds/noesis-mobile.webp");
  }

  .noesis-title {
    width: min(64vw, 16rem);
  }

  .noesis-features {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 22rem);
    row-gap: 2.5rem;
  }

  /* Same final mobile treatment as the existing sibling-page Home links. */
  .noesis-home-link {
    top: max(0.72rem, env(safe-area-inset-top));
    left: max(0.72rem, env(safe-area-inset-left));
    z-index: 90;
    min-height: 2.3rem;
    padding: 0.48rem 0.75rem;
    border-radius: 0.62rem;
    backdrop-filter: blur(14px) saturate(116%);
    -webkit-backdrop-filter: blur(14px) saturate(116%);
  }

  .noesis-body .language-dock {
    top: max(0.8rem, env(safe-area-inset-top));
    right: max(0.8rem, env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce) {
  .noesis-application-toggle {
    transition: none;
  }
}
