﻿@import url('https://manworld.sbs/assets/css/normalize.css') layer(normalize);

@layer normalize, base, demo;

@layer demo {
  body {
    background: light-dark(#fff, #000);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding-block: 2rem;
  }

  h1,
  p {
    margin: 0;
  }

  h1.fluid {
    --font-size-min: 22;
    --font-level: 4.25;
  }

  h3 {
    white-space: nowrap;
    margin: 0;
  }

  body > p {
    width: 74ch;
    max-width: calc(100% - 4rem);
    text-wrap: balance;
    font-family: monospace;
    margin-bottom: 0rem;
    line-height: 1.5;
    opacity: 0.8;
    font-weight: 400;

    @media (max-width: 768px) {
      text-align: center;
    }
  }

  li :is(svg, h3) {
    opacity: 0.6;
    transition: opacity calc(var(--speed) * 1.2) var(--easing);
  }

  li :is(a, p) {
    opacity: 0;
    transition: opacity calc(var(--speed) * 1.2) var(--easing);
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
  }

  li img {
    filter: grayscale(1) brightness(1.5);
    scale: 1.1;
    transition-property: filter, scale;
    transition-duration: calc(var(--speed) * 1.2);
    transition-timing-function: var(--easing);
  }

  [data-active='true'] :is(a, p, h3, svg) {
    opacity: var(--opacity, 1);
  }
  [data-active='true'] :is(a, p) {
    transition-delay: calc(var(--speed) * 0.25);
  }

  [data-active='true'] img {
    filter: grayscale(0) brightness(1);
    scale: 1;
    transition-delay: calc(var(--speed) * 0.25);
  }

  article {
/*     outline: 2px dashed canvasText; */
    width: calc(var(--article-width) * 1px);
    height: 100%;
    position: absolute;
    font-family: monospace;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    padding-inline: calc(var(--base) * 0.5 - 9px);
    padding-bottom: 1rem;
    overflow: hidden;

    h3 {
      position: absolute;
      top: 1rem;
      left: calc(var(--base) * 0.5);
      transform-origin: 0 50%;
      rotate: 90deg;
      font-size: 1rem;
      font-weight: 300;
      text-transform: uppercase;
      font-family: monospace;
    }
    svg {
      width: 18px;
      fill: none;
    }

    p {
      font-size: 13px;
      text-wrap: balance;
      line-height: 1.25;
      --opacity: 0.8;
    }

    a {
      position: absolute;
      bottom: 1rem;
      height: 18px;
      line-height: 1;
      color: inherit;
      

      &:is(:focus-visible, :hover) {
        outline: none;
        span {
          text-decoration: underline;
          text-underline-offset: 4px;
        }
      }

      span {
        display: inline-block;
        line-height: 18px;
        translate: calc(var(--base) * 0.5);
        font-weight: 500;
      }
    }

    img {
      position: absolute;
      pointer-events: none;
      inset: 0;
      width: 100%;
      height: 100%;
      -o-object-fit: cover;
         object-fit: cover;
      -webkit-mask: radial-gradient(100% 100% at 100% 0, #fff, #0000);
              mask: radial-gradient(100% 100% at 100% 0, #fff, #0000);
    }
  }
  /* gotta use some Math on the container really */
  /* width is "ideal" 7 * 80px + 6 * gap + say 300px or whatever the ideal width is */
  :root {
    --gap: 8px;
    --base: clamp(2rem, 8cqi, 80px);
    --easing: linear(
      0 0%,
      0.1538 4.09%,
      0.2926 8.29%,
      0.4173 12.63%,
      0.5282 17.12%,
      0.6255 21.77%,
      0.7099 26.61%,
      0.782 31.67%,
      0.8425 37%,
      0.8887 42.23%,
      0.9257 47.79%,
      0.9543 53.78%,
      0.9752 60.32%,
      0.9883 67.11%,
      0.9961 75%,
      1 100%
    );
    --speed: 0.6s;
  }
  ul {
    display: grid;
    container-type: inline-size;
    grid-template-columns: 10fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: var(--gap);
    list-style-type: none;
    justify-content: center;
    padding: 0;
    height: clamp(300px, 40dvh, 474px);
    margin: 0;
    width: calc(
      ((var(--items) - 1) * var(--base)) + ((var(--items) - 1) * var(--gap)) +
        var(--ideal)
    );
    width: 820px;
    max-width: calc(100% - 4rem);
    transition: grid-template-columns var(--speed) var(--easing);
    transition: grid-template-columns var(--speed) var(--easing), -ms-grid-columns var(--speed) var(--easing);
  }

  li {
    /* outline: 4px dashed canvasText; */
    background: light-dark(#fff, #000);
    position: relative;
    overflow: hidden;
    min-width: var(--base);
    border-radius: 8px;
    border: 1px solid color-mix(in hsl, canvas, canvasText 50%);
  }
}

@layer base {
  :root {
    --font-size-min: 16;
    --font-size-max: 20;
    --font-ratio-min: 1.2;
    --font-ratio-max: 1.33;
    --font-width-min: 375;
    --font-width-max: 1500;
  }

  html {
    color-scheme: light dark;
  }

  [data-theme='light'] {
    color-scheme: light only;
  }

  [data-theme='dark'] {
    color-scheme: dark only;
  }

  :where(.fluid) {
    --fluid-min: calc(
      var(--font-size-min) * pow(var(--font-ratio-min), var(--font-level, 0))
    );
    --fluid-max: calc(
      var(--font-size-max) * pow(var(--font-ratio-max), var(--font-level, 0))
    );
    --fluid-preferred: calc(
      (var(--fluid-max) - var(--fluid-min)) /
        (var(--font-width-max) - var(--font-width-min))
    );
    --fluid-type: clamp(
      (var(--fluid-min) / 16) * 1rem,
      ((var(--fluid-min) / 16) * 1rem) -
        (((var(--fluid-preferred) * var(--font-width-min)) / 16) * 1rem) +
        (var(--fluid-preferred) * var(--variable-unit, 100vi)),
      (var(--fluid-max) / 16) * 1rem
    );
    font-size: var(--fluid-type);
  }

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

  body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    font-family: 'SF Pro Text', 'SF Pro Icons', 'AOS Icons', 'Helvetica Neue',
      Helvetica, Arial, sans-serif, system-ui;
  }

  body::before {
    --size: 45px;
    --line: color-mix(in hsl, canvasText, transparent 70%);
    content: '';
    height: 100vh;
    width: 100vw;
    position: fixed;
    background: linear-gradient(
          90deg,
          var(--line) 1px,
          transparent 1px var(--size)
        )
        50% 50% / var(--size) var(--size),
      linear-gradient(var(--line) 1px, transparent 1px var(--size)) 50% 50% /
        var(--size) var(--size);
    -webkit-mask: linear-gradient(-20deg, transparent 50%, white);
            mask: linear-gradient(-20deg, transparent 50%, white);
    top: 0;
    transform-style: flat;
    pointer-events: none;
    z-index: -1;
  }

  .bear-link {
    color: canvasText;
    position: fixed;
    top: -22px;
    left: 1rem;
    /*width: 48px;*/
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    /*opacity: 0.8;*/
  }

  :where(.x-link, .bear-link):is(:hover, :focus-visible) {
    opacity: 1;
  }

  .bear-link svg {
    width: 75%;
  }

  /* Utilities */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }
}

  /* Ø§ÙˆÙ„ Ù‡Ù…Ù‡ Ú†ÛŒØ²Ùˆ Ù†Ø´ÙˆÙ† Ø¨Ø¯Ù‡ */
  .desktop {
    display: block;
  }

  /* ØªØ¨Ù„Øª Ùˆ Ù…ÙˆØ¨Ø§ÛŒÙ„: hide Ú©Ù† */
  @media (max-width: 1024px) {
    .desktop {
      display: none;
    }
  }

    /* Ù¾ÛŒØ´â€ŒÙØ±Ø¶: Ù…Ø®ÙÛŒ */
    .mobilet {
      display: none;
    }
  
    /* Ù…ÙˆØ¨Ø§ÛŒÙ„ Ùˆ ØªØ¨Ù„Øª: Ù†Ø´ÙˆÙ† Ø¨Ø¯Ù‡ */
    @media (max-width: 1024px) {
      .mobilet {
        display: block;
      }
    }
/* === Local overrides for landing page === */
:root {
  color-scheme: dark light;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(217, 157, 61, 0.2), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(175, 158, 132, 0.11), transparent 60%),
    #050306;
  color: rgba(248, 250, 252, 0.9);
}

body::before {
  content: '';
  position: fixed;
  inset: -160px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px;
  background-position: 0 0, 0 0;
  animation: grid-pan-local 20s ease-in-out infinite alternate;
  opacity: 0.72;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  /*background:
    radial-gradient(circle at 18% 28%, rgba(96, 76, 255, 0.32), transparent 62%),
    radial-gradient(circle at 84% 70%, rgba(255, 74, 120, 0.28), transparent 68%);*/
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: aurora-local 18s ease-in-out infinite alternate;
  z-index: -1;
}

@media (prefers-color-scheme: light) {
  body {
    background:
      radial-gradient(circle at 22% 26%, rgba(255, 205, 139, 0.45), transparent 62%),
      radial-gradient(circle at 74% 70%, rgba(157, 188, 255, 0.38), transparent 68%),
      #f4f6fb;
    color: #111827;
  }

  body::before {
    background:
      linear-gradient(90deg, rgba(17, 24, 39, 0.12) 1px, transparent 1px) 0 0 / 36px 36px,
      linear-gradient(rgba(17, 24, 39, 0.12) 1px, transparent 1px) 0 0 / 36px 36px;
    opacity: 0.58;
  }

  body::after {
    background:
      radial-gradient(circle at 18% 30%, rgba(255, 219, 184, 0.58), transparent 70%),
      radial-gradient(circle at 80% 72%, rgba(183, 204, 255, 0.5), transparent 72%);
    opacity: 0.9;
  }
}

@keyframes grid-pan-local {
  0% {
    background-position: 0 0, 0 0;
  }
  50% {
    background-position: 24px 24px, 24px 24px;
  }
  100% {
    background-position: 48px 48px, 48px 48px;
  }
}

@keyframes aurora-local {
  0% {
    background-position: 0% 0%, 100% 100%;
    filter: brightness(0.9);
  }
  50% {
    background-position: 30% 40%, 70% 60%;
    filter: brightness(1.05);
  }
  100% {
    background-position: 0% 100%, 100% 0%;
    filter: brightness(0.94);
  }
}

.home-hero {
  width: min(900px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(1.2rem, 3.5vw, 2rem);
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.5rem, 5vw, 3rem);
}

.home-hero > * {
  margin: 0;
}

.hero-title {
  font-family: "Doran FaNum", "Vanda", sans-serif;
  font-weight: 500;
}

.hero-title--mobile {
  margin-top: 0.75rem;
}

.hero-description {
  font-family: "Vanda", "Doran FaNum", sans-serif;
  line-height: 1.8;
  margin: 0 auto;
}

.hero-description--desktop {
  font-weight: 500;
  max-width: 85%;
  font-size: 22px;
}

.hero-description--mobile {
  font-size: 25px;
}

.primary-download,
.store-links,
.developer-portal,
.developer-portal__link,
.developer-portal__image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-download {
  gap: 0.5rem;
  margin: clamp(1.2rem, 4vw, 1.8rem) auto 0;
  padding: 0.9rem 3rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 48px;
  min-width: clamp(240px, 42vw, 360px);
  color: #fff;
  text-decoration: none;
  font-family: "Vanda", "Doran FaNum", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.2));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-download:hover,
.primary-download:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.25);
}

.primary-download__label {
  display: block;
  width: 100%;
  text-align: center;
  pointer-events: none;
}

.store-links {
  gap: 1.25rem;
  width: min(90%, 600px);
  margin: clamp(1.1rem, 3.5vw, 1.7rem) auto 0;
}

.store-links__image {
  max-width: 100%;
  height: auto;
  width: clamp(140px, 40vw, 220px);
}

.developer-portal {
  margin-top: clamp(1.3rem, 4.2vw, 2.1rem);
  width: 100%;
}

.developer-portal__link {
  width: 100%;
}

.developer-portal__image {
  width: clamp(200px, 45vw, 320px);
  max-width: 320px;
  margin: 0 auto;
  height: auto;
}

.error-container {
  min-height: min(60vh, 540px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 5vw, 3rem);
}

.error-container__subtitle {
  max-width: min(48ch, 90%);
  margin: 0 auto;
}

.page-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 9999;
  overflow: hidden;
}

.page-loader--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loader__grid,
.page-loader__flash {
  position: absolute;
  inset: 0;
}

.page-loader__grid {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 50% 50% / 40px 40px,
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 50% 50% / 40px 40px;
  animation: loader-grid-shift-local 8s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.12));
}

.page-loader__flash {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
  opacity: 0;
  transform: scale(0.5);
}

.page-loader__label {
  font-family: "Vanda", "Doran FaNum", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  animation: loader-label-pulse-local 2.4s ease-in-out infinite;
}

.page-loader--closing {
  pointer-events: none;
}

.page-loader--closing .page-loader__flash {
  animation: loader-flash-local 0.6s ease-out forwards;
}

.page-loader--closing .page-loader__grid {
  animation: loader-grid-burst-local 0.6s ease-out forwards;
}

.page-loader--closing ..page-loader__label {
  animation: loader-label-fade-local 0.4s ease forwards;
}

@keyframes loader-grid-shift-local {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(25px, 25px, 0) scale(1.02);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes loader-grid-burst-local {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1.28);
    opacity: 0;
  }
}

@keyframes loader-flash-local {
  0% {
    opacity: 0.05;
    transform: scale(0.65);
  }
  30% {
    opacity: 0.6;
    transform: scale(1.1);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes loader-label-pulse-local {
  0%, 100% {
    letter-spacing: 0.1em;
    opacity: 0.45;
  }
  45% {
    letter-spacing: 0.28em;
    opacity: 1;
  }
}

@keyframes loader-label-fade-local {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}


/* === Grid motion fix === */
body {
  /*background:
    radial-gradient(circle at 20% 30%, rgba(217, 157, 61, 0.2), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(175, 158, 132, 0.11), transparent 60%),
    #050306;*/
}

body::before {
  content: '';
  position: fixed;
  top: -160px;
  left: -160px;
  width: calc(100% + 320px);
  height: calc(100% + 320px);
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 48px 48px;
  opacity: 0.7;
  transform-origin: top left;
  animation: grid-pan-anchor 22s ease-in-out infinite alternate;
  z-index: -2;
}

@keyframes grid-pan-anchor {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-18px, -18px, 0) scale(1.02);
  }
  100% {
    transform: translate3d(-32px, -32px, 0) scale(1.04);
  }
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  /*background:
    radial-gradient(circle at 18% 28%, rgba(96, 76, 255, 0.32), transparent 62%),
    radial-gradient(circle at 84% 70%, rgba(255, 74, 120, 0.28), transparent 68%);*/
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: aurora-anchor 18s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes aurora-anchor {
  0% {
    background-position: 0% 0%, 100% 100%;
    filter: brightness(0.9);
  }
  50% {
    background-position: 32% 38%, 68% 62%;
    filter: brightness(1.05);
  }
  100% {
    background-position: 0% 100%, 100% 0%;
    filter: brightness(0.92);
  }
}

@media (prefers-color-scheme: light) {
  body {
    background:
      radial-gradient(circle at 22% 26%, rgba(255, 205, 139, 0.45), transparent 62%),
      radial-gradient(circle at 74% 70%, rgba(157, 188, 255, 0.38), transparent 68%),
      #f4f6fb;
    color: #111827;
  }

  body::before {
    background:
      linear-gradient(90deg, rgba(17, 24, 39, 0.12) 1px, transparent 1px) 0 0 / 36px 36px,
      linear-gradient(rgba(17, 24, 39, 0.12) 1px, transparent 1px) 0 0 / 36px 36px;
    opacity: 0.58;
  }

  body::after {
    background:
      radial-gradient(circle at 18% 30%, rgba(255, 219, 184, 0.58), transparent 70%),
      radial-gradient(circle at 80% 72%, rgba(183, 204, 255, 0.5), transparent 72%);
    opacity: 0.9;
  }
}
.page-loader {
  background: radial-gradient(circle at center, rgba(5, 3, 6, 0.94) 40%, rgba(5, 3, 6, 0.98) 100%);
}
.page-loader {
  background: radial-gradient(circle at center, rgba(5, 3, 6, 0.94) 40%, rgba(5, 3, 6, 0.98) 100%);
}
/* Grid animation override */
body::before {
  animation: grid-glide-man 20s ease-in-out infinite alternate;
}

@keyframes grid-glide-man {
  0% {
    transform: translate3d(-16px, -16px, 0);
  }
  50% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(16px, 16px, 0);
  }
}
/* Flashy grid animation */
body::before {
  animation:
    grid-glide-man 22s ease-in-out infinite alternate,
    grid-flicker-man 1.4s steps(2, end) infinite;
}

@keyframes grid-flicker-man {
  0%, 45% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.3;
  }
  55%, 100% {
    opacity: 0.7;
  }
}
body::before {
  animation:
    grid-glide 22s ease-in-out infinite alternate,
    grid-flash-strong 1.1s linear infinite;
  filter: brightness(1);
}

@keyframes grid-flash-strong {
  0%, 15% {
    opacity: 0.85;
    filter: brightness(1);
  }
  18%, 28% {
    opacity: 0.35;
    filter: brightness(0.6);
  }
  30% {
    opacity: 1;
    filter: brightness(1.45);
  }
  45% {
    opacity: 0.8;
    filter: brightness(1);
  }
  55% {
    opacity: 0.4;
    filter: brightness(0.7);
  }
  60% {
    opacity: 1;
    filter: brightness(1.35);
  }
  100% {
    opacity: 0.85;
    filter: brightness(1);
  }
}
.error-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: clamp(1.2rem, 4vw, 1.8rem) auto 0;
  padding: 0.9rem 3rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 48px;
  min-width: clamp(240px, 42vw, 360px);
  color: #fff;
  text-decoration: none;
  font-family: "Vanda", "Doran FaNum", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.2));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.error-back:hover,
.error-back:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.25);
}
