/* The real app on the homepage: the map screen (#mapped) and the answer in #check.
   Still frame (no JS, reduced motion): the last moment of the day, the patterns beneath it. */

#mapped { background: var(--void); }
#mapped .frame {
  display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); align-items: center;
  gap: clamp(28px, 3vw, 56px); max-width: 1560px; margin: 0 auto; padding: 120px var(--gutter);
}
.motion .m-pin { height: 380vh; }
.motion #mapped .frame { position: sticky; top: 0; height: 100svh; min-height: 640px; padding-top: 0; padding-bottom: 0; }

.m-copy .big { font-size: clamp(44px, 4.3vw, 76px); }
.m-copy .beat-line { margin: 22px 0 0; }
.m-clock { margin: 34px 0 0; color: var(--cyan); font: 500 clamp(44px, 4.6vw, 72px)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
html:not(.motion) .m-clock { display: none; }

.m-app { --cap: 32px; position: relative; margin: 0; }
.m-win {
  position: relative; aspect-ratio: 1400 / 875; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: #0A0D16;
  box-shadow: 0 0 0 1px rgba(8, 11, 19, .6), 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 120px -40px rgba(69, 217, 244, .18);
}
.m-f { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.m-f.on { opacity: 1; }
.m-f img { display: block; width: 100%; height: 100%; object-fit: cover; }
#mapped.dim .m-f.on { opacity: .28; }

.m-spots {
  position: absolute; left: 50%; bottom: calc(var(--cap) + 6%); width: min(78%, 760px); height: auto;
  border-radius: 10px; transform: translate(-50%, 24px); opacity: 0;
  box-shadow: 0 0 0 1px var(--gold), 0 24px 60px -20px rgba(0, 0, 0, .95);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
#mapped.dim .m-spots { opacity: 1; transform: translate(-50%, 0); }

/* still frame: the full day, then the patterns under the map */
html:not(.motion) .m-win { overflow: visible; aspect-ratio: auto; border: 0; background: none; box-shadow: none; }
html:not(.motion) .m-f { display: none; position: static; }
html:not(.motion) .m-f.on { display: block; opacity: 1; }
html:not(.motion) .m-f.on img { height: auto; border: 1px solid var(--line); border-radius: 14px; }
html:not(.motion) .m-spots { position: static; display: block; width: 100%; margin-top: 16px; transform: none; opacity: 1; }

.m-app figcaption { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; }
.m-app figcaption .caption { margin: 0; }

.m-spots-text { display: none; }
.m-spots-h { margin: 0 0 6px; color: var(--muted); font: 500 12px/1.3 var(--sans); }
.m-spots-text ul { margin: 0; padding: 0; list-style: none; }
.m-spots-text li { padding: 7px 0; border-top: 1px solid var(--line); color: var(--ink); font: 500 14px/1.3 var(--sans); }
.m-spots-text li:first-child { border-top: 0; }
.m-spots-text li span { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }

@media (max-width: 1023px) {
  #mapped .frame { grid-template-columns: 1fr; gap: 22px; padding: 96px var(--gutter); align-content: center; }
  .m-copy .beat-line { max-width: 34em; }
}
@media (max-width: 760px) {
  .m-copy .big { font-size: clamp(36px, 10vw, 44px); }
  .m-win { aspect-ratio: 1 / 1; }
  .m-clock { margin-top: 14px; font-size: 40px; }
  .m-copy .beat-line { margin-top: 14px; }
  /* phones: the patterns arrive under the map as legible text, as the line makes way */
  .m-spots, html:not(.motion) .m-spots { display: none; }
  .m-spots-text { display: block; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 12px; background: var(--surface); }
  .motion .m-spots-text { display: none; }
  .motion #mapped.dim .m-spots-text { display: block; animation: m-rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .motion #mapped.dim .m-copy .beat-line { display: none; }
  .m-app figcaption { flex-direction: column; gap: 2px; }
}
@media (max-width: 760px) and (max-height: 760px) { .m-copy .beat-line { display: none; } }

/* the answer, as the app shows it */
.app-proof { max-width: 760px; margin: 56px auto 0; }
.app-proof img {
  -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent);
  display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.app-proof figcaption { margin-top: 12px; color: var(--muted); font-size: 15px; text-align: center; }

@keyframes m-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .m-spots-text { animation: none !important; } }

/* health: the real app's health screen, made-up readings */
#health { background: var(--void); }
#health .frame { max-width: 1320px; margin: 0 auto; padding: 120px var(--gutter); }
.h-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.h-copy .big { font-size: clamp(40px, 5vw, 76px); }
.h-copy .beat-line { margin: 22px auto 0; max-width: 36em; }
.h-app { margin: 56px 0 0; }
.h-app img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: #0A0D16;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 120px -40px rgba(130, 107, 255, .16); }
.h-charts { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
/* the app's own ground around each chart, so every card has the same inset as the readings above */
.h-app img { background: #070B13; }
.h-charts img { box-sizing: border-box; height: 100%; padding: clamp(10px, 1.6vw, 22px); object-fit: contain; object-position: left top; }
.h-app figcaption { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; }
.h-app figcaption .caption { margin: 0; }
@media (max-width: 760px) {
  #health .frame { padding: 88px var(--gutter); }
  .h-copy { text-align: left; }
  .h-app { margin-top: 32px; }
  .h-today { display: none !important; }
  .h-charts { grid-template-columns: 1fr; margin-top: 0; }
  .h-app figcaption { flex-direction: column; gap: 2px; }
}
