:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  color: #f8f9f6;
  background: #243329;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --accent: #b9ed49;
}

* { box-sizing: border-box; }

body { margin: 0; }

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

svg { display: block; flex-shrink: 0; }

.landing {
  --landscape-height: 75vw;
  --landscape-offset: 0px;
  --mist-clear-start: 26%;
  --mist-clear-end: 28%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 2.2vw, 36px);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(230px, 29vh, 420px) 4.6% clamp(28px, 8vh, 108px) 3.8%;
  background-image: url("./assets/mesama-background-desktop.png");
  /* Fit the complete artwork across the page: cover would crop its wordmark
     when stacked content makes the page taller than the image's aspect ratio. */
  background-size: 100% auto;
  background-position: center var(--landscape-offset);
  background-repeat: no-repeat;
}

/* Continue only the lower forest behind long pages, using the same untouched
   asset. The lower third fills this layer proportionally; the lettering cannot
   repeat. A short blend joins it to the full-width scene without a blank band. */
.landing::after {
  content: "";
  position: absolute;
  top: calc(var(--landscape-offset) + var(--landscape-height) * .9);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background-image: inherit;
  background-size: auto max(300%, var(--landscape-height));
  background-position: center bottom;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 calc(var(--landscape-height) * .1));
  mask-image: linear-gradient(transparent, #000 calc(var(--landscape-height) * .1));
  pointer-events: none;
}

/* Keep the bright sky and embedded wordmark free of the content scrim. */
.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 12% 78%, rgb(3 12 9 / 29%), transparent 65%),
    linear-gradient(180deg, transparent 28%, rgb(4 12 7 / 8%) 45%, rgb(4 12 7 / 16%) 100%),
    linear-gradient(90deg, rgb(3 12 9 / 35%), rgb(3 12 9 / 12%) 55%, transparent 80%);
  -webkit-mask-image: linear-gradient(180deg, transparent 23%, #000 42%);
  mask-image: linear-gradient(180deg, transparent 23%, #000 42%);
  pointer-events: none;
}

/* Background → readability scrim → atmosphere → interactive content. */
.atmosphere {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  --atmosphere-limit: clamp(240px, 39vh, 440px);
  /* Fade before the left copy; retain distant valley mist on wide screens. */
  -webkit-mask-image:
    linear-gradient(#000 calc(var(--atmosphere-limit) - 65px), transparent var(--atmosphere-limit)),
    linear-gradient(90deg, transparent 40%, #000 68%);
  mask-image:
    linear-gradient(#000 calc(var(--atmosphere-limit) - 65px), transparent var(--atmosphere-limit)),
    linear-gradient(90deg, transparent 40%, #000 68%);
}

.atmosphere * { pointer-events: none; }

.atmosphere-scene {
  position: absolute;
  top: var(--landscape-offset);
  left: 0;
  width: 100%;
  /* Match the active asset's proportional size and vertical position. */
  height: var(--landscape-height);
}

.mist-landscape {
  position: absolute;
  inset: 0;
  /* Stationary exclusion follows each image's lettering, not drifting tiles. */
  -webkit-mask-image: linear-gradient(transparent var(--mist-clear-start), #000 var(--mist-clear-end));
  mask-image: linear-gradient(transparent var(--mist-clear-start), #000 var(--mist-clear-end));
}

.mist {
  position: absolute;
  left: 0;
  width: 200%;
  height: 16%;
  background: url("./assets/atmospheric-mist.svg") repeat-x left center / 50% 100%;
  opacity: .78;
  will-change: transform;
  /* Two identical tiles exchange places: the loop has no visible reset. */
  animation: mist-drift 120s linear infinite;
  animation-delay: -38.4s;
}

.mist--ridge { top: 12%; opacity: .48; animation-duration: 168s; animation-delay: -109.6s; }
.mist--valley { top: 24%; }

@keyframes mist-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.bird {
  position: absolute;
  top: var(--flight-height);
  left: 0;
  width: var(--bird-size);
  color: #34474c;
  opacity: .62;
  will-change: transform;
  animation: bird-flight var(--flight-duration) linear infinite;
  animation-delay: var(--flight-delay);
}

.bird svg {
  width: 100%;
  height: auto;
  fill: currentColor;
  transform-origin: 50% 65%;
  animation: bird-wings var(--wing-duration) ease-in-out infinite;
  animation-delay: var(--flight-delay);
}

.bird--one { --flight-height: 16.5%; --bird-size: 22px; --flight-duration: 66s; --flight-delay: -22s; --wing-duration: 5.3s; --rest-x: 28%; }
.bird--two { --flight-height: 10.5%; --bird-size: 18px; --flight-duration: 83s; --flight-delay: -59s; --wing-duration: 6.7s; --rest-x: 57%; }
.bird--three { --flight-height: 7.5%; --bird-size: 15px; --flight-duration: 91s; --flight-delay: -12s; --wing-duration: 5.9s; --rest-x: 76%; }
.bird--four { --flight-height: 19.5%; --bird-size: 17px; --flight-duration: 78s; --flight-delay: -44s; --wing-duration: 7.1s; --rest-x: 87%; }

@keyframes bird-flight {
  0% { transform: translate3d(-6vw, 0, 0) rotate(-3deg); }
  25% { transform: translate3d(22vw, -12px, 0) rotate(2deg); }
  55% { transform: translate3d(55.6vw, 6px, 0) rotate(-2deg); }
  80% { transform: translate3d(83.6vw, -8px, 0) rotate(1deg); }
  100% { transform: translate3d(106vw, -3px, 0) rotate(-3deg); }
}

@keyframes bird-wings {
  0%, 35%, 100% { transform: scaleY(.85); }
  8%, 24% { transform: scaleY(.4); }
  16%, 32% { transform: scaleY(1.1); }
  65% { transform: scaleY(.95); }
}

.introduction, .proof { position: relative; z-index: 2; }
.company-details { display: flow-root; }
.introduction {
  min-width: 0;
  /* Use some of the reserved bottom space without moving the proof panels. */
  margin-bottom: calc(-1 * clamp(32px, 2.8vw, 52px));
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  color: rgb(255 255 255 / 83%);
  font-size: clamp(16px, 1.38vw, 21px);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.eyebrow::before {
  content: "";
  flex: 0 0 34px;
  height: 4px;
  background: var(--accent);
}

h1 {
  max-width: 11.25em;
  margin: 22px 0 0;
  font-size: clamp(42px, 4.3vw, 66px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.052em;
}

.headline-line { display: block; }

.accent, .trust-separator { color: var(--accent); }

.description {
  max-width: 610px;
  margin: 34px 0 0;
  font-size: clamp(19px, 1.53vw, 22px);
  line-height: 1.36;
  letter-spacing: -.028em;
  color: rgb(255 255 255 / 91%);
}

.trust {
  margin: 32px 0 0;
  font-size: clamp(16px, 1.38vw, 21px);
  line-height: 1.4;
  letter-spacing: -.025em;
}

.trust-separator { display: inline-block; margin: 0 9px; }

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 28px;
  padding: 13px 24px;
  border: 1px solid rgb(137 184 52 / 55%);
  border-radius: 12px;
  background: var(--accent);
  color: #0b1204;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.035em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.profile-button svg { width: 24px; height: 24px; }
.profile-button:focus-visible { background: #1f1f1f; color: #f8f9f6; border-color: #1f1f1f; }
@media (hover: hover) {
  .profile-button:hover { background: #1f1f1f; color: #f8f9f6; border-color: #1f1f1f; }
}

:where(a, button):focus-visible {
  outline: 3px solid #fff;
  outline-offset: 5px;
  box-shadow: 0 0 0 7px rgb(14 28 18 / 85%);
}

.contacts {
  display: grid;
  grid-template-columns: max-content 1px max-content 1px max-content 1px minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(16px, 1.4vw, 26px);
  height: 44px;
  margin-top: 28px;
  font-size: clamp(15px, 1.24vw, 19px);
  font-style: normal;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.contacts a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  border-radius: 3px;
}

.contacts a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contacts svg { width: 23px; height: 23px; }
.contacts a[href^="tel:"], .contact-whatsapp { white-space: nowrap; }
.contact-location { min-width: 0; }
.contact-location span { min-width: 0; }
.contact-location-content { display: contents; }
.contact-divider { width: 1px; height: 19px; background: rgb(255 255 255 / 30%); }

.social-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 3px;
  color: rgb(255 255 255 / 88%);
  transition: color 200ms ease;
}

.social-links svg { width: 23px; height: 23px; }
.social-links a:focus-visible { color: var(--accent); }
@media (hover: hover) {
  .social-links a:hover { color: var(--accent); }
}

.proof { min-width: 0; width: 92%; max-width: 660px; justify-self: end; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.glass {
  border: 1px solid rgb(231 241 244 / 27%);
  border-radius: 21px;
  background: rgb(68 86 91 / 26%);
  -webkit-backdrop-filter: blur(8px) saturate(.76);
  backdrop-filter: blur(8px) saturate(.76);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%), 0 3px 10px rgb(0 0 0 / 6%);
}

.stat { min-height: 160px; padding: 19px clamp(11px, 1vw, 18px) 17px; }
.stat-icon { width: 32px; height: 32px; color: var(--accent); }
.stat:nth-child(3) .stat-icon { padding: 1px; }

.stat-value {
  margin: 10px 0 0;
  font-size: clamp(22px, 2.05vw, 33px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.stat-label {
  margin: 8px 0 0;
  color: rgb(255 255 255 / 88%);
  font-size: clamp(13px, 1.035vw, 16px);
  line-height: 1.3;
  letter-spacing: -.033em;
}

.notice {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 136px;
  margin-top: 12px;
  padding: 16px 20px;
}

.notice-symbol {
  display: flex;
  align-items: center;
  align-self: stretch;
  margin-block: 8px;
  border-right: 1px solid rgb(255 255 255 / 43%);
  color: var(--accent);
}

.notice-symbol svg { width: 33px; height: 33px; }

.notice h2 {
  margin: 0;
  font-size: clamp(14px, 1.18vw, 19px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.notice p {
  margin: 10px 0 0;
  color: rgb(255 255 255 / 88%);
  font-size: clamp(13px, 1.035vw, 16px);
  line-height: 1.4;
  letter-spacing: -.025em;
}

.copyright {
  padding: 16px 24px 20px;
  color: rgb(255 255 255 / 76%);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgb(52 65 55 / 89%); }
}

@media (min-width: 1101px) {
  .contact-location-content {
    display: flex;
    align-items: flex-start;
    gap: inherit;
    width: 100%;
    text-align: left;
    /* Align the first line with the row without shifting the centered outer link. */
    translate: 0 calc((100% - 1lh) / 2);
  }
  .contact-location-locality { white-space: nowrap; }
}

@media (min-width: 1101px) and (max-height: 950px) {
  .landing { padding-top: 190px; padding-bottom: 24px; }
  .introduction { margin-bottom: -12px; }
  h1 { font-size: clamp(42px, min(4.15vw, 6.35vh), 64px); }
  .description { margin-top: 30px; font-size: 20px; max-width: 620px; }
  .trust { margin-top: 24px; }
  .profile-button { margin-top: 20px; min-height: 54px; }
  .contacts { margin-top: 20px; }
  .glass { background-color: rgb(36 53 60 / 35%); }
}

@media (min-width: 1101px) and (max-width: 1999px) {
  .contacts { grid-template-columns: max-content 1px max-content 1px max-content; height: auto; row-gap: 4px; }
  .contact-location { grid-column: 1 / -1; }
  .contacts .contact-divider:nth-of-type(3) { display: none; }
}

@media (max-width: 1100px) {
  .landing {
    --landscape-height: calc(100vw * 1448 / 1086);
    --landscape-offset: min(0px, calc(280px - var(--landscape-height) * .33));
    --mist-clear-start: 33%;
    --mist-clear-end: 35%;
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
    padding: clamp(320px, 31vw, 345px) 5.5% 56px;
    background-image: url("./assets/mesama-background-tablet.png");
  }
  .landing::before {
    background: linear-gradient(180deg, transparent 150px, rgb(3 12 6 / 43%) 320px, rgb(3 12 6 / 28%) 100%);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .introduction { margin-bottom: 0; }
  .atmosphere {
    --atmosphere-limit: 305px;
    -webkit-mask-image: linear-gradient(#000 calc(var(--atmosphere-limit) - 65px), transparent var(--atmosphere-limit));
    mask-image: linear-gradient(#000 calc(var(--atmosphere-limit) - 65px), transparent var(--atmosphere-limit));
  }
  /* Keep landscape mist below the lettering on narrow cover crops, with a
     horizontal fade to protect the main copy. Bird masking is unchanged. */
  .atmosphere--mist {
    -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 75%);
    mask-image: linear-gradient(90deg, transparent 25%, #000 75%);
  }
  .atmosphere:not(.atmosphere--mist) .atmosphere-scene {
    /* Keep the existing flight paths in the visible sky after the scenic shift. */
    top: 0;
    height: min(900px, var(--landscape-height));
  }
  .mist { height: 15%; animation-duration: 140s; }
  .mist--ridge { top: 28%; opacity: .4; animation-duration: 190s; }
  .mist--valley { top: 33%; opacity: .54; }
  .eyebrow { font-size: 18px; }
  h1 { margin-top: 20px; font-size: clamp(46px, 6.1vw, 64px); line-height: .99; }
  .description { max-width: 650px; margin-top: 30px; font-size: 22px; }
  .trust { font-size: 18px; margin-top: 24px; }
  .profile-button { margin-top: 24px; }
  .contacts { display: flex; flex-wrap: wrap; height: auto; gap: 4px 24px; font-size: 17px; margin-top: 16px; }
  .contact-divider { display: none; }
  .social-links { gap: 8px; }
  .social-links a { width: 44px; height: 44px; }
  .proof { width: 100%; max-width: 720px; justify-self: start; }
  .stats { gap: 12px; }
  .stat { min-height: 160px; padding: 20px; }
  .stat-value { font-size: 30px; }
  .stat-label { font-size: 16px; max-width: 155px; }
  .notice { min-height: 132px; }
  .notice h2 { font-size: 18px; }
  .notice p { font-size: 16px; max-width: 57ch; }
}

/* Image art direction switches independently of the approved content layout. */
@media (width < 768px) {
  .landing {
    --landscape-height: calc(100vw * 1672 / 941);
    --landscape-offset: calc(min(0px, calc(280px - var(--landscape-height) * .35)) - var(--mobile-sky-trim, 0px));
    --mist-clear-start: 35%;
    --mist-clear-end: 37%;
    background-image: url("./assets/mesama-background-mobile.png");
  }
  .mist--ridge { top: 30%; }
  .mist--valley { top: 35%; }
}

@media (max-width: 600px) {
  .landing {
    --mobile-sky-trim: 72px;
    gap: 30px;
    padding: calc(315px - var(--mobile-sky-trim)) 24px 24px;
  }
  .landing::before {
    background: linear-gradient(180deg, transparent calc(150px - var(--mobile-sky-trim)), rgb(3 12 6 / 43%) calc(320px - var(--mobile-sky-trim)), rgb(3 12 6 / 28%) 100%);
  }
  /* CSS provides the final layout even before the script aligns DOM reading order. */
  .introduction { display: contents; }
  .hero-copy, .company-details { position: relative; z-index: 2; }
  .proof { order: 1; }
  .company-details { order: 2; min-width: 0; }
  .eyebrow { gap: 11px; font-size: 14px; letter-spacing: -.035em; }
  .atmosphere { --atmosphere-limit: 290px; }
  .atmosphere:not(.atmosphere--mist) .atmosphere-scene {
    height: min(540px, calc(var(--landscape-height) - var(--mobile-sky-trim) * 2));
  }
  .mist { height: 14%; }
  .mist--ridge { opacity: .3; animation-duration: 196s; }
  .mist--valley { opacity: .4; }
  .bird { opacity: .5; animation-duration: calc(var(--flight-duration) * 1.35); }
  .bird--one { --bird-size: 18px; }
  .bird--four { display: none; }
  .eyebrow::before { flex-basis: 24px; height: 3px; }
  h1 { margin-top: 20px; font-size: clamp(34px, 9.6vw, 54px); line-height: 1.04; letter-spacing: -.045em; }
  .headline-line { display: inline; }
  .description { margin-top: 21px; font-size: 18px; line-height: 1.45; letter-spacing: -.02em; }
  .trust { margin-top: 22px; font-size: 15px; letter-spacing: -.02em; }
  .trust-separator { margin-inline: 6px; }
  .profile-button { width: 100%; min-height: 56px; margin-top: 24px; padding-inline: 16px; font-size: 17px; border-radius: 12px; }
  .contacts { flex-wrap: wrap; column-gap: 18px; row-gap: 0; margin-top: 0; font-size: 16px; }
  .contacts a { gap: 12px; }
  .contacts svg { width: 21px; height: 21px; }
  .social-links svg { width: 21px; height: 21px; }
  .contact-divider { display: none; }
  .stats { gap: 8px; }
  .stat { min-height: 151px; padding: 16px 11px; border-radius: 17px; }
  .stat-icon { width: 28px; height: 28px; }
  .stat-value { margin-top: 12px; font-size: clamp(20px, 5.64vw, 30px); letter-spacing: -.055em; }
  .stat-label { margin-top: 7px; font-size: 12px; line-height: 1.35; letter-spacing: -.03em; }
  .notice { grid-template-columns: 40px minmax(0, 1fr); gap: 16px; margin-top: 12px; padding: 17px 16px; border-radius: 19px; }
  .notice-symbol { margin-block: 3px; }
  .notice-symbol svg { width: 28px; height: 28px; }
  .notice h2 { font-size: 17px; line-height: 1.35; }
  .notice p { margin-top: 10px; font-size: 14px; line-height: 1.5; }
}

@media (max-width: 359px) {
  .landing { padding-inline: 18px; }
  .eyebrow { font-size: 13px; gap: 8px; }
  .eyebrow::before { flex-basis: 18px; }
  .trust { font-size: 14px; }
  .stat { padding-inline: 9px; }
  .stat-value { font-size: 19px; }
  .stat-label { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-button { transition: none; }
  .social-links a { transition: none; }
  .mist, .bird, .bird svg { animation: none; will-change: auto; }
  .mist--ridge { transform: translate3d(-18%, 0, 0); }
  .mist--valley { transform: translate3d(-7%, 0, 0); }
  .bird { left: var(--rest-x); transform: none; }
}
