/*
 * GISTM.NET landing page.
 * Desktop artwork keeps its own aspect ratio, with HTML labels in separate flowing columns.
 * Text sizes adapt by role; below 1200px the hero uses a photograph.
 */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("site/fonts/manrope-variable-latin.woff2") format("woff2");
}

:root {
  --blue: #003a9e;
  --blue-deep: #00348f;
  --blue-lift: #0443ad;
  --ink: #ffffff;
  --ink-soft: rgb(228 238 255 / 0.86);
  --ink-faint: rgb(214 228 255 / 0.78);
  --line: rgb(226 237 255 / 0.9);
  --lime: #dfff29;
  --brand-gold: #c59849;
  --brand-slate: #698996;
  --lime-hover: #eaff6a;
  --navy: #0a1b3f;
  --text-label: 0.8125rem;
  --text-diagram: 0.75rem;
  --text-control: 0.875rem;
  --font-text: "Manrope", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--blue);
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
  /* The lit gradient belongs to the hero; the long page below settles on flat blue. */
  background-color: var(--blue);
  background-image:
    radial-gradient(90% 70% at 72% 52%, rgb(20 84 190 / 0.35), transparent 70%),
    radial-gradient(60% 50% at 8% 0%, rgb(0 70 190 / 0.45), transparent 70%),
    linear-gradient(180deg, #003da7 0%, var(--blue) 60%, var(--blue) 100%);
  background-size: 100% min(1100px, 100vh + 200px);
  background-repeat: no-repeat;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

/* Avoid flashing the English fallback before the inferred language is applied. */
.i18n-pending body {
  visibility: hidden;
}

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

.page {
  position: relative;
  container-type: inline-size;
  overflow-x: clip;
  min-height: 100svh;
}

/* ---------------------------------------------------------------------------
 * Shared components
 * ------------------------------------------------------------------------- */

.arrow {
  width: 1.3em;
  height: 0.8em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.95em;
  font-weight: 500;
  white-space: normal;
  text-align: center;
  line-height: 1.45;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.button:hover .arrow,
.button:focus-visible .arrow {
  transform: translateX(3px);
}

.button-primary {
  background: var(--lime);
  color: var(--navy);
}

.button-primary:hover {
  background: var(--lime-hover);
}

.button-outline {
  border: 1px solid rgb(255 255 255 / 0.82);
  color: var(--ink);
}

.button-outline:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: var(--ink);
}

.brand {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  align-items: center;
}

.brand-mark {
  grid-row: span 2;
}

/* The GISTM.NET wordmark, as on the platform: Arial Bold, gold full stop, slate "NET". */
.wordmark {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
}

.wordmark-dot {
  color: var(--brand-gold);
}

.wordmark-net {
  color: var(--brand-slate);
}

.brand-tagline {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.45;
}

.primary-nav a,
.language-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  min-width: 24px;
  transition: color 160ms ease;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45em;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
  transform: scaleX(1);
}

.language-nav {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
}

.language-nav a:hover {
  color: var(--ink);
}

.language-nav a[aria-current="true"] {
  color: var(--ink);
}

.language-nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -0.55em;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  font-weight: 800;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.lede {
  font-weight: 400;
  letter-spacing: -0.005em;
}

.rule {
  fill: var(--ink);
  stroke: var(--ink-soft);
  stroke-width: 1;
}

.pillars,
.note,
.annotation,
.layer ul,
.scale {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.layer h2 {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.survey-mark svg,
.note-arrow {
  fill: var(--ink);
  stroke: var(--line);
  stroke-width: 1;
}

.note-arrow path {
  fill: none;
}

.survey-mark path {
  fill: none;
}

.stack-art img,
.layer-hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.layer-hotspots polygon {
  fill: transparent;
  pointer-events: all;
}

/* Layer focus: hovering a layer (artwork or label) blurs the others and lights up the chosen one.
   Only opacity and transform are animated. The blur and glow switch on at once: animating a filter makes the
   browser re-render the whole terrain drawing on every frame, which is what made this hover stutter. */
.layer-art,
.stack-guides,
.layer,
.annotation {
  transition:
    opacity 450ms ease,
    transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.layer h2,
.layer ul {
  transition: color 300ms ease;
}

.layer {
  transform-origin: 0 calc(10 * var(--u, 1px));
  cursor: default;
  outline-offset: 6px;
}

.layers {
  pointer-events: none;
}

.layer {
  pointer-events: auto;
}

.stack-canvas[data-active] .layer-art:not(.is-active) {
  filter: blur(calc(3.5 * var(--u, 1px)));
  opacity: 0.3;
}

.stack-canvas[data-active] .layer-art.is-active {
  filter: brightness(1.2) drop-shadow(0 0 calc(14 * var(--u, 1px)) rgb(150 196 255 / 0.6));
}

.stack-canvas[data-active] .stack-guides {
  opacity: 0.45;
}

/* Annotations stay readable while a layer is focused; the one that calls out a layer lights up with it. */
.stack-canvas[data-active] .annotation.is-active {
  color: var(--ink);
}

.stack-canvas[data-active] .layer:not(.is-active) {
  opacity: 0.32;
}

.layer.is-active h2 {
  color: var(--lime);
}

.layer.is-active ul {
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
 * Desktop: the 1536 × 1024 composition
 * ------------------------------------------------------------------------- */

@container (min-width: 75rem) {
  .stage,
  .site-header {
    --u: calc(100cqw / 1536);
  }

  .site-header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
  }

  /* Header */
  .site-header .brand {
    column-gap: 0.875rem;
    row-gap: 0.375rem;
  }

  .site-header .brand-mark {
    width: calc(54 * var(--u));
    height: calc(54 * var(--u));
    align-self: start;
  }

  .site-header .brand-name {
    font-size: 1.9375rem;
    margin-top: 0;
    align-self: end;
  }

  .site-header .brand-tagline {
    font-size: var(--text-diagram);
    line-height: 1.4;
    margin-left: calc(2 * var(--u));
    align-self: start;
  }

  .site-header .primary-nav {
    display: flex;
    flex-wrap: wrap;
    margin-left: auto;
    gap: 0.5rem 1.5rem;
    font-size: var(--text-control);
    line-height: 1.5;
    font-weight: 450;
    letter-spacing: -0.01em;
  }

  .site-header .nav-divider {
    flex: none;
    width: 1px;
    height: 2rem;
    background: rgb(255 255 255 / 0.55);
  }

  .site-header .language-nav {
    gap: 0.75rem;
    font-size: var(--text-label);
    line-height: 1.5;
    letter-spacing: 0.04em;
  }

  .site-header .button-outline {
    /* Symmetric padding: translated labels can be longer than the minimum width. */
    flex: none;
    padding: 0.625rem 1.375rem;
    min-height: 2.75rem;
    font-size: var(--text-control);
    gap: 1rem;
  }

  .site-header .button-outline .arrow {
    width: calc(20 * var(--u));
    height: calc(12 * var(--u));
  }

  /* Copy and artwork share a flowing grid. A short viewport scrolls instead of shrinking the art under its labels. */
  .stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.65fr);
    grid-template-rows: auto auto 1fr auto;
    gap: 1.5rem 2rem;
    padding: 2rem 2rem 3rem;
  }

  .topography {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
  }

  .hero {
    display: contents;
  }

  .hero h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    z-index: 1;
    width: max-content;
    max-width: 100%;
    font-size: calc(110 * var(--u));
    line-height: 0.9;
  }

  html:lang(es) .hero h1,
  html:lang(pt) .hero h1 {
    font-size: calc(96 * var(--u));
  }

  .hero-body {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .lede {
    max-width: 26ch;
    font-size: max(1rem, calc(25.6 * var(--u)));
    line-height: 1.3;
  }

  .rule {
    margin: 0.75rem 0 0 0.1875rem;
    width: 3.25rem;
    height: 0.375rem;
  }

  .pillars {
    margin: 0.625rem 0 0 0.375rem;
    font-size: var(--text-label);
    line-height: 1.5;
  }

  .hero-body .button-primary {
    margin-top: 1.5rem;
    min-height: 3rem;
    padding: 0.75rem 1.625rem;
    font-size: var(--text-control);
  }

  .survey-mark,
  .note-possibilities {
    grid-column: 1;
    grid-row: 3;
    position: relative;
    align-self: end;
    justify-self: center;
  }

  .survey-mark {
    width: 8.25rem;
    margin: 2rem 6rem 3rem 0;
  }

  .note {
    font-size: var(--text-label);
    line-height: 1.5;
  }

  .note-possibilities {
    margin-left: 8rem;
  }

  .note-action {
    grid-column: 1;
    grid-row: 4;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .note-arrow {
    width: 2.875rem;
    height: 0.625rem;
    margin-top: 0.4em;
    flex: none;
  }

  .stack {
    grid-column: 2;
    grid-row: 1 / -1;
    position: relative;
    min-width: 0;
    align-self: start;
  }

  /* Dedicated label lanes never share space with the cropped terrain and plates. */
  .stack-canvas {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 2.9fr) minmax(0, 0.75fr);
    gap: 1rem;
  }

  .stack-art {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    align-self: center;
    aspect-ratio: 640 / 934;
  }

  .layers {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-rows: minmax(8rem, 1.8fr) repeat(5, minmax(max-content, 1fr));
    gap: 1rem;
    padding-bottom: 1rem;
  }

  .layers::before {
    content: "";
  }

  .layer {
    position: relative;
    min-width: 0;
    align-self: start;
  }

  .layer h2 {
    width: fit-content;
    max-width: 100%;
    font-size: var(--text-control);
    line-height: 1.4;
  }

  .layer ul {
    margin-top: 0.3125rem;
    font-size: var(--text-diagram);
    line-height: 1.4;
    letter-spacing: 0.035em;
  }

  .stack-notes {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    min-width: 0;
  }

  .annotation {
    font-size: var(--text-diagram);
    line-height: 1.5;
    letter-spacing: 0.05em;
  }

  .annotation-from::before,
  .annotation-path::before {
    content: "";
    display: block;
    width: 1px;
    height: 3rem;
    margin: 0 0 1rem 0.5rem;
    background: var(--line);
  }

  .stack-measure {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .scale {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--line);
    font-size: var(--text-label);
    letter-spacing: 0.02em;
    text-transform: none;
  }

  .compass {
    flex: none;
    display: grid;
    justify-items: center;
    font-size: var(--text-label);
    color: var(--ink-soft);
  }

  .compass svg {
    width: 2.5rem;
    height: 2.5rem;
    fill: none;
    stroke: var(--line);
  }

  .stack-connectors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    fill: none;
    stroke: var(--line);
    stroke-width: 1;
  }

  .stack-connectors path {
    transition: opacity 450ms ease;
  }

  .stack-canvas[data-active] .stack-connectors path:not(.is-active) {
    opacity: 0.32;
  }
}

/* ---------------------------------------------------------------------------
 * Small screens: stacked flow
 * ------------------------------------------------------------------------- */

@container (max-width: 74.999rem) {
  .stage {
    position: relative;
    padding: 0 16px 48px;
  }

  .topography {
    position: absolute;
    left: -60%;
    bottom: 0;
    width: 220%;
    opacity: 0.8;
    pointer-events: none;
  }

  .site-header {
    position: relative;
    z-index: 2;
    padding: 20px 16px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand demo"
      "nav lang";
    align-items: center;
    gap: 18px 12px;
  }

  .site-header .brand {
    grid-area: brand;
  }

  .site-header .brand-mark {
    width: 40px;
    height: 40px;
  }

  .site-header .brand {
    column-gap: 10px;
  }

  .site-header .brand-name {
    font-size: 1.375rem;
  }

  .site-header .brand-tagline {
    font-size: var(--text-diagram);
    letter-spacing: 0.1em;
  }

  .site-header .button-outline {
    grid-area: demo;
    padding: 10px 14px;
    font-size: var(--text-control);
    gap: 10px;
  }

  .site-header .primary-nav {
    grid-area: nav;
    display: flex;
    gap: 16px;
    font-size: var(--text-control);
    flex-wrap: wrap;
  }

  .site-header .nav-divider {
    display: none;
  }

  .site-header .language-nav {
    grid-area: lang;
    gap: 8px;
    font-size: var(--text-label);
  }

  main {
    position: relative;
  }

  .hero {
    position: relative;
    padding-top: 32px;
  }

  .hero h1 {
    font-size: clamp(2.125rem, 11.5vw, 3.25rem);
    line-height: 0.98;
  }

  .lede {
    max-width: 26ch;
    margin-top: 22px;
    font-size: 1.0625rem;
    line-height: 1.45;
  }

  .rule {
    width: 52px;
    height: 6px;
    margin-top: 26px;
  }

  .hero-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .pillars {
    margin-top: 12px;
    font-size: var(--text-label);
    line-height: 1.65;
  }

  .hero-body .button-primary {
    margin-top: 28px;
    padding: 13px 22px;
    font-size: var(--text-control);
  }

  .survey-mark,
  .note-possibilities {
    display: none;
  }

  .note {
    font-size: var(--text-label);
    line-height: 1.6;
  }

  .note-action {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 28px;
  }

  .note-arrow {
    width: 36px;
    height: 10px;
    margin-top: 3px;
    flex: none;
  }

  /* Below the wide desktop grid, the photograph replaces the layer stack and the copy leads. */
  .stack {
    display: none;
  }

  /* Romance-language headlines are a few letters longer. */
  html:lang(es) .hero h1,
  html:lang(pt) .hero h1 {
    font-size: clamp(1.875rem, 9.6vw, 2.875rem);
  }

  .site-header .brand {
    min-width: 0;
  }
}

@media (max-width: 479.98px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand lang"
      "nav nav"
      "demo demo";
  }

  .site-header .brand-tagline,
  .site-header .button-outline .arrow,
  .site-header .nav-contact {
    /* "Book a demo" already links to the contact form. */
    display: none;
  }

  .site-header .brand-mark {
    width: 34px;
    height: 35px;
  }

  .site-header .brand-name {
    font-size: 1.25rem;
  }

  .site-header .button-outline {
    justify-self: start;
    min-height: 2.75rem;
    padding: 9px 12px;
    font-size: var(--text-control);
  }

  .site-header .primary-nav {
    gap: 12px;
    font-size: var(--text-control);
  }
}

/* Laptop and tablet copy gets a composition of its own. */
@container (min-width: 40rem) and (max-width: 74.999rem) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px 32px;
    align-items: start;
    padding-top: 40px;
  }

  .hero h1 {
    grid-column: 1;
    font-size: clamp(2.625rem, 5.5cqw, 4rem);
    line-height: 1.02;
  }

  html:lang(es) .hero h1,
  html:lang(pt) .hero h1 {
    font-size: clamp(2.25rem, 4.6cqw, 3.5rem);
  }

  .hero-body,
  .note-action {
    grid-column: 1;
  }

  .lede {
    margin-top: 0;
    font-size: 1.25rem;
  }

  .note-action {
    margin-top: 0;
  }
}

/* Two header rows fit regular phones; the smallest phones keep a separate demo row. */
@container (min-width: 22.5rem) and (max-width: 29.999rem) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand demo"
      "nav lang";
    gap: 12px 8px;
  }

  .site-header .brand-name {
    font-size: 1.125rem;
  }

  .site-header .brand {
    column-gap: 8px;
  }

  .site-header .button-outline {
    justify-self: end;
    max-width: 10rem;
    padding-inline: 10px;
  }

  .site-header .language-nav {
    gap: 6px;
    justify-self: end;
  }

  .site-header .primary-nav {
    gap: 8px;
  }
}

/* Preserve the larger type approved for big screens. */
@container (min-width: 100rem) {
  .page > * {
    --text-label: 0.875rem;
    --text-diagram: 0.875rem;
    --text-control: 1rem;
  }

  .stage,
  .site-header {
    --u: calc(100cqw / 1536);
  }

  .site-header .brand-tagline,
  .site-header .language-nav,
  .pillars,
  .note,
  .layer ul,
  .annotation,
  .scale,
  .compass-north {
    font-size: 0.875rem;
  }

  .site-header .primary-nav,
  .site-header .button-outline,
  .hero-body .button-primary,
  .layer h2 {
    font-size: 1rem;
  }

  .hero-body .button-primary {
    min-height: 3.25rem;
  }

  .layer ul {
    line-height: 1.4;
    margin-top: 0.375rem;
  }
}

/* ---------------------------------------------------------------------------
 * Entrance motion
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero > *,
  .site-header,
  .stack-art,
  .layer,
  .annotation {
    animation: rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  .site-header {
    animation-name: fade;
  }

  .hero > :nth-child(2) {
    animation-delay: 80ms;
  }

  .hero > :nth-child(n + 3) {
    animation-delay: 160ms;
  }

  .stack-art {
    animation-name: fade;
    animation-duration: 1400ms;
    animation-delay: 120ms;
  }

  .layer {
    animation-name: fade;
  }

  .layer:nth-child(1) {
    animation-delay: 300ms;
  }

  .layer:nth-child(2) {
    animation-delay: 380ms;
  }

  .layer:nth-child(3) {
    animation-delay: 460ms;
  }

  .layer:nth-child(4) {
    animation-delay: 540ms;
  }

  .layer:nth-child(5) {
    animation-delay: 620ms;
  }

  .annotation {
    animation-name: fade;
    animation-delay: 700ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* Keep enlarged text in flow when the visitor increases their preferred font size. */
@container (max-width: 18rem) {
  .site-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "lang"
      "nav"
      "demo";
  }

  .site-header .brand-tagline {
    display: none;
  }
}
