@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&display=swap');

/* =========================================================
   LIVINGSPACE — MAIN
   ========================================================= */

.main-view {
  /* Typography */
  --main-font: "Barlow", Arial, sans-serif;
  --main-menu-font: "Chakra Petch", Arial, sans-serif;

  /* Colors */
  --main-background: #000000;
  --main-foreground: #ffffff;
  --main-grey: #b4b4b4;
  --main-line: #1f1f1f;
  --main-line-soft: #141414;

  /* Header */
  --main-header-height: 64px;
  --main-side-mobile: 16px;
  --main-side-tablet: 28px;
  --main-side-desktop: 42px;

  /* Menu layout */
  --menu-left: clamp(28px, 7vw, 58px);
  --menu-right: clamp(24px, 8vw, 56px);
  --menu-top-gap: 42px;
  --menu-row-pad: 14px;

  /* Menu typography */
  --menu-font-size: 19px;
  --menu-letter-spacing: 0.6px;

  /* Chevron */
  --chev-size: 18px;
  --chev-rot-ms: 1040ms;

  /* Saber */
  --saber-width: 4px;
  --saber-height: 26px;
  --saber-offset: 0px;
  --active-shift: 14px;

  /* Panels */
  --panel-font-size: 14px;
  --panel-line-height: 1.65;
  --arrow-safe: calc(var(--chev-size) + 26px);
  --mainPanelDuration: 700ms;

  /* Animations */
  --menu-enter-duration: 1150ms;
  --menu-enter-easing: cubic-bezier(0.16, 1, 0.3, 1);
  --main-arrival-duration: 2400ms;
  --main-arrival-easing: cubic-bezier(0.16, 1, 0.3, 1);

  /* Main container */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;

  background: var(--main-background);
  color: var(--main-foreground);
  font-family: var(--main-font);

  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms linear;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   MAIN — VISIBILITY
   ========================================================= */

.main-view.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   MAIN — RESET
   ========================================================= */

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

.main-view button {
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;

  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
}

.main-view img {
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* =========================================================
   HEADER — CONTAINER
   ========================================================= */

.main-view__header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--main-header-height) + env(safe-area-inset-top, 0px));

  padding: env(safe-area-inset-top, 0px) var(--main-side-mobile) 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  z-index: 20;
  pointer-events: none;
}

/* =========================================================
   HEADER — CONTROLS
   ========================================================= */

.main-view__header-button {
  position: relative;
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;

  opacity: 0;
  pointer-events: none;

  transform: translate3d(0, calc(-100% - 120px), 0);
  transform-origin: center center;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.main-view.is-controls-visible .main-view__header-button {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);

  animation:
    mainControlsArrival var(--main-arrival-duration) var(--main-arrival-easing) both;
}

@keyframes mainControlsArrival {
  0% {
    opacity: 0;
    transform: translate3d(0, calc(-100% - 120px), 0);
  }

  12% {
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.main-view__header-button:focus {
  outline: none;
}

.main-view__header-button:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* =========================================================
   HEADER — ICONS
   ========================================================= */

.main-view__header-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
}

.main-view__header-icon--hamburger {
  width: 30px;
  height: 30px;
}

.main-view__header-icon--search {
  width: 22px;
  height: 22px;
}

/* =========================================================
   LOGO — LIVINGSPACE
   ========================================================= */

.main-view__logo {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + var(--main-header-height) / 2);
  left: 50%;

  width: 240px;
  height: auto;
  margin: 0;
  padding: 0;
  object-fit: contain;

  opacity: 0;
  transform: translate3d(-50%, calc(-150% - 120px), 0);
  transform-origin: center center;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;

  pointer-events: none;
  z-index: 21;
}

/* =========================================================
   LOGO — ARRIVAL
   ========================================================= */

.main-view.is-logo-visible .main-view__logo {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0);

  animation:
    mainLogoArrival var(--main-arrival-duration) var(--main-arrival-easing) both;
}

@keyframes mainLogoArrival {
  0% {
    opacity: 0;
    transform: translate3d(-50%, calc(-150% - 120px), 0);
  }

  12% {
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0);
  }
}

/* =========================================================
   MENU — SCROLL AREA
   ========================================================= */

.main-menu {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100svh;

  padding-top: calc(env(safe-area-inset-top, 0px) + var(--main-header-height));

  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

  z-index: 10;
  scrollbar-width: none;

  visibility: hidden;
  pointer-events: none;
}

.main-view.is-menu-visible .main-menu {
  visibility: visible;
  pointer-events: auto;
}

.main-menu::-webkit-scrollbar {
  display: none;
}

/* =========================================================
   MENU — CONTENT
   ========================================================= */

.main-menu__content {
  position: relative;
  width: 100%;

  padding-left: var(--menu-left);
  padding-right: var(--menu-right);
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));

  transform: translateY(30px);
}

/* =========================================================
   MENU — LIST
   ========================================================= */

.main-menu__list {
  position: relative;
  width: 100%;
  list-style: none;

  margin: var(--menu-top-gap) 0 0;
  padding: 0;
}

/* =========================================================
   SABER — SLOT
   ========================================================= */

.main-menu__saber-slot {
  position: absolute;
  left: 0;
  top: 0;

  width: 32px;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;

  z-index: 5;
  pointer-events: none;
}

/* =========================================================
   SABER — NEON GLOW
   ========================================================= */

.main-menu__saber {
  position: absolute;
  left: var(--saber-offset);
  top: 0;

  width: var(--saber-width);
  height: var(--saber-height);

  background: #fff9cf;
  border-radius: 3px;

  box-shadow:
    0 0 3px rgba(255, 255, 255, 0.95),
    0 0 7px rgba(255, 238, 145, 0.90),
    0 0 13px rgba(255, 220, 70, 0.62),
    0 0 22px rgba(255, 205, 35, 0.30);

  transform: translate3d(0, 0, 0);
  transform-origin: center center;
  transition: transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
  pointer-events: none;
}

/* =========================================================
   SABER — HANDLE
   ========================================================= */

.main-menu__saber-handle {
  position: absolute;
  left: calc(var(--saber-offset) - 14px);
  top: 0;

  width: 32px;
  height: 100%;
  background: transparent;

  z-index: 6;
  pointer-events: auto;
  touch-action: none;
}

/* =========================================================
   MENU — ITEMS
   ========================================================= */

.main-menu__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  width: 100%;
  padding: var(--menu-row-pad) 0;

  color: var(--main-grey);
  font-family: var(--main-menu-font);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--menu-letter-spacing);
  text-transform: uppercase;

  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;

  opacity: 0;
  transform: translate3d(calc(100vw + 80px), 0, 0);
  will-change: transform, opacity;
  z-index: 2;
}

/* =========================================================
   MENU — STAGGER ARRIVAL
   ========================================================= */

.main-view.is-menu-visible .main-menu__item {
  animation: mainMenuItemEnter var(--menu-enter-duration) var(--menu-enter-easing) forwards;
}

.main-view.is-menu-visible .main-menu__item:nth-of-type(2) {
  animation-delay: 0ms;
}

.main-view.is-menu-visible .main-menu__item:nth-of-type(4) {
  animation-delay: 120ms;
}

.main-view.is-menu-visible .main-menu__item:nth-of-type(6) {
  animation-delay: 240ms;
}

.main-view.is-menu-visible .main-menu__item:nth-of-type(8) {
  animation-delay: 360ms;
}

@keyframes mainMenuItemEnter {
  0% {
    opacity: 0;
    transform: translate3d(calc(100vw + 80px), 0, 0);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* =========================================================
   MENU — LABELS
   ========================================================= */

.main-menu__label {
  display: inline-block;
  color: inherit;
  cursor: pointer;

  transition:
    transform 160ms cubic-bezier(0.2, 0.9, 0.2, 1),
    color 120ms linear;

  will-change: transform, color;
}

/* =========================================================
   MENU — ACTIVE ITEM
   ========================================================= */

.main-menu__item.is-active .main-menu__label {
  color: var(--main-foreground);
  transform: translate3d(var(--active-shift), 0, 0);
}

/* =========================================================
   MENU — CHEVRON BUTTON
   ========================================================= */

.main-menu__chevron-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: none;
  overflow: visible;
}

/* =========================================================
   MENU — CHEVRON ICON
   ========================================================= */

.main-menu__chevron {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;

  transform: rotate(var(--chev-spin, 0deg)) translateZ(0);
  transform-origin: center center;

  transition: transform var(--chev-rot-ms) cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
  pointer-events: none;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* =========================================================
   MENU — PANELS
   ========================================================= */

.main-menu__panel {
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  list-style: none;
  overflow: hidden;
  opacity: 0;

  transition:
    grid-template-rows var(--mainPanelDuration) cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 220ms linear;
}

.main-menu__item.is-open + .main-menu__panel {
  grid-template-rows: minmax(0, 1fr);
  opacity: 1;
}

.main-menu__panel-inner {
  min-height: 0;
  overflow: hidden;
  padding: 10px var(--arrow-safe) 12px 0;
  border-top: 1px solid var(--main-line-soft);

  transition:
    padding-top var(--mainPanelDuration) cubic-bezier(0.2, 0.9, 0.2, 1),
    padding-bottom var(--mainPanelDuration) cubic-bezier(0.2, 0.9, 0.2, 1),
    border-top-width var(--mainPanelDuration) cubic-bezier(0.2, 0.9, 0.2, 1);
}

.main-menu__item.is-open + .main-menu__panel .main-menu__panel-inner {
  padding-top: 10px;
  padding-bottom: 12px;
  border-top-width: 1px;
}

.main-menu__panel-inner > * {
  transform: translate3d(20px, 0, 0);
}

/* =========================================================
   MENU — PANEL TEXT
   ========================================================= */

.main-menu__text {
  margin: 0;
  padding: 0;

  color: var(--main-foreground);
  font-family: var(--main-font);
  font-size: var(--panel-font-size);
  font-weight: 400;
  line-height: var(--panel-line-height);
  letter-spacing: 0.2px;
  text-transform: none;
}

/* =========================================================
   MENU — DOMŮ
   ========================================================= */

.main-menu__about {
  color: var(--main-foreground);
}

/* =========================================================
   MENU — MÉDIA
   ========================================================= */

.main-menu__art {
  color: var(--main-foreground);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* =========================================================
   MENU — DESIGN
   ========================================================= */

.main-menu__art-gallery {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;

  min-height: 38px;
  margin: 0;
  padding: 0;

  color: var(--main-grey);
  font-family: var(--main-menu-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.12em;

  text-transform: uppercase;
  text-decoration: none;
  outline: none;
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;

  transition:
    color 120ms linear,
    opacity 120ms linear,
    transform 160ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.main-menu__art-gallery:visited {
  color: var(--main-grey);
}

.main-menu__art-gallery:hover,
.main-menu__art-gallery:focus-visible {
  color: var(--main-foreground);
}

.main-menu__art-gallery:active {
  color: var(--main-foreground);
  opacity: 0.7;
  transform: scale(0.97);
}

/* =========================================================
   MENU — SHOP
   ========================================================= */

.main-menu__vision {
  color: var(--main-foreground);
}

/* =========================================================
   MENU — KONTAKT
   ========================================================= */

.main-menu__contact {
  color: var(--main-foreground);
  font-size: 15px;
  line-height: 1.85;
}

/* =========================================================
   MENU — CONTACT LINKS
   ========================================================= */

.main-menu__contact a {
  display: block;
  width: fit-content;

  color: var(--main-foreground);
  text-decoration: none;
  outline: none;

  -webkit-tap-highlight-color: transparent;

  transition:
    color 140ms ease-out,
    text-shadow 180ms ease-out,
    opacity 140ms ease-out;
}

.main-menu__contact a:link,
.main-menu__contact a:visited {
  color: var(--main-foreground);
  text-decoration: none;
}

.main-menu__contact a:hover,
.main-menu__contact a:focus,
.main-menu__contact a:focus-visible,
.main-menu__contact a:active {
  color: #fff7c2;
  text-decoration: none;

  text-shadow:
    0 0 4px rgba(255, 244, 166, 0.95),
    0 0 10px rgba(255, 226, 92, 0.72),
    0 0 18px rgba(255, 211, 64, 0.42);

  outline: none;
}

.main-menu__contact a:active {
  opacity: 0.82;
}

/* =========================================================
   MENU — DIVIDER
   ========================================================= */

.main-menu__divider {
  width: 100%;
  margin: 18px 0 0;
  border-top: 1px solid var(--main-line);
}

/* =========================================================
   RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 374px) {
  .main-view {
    --menu-left: 27px;
    --menu-right: 24px;
    --menu-top-gap: 34px;
    --menu-row-pad: 13px;
    --menu-font-size: 18px;
    --chev-size: 17px;
    --panel-font-size: 13px;
  }

  .main-view__header-icon {
    width: 22px;
    height: 22px;
  }
}

/* =========================================================
   RESPONSIVE — LARGE MOBILE
   ========================================================= */

@media (min-width: 430px) and (max-width: 767px) {
  .main-view {
    --menu-left: clamp(32px, 7vw, 58px);
    --menu-right: clamp(28px, 8vw, 56px);
    --menu-font-size: 20px;
  }

  .main-view__header {
    padding-left: 18px;
    padding-right: 18px;
    transform: translateY(20px);
  }

  .main-view__logo {
    top: calc(
      env(safe-area-inset-top, 0px) +
      var(--main-header-height) / 2 +
      20px
    );
  }
}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (min-width: 768px) {
  .main-view {
    --menu-left: clamp(52px, 8vw, 92px);
    --menu-right: clamp(44px, 8vw, 84px);
    --menu-top-gap: 54px;
    --menu-row-pad: 17px;
    --menu-font-size: 22px;
    --chev-size: 20px;
    --saber-height: 30px;
    --panel-font-size: 15px;
  }

  .main-view__header {
    padding-left: var(--main-side-tablet);
    padding-right: var(--main-side-tablet);
  }

  .main-view__header-icon {
    width: 26px;
    height: 26px;
  }

  .main-menu__content {
    max-width: 900px;
    margin: 0 auto;
  }
}

/* =========================================================
   RESPONSIVE — DESKTOP
   ========================================================= */

@media (min-width: 1200px) {
  .main-view {
    --menu-left: 72px;
    --menu-right: 72px;
    --menu-top-gap: 62px;
    --menu-row-pad: 18px;
    --menu-font-size: 23px;
    --panel-font-size: 15px;
  }

  .main-view__header {
    padding-left: var(--main-side-desktop);
    padding-right: var(--main-side-desktop);
  }

  .main-menu__content {
    max-width: 980px;
  }
}

/* =========================================================
   ACCESSIBILITY — REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .main-view {
    transition-duration: 1ms;
  }

  .main-view.is-logo-visible .main-view__logo {
    animation-duration: 700ms;
    animation-timing-function: ease-out;
  }

  .main-view.is-controls-visible .main-view__header-button {
    animation-duration: 700ms;
    animation-delay: 0ms;
  }

  .main-menu__saber {
    transition-duration: 100ms;
  }

  .main-menu__chevron {
    transition-duration: 300ms;
  }

  .main-menu__panel {
    transition:
      grid-template-rows 240ms ease-out,
      opacity 120ms linear;
  }

  .main-menu__panel-inner {
    transition:
      padding-top 240ms ease-out,
      padding-bottom 240ms ease-out,
      border-top-width 240ms ease-out;
  }
}

/* =========================================================
   MAIN MENU — SCROLL LOCK
   ========================================================= */

.main-menu {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-x;
}
