/* ============================================================
   RB Launch Page
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
*::selection { background: #B4E7F8; }

@font-face {
  font-family: 'Suisse Intl';
  src: url('../fonts/SuisseIntl-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Suisse Intl';
  src: url('../fonts/SuisseIntl-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #000;
  --muted: #b4b4b4;
  --button-bg: #f4f4f4;
  --button-bg-hover: #eeeeee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #fff;
    --muted: rgba(255, 255, 255, 0.42);
    --button-bg: #333;
    --button-bg-hover: #3d3d3d;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --fg: #000;
  --muted: #b4b4b4;
  --button-bg: #f4f4f4;
  --button-bg-hover: #eeeeee;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.42);
  --button-bg: #333;
  --button-bg-hover: #3d3d3d;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Suisse Intl', system-ui, -apple-system, sans-serif;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.launch-page {
  position: relative;
  min-height: 100svh;
  padding: 0 20px;
  background: var(--bg);
  overflow: hidden;
}

.cube-section {
  position: fixed;
  top: 45svh;
  left: 50%;
  z-index: 2;
  width: 169.4px;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
}

#launchCube {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.about-link {
  position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%);
  z-index: 2001; opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.about-link.visible { opacity: 1; pointer-events: auto; }
.about-link button {
  font-size: 17px; font-weight: 400; height: 40px; padding: 0 16px; width: 85px;
  color: var(--fg); background: var(--button-bg); backdrop-filter: blur(11.55px);
  -webkit-backdrop-filter: blur(11.55px); display: inline-flex; align-items: center;
  justify-content: center; border-radius: 100px; transition: all 0.3s ease;
  position: relative; overflow: hidden; border: none; cursor: pointer;
}
.about-link button:hover { background: var(--button-bg-hover); }
.about-link button .about-text { position: relative; top: 1px; transition: opacity 0.3s ease, transform 0.3s ease; white-space: nowrap; }
.about-link button .close-icon { position: absolute; width: 24px; height: 24px; opacity: 0; transition: opacity 0.3s ease; }
.about-link button .close-icon::before,
.about-link button .close-icon::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 2px; background: currentColor; }
.about-link button .close-icon::before { transform: translate(-50%,-50%) rotate(45deg); }
.about-link button .close-icon::after  { transform: translate(-50%,-50%) rotate(-45deg); }
.about-link.active button { padding: 0; width: 40px; }
.about-link.active button .about-text { opacity: 0; transform: scale(0.8); }
.about-link.active button .close-icon { opacity: 1; }
.about-link.hidden-by-section {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(20px);
}

/* ============================================================
   ABOUT OVERLAY
============================================================ */
.about-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(255,255,255,0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
  visibility: hidden; opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4,0,0.2,1) 0.2s,
              background 0.8s cubic-bezier(0.4,0,0.2,1),
              backdrop-filter 0.8s cubic-bezier(0.4,0,0.2,1),
              visibility 0s 0.8s;
}
.about-overlay.active {
  visibility: visible; opacity: 1;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1), background 0.4s cubic-bezier(0.4,0,0.2,1),
              backdrop-filter 0.4s cubic-bezier(0.4,0,0.2,1), visibility 0s 0s;
}
.about-scroll-area {
  position: absolute; inset: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.about-overlay-fade {
  position: sticky; top: 0; z-index: 9;
  width: 100%; height: 160px; flex-shrink: 0; align-self: stretch;
  background: transparent;
  pointer-events: none;
}
.about-content {padding: 8px 0 120px;text-align: center;width: 316px;max-width: calc(100% - 32px);margin: auto;}
.about-content p {
  font-size: 20px; line-height: 28px; color: var(--fg); margin: 0 auto 40px;
  font-weight: 400; letter-spacing: -0.033px; text-align: center;
  width: 100%; max-width: 100%;
  transform: translateY(30px); opacity: 0;
  transition: transform 0.8s cubic-bezier(0.4,0,0.2,1), opacity 0.8s cubic-bezier(0.4,0,0.2,1);
}
.about-content p:last-child { margin-bottom: 0; }
.about-content p a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.about-content p a:hover { opacity: 0.6; }
.about-overlay.active .about-content p:nth-child(1) { transform: translateY(0); opacity: 1; transition-delay: 0.15s; }
.about-overlay.active .about-content p:nth-child(2) { transform: translateY(0); opacity: 1; transition-delay: 0.25s; }
.about-overlay.active .about-content p:nth-child(3) { transform: translateY(0); opacity: 1; transition-delay: 0.35s; }
.about-overlay.active .about-content p:nth-child(4) { transform: translateY(0); opacity: 1; transition-delay: 0.45s; }
.about-overlay:not(.active) .about-content p:nth-child(1) { transition-delay: 0.20s; }
.about-overlay:not(.active) .about-content p:nth-child(2) { transition-delay: 0.10s; }
.about-overlay:not(.active) .about-content p:nth-child(3) { transition-delay: 0.05s; }
.about-overlay:not(.active) .about-content p:nth-child(4) { transition-delay: 0s; }


.about-content p a { font-weight: 500; text-decoration: none; }
.about-content sup { font-size: 0.55em; vertical-align: super; line-height: 0; }

/* Fade theme colors without changing the cube material. */
body,
.launch-page {
  transition: background-color 0.65s ease, color 0.65s ease;
}
.about-content p,
.about-content p a {
  transition: color 0.65s ease, transform 0.8s cubic-bezier(0.4,0,0.2,1), opacity 0.8s cubic-bezier(0.4,0,0.2,1);
}
.about-link button {
  transition: background-color 0.65s ease, color 0.65s ease, width 0.3s ease, padding 0.3s ease;
}
.about-link button .close-icon::before,
.about-link button .close-icon::after {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  body, .launch-page, .about-content p, .about-content p a,
  .about-link button, .about-link button .close-icon::before,
  .about-link button .close-icon::after {
    transition-duration: 0.01ms;
  }
}

/* Keep controls inside the visible viewport as mobile browser chrome changes. */
:root {
  --about-bottom: max(16px, env(safe-area-inset-bottom));
}
.about-link {
  bottom: auto;
  top: calc(100dvh - var(--about-bottom) - 40px);
}
.about-overlay {
  bottom: auto;
  height: 100dvh;
}
.about-scroll-area {
  top: max(24px, env(safe-area-inset-top));
  bottom: calc(var(--about-bottom) + 40px + 24px);
  padding: 16px 0;
}
.about-overlay-fade { display: none; }
.about-content {
  flex: 0 0 auto;
  padding: 0;
  margin: auto;
}

.about-founder { white-space: nowrap; }
@media (min-width: 721px) {
  :root { --about-bottom: 52px; }
}
