/* ============================================================================
   Flatmir — the landing page (issue #99). The site's tokens come from
   styles.css; here: this page's layout, its globe's two palettes, and the
   globe's own rules adapted from NS's prototype (globe.css). Light only, as
   the site is.
   ========================================================================== */

/* styles.css fixes html and body to the window for the app shell; this page scrolls */
body.landing-app {
  height: auto; min-height: 100%;
  background: var(--bg); color: var(--ink);
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) max(48px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.landing-app main, .land-head, .land-foot { max-width: 1120px; margin-inline: auto; }
/* the site's footer (styles.css .listfoot), after the closing block */
.land-foot { margin-top: clamp(32px, 6vh, 56px); }

/* ------------------------------- header -------------------------------- */
.land-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding-top: env(safe-area-inset-top, 0px);
}
.land-brand { display: inline-flex; align-items: center; min-height: 44px; }
.land-brand img { display: block; width: auto; height: 34px; }
/* the language switch, in the main header's look (styles.css .hdr__lang,
   whose phone rule positions it for that header only) */
.land-lang {
  appearance: none; -webkit-appearance: none; border: none; min-height: 44px;
  padding: 9px 26px 9px 12px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--sub); cursor: pointer; transition: background-color .15s, color .15s;
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M2.5 4.5l3.5 3.5 3.5-3.5" fill="none" stroke="%236E695E" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 10px center / 11px;
}
.land-lang:hover { background-color: var(--wash); color: var(--ink); }
/* the language switch and the "List your place" button, together on the right */
.land-head__end { display: flex; align-items: center; gap: 8px; }
/* the button keeps its words where the listings page drops them (styles.css,
   up to 960px: there the type tabs need the room; this header has it) */
@media (max-width: 960px) {
  .land-head .land-cta { padding: 9px 14px; }
  .land-head .land-cta span { display: inline; }
}
/* under 360px the words no longer fit beside the logo and the language
   switch (measured: 20–25px of sideways scroll at 320px in EN and RU) —
   the plus mark alone, as on the listings page */
@media (max-width: 359px) {
  .land-head .land-cta { padding: 10px; }
  .land-head .land-cta span { display: none; }
}

/* -------------------- the slogan, the search, the kinds -------------------- */
.land-hero { position: relative; z-index: 20; margin: clamp(6px, 2.5vh, 26px) auto 0; text-align: center; }
/* the slogan (NS, 2026-10-07): "Easy to" stays and the last word turns, in
   the logo's deeper orange (landing.js) */
.land-hero h1 {
  margin: 0; font-family: var(--display); font-weight: 800;
  font-size: clamp(38px, 7vw, 66px); line-height: 1.06; letter-spacing: -0.035em;
}
.land-slogan__turn { display: inline-block; white-space: nowrap; text-align: left; transition: width .3s ease; }
.land-slogan__word { display: inline-block; color: var(--accent-2); transition: transform .3s ease, opacity .3s ease; }
.land-slogan__word.is-out { transform: translateY(-.32em); opacity: 0; }
.land-slogan__word.is-in { transform: translateY(.32em); opacity: 0; transition: none; }
/* with less motion asked for, the three sentences stand still, one a line */
.land-slogan__show.is-still .land-slogan__line { display: block; }
/* read by a screen reader, not shown */
.land-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the search, one bar (NS, 2026-10-07): "Where to?" names it on its left; on a
   wide screen the place box and the kinds share the bar — the kind chosen goes
   with the search to the map. On a phone the kinds sit under the box. */
.land-search {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  max-width: 800px; margin: clamp(16px, 3vh, 26px) auto 0; text-align: left;
}
.land-where__label { flex: none; font-family: var(--display); font-weight: 750; font-size: 22px; letter-spacing: -.015em; color: var(--ink); cursor: text; }
.land-where {
  position: relative; flex: 0 1 680px; min-width: 0; display: flex; align-items: center; height: 58px; padding-right: 7px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); box-shadow: var(--sh-2);
}
.land-where:has(.wsearch:focus) { outline: 2px solid var(--ink); outline-offset: 2px; }
.land-where__field { flex: 1 1 auto; min-width: 0; }
.land-where__ic { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; translate: 0 -50%; color: var(--sub); pointer-events: none; z-index: 1; }
.land-where .wsearch {
  margin: 0; height: 56px; padding: 0 12px 0 48px; border: 0; border-radius: 999px; background: transparent;
  font-size: 16px; text-overflow: ellipsis;
}
.land-where .wsearch:focus { outline: none; }
/* the phone's line inside the box (below): hidden on wider screens */
.land-where__hint { display: none; }
/* the place search's rows (styles.css .wrow), laid over the page under the bar */
.land-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
  max-height: min(46dvh, 420px); overflow-y: auto; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-2);
}
.land-list .wrow { width: 100%; }

/* the kinds, inside the bar: small, after a hairline */
.land-kinds { flex: none; display: flex; align-items: center; gap: 2px; }
.land-kinds::before { content: ""; align-self: center; width: 1px; height: 26px; margin-right: 6px; background: var(--line-2); }
.land-kinds button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 13px;
  border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--sub); white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.land-kinds button:hover { background: var(--wash); color: var(--ink); }
.land-kinds button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.land-kinds svg { width: 16px; height: 16px; }
.land-count { max-width: 640px; margin: 12px auto 0; min-height: 1.4em; color: var(--sub); font-size: 14px; }

/* ------------------------------- the globe ------------------------------ */
.globe {
  /* the orange sea, the default (desc Assumption 3): cream land on the site's amber */
  --ocean: #F39A4A; --ocean-hi: #F8BB7F; --ocean-lo: #DE7A25;
  --land: #FFF6EA; --coast: #C8661B; --border: rgba(176, 92, 22, .36); --grat: rgba(255, 255, 255, .2);
  --atmo: rgba(237, 137, 51, .34); --atmo-0: rgba(237, 137, 51, 0); --shade: rgba(110, 48, 0, .18);
  position: relative; isolation: isolate;   /* the markers' z-index stays inside, under the place search's list */
  width: 100%; height: min(78vh, 760px); min-height: 360px; margin: clamp(4px, 2vh, 16px) auto 0;
  container-type: size; touch-action: pan-y; cursor: grab;
  user-select: none; -webkit-user-select: none; outline: none; border-radius: 20px;
}
/* the other reading of "orange": amber land on a pale warm sea */
.globe[data-palette="land"] {
  --ocean: #FBF6EE; --ocean-hi: #FFFFFF; --ocean-lo: #F0E5D5;
  --land: #F2AE62; --coast: #D9771B; --border: rgba(255, 255, 255, .75); --grat: rgba(25, 23, 19, .06);
  --atmo: rgba(237, 137, 51, .22); --atmo-0: rgba(237, 137, 51, 0); --shade: rgba(90, 50, 10, .1);
}
.globe:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.globe.grabbing { cursor: grabbing; }
/* painted by CSS before any script runs, so there is no empty hole while the page loads */
.globe::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: calc(86 * min(1cqw, 1cqh)); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; background: radial-gradient(circle at 34% 31%, var(--ocean-hi), var(--ocean) 60%, var(--ocean-lo));
  box-shadow: 0 0 70px var(--atmo); transition: opacity .4s;
}
.globe.ready::before { opacity: 0; }
.globe canvas { position: absolute; inset: 0; display: block; transition: opacity .35s; }
.pins { position: absolute; inset: 0; overflow: hidden; pointer-events: none; transition: opacity .35s; }
.globe.map-open canvas, .globe.map-open .pins { opacity: .35; }
.zoom {
  position: absolute; right: 10px; bottom: 10px; z-index: 5; display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-1); cursor: default;
}
.zoom button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); }
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { background: var(--wash); }
.zoom button:disabled { opacity: .35; cursor: default; background: transparent; }
.zoom svg { width: 18px; height: 18px; stroke-width: 2; }
.hint {
  position: absolute; left: 50%; bottom: 16px; z-index: 6; margin: 0; padding: 8px 13px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
  opacity: 0; translate: -50% 6px; transition: opacity .2s, translate .2s; pointer-events: none;
}
.hint.show { opacity: 1; translate: -50% 0; }

/* a marker: a place (its count, its name under it) or a group (its count; its names on hover or focus) */
.mk {
  position: absolute; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; background: none;
  appearance: none; -webkit-appearance: none; pointer-events: auto; cursor: pointer; will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.mk:focus-visible { outline: none; }
.mk-b {
  position: absolute; left: 0; top: 0; translate: -50% -50%; width: var(--sz); height: var(--sz); padding: 3px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 5px rgba(23, 80, 92, .16), 0 3px 10px rgba(25, 23, 19, .22);
  animation: pop .32s cubic-bezier(.2, 1.25, .35, 1) backwards; transition: scale .15s ease;
}
/* the tap area: never smaller than 44 px, whatever the circle's size */
.mk-b::after { content: ""; position: absolute; inset: min(0px, calc((var(--sz) - 44px) / 2)); border-radius: 50%; }
@keyframes pop { from { opacity: 0; scale: .35; } }
.mk-n {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: var(--cluster); color: #fff;   /* the main map's pill colour, "amber's foil" */
  /* a third of the circle, smaller when the number is long (globe.js sets --len), never under 10.5 px */
  font-size: max(10.5px, min(calc(var(--sz) * .32), calc((var(--sz) - 12px) / (var(--len, 3) * .6))));
  font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.mk-name {
  position: absolute; left: 0; top: 0; translate: -50% calc(var(--sz) / 2 + 5px); padding: 2px 7px; border-radius: 6px;
  background: rgba(255, 255, 255, .92); box-shadow: var(--sh-1); font-size: 12px; font-weight: 650; color: var(--ink);
  white-space: nowrap; pointer-events: none;
}
.mk-tip {
  position: absolute; left: 0; top: 0; translate: -50% calc(-100% - var(--sz) / 2 - 12px); padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
@media (hover: hover) { .mk:hover .mk-b { scale: 1.08; } .mk:hover .mk-tip { opacity: 1; } }
.mk:focus-visible .mk-b { outline: 2px solid var(--ink); outline-offset: 3px; }
.mk:focus-visible .mk-tip { opacity: 1; }

/* ------------------------ version 2: trust strip ------------------------ */
.land-trust {
  margin: clamp(24px, 4vh, 40px) auto 0;
  border-radius: 999px; background: var(--accent); color: #fff;
  container-type: inline-size;
}
.land-trust__stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 120px; margin: 0; padding: 0 16px;
}
.land-trust__stat {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; min-width: 0; padding: 10px 12px;
}
.land-trust__stat + .land-trust__stat::before {
  content: ""; position: absolute; top: 26%; bottom: 26%; left: 0;
  width: 1px; background: rgba(255, 255, 255, .22);
}
.land-trust__stat dt {
  order: 1; margin: 6px 0 0; text-align: center;
  font-family: "Golos Text", var(--body); font-size: 14px; font-weight: 400; line-height: 1.35;
}
.land-trust__stat dd {
  order: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0;
}
.land-trust__icon { width: 22px; height: 22px; stroke-width: 1.65; }
.land-trust__value {
  font-family: var(--display); font-size: clamp(28px, 6.1cqw, 42px); font-weight: 500;
  font-variation-settings: "opsz" 48; line-height: 1; letter-spacing: -.045em; white-space: nowrap;
}
.land-trust__plus { font-size: .72em; vertical-align: .12em; margin-left: 2px; }
@container (max-width: 640px) {
  .land-trust__stats { min-height: 104px; padding: 0 8px; }
  .land-trust__stat { padding: 12px 6px 4px; }
  .land-trust__stat dd { gap: 4px; }
  .land-trust__icon { width: 18px; height: 18px; }
  .land-trust__stat dt { margin-top: 4px; font-size: 12px; min-height: 2.7em; }
}
@container (max-width: 450px) {
  .land-trust__stats { padding: 0 4px; }
  .land-trust__value { font-size: 29px; letter-spacing: -.06em; }
  .land-trust__stat dt { font-size: 11px; min-height: 30px; }
}

/* --------------------------------- phones -------------------------------- */
/* below 880 px the bar gives way (the kinds need ~380 px in Russian): the box
   keeps its row beside "Where to?", the kinds take their own slim row under it */
@media (max-width: 880px) {
  .land-search { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; max-width: 640px; }
  .land-where { display: contents; }
  .land-where__field { position: relative; grid-column: 2; }
  .land-where .wsearch { border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--sh-2); }
  .land-where .wsearch:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
  .land-kinds {
    grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  }
  .land-kinds::before { display: none; }
  .land-kinds button { height: 40px; padding: 0 6px; gap: 5px; font-size: 13px; }
  .land-kinds svg { width: 15px; height: 15px; }
}
@media (max-width: 760px) {
  .globe { height: auto; min-height: 0; aspect-ratio: 1 / 1; }
}
@media (max-width: 560px) {
  /* one line on a phone, the longest sentence too (ru, "Легко пользоваться.") */
  .land-hero h1 { font-size: clamp(26px, 8.4vw, 36px); }
  /* "Where to?" moves into the box (NS, 2026-10-17): beside it, it took a third
     of the row and cut the box's hint short. The label stays as the box's name
     for screen readers; the box takes the whole row and, while it is empty,
     reads "Where to? (city or country)" — the question semi-bold, the hint as
     the browser's own would read, which can be one weight only and so is hidden */
  .land-search { grid-template-columns: minmax(0, 1fr); }
  .land-where__label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .land-where__field { grid-column: 1; }
  .land-where__ic { left: 14px; }
  .land-where .wsearch { padding: 0 14px 0 42px; }
  .land-where .wsearch::placeholder { color: transparent; }
  .land-where__hint {
    display: block; position: absolute; left: 42px; right: 14px; top: 50%; translate: 0 -50%;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none;
    font-family: var(--landing-body); font-size: 16px; color: var(--sub);
  }
  .land-where__hint b { font-weight: 600; color: var(--ink); }
  .land-where .wsearch:not(:placeholder-shown) + .land-where__hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-b { animation: none; }
  .globe::before, .globe canvas, .pins, .land-slogan__turn, .land-slogan__word { transition: none; }
}
