/* =============================================================================
   NORMALIZE  (v3 subset — reset/baseline)
   ============================================================================= */

html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section, summary {
  display: block;
}
audio, canvas, progress, video {
  display: inline-block;
  vertical-align: baseline;
}
audio:not([controls]) {
  display: none;
  height: 0;
}
[hidden], template {
  display: none;
}
a {
  background-color: transparent;
}
a:active, a:hover {
  outline: 0;
}
abbr[title] {
  border-bottom: 1px dotted;
}
b, strong {
  font-weight: bold;
}
dfn {
  font-style: italic;
}
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
mark {
  background: #ff0;
  color: #000;
}
small {
  font-size: 80%;
}
sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }
img { border: 0; }
svg:not(:root) { overflow: hidden; }
figure { margin: 1em 40px; }
hr {
  box-sizing: content-box;
  height: 0;
}
pre { overflow: auto; }
code, kbd, pre, samp {
  font-family: monospace, monospace;
  font-size: 1em;
}
button, input, optgroup, select, textarea {
  color: inherit;
  font: inherit;
  margin: 0;
}
button { overflow: visible; }
button, select { text-transform: none; }
button,
html input[type="button"],
input[type="reset"] {
  -webkit-appearance: button;
  cursor: pointer;
}
button[disabled], html input[disabled] { cursor: default; }
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}
input { line-height: normal; }
input[type='checkbox'], input[type='radio'] {
  box-sizing: border-box;
  padding: 0;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  height: auto;
}
input[type='search'] { -webkit-appearance: none; }
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}
fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}
legend { border: 0; padding: 0; }
textarea { overflow: auto; }
optgroup { font-weight: bold; }
table {
  border-collapse: collapse;
  border-spacing: 0;
}
td, th { padding: 0; }


/* =============================================================================
   X — BASE  (fonts, box-sizing, global tokens)
   ============================================================================= */

@font-face {
  font-family: 'X-font';
  src: url('../fonts/X-font.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

.clearfix::before, .clearfix::after { display: table; content: ''; }
.clearfix::after { clear: both; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #dbdbdb;
  font-family: 'X-font', sans-serif;
  font-weight: 400;
  font-size: 1em;
}

a {
  color: #36b6dd;
  text-decoration: none;
}
a:hover, a:focus {
  outline: none;
  color: #fff !important;
}


/* =============================================================================
   LAYOUT-MULTI  (scroll-snap pages, containers, intro, thumb-nav base)
   ============================================================================= */

.hidden {
  position: absolute;
  overflow: hidden;
  width: 0;
  height: 0;
}

/* Pages scroll container */
.pages {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.pages > .container,
.pages > .container::after {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100svh !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.pages > .container {
  scroll-snap-align: start;
  overflow: hidden !important;
}

.pages > .container::after {
  display: none !important;
}

.pages .intro {
  position: relative !important;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: transparent;
}

/* Intro media / embed */
.intro__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  perspective: 900px;
  overflow: hidden;
}

.intro__media::after {
  content: none;
}

.intro__embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: auto;
  touch-action: auto;
  transform: translate3d(0,0,0) scale(1.06);
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Intro content overlay */
.intro__content {
  position: absolute !important;
  inset: 0;
  z-index: 25;
  padding: 1.8em;
  padding-top: calc(1.8em + env(safe-area-inset-top));
  padding-right: calc(1.8em + 88px + env(safe-area-inset-right));
  background: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  font-size: 1.15em;
}

.intro__content * { pointer-events: auto; }

.intro__content a { color: inherit; }

.intro__title {
  font-family: 'X-font', sans-serif !important;
  font-size: 4em;
  margin: 0 0 20px;
  line-height: 1;
  color: #00ff00;
}

/* Trigger button (grid icon, top-right) */
.pages .trigger {
  position: absolute !important;
  top: 16px;
  right: 16px;
  margin: 0 !important;
  z-index: 30;
}

@supports (padding: max(0px)) {
  .pages .trigger {
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
  }
}

.pages .container--open .intro {
  transform: none !important;
}

/* Thumb nav */
.thumb-nav {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 2em;
  z-index: 9999;
  -webkit-transition: -webkit-transform 0.6s, opacity 0.6s;
  transition: transform 0.6s, opacity 0.6s;
  -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
}

@supports (padding: max(0px)) {
  .thumb-nav {
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
  }
}

.thumb-nav__item {
  position: relative;
  display: block;
  text-decoration: none;
}


.thumb-nav__icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
}

.thumb-nav__icon {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 999px;
  object-fit: contain;
  background: rgba(255,255,255,0.06);
  border: none;
  opacity: 0.2;
  -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
  transition: opacity 0.3s, transform 0.3s;
}

.thumb-nav__item--current .thumb-nav__icon,
.thumb-nav__item:hover .thumb-nav__icon {
  opacity: 0.95;
  transform: scale(1.04);
}

.thumb-nav .thumb-nav__item .thumb-nav__label {
  position: absolute;
  top: 52px;
  left: 65px;
  width: auto;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: none;
  text-align: left;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  opacity: 0.95;
  transform-origin: 0 0;
  transform: rotate(45deg);
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.thumb-nav--hide {
  opacity: 0;
  -webkit-transform: translate3d(0, -200px, 0);
  transform: translate3d(0, -200px, 0);
}

/* Swipe rail */
.swipe-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(12px + env(safe-area-inset-right));
  width: 44px;
  z-index: 26;
  pointer-events: auto;
  background: transparent;
  touch-action: none;
  user-select: none;
}

.swipe-rail::after { display: none; }

/* Menu panel (open state) */
.menu-panel {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.container.container--open .menu-panel {
  opacity: 1;
  pointer-events: auto;
}

.menu-panel__inner {
  max-width: 520px;
  width: calc(100% - 32px);
  padding: 24px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #fff;
  text-align: center;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.25s ease;
  will-change: transform;
}

.container.container--open .menu-panel__inner {
  transform: translateY(0) scale(1);
}

/* Theme variants */
.theme-1 a { color: #e28e51; }
.theme-1, .theme-1 .intro { background: transparent; }

.theme-2 a { color: #90be23; }
.theme-2, .theme-2 .intro { background: transparent; }

/* Responsive — layout */
@media screen and (max-width: 768px) {
  .thumb-nav {
    gap: 20px;
    padding: 16px;
  }
  .thumb-nav__icon-wrap { width: 56px; height: 56px; }
  .thumb-nav__icon      { width: 56px; height: 56px; }
  .thumb-nav .thumb-nav__item .thumb-nav__label {
    top: 48px;
    left: 62px;
    font-size: 18px;
  }
  .intro__media {
    left: 0; right: 0;
    width: 100vw;
    margin: 0; padding: 0;
  }
  .intro__embed {
    width: 100vw;
    max-width: 100vw;
    left: 0; right: 0;
    margin: 0;
  }
  .intro__content {
    padding: 1.2em;
    font-size: 1em;
    padding-right: calc(1.2em + 92px + env(safe-area-inset-right)) !important;
  }
  .intro__title       { font-size: 2.5em; }
  .intro__description { font-size: 0.95em; }
}

@media screen and (max-width: 480px) {
  .thumb-nav { gap: 16px; padding: 12px; }
  .thumb-nav .thumb-nav__item .thumb-nav__label {
    top: 46px;
    left: 60px;
    font-size: 16px;
  }
  .intro__title { font-size: 2em; }
}

@media screen and (max-width: 375px) {
  .thumb-nav .thumb-nav__item .thumb-nav__label {
    font-size: 14px;
    top: 44px;
    left: 58px;
  }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
  .thumb-nav { gap: 14px; padding: 10px; }
  .thumb-nav__icon-wrap { width: 48px; height: 48px; }
  .thumb-nav__icon      { width: 48px; height: 48px; }
  .thumb-nav .thumb-nav__item .thumb-nav__label {
    top: 42px;
    left: 54px;
    font-size: 14px;
  }
  .intro__title { font-size: 1.8em; }
}


/* =============================================================================
   STYLE  (side menus, overlays, icon, utilities)
   ============================================================================= */

/* Icon SVG */
.icon {
  -webkit-transform-origin: 50% 50%;
  transform-origin: 50% 50%;
  -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
  transition: opacity 0.3s, transform 0.3s;
  stroke: #dbdbdb;
  fill: none;
  stroke-width: 2px;
}

/* Side-menu triggers */
.side-menu-trigger {
  position: fixed;
  right: 0;
  z-index: 9998;
  padding: 16px 8px;
  border: none;
  border-radius: 8px 0 0 8px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  top: 0;
}

.side-menu-trigger:hover { background: rgba(255,255,255,0.15); }

.side-menu-trigger--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%) !important;
}

.side-menu-trigger__text {
  display: block;
  color: #00ff00;
  font-family: 'X-font', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-align: center;
}

/* Side-menu overlay */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.side-menu-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Side menu panel */
.side-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 10000;
  width: 70%;
  max-width: 400px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.side-menu--open { transform: translateX(0); }

.side-menu__close {
  position: absolute;
  top: 16px;
  right: 16px;
  overflow: hidden;
  margin: 0; padding: 0;
  width: 40px; height: 40px;
  outline: none;
  border: none;
  background: none;
  cursor: pointer;
}

.side-menu__close svg   { width: 100%; height: 100%; }
.side-menu__close .icon {
  transform-origin: 50% 50%;
  transition: opacity 0.3s, transform 0.3s;
  stroke: #dbdbdb;
  fill: none;
  stroke-width: 2px;
}

.side-menu__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 32px;
}

.side-menu__title {
  display: none;
}

.side-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-menu__link {
  color: #fff;
  font-family: 'X-font', sans-serif;
  font-size: 1.25em;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.side-menu__link:hover { opacity: 1; }

.side-menu__category {
  color: #fff;
  font-family: 'X-font', sans-serif;
  font-size: 1.25em;
  opacity: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: flex-start;
}

.side-menu__group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: -12px;
  padding-top: 12px;
  padding-bottom: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.8);
  padding-left: 16px;
}

.side-menu__group::before,
.side-menu__group::after {
  content: '';
  position: absolute;
  left: -1px;
  width: var(--xmail-bracket-w, 5em);
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

.side-menu__group::before { top: 0; }
.side-menu__group::after  { bottom: 0; width: var(--xmail-android-w, 10em); }

/* About menu specifics */
#sideMenuAbout .side-menu__content {
  justify-content: space-between;
  padding-top: 90px;
}
#sideMenuAbout .side-menu__main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#sideMenuAbout .side-menu__intro {
  color: rgba(255,255,255,0.72);
  font-family: 'X-font', sans-serif;
  font-size: 0.95em;
  line-height: 1.55;
  margin: 0;
  padding: 0;
}
#sideMenuAbout .side-menu__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 0;
}

.about-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: rgba(255,255,255,0.72);
  font-family: 'X-font', sans-serif;
  font-size: 1.0em;
  line-height: 1.5;
}

.about-footer strong { color: rgba(255,255,255,0.88); font-weight: 600; }

.about-footer__links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.about-footer__contact {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.about-footer__contact:hover { opacity: 1; }

/* Luke overlay */
.luke-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.luke-overlay.is-open { display: block; }

.luke-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.luke-overlay.is-open .luke-overlay__backdrop { opacity: 1; }

.luke-overlay__blobWrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vw, 760px);
  height: min(78vw, 760px);
  max-height: 82svh;
  transform: translate(-50%, -50%) translateY(16px) scale(0.985);
  opacity: 0;
  transition: opacity 220ms ease, transform 260ms ease;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,0.55));
}

.luke-overlay.is-open .luke-overlay__blobWrap {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0) scale(1);
}

.luke-overlay__close {
  position: absolute;
  top: -6px;
  right: -6px;
  margin: 0; padding: 0;
  width: 40px; height: 40px;
  border: none; outline: none;
  background: none;
  cursor: pointer;
  z-index: 30;
}

.luke-overlay__close svg   { width: 100%; height: 100%; }
.luke-overlay__close .icon {
  transform-origin: 50% 50%;
  transition: opacity 0.3s, transform 0.3s;
  stroke: #dbdbdb;
  fill: none;
  stroke-width: 2px;
}

.luke-overlay__blob {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: transparent !important;
  overflow: visible;
}

.luke-overlay__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent !important;
  display: block;
}

@media (max-width: 480px) {
  .luke-overlay__blobWrap {
    width: min(86vw, 760px);
    height: min(86vw, 760px);
    max-height: 84svh;
  }
}

/* Mission overlay */
.mission-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.mission-overlay.is-open { display: flex; }

.mission-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mission-overlay__card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(60px) saturate(220%) brightness(1.08);
  -webkit-backdrop-filter: blur(60px) saturate(220%) brightness(1.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  padding: 48px 52px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.28);
  animation: missionFadeIn 0.25s ease;
}

@keyframes missionFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.mission-overlay__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0; margin: 0;
  outline: none;
}

.mission-overlay__close svg  { width: 100%; height: 100%; }
.mission-overlay__close .icon {
  stroke: #dbdbdb;
  fill: none;
  stroke-width: 2px;
}

.mission-overlay__title {
  font-family: 'X-font', sans-serif;
  font-size: 1.6rem;
  font-weight: normal;
  color: #00ff00;
  letter-spacing: 0.04em;
  margin: 0 0 28px 0;
  text-align: center;
}

.mission-overlay__body {
  font-family: 'X-font', sans-serif;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.75;
}

.mission-overlay__body p    { margin: 0 0 8px 0; }
.mission-overlay__body .gap { margin-top: 18px; }

.mission-overlay__body .indent {
  padding-left: 14px;
  margin-top: 6px;
}

.mission-overlay__body .indent p { margin: 3px 0; }

@media (max-width: 600px) {
  .mission-overlay__card {
    padding: 40px 28px;
    border-radius: 20px;
  }
  .mission-overlay__title {
    font-size: 1.35rem;
    margin-bottom: 22px;
  }
  .mission-overlay__body { font-size: 1rem; }
}

/* Utility */
.tri-stack-underline {
  text-decoration: underline;
  text-decoration-color: #00ff00;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.intro__content a { color: inherit; }

/* Safe-area overrides */
@supports (padding: max(0px)) {
  .side-menu-trigger { right: max(0px, env(safe-area-inset-right)); }
  .side-menu__close {
    top:   max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
  }
  .side-menu__content {
    padding-right: max(32px, env(safe-area-inset-right));
  }
}

/* Responsive — side menus */
@media screen and (min-width: 768px) {
  .side-menu { width: 30%; max-width: none; }
}

@media screen and (max-width: 768px) {
  .side-menu { width: 75%; }
  .side-menu__content { padding: 48px 24px; }
}

@media screen and (max-width: 480px) {
  .side-menu { width: 75%; }
}

/* Blob overlay edge-fade mask */
.luke-overlay__blobWrap {
  -webkit-mask-image: radial-gradient(
    ellipse 88% 88% at 50% 50%,
    black 55%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 88% 88% at 50% 50%,
    black 55%,
    transparent 100%
  );
}

/* Close button sits inside the blob frame */
.luke-overlay__close {
  top: 12px;
  right: 12px;
  z-index: 40;
}

/* =============================================================================
   MOBILE PERFORMANCE  (reduce GPU-expensive effects on touch/low-power devices)
   ============================================================================= */

/* Touch devices: drop the always-on backdrop blur on the trigger tabs.
   A solid semi-transparent bg is visually equivalent and free to composite. */
@media (hover: none) and (pointer: coarse) {
  .side-menu-trigger {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(0, 0, 0, 0.65);
  }

  .side-menu {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mission-overlay__card {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
  }

  .luke-overlay__backdrop,
  .mission-overlay__backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}
