/* Quvasoy City — first screen: back layer → wordmark → cut-out building → white fade, the navbar with
   its mobile menu, the intro, and the top capsule shown past the first screen.
   Script-only pieces (burger, menu, capsule) appear only under .js [data-qc="hero"][data-qc-ready]: until the
   hero script has started (or when it never does) the navbar keeps its full links. */

.hx-page {
  --hx-sky: #468dc6;                           /* top of the back layer's sky, shown until it paints */
  --hx-ink: var(--qc-ink);
  --hx-accent: var(--qc-accent);
  --hx-glass: rgba(255, 255, 255, 0.22);
  --hx-glass-border: rgba(255, 255, 255, 0.45);
  --hx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --hx-ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --hx-dur-open: 0.55s;
  --hx-dur-close: 0.35s;
  --hx-fg: var(--hx-ink);                      /* navbar text and bars over the sky */
  position: relative;
}

.hx-page :focus-visible {
  outline: 2px solid var(--hx-fg);
  outline-offset: 3px;
}

/* ───────────── Hero: one composition ───────────── */

.hx-hero {
  /* Both layers are one 2048 × 1280 frame (16:10), sized like object-fit: cover and pinned to the top; on
     very wide screens it rises so the dome top (28.3 % of the frame) stays near 42 % of the height.
     --hx-fh / --hx-fw: frame height and width, --hx-ft: frame top. */
  --hx-fh: max(100vw / 1.6, 100vh);
  --hx-fw: calc(var(--hx-fh) * 1.6);
  --hx-ft: min(0px, 0.42 * 100vh - 0.283 * var(--hx-fh));
  /* Wordmark: a share of the frame width, capped by the viewport on narrow screens; its baseline sits
     --hx-cover × cap height below the dome top, so the dome and the roofs cover the bottom of the letters
     at every size. --hx-mark-c moves its centre right of the frame centre, into the open sky between the
     two trees (frame x 0.36–0.91 above the roofs), as far as the viewport leaves room. */
  --hx-mark-w: min(88vw, 0.54 * var(--hx-fw));
  --hx-mark-c: 0.135;
  --hx-cover: 0.33;
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--hx-sky);
}

@supports (height: 100svh) {
  .hx-hero {
    --hx-fh: max(100vw / 1.6, 100svh);
    --hx-ft: min(0px, 0.42 * 100svh - 0.283 * var(--hx-fh));
  }
}

.hx-hero__back,
.hx-hero__front {
  position: absolute;
  top: var(--hx-ft);
  left: 50%;
  display: block;
  width: var(--hx-fw);
  height: var(--hx-fh);
  max-width: none;
  transform: translateX(-50%);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.hx-hero__back {
  z-index: 0;
}

/* Baseline = dome top (28.3 % of the frame) + --hx-cover × cap height; the SVG box puts the baseline at
   260/1660 of its width and the cap height (Unbounded, 0.75 em × 224) at 168/1660.
   The centre keeps a 6vw margin on the right edge of the viewport. */
.hx-hero__mark {
  position: absolute;
  z-index: 1;
  top: calc(var(--hx-ft) + 0.283 * var(--hx-fh) + (var(--hx-cover) * 0.1012 - 0.15663) * var(--hx-mark-w));
  left: calc(50% + max(0px, min(var(--hx-mark-c) * var(--hx-fw), 44vw - var(--hx-mark-w) / 2)));
  width: var(--hx-mark-w);
  height: auto;
  aspect-ratio: 1660 / 300;
  overflow: visible;
  transform: translateX(-50%);
  pointer-events: none;
}

.hx-hero__mark text {
  font-family: var(--qc-f-display);
  font-size: 224px;
  font-weight: 800;
  letter-spacing: -0.02em;
  fill: #fff;
}

/* CITY in lighter spaced capitals (like GROUP under IZMIR in the logo), its cap top on QUVASOY's cap top:
   dy = -(168 - 0.75 × 64) */
.hx-hero__mark-sup {
  font-weight: 500;
  font-size: 64px;
  letter-spacing: 0.14em;
}

.hx-hero__front {
  z-index: 2;
}

.hx-hero__fade {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(245, 240, 234, 0) 0%,
    rgba(245, 240, 234, 0.35) 32%,
    rgba(245, 240, 234, 0.78) 58%,
    rgba(245, 240, 234, 0.96) 80%,
    var(--qc-ivory) 100%
  );
}

/* ───────────── Navbar ───────────── */

.hx-nav {
  position: absolute;
  z-index: 60;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 40px;
  padding-top: calc(26px + env(safe-area-inset-top, 0px));
  pointer-events: none;
}

.hx-nav > * {
  pointer-events: auto;
}

/* The logo sits on frosted glass: the tree behind it is bright and dark in patches. */
.hx-nav__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--hx-glass-border);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: var(--hx-fg);
  font-family: var(--qc-f-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--hx-dur-close) var(--hx-ease-in), background-color var(--hx-dur-close) var(--hx-ease-in),
    border-color var(--hx-dur-close) var(--hx-ease-in);
}

.hx-page.hx-is-open .hx-nav__logo {
  border-color: transparent;
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.hx-nav__links,
.hx-topbar__links,
.hx-menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* no line box around the pills (it would add the text strut below them) */
.hx-nav__links > li,
.hx-topbar__links > li {
  display: flex;
}

.hx-nav__links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}

/* Pills: the link box is 44 px tall (touch target); the visible glass pill is its ::before, sized like the
   1.2 em line + vertical padding + 1 px border. */
.hx-pill,
.hx-cta {
  --hx-py: 11px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border-radius: 999px;
  color: var(--hx-fg);
  font-family: var(--qc-f-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s var(--hx-ease-out);
}

.hx-pill::before,
.hx-cta::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 0;
  left: 0;
  height: calc(1.2em + 2 * var(--hx-py) + 2px);
  border: 1px solid var(--hx-glass-border);
  border-radius: 999px;
  background-color: var(--hx-glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transform: translateY(-50%);
  transition: background-color 0.25s var(--hx-ease-out);
}

.hx-pill:hover::before {
  background-color: rgba(255, 255, 255, 0.4);
}

.hx-pill--on,
.hx-pill.hx-is-active {
  color: var(--hx-ink);
  font-weight: 600;
}

.hx-pill--on::before,
.hx-pill.hx-is-active::before {
  background-color: #fff;
}

.hx-pill--on:hover::before,
.hx-pill.hx-is-active:hover::before {
  background-color: rgba(255, 255, 255, 0.88);
}

/* the one call to action: copper, like every primary button on the page */
.hx-cta {
  color: #fff;
  font-weight: 600;
}

.hx-cta::before {
  border-color: var(--qc-accent);
  background-color: var(--qc-accent);
}

.hx-cta:hover::before {
  border-color: var(--qc-accent-hover);
  background-color: var(--qc-accent-hover);
}

@media (max-width: 1100px) {
  .hx-nav {
    gap: 18px;
    padding: 22px 28px;
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
  }
  .hx-nav__links {
    gap: 8px;
  }
  .hx-nav .hx-pill,
  .hx-nav .hx-cta {
    --hx-py: 10px;
    padding: 0 20px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .hx-nav {
    gap: 14px;
    padding: 20px 22px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
  }
  .hx-nav__links {
    gap: 6px;
  }
  .hx-nav .hx-pill,
  .hx-nav .hx-cta {
    --hx-py: 9px;
    padding: 0 15px;
    font-size: 12px;
  }
}

/* ───────────── Burger ───────────── */

.hx-burger {
  display: none;
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--hx-glass-border);
  border-radius: 50%;
  background: var(--hx-glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--hx-fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--hx-dur-close) var(--hx-ease-in);
}

.hx-burger__bar {
  position: absolute;
  left: calc(50% - 10px);
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  /* close: rotate back first, then translate (reverse of open) */
  transition:
    rotate var(--hx-dur-close) var(--hx-ease-in),
    translate var(--hx-dur-close) var(--hx-ease-in) 0.14s,
    opacity var(--hx-dur-close) var(--hx-ease-in),
    scale var(--hx-dur-close) var(--hx-ease-in);
}

.hx-burger__bar:nth-child(1) {
  top: calc(50% - 7px);
}

.hx-burger__bar:nth-child(2) {
  top: calc(50% - 1px);
}

.hx-burger__bar:nth-child(3) {
  top: calc(50% + 5px);
}

.hx-page.hx-is-open .hx-burger__bar {
  /* open: translate first, then rotate 0.14 s later */
  transition:
    translate var(--hx-dur-open) var(--hx-ease-out),
    rotate var(--hx-dur-open) var(--hx-ease-out) 0.14s,
    opacity var(--hx-dur-open) var(--hx-ease-out),
    scale var(--hx-dur-open) var(--hx-ease-out);
}

.hx-page.hx-is-open .hx-burger__bar:nth-child(1) {
  translate: 0 6px;
  rotate: 45deg;
}

.hx-page.hx-is-open .hx-burger__bar:nth-child(2) {
  opacity: 0;
  scale: 0.2 1;
}

.hx-page.hx-is-open .hx-burger__bar:nth-child(3) {
  translate: 0 -6px;
  rotate: -45deg;
}

/* over the open menu the navbar turns white */
.hx-page.hx-is-open .hx-nav {
  --hx-fg: #fff;
}

.hx-page.hx-is-open .hx-nav__logo,
.hx-page.hx-is-open .hx-burger {
  transition: color var(--hx-dur-open) var(--hx-ease-out), background-color var(--hx-dur-open) var(--hx-ease-out),
    border-color var(--hx-dur-open) var(--hx-ease-out);
}

/* ───────────── Mobile menu (≤ 780 px, script only) ───────────── */

.hx-menu {
  --hx-fg: #fff;
  display: none;
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  align-items: center;
}

.js [data-qc="hero"][data-qc-ready] .hx-menu {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--hx-dur-close) var(--hx-ease-in),
    visibility 0s linear var(--hx-dur-close);
}

.js [data-qc="hero"][data-qc-ready].hx-is-open .hx-menu {
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--hx-dur-open) var(--hx-ease-out),
    visibility 0s linear 0s;
}

.hx-menu__bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    158deg,
    rgba(69, 11, 9, 0.96) 0%,
    rgba(40, 18, 14, 0.96) 52%,
    rgba(26, 17, 13, 0.97) 100%
  );
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
}

.js [data-qc="hero"][data-qc-ready] .hx-menu__bg {
  transform: scale(1.12);
  transition: transform var(--hx-dur-close) var(--hx-ease-in);
}

.js [data-qc="hero"][data-qc-ready].hx-is-open .hx-menu__bg {
  transform: none;
  transition: transform 0.7s var(--hx-ease-out);
}

.hx-menu__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 36px;
  width: 100%;
  padding: 0 28px;
}

.hx-menu__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hx-menu__list li:nth-child(2) { --hx-i: 1; }
.hx-menu__list li:nth-child(3) { --hx-i: 2; }
.hx-menu__list li:nth-child(4) { --hx-i: 3; }
.hx-menu__list li:nth-child(5) { --hx-i: 4; }

.js [data-qc="hero"][data-qc-ready] .hx-menu__list li,
.js [data-qc="hero"][data-qc-ready] .hx-menu__cta {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--hx-dur-close) var(--hx-ease-in),
    transform var(--hx-dur-close) var(--hx-ease-in);
}

.js [data-qc="hero"][data-qc-ready].hx-is-open .hx-menu__list li {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.5s var(--hx-ease-out) calc(var(--hx-i, 0) * 55ms + 140ms),
    transform 0.65s var(--hx-ease-out) calc(var(--hx-i, 0) * 55ms + 140ms);
}

.js [data-qc="hero"][data-qc-ready].hx-is-open .hx-menu__cta {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.5s var(--hx-ease-out) 420ms,
    transform 0.65s var(--hx-ease-out) 420ms;
}

.hx-menu__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  color: var(--qc-on-night);
  font-family: var(--qc-f-display);
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform 0.2s var(--hx-ease-out);
}

.hx-menu__list a:active {
  transform: translateX(6px);
}

.hx-menu__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 14px 30px;
  border-radius: 999px;
  background: var(--qc-accent);
  color: #fff;
  font-family: var(--qc-f-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

/* ───────────── Intro ───────────── */

.hx-intro {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 68vh;
  min-height: 68svh;
  padding: clamp(96px, 17vh, 190px) 24px clamp(80px, 12vh, 150px);
  background: var(--qc-ivory);
  text-align: center;
}

/* Slide-over into the gallery: the intro pins once its bottom reaches the bottom
   of the screen, and the part keeps one more screen of room after it; the gallery ([data-gl-overlap],
   margin-top: -100vh) climbs into that room over the pinned intro. */
.hx-intro {
  position: sticky;
  top: 32vh;
  top: 32svh;
}

.hx-page::after {
  content: "";
  display: block;
  height: 100vh;
}

@media (max-height: 500px) {
  .hx-intro {
    top: 0;
  }
}

.hx-intro__eyebrow {
  margin: 0 0 22px;
  color: var(--hx-accent);
  font-family: var(--qc-f-sans);
  font-size: var(--qc-fs-label);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--qc-track-label);
  text-transform: uppercase;
}

/* 17ch: «хочется остаться» with the wide display word needs 16.1ch and stays on one line */
.hx-intro__title {
  max-width: 17ch;
  margin: 0;
  color: var(--hx-ink);
  font-family: var(--qc-f-sans);
  font-size: clamp(32px, 5.6vw, 68px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

/* the accent word: a heavy, wide display face with Cyrillic */
.hx-intro__title strong {
  font-family: var(--qc-f-display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ───────────── Top capsule (past the first screen, script only) ───────────── */

.hx-topbar {
  --hx-fg: #fff;
  display: none;
  position: fixed;
  z-index: 55;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 0;
  left: 0;
  padding: 0 12px;
  pointer-events: none;
}

.js [data-qc="hero"][data-qc-ready] .hx-topbar {
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(-100% - 24px));
  transition:
    transform var(--hx-dur-close) var(--hx-ease-in),
    opacity var(--hx-dur-close) var(--hx-ease-in),
    visibility 0s linear var(--hx-dur-close);
}

.js [data-qc="hero"][data-qc-ready] .hx-topbar.hx-is-shown {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    transform var(--hx-dur-open) var(--hx-ease-out),
    opacity var(--hx-dur-open) var(--hx-ease-out),
    visibility 0s;
}

.hx-topbar__in {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 7px 7px 7px 24px;
  border-radius: 999px;
  background: rgba(26, 17, 13, 0.86);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 16px 40px rgba(26, 17, 13, 0.24);
  pointer-events: auto;
}

.hx-topbar__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 0;
  color: var(--qc-on-night);
  font-family: var(--qc-f-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.hx-topbar__nav {
  margin: 0 auto;
}

.hx-topbar__links {
  display: flex;
  gap: 6px;
}

.hx-topbar .hx-pill,
.hx-topbar .hx-cta {
  --hx-py: 10px;
  padding: 0 18px;
  font-size: 13px;
}

@media (max-width: 1000px) {
  .hx-topbar .hx-pill {
    --hx-py: 9px;
    padding: 0 13px;
    font-size: 12px;
  }
  .hx-topbar__in {
    gap: 10px;
    padding-left: 18px;
  }
}

/* ───────────── Responsive ───────────── */

@media (max-width: 780px) {
  .hx-hero__fade {
    height: 30%;
  }
  .hx-nav {
    flex-wrap: wrap;
    row-gap: 12px;
    padding: 18px 20px;
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }
  /* without a running script: the full links wrap under the logo */
  .hx-nav__links {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
  }
  .hx-nav__cta {
    margin-left: auto;
  }
  /* with the script: logo + burger, links in the menu */
  .js [data-qc="hero"][data-qc-ready] .hx-nav__links,
  .js [data-qc="hero"][data-qc-ready] .hx-nav__cta {
    display: none;
  }
  .js [data-qc="hero"][data-qc-ready] .hx-burger {
    display: block;
  }
  .js [data-qc="hero"][data-qc-ready] .hx-menu {
    display: flex;
  }
  .hx-topbar__nav,
  .hx-topbar__cta {
    display: none;
  }
  .hx-topbar__burger {
    width: 44px;
    height: 44px;
  }
  .hx-topbar__in {
    justify-content: space-between;
    padding: 5px 5px 5px 20px;
  }
  .hx-topbar__logo {
    font-size: 14px;
  }
  .hx-page.hx-is-open .hx-topbar__in {
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hx-intro__title {
    max-width: 13ch;
  }
}

@media (max-width: 420px) {
  .hx-nav__logo {
    font-size: 14px;
  }
}

/* Phones (25.11): the intro is half a screen, not two thirds with deep padding, and it pins in the middle of
   the screen, so its line reads as a centred title card instead of sitting low under an empty cream band; the
   gallery still climbs over it. The capsule is near-opaque: text scrolling under it must not read through. */
@media (max-width: 780px) {
  .hx-intro {
    min-height: 50vh;
    min-height: 50svh;
    padding: 56px 24px 48px;
    top: 25vh;
    top: 25svh;
  }
  .hx-topbar__in {
    background: rgba(26, 17, 13, 0.95);
  }
}
@media (max-width: 780px) and (max-height: 500px) {
  .hx-intro {
    top: 0;
  }
}

/* Phone crop: in portrait a phone sees only the middle of the frame, so <picture> swaps in the centre half
   of it (media/hero-*-phone.*, same pixels, half the bytes) and the layer narrows to half the frame width,
   still centred: every pixel lands where the full frame put it. Same media query as the <source>. */
@media (max-width: 780px) and (max-aspect-ratio: 5/8) {
  .hx-hero__back,
  .hx-hero__front {
    width: calc(var(--hx-fw) / 2);
  }
}

/* Reduced motion: no slides or fades; the menu and the capsule switch at once. No transitions at all: a forced tiny
   duration made every change on every element a transition (unset transition-property is «all»), and WebKit starts
   those a frame late, so the open menu's links stayed hidden for a moment and a Tab right after opening was lost. */
@media (prefers-reduced-motion: reduce) {
  .hx-page *,
  .hx-page *::before,
  .hx-page *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
