/**
 * Nbulai homepage — responsive layout & liquid-glass floating footer
 */

:root {
  --page-max: 1400px;
  --celestial-max: 1100px;
  --nav-max: min(100vw - 20px, 1280px);
  --footer-float-z: 99990;
  --footer-h: clamp(28px, 4vh, 36px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --stack-footer: calc(var(--footer-h) + var(--safe-bottom) + 8px);
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-height: 100%;
  min-height: 100dvh;
}

/* Allow vertical scroll when stacked UI exceeds viewport */
@media (max-width: 900px), (max-height: 700px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
  }
}

/* —— Hero content —— */
.content {
  top: clamp(36%, 44vh, 50%);
  max-width: min(92vw, 720px);
  width: 100%;
  padding: 0 clamp(12px, 3vw, 24px);
  box-sizing: border-box;
}

.content h1 {
  font-size: clamp(1.15rem, 3.8vw + 0.5rem, 2.35rem);
  line-height: 1.2;
  margin: 0 0 0.65em;
}

.content p {
  font-size: clamp(0.78rem, 1.6vw + 0.35rem, 1.05rem);
  line-height: 1.55;
  margin: 0.45em 0;
}

/* Top nav → assets/main_page_covers/nav-menu.css */

/* —— Footer credit — transparent, text only —— */
.nbulai-credit-footer {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(clamp(6px, 1.2vw, 10px) + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(96vw, 720px);
  max-width: calc(100vw - 20px);
  margin: 0;
  padding: 0 clamp(10px, 2vw, 14px);
  z-index: var(--footer-float-z);
  border: none !important;
  outline: none;
  border-radius: 0;
  text-align: center;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

.nbulai-credit-line {
  margin: 0;
  font-size: clamp(0.52rem, 1.4vw, 0.62rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.42);
}

.nbulai-credit-footer::before {
  display: none;
}

.nbulai-credit-footer a {
  color: rgba(94, 238, 255, 0.62);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nbulai-credit-footer a:hover {
  color: rgba(94, 238, 255, 0.9);
}

.nbulai-credit-footer:hover {
  transform: translateX(-50%);
  box-shadow: none !important;
  background: transparent !important;
}

/* Celestial timeline — full-width band above footer */
.celestial-timeline {
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  transform: none;
  bottom: var(--stack-footer);
  padding: 0 clamp(6px, 2vw, 16px) 4px;
  box-sizing: border-box;
}

.cooking-toast {
  bottom: calc(var(--stack-footer) + 12px);
  max-width: min(92vw, 420px);
  font-size: clamp(0.7rem, 2vw, 0.75rem);
}

/* —— Large desktop / ultra-wide —— */
@media (min-width: 1400px) {
  :root {
    --celestial-max: 1200px;
    --page-max: 1600px;
  }

  .content {
    max-width: min(92vw, 800px);
  }

  .celestial-timeline {
    width: 100%;
    max-width: none;
  }
}

@media (min-width: 1800px) {
  #cosmic-cover .cosmic-hero__planet--ringed {
    transform: scale(1.08);
  }

  #cosmic-cover .cosmic-hero__black-hole {
    transform: scale(1.05);
  }
}

/* —— Tablet —— */
@media (max-width: 1024px) {
  .content {
    top: clamp(34%, 40vh, 46%);
    max-width: min(94vw, 640px);
  }

  .celestial-timeline {
    width: 100%;
  }

  .timeline-readouts {
    gap: 8px 12px;
  }
}


/* —— Phone portrait —— */
@media (max-width: 768px) {
  :root {
    --celestial-max: 100%;
    --footer-h: clamp(36px, 7vh, 48px);
  }

  .content {
    top: clamp(32%, 38vh, 42%);
    padding-top: clamp(52px, 14vw, 72px);
  }

  .celestial-timeline {
    width: 100%;
    transform: none;
    padding: 0 6px 4px;
  }

  .celestial-sky-svg,
  .celestial-path-svg {
    max-height: min(150px, 20vh);
  }

  .celestial-controls-actions {
    gap: 8px;
  }

  .celestial-btn {
    padding: 0;
  }

  .marker-tag-svg {
    font-size: 5px !important;
  }

  .altitude-axis {
    width: 20px;
    font-size: 4px;
  }

  .horizon-label {
    font-size: 4px;
  }

  .timeline-readouts {
    gap: 6px;
  }

  .readout-row {
    gap: 5px 7px;
  }

  .celestial-readout {
    font-size: 6px;
    white-space: normal;
    text-align: center;
    max-width: 100%;
  }

  .celestial-readout[data-chip-tier="detail"] {
    display: none;
  }

  .celestial-readout.readout-group--body[data-chip-tier="detail"] {
    display: none;
  }

  .nbulai-credit-footer {
    width: min(94vw, 520px);
    padding: 0 10px;
  }

  .nbulai-credit-line {
    font-size: 0.5rem;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 480px) {
  .content {
    top: clamp(30%, 36vh, 40%);
  }

  .celestial-timeline {
    width: 94vw;
    transform: translateX(-50%) scale(0.95);
  }

  .timeline-point--noon {
    display: none;
  }

  .timeline-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .timeline-title {
    font-size: 8px;
  }
}

/* —— Landscape phone / short viewport —— */
@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --footer-h: 38px;
  }

  .content {
    top: 50%;
    transform: translate(-50%, -52%);
    max-width: min(70vw, 560px);
  }

  .content h1 {
    font-size: clamp(1rem, 4vh, 1.35rem);
    margin-bottom: 0.35em;
  }

  .content p {
    font-size: 0.75rem;
    margin: 0.25em 0;
  }

  .celestial-timeline {
    bottom: calc(var(--stack-footer) - 4px);
    transform: translateX(-50%) scale(0.88);
    transform-origin: center bottom;
  }

  .timeline-sky-stage {
    height: 72px;
    padding-left: 18px;
    margin-bottom: 4px;
  }

  .marker-tag,
  .horizon-label {
    display: none;
  }

  .timeline-readouts {
    gap: 4px 8px;
  }

  .celestial-readout {
    font-size: 6px;
  }

  .nbulai-credit-footer {
    padding: 8px 12px;
    font-size: 0.52rem;
  }

  .cooking-toast {
    bottom: calc(var(--stack-footer) + 8px);
    padding: 8px 14px;
  }
}

/* —— Tablet landscape —— */
@media (orientation: landscape) and (min-width: 768px) and (max-height: 700px) {
  .content {
    top: 48%;
    max-width: min(60vw, 680px);
  }

  .celestial-timeline {
    width: min(900px, 88vw);
    transform: translateX(-50%) scale(0.96);
  }
}

/* —— Portrait tablets —— */
@media (orientation: portrait) and (min-width: 600px) and (max-width: 1024px) {
  .content {
    top: 40%;
  }

  .celestial-timeline {
    bottom: var(--stack-footer);
  }
}

/* Modals above floating footer */
.coming-soon-modal {
  z-index: 100002;
}

.cooking-toast {
  z-index: 100001;
}

@media (prefers-reduced-motion: reduce) {
  .nbulai-credit-footer:hover {
    transform: translateX(-50%);
  }

  .celestial-timeline {
    transform: translateX(-50%) !important;
  }
}
