/* Landing page over the live sky. Same tokens as the app (css/app.css): dark, calm, one amber accent,
   system fonts, no glow. States on <html>: .js (scripts run), .home-on (landing page up),
   .home-off (app up), .home-leaving (fading out after Launch). Without scripts the page shows as is. */

/* ——— states ——— */
.home {
  position: fixed; inset: 0; z-index: 40;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  transition: opacity 0.3s ease;
}
html.home-off:not(.home-leaving) .home { display: none; }
html.home-leaving .home { opacity: 0; pointer-events: none; }
html.home-on .boot, html:not(.js) .boot { display: none; }
html.home-on .ui, html.home-on .label-layer,
html:not(.js) .ui, html:not(.js) .label-layer { visibility: hidden; opacity: 0; }
.ui { transition: opacity 0.3s ease; }
html:not(.js) .home-launch, html:not(.js) .home-status, html:not(.js) .home-scroll { display: none; }
@media (prefers-reduced-motion: reduce) {
  .home, .ui { transition: none; }
}

/* ——— top bar ——— */
.home-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px;
  padding: calc(14px + var(--safe-t)) calc(20px + var(--safe-r)) 10px calc(20px + var(--safe-l));
  background: linear-gradient(to bottom, rgba(5, 7, 11, 0.72), rgba(5, 7, 11, 0));
}
.home-brand {
  font-weight: 600; letter-spacing: 0.04em; text-decoration: none; color: var(--text);
  padding: 8px 0; margin-right: auto;
}
.home-nav ul, .home-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.home-nav a {
  display: inline-block; padding: 8px 10px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.home-nav a:hover { color: var(--text); background: var(--hover); }

/* ——— hero ——— */
.home-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(88px + var(--safe-t)) calc(20px + var(--safe-r)) 64px calc(20px + var(--safe-l));
}
.home-hero::before {
  /* Readability over the sky: a soft dark wash behind the words, not a box. */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 22% 55%, rgba(5, 7, 11, 0.62), rgba(5, 7, 11, 0) 70%),
    linear-gradient(to top, rgba(5, 7, 11, 0.7), rgba(5, 7, 11, 0) 45%);
}
.home-hero-inner { width: 100%; max-width: 1080px; margin: 0 auto; }
.home-hero-inner > * { max-width: 560px; }
.home-title {
  margin: 0 0 6px;
  font-size: clamp(38px, 9vw, 68px); line-height: 1.04; font-weight: 600; letter-spacing: 0.01em;
}
.home-tagline { margin: 0 0 16px; color: var(--accent); font-size: clamp(17px, 3.6vw, 21px); font-weight: 500; }
.home-lead { margin: 0 0 26px; color: var(--text); font-size: clamp(16px, 2.4vw, 18px); line-height: 1.5; opacity: 0.92; }
.home-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.home-launch {
  min-height: 56px; padding: 0 30px; border-radius: 14px;
  font-size: 18px; font-weight: 650;
}
.home-launch.is-waiting { cursor: progress; }
.home-launch:focus-visible { outline-offset: 3px; }
.home-returning { margin: 0; color: var(--muted); font-size: 14px; }
.home-status { display: flex; align-items: center; gap: 10px; min-height: 18px; color: var(--faint); font-size: 13px; }
.home-progress { width: 120px; height: 2px; background: var(--line); border-radius: 1px; overflow: hidden; flex: none; }
.home-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.home-status.is-done { visibility: hidden; }
.home-launch.is-waiting ~ .home-status .home-status-text { color: var(--text); }
.home-error { max-width: 440px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.home-error-msg { color: var(--text); }
.home-error-detail { color: var(--faint); font-size: 12px; word-break: break-word; }
.home-error .btn { margin-top: 4px; }
.home-noscript { margin: 0; color: var(--muted); font-size: 14px; max-width: 440px; }
.home-scroll {
  position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap;
}
.home-scroll:hover { color: var(--text); }

/* ——— below the hero: content on a dark backing ——— */
.home-below {
  background: linear-gradient(to bottom, rgba(5, 7, 11, 0.55), rgba(5, 7, 11, 0.86) 240px);
  padding: 8px 0 24px;
}
.home-band, .home-footer {
  width: 100%; max-width: 1080px; margin: 0 auto;
  padding-left: calc(20px + var(--safe-l)); padding-right: calc(20px + var(--safe-r));
}
.home-band { padding-top: 28px; padding-bottom: 28px; }
.home-h2 { margin: 0 0 14px; font-size: 22px; font-weight: 600; }
.home-muted { color: var(--muted); }

/* Today's destination */
.home-today-card {
  display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.home-today-photo .photo { margin: 0; }
.home-today-photo .photo-frame { border-radius: 0; aspect-ratio: 16 / 9; }
.home-today-photo .photo-credit { padding: 0 16px; }
.home-today-text { padding: 16px 18px 20px; min-width: 0; }
.home-today-name { margin: 0 0 2px; font-size: 24px; font-weight: 600; line-height: 1.2; }
.home-today-sub { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.home-today-why { margin: 0 0 16px; font-size: 16px; line-height: 1.5; }
.home-today-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.home-today-actions .btn { text-decoration: none; }
@media (min-width: 760px) {
  .home-today-card { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
  .home-today-photo .photo-frame { aspect-ratio: 4 / 3; }
  .home-today-photo .photo-credit { padding: 0 14px 12px; }
  .home-today-text { padding: 24px 28px; }
  .home-today-name { font-size: 28px; }
}

/* The other builder's sections live in #home-sections (css/home-sections.css); keep them in the column. */
.home-sections {
  width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 8px calc(20px + var(--safe-r)) 32px calc(20px + var(--safe-l));
}
.home-sections:empty { display: none; }

/* ——— footer ——— */
.home-footer {
  padding-top: 24px;
  padding-bottom: calc(28px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.9);
  max-width: none;
}
.home-footer > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.home-footer a { display: inline-block; padding: 6px 8px; color: var(--muted); font-size: 14px; }
.home-footer a:hover { color: var(--text); }
.home-footer p { margin-top: 12px; font-size: 13px; padding: 0 8px; }

/* Wide screens: the hero words sit left of centre so the docked world stays in view. */
@media (min-width: 1100px) {
  .home-top { padding-left: calc(40px + var(--safe-l)); padding-right: calc(40px + var(--safe-r)); }
  .home-hero { padding-left: calc(max(40px, 5vw) + var(--safe-l)); }
  .home-hero-inner { max-width: none; margin: 0; }
  .home-hero-inner > * { max-width: 470px; }
  .home-title { font-size: 60px; }
}
@media (max-width: 520px) {
  .home-top { gap: 0 8px; padding-top: calc(8px + var(--safe-t)); }
  .home-nav a { padding: 6px 8px; font-size: 13px; }
  .home-hero { justify-content: flex-end; padding-top: calc(112px + var(--safe-t)); padding-bottom: calc(56px + var(--safe-b)); }
  .home-launch { width: 100%; }
  .home-cta { align-items: stretch; }
}
