/* ==========================================================================
   Layout: fixed header (top bar + navbar), mobile menu, footer, and the
   line-art scenes from js/art.js. Mobile first; desktop from 860px.
   ========================================================================== */

/* ---- Header shell: transparent at the top, glass once you scroll ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-header);
  border-bottom: var(--hairline) solid transparent;
  transition:
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}

.site-header.is-scrolled,
.site-header.is-menu-open {
  background: var(--glass-strong);
  border-bottom-color: var(--glass-border);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

/* ---- Top bar: one small status readout + social links ---- */
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 34px;
  border-bottom: var(--hairline) solid var(--hair);
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar__status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: var(--glow-pink);
  animation: blink 2.4s steps(1, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

@media (max-width: 479px) {
  .topbar__status {
    display: none;
  }

  .topbar__inner {
    justify-content: flex-end;
  }

  /* Narrow screens: icons only in the top bar (the link keeps its aria-label) */
  .topbar .social__link:has(.social__icon) .social__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.social {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
}

.social__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), text-shadow var(--dur-fast) var(--ease-out);
}

.social__link:hover {
  color: var(--ink);
  text-shadow: var(--glow-text);
}

.social__icon {
  flex: none;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Night/day variants of an official icon (only when iconNight is set) */
.social__icon--night,
:root:not([data-theme="day"]) .social__icon--day {
  display: none;
}

:root:not([data-theme="day"]) .social__icon--night {
  display: block;
}

/* ---- Navbar ---- */
.navbar {
  position: relative;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 68px;
}

/* Logo: the SVG files in assets/logo/ are used as a mask and painted with
   --brand, so one file recolors with the theme (no path copies in code).
   Height is set per place; the width follows the file's aspect ratio. */
.logo {
  display: block;
  background-color: var(--brand);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.logo--wordmark {
  aspect-ratio: 2107.6 / 572;
  -webkit-mask-image: url("../assets/logo/mostar-legend-wordmark.svg");
  mask-image: url("../assets/logo/mostar-legend-wordmark.svg");
}

/* High contrast mode would drop the background color and hide the logo */
@media (forced-colors: active) {
  .logo {
    background-color: CanvasText;
    forced-color-adjust: none;
  }
}

/* Navbar brand: the wordmark, links home */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: filter var(--dur-fast) var(--ease-out);
}

.brand .logo {
  height: 44px;
}

.brand:hover {
  filter: var(--brand-glow);
}

@media (min-width: 860px) {
  .brand .logo {
    height: 52px;
  }
}

/* Hamburger (mobile only) */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Menu: a glass drop-down panel on mobile */
.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-6) var(--gutter) var(--space-7);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: var(--hairline) solid var(--glass-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out),
    visibility 0s linear var(--dur);
}

.nav-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

/* Nav link: neon underline that glows on hover and stays on the active page */
.nav-link {
  position: relative;
  display: inline-block;
  padding: var(--space-2) 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 800;
  font-stretch: var(--stretch-condensed);
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: text-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--neon-pink);
  box-shadow: var(--glow-pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* The current page is marked in the brand petrol; hover stays pink */
.nav-link[aria-current="page"]::after {
  background: var(--brand);
  box-shadow: var(--brand-glow-text);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  text-shadow: var(--glow-text);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Small borderless toggles */
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
}

.toggle:hover {
  color: var(--ink);
}

.toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle:hover svg {
  filter: drop-shadow(0 0 6px var(--cyber-blue));
}

/* Theme toggle shows the icon of the theme you will switch to */
.theme-toggle .icon-sun,
:root[data-theme="day"] .theme-toggle .icon-planet {
  display: none;
}

:root[data-theme="day"] .theme-toggle .icon-sun {
  display: block;
}

.lang-toggle {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  font-stretch: var(--stretch-expanded);
  letter-spacing: 0.08em;
}

.lang-toggle__sep {
  opacity: 0.4;
}

:root[lang="tr"] .lang-toggle__opt[data-lang-opt="tr"],
:root[lang="en"] .lang-toggle__opt[data-lang-opt="en"] {
  color: var(--ink);
  text-shadow: var(--glow-text);
}

/* ---- Desktop navbar ---- */
@media (min-width: 860px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: var(--space-7);
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .nav-links {
    flex-direction: row;
    gap: var(--space-6);
  }

  .nav-link {
    font-size: var(--step-0);
    font-weight: 700;
    font-stretch: var(--stretch-expanded);
    letter-spacing: 0.12em;
  }

  .nav-link::after {
    bottom: -4px;
  }
}

/* ---- Line art (js/art.js) ---- */
.art-line {
  fill: none;
  stroke: var(--art-line);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-line--bold {
  stroke-width: 2;
}

.art-line--bright {
  stroke: var(--art-bright);
}

.art-bridge,
.art-station {
  filter: var(--art-glow);
}

#art-beam-grad {
  color: var(--art-beam);
}

#art-station-grad {
  color: var(--art-station);
}

#art-trail-grad {
  color: var(--fire);
}

.art-beam {
  animation: beam-pulse 4s ease-in-out infinite;
}

.art-beam-soft {
  opacity: 0.12;
}

@keyframes beam-pulse {
  50% {
    opacity: 0.55;
  }
}

.art-orbit {
  fill: none;
  stroke: var(--art-station);
  stroke-width: 1;
  opacity: 0.7;
}

.art-blink {
  fill: var(--art-station);
  animation: blink 1.8s steps(1, end) infinite;
}

.art-reflect {
  fill: none;
  stroke: var(--art-bright);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.35;
}

.art-ship {
  animation: ship-float 9s ease-in-out infinite;
}

.art-engine {
  fill: var(--fire);
  opacity: 0.55;
  filter: blur(3px);
}

.art-windows {
  fill: none;
  stroke: var(--fire-hot);
  stroke-width: 2;
  stroke-linecap: round;
}

@keyframes ship-float {
  50% {
    transform: translateY(-6px);
  }
}

/* Rocket (art.js rocket()): filled body, flickering flame */
.art-line.art-rocket-body {
  fill: var(--sky-mid);
}

.art-flame {
  fill: var(--fire);
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: flicker 0.16s ease-in-out infinite alternate;
}

.art-flame--core {
  fill: var(--fire-hot);
}

@keyframes flicker {
  to {
    transform: scaleY(0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-flame {
    animation: none;
  }
}

/* Smoke trail divider */
.trail {
  width: 100%;
  height: clamp(70px, 10vw, 150px);
}

.trail__smoke {
  fill: none;
  stroke: var(--art-smoke);
  stroke-width: 26;
  stroke-linecap: round;
  opacity: 0.12;
}

.trail__smoke--inner {
  stroke-width: 10;
  opacity: 0.22;
}

.trail__core {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ---- Footer ---- */
.site-footer {
  position: relative;
  margin-top: var(--space-9);
}

.footer__sky {
  position: relative;
}

.footer__closing {
  max-width: 16ch;
  padding-block: var(--space-7) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 800;
  font-stretch: var(--stretch-condensed);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.skyline {
  width: 100%;
  height: clamp(150px, 20vw, 290px);
}

.footer__base {
  background: var(--bg-deep);
}

.footer__grid {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-7) var(--space-6);
}

.footer__brand .logo {
  height: 40px;
}

.footer__col {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.footer__title {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  font-stretch: var(--stretch-expanded);
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

/* Footer social links: tappable glass pills in one wrapping row */
.social--pills {
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-2);
}

/* Footer store badges at 40px (Apple's minimum), both the same height. The
   clear space sits outside the column, so the visible badges line up with the title. */
.footer__col .store-badges,
.footer__col .badge {
  --badge-h: 40px;
}

.footer__col .store-badges {
  margin-inline-start: calc(var(--badge-h) / -4);
}

.social--pills .social__link {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: var(--hairline) solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.social--pills .social__link:hover {
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
  text-shadow: none;
  transform: translateY(-2px);
}

/* The address is long: allow a break at 375px instead of widening the page */
.social__link--email .social__name {
  overflow-wrap: anywhere;
}

/* Explore links: one compact row, separated by small neon dots */
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  list-style: none;
  padding: 0;
}

.footer__nav li {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.footer__nav li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: var(--glow-pink);
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  font-stretch: var(--stretch-expanded);
  letter-spacing: 0.08em;
  text-decoration: none;
}

.footer__nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--neon-pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.footer__legal {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-5) var(--space-6);
  border-top: var(--hairline) solid var(--hair);
}

.footer__legal p {
  max-width: none;
  font-size: var(--step--2);
  color: var(--ink-muted);
}

/* Trademark line: a step quieter than the copyright. 85% ink-muted on
   --bg-deep keeps WCAG AA (night 6.8:1, day 4.9:1). */
.footer__legal [data-i18n="footer.trademark"] {
  font-size: clamp(0.65rem, 0.63rem + 0.08vw, 0.7rem);
  color: color-mix(in srgb, var(--ink-muted) 85%, var(--bg-deep));
}

@media (min-width: 860px) {
  .footer__grid {
    grid-template-columns: 1fr auto auto auto;
    column-gap: var(--space-8);
    align-items: start;
  }
}

/* ---- Page intro (GAMES, ABOUT): big title over a line-art scene ---- */
.page-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-9) var(--space-7);
}

/* Mobile: the scene sits faded behind the text; desktop: it fills the right side */
.page-intro__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
}

.page-intro__scene {
  width: 100%;
  height: 100%;
}

.page-intro__inner {
  display: grid;
  justify-items: start;
  gap: var(--space-5);
}

.page-intro__title {
  font-size: var(--step-6);
}

/* Buttons under the intro text (404 page) */
.page-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

/* Dashed flight path in intro scenes */
.art-path {
  fill: none;
  stroke: var(--art-bright);
  stroke-width: 1.5;
  stroke-dasharray: 2 10;
  stroke-linecap: round;
  opacity: 0.6;
}

@media (min-width: 860px) {
  .page-intro__art {
    left: auto;
    width: 58%;
    opacity: 1;
  }

  .page-intro__inner > * {
    max-width: 52%;
  }
}
