:root {
  --navy-950: #031930;
  --navy-800: #223a59;
  --blue-500: #3684db;
  --slate-500: #758ba5;
  --surface: #ffffff;
  --text: #0a2038;
  --radius-lg: 22px;
  --footer-h: clamp(27px, 3.4vh, 36px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

html,
body {
  width: 100%;
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--text);
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
a {
  font: inherit;
}

.hub-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  display: flex;
  overflow: hidden;
  background: var(--surface);
}

/* ---------------------------------------------------------------- left / video */

.visual {
  position: relative;
  height: 100%;
  max-height: 100dvh;
  aspect-ratio: 9 / 16;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--navy-950);
}

.visual__poster,
.visual__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual__video {
  opacity: 0;
  transition: opacity 500ms ease;
}

.visual__video.is-ready {
  opacity: 1;
}

.visual__shade {
  position: absolute;
  inset: 0;
  background: rgba(3, 25, 48, 0.08);
  pointer-events: none;
}

.canvas-mark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.4vh, 16px);
  padding: 24px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.canvas-mark__logo {
  display: block;
  width: clamp(92px, 21%, 132px);
  height: auto;
  filter: drop-shadow(0 5px 18px rgba(0, 0, 0, 0.34));
}

.canvas-mark__tagline {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: clamp(0.9rem, 1.1vw, 1.12rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
}

/* ---------------------------------------------------------------- right / launcher */

.launcher {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: 100dvh;
  display: flex;
  align-items: flex-start;
  overflow: hidden !important;
  padding: clamp(28px, 12vh, 110px) clamp(22px, 4.4vw, 66px) calc(var(--footer-h) + clamp(18px, 3vh, 34px));
  background: var(--surface);
}

.launcher__ship {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: auto;
  top: -18%;
  right: 0;
  bottom: auto;
  left: auto;
  max-width: none;
  max-height: none;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

.launcher__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  font-size: clamp(0.6rem, 0.68vw, 0.74rem);
  font-weight: 700;
  letter-spacing: 0.18em;
}

.launcher__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.access__title {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.access__subtitle {
  margin: clamp(14px, 2.2vh, 26px) 0 0;
  color: #16232f;
  font-size: clamp(0.92rem, 1.35vw, 1.15rem);
  font-weight: 500;
  line-height: 1.35;
}

.apps {
  width: min(100%, 840px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 72px);
  margin: clamp(18px, 3vh, 34px) auto 0;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(122px, 21vh, 178px);
  padding: clamp(18px, 2vh, 26px) clamp(16px, 1.6vw, 28px) clamp(32px, 3.6vh, 42px);
  border-radius: clamp(15px, 1.45vw, 22px);
  overflow: hidden;
  background-image:
    linear-gradient(var(--card-overlay-top), var(--card-overlay-bottom)),
    var(--card-artwork);
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  transition: transform 180ms ease, box-shadow 220ms ease;
}

.app-card__title {
  font-size: clamp(1rem, 1.85vw, 1.68rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.app-card__brand {
  color: #fff;
}

.app-card[data-app-status="online"],
.app-card[data-app-status="available"] {
  text-decoration: none;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .app-card:hover {
    transform: translateY(-2px);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--card-glow) 76%, transparent),
      0 0 18px color-mix(in srgb, var(--card-glow) 46%, transparent),
      0 0 42px color-mix(in srgb, var(--card-glow) 30%, transparent),
      inset 0 0 18px color-mix(in srgb, var(--card-glow) 14%, transparent);
  }
}

.app-card[data-app-status="online"]:focus-visible,
.app-card[data-app-status="available"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--card-glow) 62%, transparent);
  outline-offset: 3px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--card-glow) 76%, transparent),
    0 0 18px color-mix(in srgb, var(--card-glow) 46%, transparent),
    0 0 42px color-mix(in srgb, var(--card-glow) 30%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--card-glow) 14%, transparent);
}

.app-card[aria-disabled="true"] {
  cursor: default;
  user-select: none;
}

.app-card__accent {
  color: var(--card-accent);
}

.app-card__title {
  text-shadow: 0 1px 10px rgba(3, 25, 48, 0.4);
}

.app-card__desc {
  margin-top: 0.5em;
  font-size: clamp(0.66rem, 0.8vw, 0.84rem);
  font-weight: 500;
  line-height: 1.3;
  opacity: 0.96;
}

.app-card__version {
  position: absolute;
  left: clamp(14px, 1.4vw, 22px);
  bottom: clamp(10px, 1.1vh, 16px);
  font-size: clamp(0.54rem, 0.6vw, 0.68rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.92;
}

.app-card__desc {
  text-shadow: 0 1px 8px rgba(3, 25, 48, 0.4);
}

.app-card__badge {
  position: absolute;
  top: clamp(9px, 1.1vh, 14px);
  right: clamp(10px, 1.1vw, 16px);
  padding: 0.32em 0.66em;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(3, 25, 48, 0.55);
  color: #ffffff;
  font-size: clamp(0.5rem, 0.56vw, 0.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.app-card__action {
  position: absolute;
  right: clamp(12px, 1.3vw, 20px);
  bottom: clamp(9px, 1.1vh, 15px);
  width: clamp(26px, 2.3vw, 34px);
  height: clamp(26px, 2.3vw, 34px);
  display: grid;
  place-items: center;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  z-index: 2;
}

.app-card__action svg {
  display: block;
  width: 52%;
  height: 52%;
}

.app-card[data-app-status="online"] .app-card__action,
.app-card[data-app-status="available"] .app-card__action {
  color: var(--card-accent);
}

.app-card[aria-disabled="true"] .app-card__action {
  color: rgba(255, 255, 255, 0.82);
}

/* ---------------------------------------------------------------- constrained-height fallback */

/*
 * Keep the canonical one-screen composition on normal viewports.
 * When browser zoom or a short landscape viewport leaves too little vertical
 * space, allow the document to scroll instead of clipping interactive content.
 */
@media (min-width: 721px) and (max-height: 700px) {
  html {
    height: auto;
    overflow-y: auto;
  }

  body {
    min-height: 700px;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  .hub-shell {
    height: 700px;
    min-height: 700px;
    max-height: none;
  }

  .visual,
  .launcher {
    height: 700px;
    max-height: none;
  }

  .launcher {
    padding-top: clamp(28px, 8vh, 56px);
  }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) and (min-height: 641px) {
  .access__title {
    font-size: clamp(2rem, 5.4vw, 3rem);
  }
}

@media (max-width: 720px) {
  .hub-shell {
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(180px, 34dvh) minmax(0, 1fr);
    overflow: hidden;
  }

  .visual {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .visual__video {
    display: none;
  }

  .visual__poster {
    object-position: center 47%;
  }

  .canvas-mark {
    gap: 8px;
    padding: 16px;
  }

  .canvas-mark__logo {
    width: clamp(72px, 18vw, 92px);
  }

  .canvas-mark__tagline {
    font-size: clamp(0.8rem, 3.4vw, 0.95rem);
  }

  .launcher {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    padding: 18px 18px calc(var(--footer-h) + 14px);
  }

  .launcher__footer {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
  }

  .launcher__inner {
    width: 100%;
    max-height: 100%;
  }

  .access__title {
    font-size: clamp(1.5rem, 7vw, 2.1rem);
  }

  .access__subtitle {
    margin-top: 8px;
    font-size: 0.82rem;
  }

  .apps {
    gap: 9px;
    margin-top: 14px;
  }

  .app-card {
    min-height: 108px;
    padding: 14px 12px 26px;
    border-radius: 16px;
  }

  .app-card__title {
    font-size: clamp(0.82rem, 3.6vw, 1rem);
  }

  .app-card__desc {
    font-size: 0.62rem;
    line-height: 1.25;
  }

  .app-card__version {
    left: 10px;
    bottom: 8px;
    font-size: 0.52rem;
  }

  .app-card__badge {
    top: 7px;
    right: 8px;
    padding: 0.28em 0.56em;
    font-size: 0.48rem;
  }

  .app-card__action {
    right: 9px;
    bottom: 7px;
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 720px) and (max-height: 620px) {
  .hub-shell {
    grid-template-rows: minmax(150px, 30dvh) minmax(0, 1fr);
  }

  .app-card__desc {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .visual__video {
    display: none;
  }

  .launcher__ship {
    opacity: 0.05;
  }
}


/* Very short mobile landscape: preserve the layout, but never clip the launcher. */
@media (max-width: 720px) and (max-height: 480px) {
  html {
    height: auto;
    overflow-y: auto;
  }

  body {
    min-height: 560px;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  .hub-shell {
    height: 560px;
    min-height: 560px;
    max-height: none;
    grid-template-rows: 150px minmax(0, 1fr);
  }

  .visual,
  .launcher {
    max-height: none;
  }
}


/* ---------------------------------------------------------------- 404 */

.not-found-page {
  min-height: 100dvh;
  overflow: auto;
  background:
    radial-gradient(circle at 80% 20%, rgba(54, 132, 219, 0.08), transparent 34rem),
    #ffffff;
}

.not-found {
  min-height: 100dvh;
  width: min(100% - 40px, 620px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 0;
}

.not-found__mark {
  width: 74px;
  height: 74px;
  object-fit: contain;
  margin-bottom: 28px;
}

.not-found__kicker {
  margin: 0 0 8px;
  color: var(--blue-500);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.not-found h1 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(4.8rem, 16vw, 8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.not-found__copy {
  margin: 24px 0 0;
  color: var(--navy-800);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.6;
}

.not-found__action {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 28px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--navy-950);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.not-found__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(3, 25, 48, 0.18);
}

.not-found__action:focus-visible {
  outline: 3px solid rgba(54, 132, 219, 0.4);
  outline-offset: 3px;
}
