/**
 * Mobile UX chrome for getviveka.in landing + app shell.
 * Design tokens per mobile UX spec — max-width 767px.
 */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600&display=swap");

:root {
  --mob-bg: #0c0d0f;
  --mob-surface: #111316;
  --mob-border: #1e2126;
  --mob-border2: #252a30;
  --mob-text: #e8e9ea;
  --mob-muted: #6b7280;
  --mob-gold: #c9a84c;
  --mob-gold2: #e8c97a;
  --mob-green: #4ade80;
  --mob-blue: #60a5fa;
  --mob-top-h: 52px;
  --mob-nav-h: 56px;
}

/* ─── Chrome visibility ─────────────────────────────────────────── */
.mobile-top-bar,
.mobile-bottom-nav,
.mobile-sheet-root,
.mobile-learn-more-wrap {
  display: none;
}

@media (max-width: 767px) {
  body.mobile-ux-active {
    padding-top: var(--mob-top-h);
    padding-bottom: calc(var(--mob-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-ux-active .hero {
    padding-top: 40px;
  }

  body.mobile-ux-active nav.top {
    display: none;
  }

  .mobile-top-bar,
  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-learn-more-wrap {
    display: block;
  }

  /* Hide heavy sections unless expanded */
  body.mobile-ux-active:not(.mobile-expanded) #how,
  body.mobile-ux-active:not(.mobile-expanded) #manifesto-pin,
  body.mobile-ux-active:not(.mobile-expanded) .hero-portals {
    display: none !important;
  }

  .lede-desktop {
    display: none !important;
  }

  .lede-mobile {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .lede-mobile {
    display: none !important;
  }

  .lede-desktop {
    display: block;
  }
}

/* ─── Top bar ───────────────────────────────────────────────────── */
.mobile-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--mob-top-h);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(12, 13, 15, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mob-border2);
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
}

.mobile-top-bar__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mobile-top-bar__name {
  color: var(--mob-gold2);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.mobile-top-bar__deva {
  color: var(--mob-muted);
  font-size: 11px;
}

.mobile-top-bar__cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--mob-gold);
  background: rgba(201, 168, 76, 0.1);
  color: var(--mob-gold2);
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-top-bar__cta:hover {
  background: rgba(201, 168, 76, 0.18);
  color: var(--mob-text);
}

/* ─── Bottom nav ────────────────────────────────────────────────── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--mob-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(12, 13, 15, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--mob-border2);
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
}

.mobile-bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--mob-muted);
  padding: 8px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
}

.mobile-bottom-nav__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--mob-gold2);
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-bottom-nav__item--active {
  color: var(--mob-gold2);
}

.mobile-bottom-nav__item--active::before {
  opacity: 1;
  transform: scaleX(1);
}

.mobile-bottom-nav__icon {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.mobile-bottom-nav__item--active .mobile-bottom-nav__icon {
  transform: scale(1.15);
}

.mobile-bottom-nav__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Action sheets ─────────────────────────────────────────────── */
.mobile-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: block;
  pointer-events: none;
}

.mobile-sheet-root.is-open {
  pointer-events: auto;
}

.mobile-sheet-overlay {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.28s ease;
  cursor: pointer;
}

.mobile-sheet-root.is-open .mobile-sheet-overlay {
  opacity: 1;
}

.mobile-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  background: var(--mob-surface);
  border: 1px solid var(--mob-border2);
  border-radius: 12px;
  padding: 16px 0 0;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1),
    opacity 0.25s ease;
  font-family: Inter, "Geist", sans-serif;
  color: var(--mob-text);
  max-height: min(70vh, 480px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mobile-sheet-root.is-open .mobile-sheet {
  transform: translateY(0);
  opacity: 1;
}

.mobile-sheet__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--mob-muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.mobile-sheet__body {
  overflow-y: auto;
  padding: 8px 16px 0;
  flex: 1;
}

.mobile-sheet__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.mobile-sheet__row--border {
  border-bottom: 1px solid var(--mob-border);
}

.mobile-sheet__row-main {
  flex: 1;
  min-width: 0;
}

.mobile-sheet__row-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--mob-text);
  line-height: 1.3;
}

.mobile-sheet__row-desc {
  margin-top: 4px;
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--mob-muted);
  line-height: 1.4;
}

.mobile-sheet__row-price {
  flex-shrink: 0;
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--mob-gold2);
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
  padding-top: 1px;
}

.mobile-sheet__cta {
  display: block;
  margin: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  text-align: center;
  border: 1px solid var(--mob-gold);
  background: rgba(201, 168, 76, 0.1);
  color: var(--mob-gold2);
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.mobile-sheet__cta:hover {
  background: rgba(201, 168, 76, 0.18);
}

/* Modes sheet actions */
.mobile-sheet__action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
  border-radius: 6px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.mobile-sheet__action--border {
  border-bottom: 1px solid var(--mob-border);
}

.mobile-sheet__action:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mobile-sheet__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
}

.mobile-sheet__icon--gold {
  background: rgba(201, 168, 76, 0.12);
}

.mobile-sheet__icon--blue {
  background: rgba(96, 165, 250, 0.12);
}

.mobile-sheet__icon--green {
  background: rgba(74, 222, 128, 0.12);
}

.mobile-sheet__action-copy {
  flex: 1;
  min-width: 0;
}

.mobile-sheet__action-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.mobile-sheet__action-desc {
  display: block;
  margin-top: 3px;
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--mob-muted);
  line-height: 1.4;
}

.mobile-sheet__badge {
  flex-shrink: 0;
  padding: 4px 8px;
  background: var(--mob-border2);
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--mob-muted);
  border-radius: 4px;
}

/* Learn more */
.mobile-learn-more-wrap {
  text-align: center;
  padding: 32px 24px 16px;
}

.mobile-learn-more-btn {
  border: none;
  background: transparent;
  color: var(--mob-gold2);
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 8px 16px;
}

/* Next.js layout wrapper */
.mobile-chrome-content {
  min-height: 100vh;
}

@media (min-width: 768px) {
  .mobile-chrome-content {
    padding-top: 0;
    padding-bottom: 0;
  }
}
