/*
 * NUEMI mobile art direction
 *
 * This file intentionally loads after styles.css. It owns only the connected
 * mobile header and the portrait phone presentation; desktop keeps the
 * approved six-scene layout and artwork unchanged.
 */

.hero-art picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-title__mobile,
.hero-description__mobile {
  display: none;
}

@media (max-width: 900px) {
  .site-header,
  .site-header.is-scrolled {
    top: max(8px, env(safe-area-inset-top, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: 44px auto;
    align-items: center;
    gap: 0 8px;
    min-height: 58px;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px)));
    padding: 7px 7px 10px 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 30px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.4));
    box-shadow:
      0 18px 46px rgba(61, 34, 92, 0.13),
      inset 0 1px 0 rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(28px) saturate(1.38);
    -webkit-backdrop-filter: blur(28px) saturate(1.38);
    transition:
      grid-template-rows 380ms cubic-bezier(.22, .8, .24, 1),
      padding 380ms cubic-bezier(.22, .8, .24, 1),
      background 280ms ease,
      box-shadow 280ms ease;
  }

  .js .site-header,
  .js .site-header.is-scrolled {
    grid-template-rows: 44px 0fr;
    padding-bottom: 7px;
  }

  .js .site-header.is-menu-open,
  .js .site-header.is-menu-open.is-scrolled {
    grid-template-rows: 44px 1fr;
    padding-bottom: 10px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.6));
    box-shadow:
      0 24px 58px rgba(61, 34, 92, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  .site-header .brand,
  .site-header.is-scrolled .brand {
    grid-row: 1;
    grid-column: 1;
    width: 116px;
    height: 44px;
  }

  .site-header .nav-toggle {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .site-header .nav-toggle span {
    width: 21px;
    height: 2px;
  }

  .site-header .button--header {
    display: none;
  }

  .primary-nav,
  .site-header .primary-nav,
  .site-header.is-scrolled .primary-nav {
    position: static;
    grid-row: 2;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-height: 0;
    max-height: calc(100dvh - 94px - env(safe-area-inset-top, 0px));
    margin: 0;
    padding: 8px 0 2px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .js .site-header .primary-nav,
  .js .site-header.is-scrolled .primary-nav {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition:
      max-height 380ms cubic-bezier(.22, .8, .24, 1),
      padding 380ms cubic-bezier(.22, .8, .24, 1),
      opacity 230ms ease,
      visibility 0s linear 380ms;
  }

  .js .site-header .primary-nav.is-open,
  .js .site-header.is-scrolled .primary-nav.is-open {
    max-height: calc(100dvh - 94px - env(safe-area-inset-top, 0px));
    padding-top: 8px;
    padding-bottom: 2px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transition:
      max-height 380ms cubic-bezier(.22, .8, .24, 1),
      padding 380ms cubic-bezier(.22, .8, .24, 1),
      opacity 250ms ease,
      visibility 0s linear 0s;
  }

  .primary-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 15px;
    border-radius: 999px;
    color: #332541;
    font-size: 0.92rem;
    font-weight: 650;
  }

  .primary-nav .nav-mobile-cta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 17px;
    color: white;
    background: var(--gradient);
    box-shadow: 0 12px 28px rgba(146, 46, 228, 0.2);
  }

  .primary-nav .nav-mobile-cta::after {
    display: none;
  }

  .nav-mobile-cta .ui-icon {
    width: 17px;
    height: 17px;
  }

  .primary-nav a:hover,
  .primary-nav a.is-active {
    color: #6f24d8;
    background: rgba(123, 44, 255, 0.075);
  }

  .primary-nav .nav-mobile-cta:hover,
  .primary-nav .nav-mobile-cta:active {
    color: white;
    background: var(--gradient);
    box-shadow: 0 15px 34px rgba(146, 46, 228, 0.27);
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  :root {
    --mobile-page-gutter: clamp(15px, 4.5vw, 21px);
  }

  html {
    scroll-padding-top: 82px;
  }

  body {
    background: #f8f4fc;
  }

  .scene,
  .scene-shell,
  .hero-shell {
    min-height: 100svh;
  }

  .scene {
    position: relative;
    padding: 0;
    isolation: isolate;
  }

  .scene-shell,
  .hero-shell {
    overflow: clip;
    border: 0;
    border-radius: 0;
    background: #f8f4fc;
    box-shadow: none;
  }

  .scene-background-picture {
    position: sticky;
    z-index: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100svh;
    overflow: hidden;
  }

  .scene-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--mobile-art-position, 50% 50%);
  }

  .scene--focus { --mobile-art-position: 52% 48%; }
  .scene--workouts { --mobile-art-position: 53% 52%; }
  .scene--money { --mobile-art-position: 50% 50%; }
  .scene--progress { --mobile-art-position: 54% 52%; }
  .scene--privacy { --mobile-art-position: 50% 50%; }

  .scene-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    align-items: start;
    width: 100%;
    min-height: 100svh;
    margin: -100svh 0 0;
    padding:
      max(104px, calc(env(safe-area-inset-top, 0px) + 92px))
      var(--mobile-page-gutter)
      34px;
    gap: 15px;
  }

  .section-copy,
  .focus-copy,
  .workout-copy,
  .money-copy,
  .progress-copy,
  .privacy-copy {
    width: 100%;
    max-width: none;
  }

  .section-copy h2 {
    font-size: clamp(2.65rem, 12.2vw, 3.55rem);
    line-height: 0.96;
    text-wrap: balance;
  }

  .section-copy > p {
    margin-top: 13px;
    color: #5f566c;
    font-size: 0.92rem;
    line-height: 1.48;
  }

  .glass-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5));
    box-shadow:
      0 14px 34px rgba(64, 37, 96, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(1.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.16);
  }

  .button {
    min-height: 50px;
    border-radius: 999px;
  }

  .insight-card a,
  .app-store-link {
    border-radius: 999px;
  }

  /* Opening scene */
  .scene--hero .hero-shell {
    height: 100svh;
    min-height: 100svh;
  }

  .scene--hero .hero-art {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 6%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 6%, #000 100%);
  }

  .scene--hero .hero-art picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  .scene--hero .hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transform: scale(1.1);
    transform-origin: center bottom;
  }

  .scene--hero .hero-art::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    background:
      linear-gradient(180deg, rgba(250, 247, 253, 0.44) 0%, rgba(250, 247, 253, 0.1) 34%, transparent 58%, transparent 100%),
      linear-gradient(90deg, rgba(250, 247, 253, 0.28), transparent 82%);
    pointer-events: none;
  }

  .scene--hero .hero-copy {
    position: relative;
    z-index: 3;
    top: auto;
    left: auto;
    width: 100%;
    padding:
      max(86px, calc(env(safe-area-inset-top, 0px) + 78px))
      var(--mobile-page-gutter)
      0;
  }

  .scene--hero .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.25rem, 11.3vw, 2.8rem);
    line-height: 0.94;
    letter-spacing: -0.052em;
  }

  .hero-title__desktop,
  .hero-description__desktop {
    display: none;
  }

  .hero-title__mobile,
  .hero-description__mobile {
    display: block;
  }

  .hero-title__mobile {
    white-space: nowrap;
  }

  .hero-description {
    max-width: 320px;
    margin-top: 11px;
    color: #5b5267;
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .hero-description br {
    display: none;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: min(100%, 350px);
    margin-top: 15px;
  }

  .hero-actions .button {
    width: 100%;
    min-height: 46px;
  }

  .scene--hero .kpi-bar {
    position: absolute;
    z-index: 4;
    right: 12px;
    top: auto;
    bottom: max(15px, env(safe-area-inset-bottom, 0px));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    margin: 0;
    padding: 6px;
    border-radius: 25px;
  }

  .scene--hero .kpi {
    min-height: 42px;
    padding: 5px 8px;
    border: 0;
  }

  .scene--hero .kpi:nth-child(even) {
    border-left: 1px solid rgba(93, 62, 132, 0.09);
  }

  .scene--hero .kpi:nth-child(n + 3) {
    border-top: 1px solid rgba(93, 62, 132, 0.09);
  }

  .scene--hero .kpi strong {
    font-size: 0.94rem;
  }

  .scene--hero .kpi span {
    font-size: 0.58rem;
  }

  .scene--hero .kpi-progress-icon,
  .scene--hero .kpi-icon {
    width: 26px;
    height: 26px;
  }

  /* Focus */
  .focus-layout {
    gap: 13px;
    padding-bottom: 30px;
  }

  .focus-copy {
    display: grid;
    gap: 0;
  }

  .focus-copy .mini-card-stack {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 15px;
  }

  .mini-stat {
    min-height: 82px;
    padding: 13px 14px;
    border-radius: 20px;
  }

  .mini-stat strong {
    margin-top: 4px;
    font-size: 1.3rem;
  }

  .mini-stat .progress-ring,
  .mini-stat__icon {
    width: 38px;
    height: 38px;
  }

  .day-card {
    width: 100%;
    min-height: 0;
    padding: 18px 17px 13px;
    border-radius: 24px;
  }

  .week-strip {
    gap: 2px;
    margin: 14px -2px 10px;
    padding-bottom: 10px;
  }

  .week-strip span {
    min-width: 0;
    min-height: 44px;
    border-radius: 12px;
  }

  .timeline-row {
    grid-template-columns: 57px 16px minmax(0, 1fr) 20px;
    min-height: 56px;
  }

  .timeline-row i::after {
    height: 47px;
  }

  .timeline-row div strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .focus-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .focus-card,
  .momentum-card {
    min-height: 0;
    border-radius: 22px;
  }

  .momentum-card {
    display: grid;
    grid-template-rows: minmax(104px, 1fr) auto;
    align-items: stretch;
    gap: 12px;
    padding: 13px;
  }

  .momentum-card__visual {
    width: 100%;
    height: 100%;
    min-height: 104px;
    border-radius: 18px;
    background:
      radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.92), transparent 28%),
      radial-gradient(circle at 24% 82%, rgba(255, 137, 67, 0.2), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(182, 73, 240, 0.16));
  }

  .momentum-card__visual::before {
    content: "";
    position: absolute;
    width: 78px;
    height: 78px;
    border: 1px solid rgba(128, 50, 232, 0.16);
    border-radius: 50%;
    box-shadow:
      0 0 0 13px rgba(255, 255, 255, 0.22),
      0 0 0 27px rgba(126, 53, 229, 0.045);
  }

  .momentum-card__visual .ui-icon {
    z-index: 1;
    width: 34px;
    height: 34px;
  }

  .momentum-card > div {
    padding: 0 3px 2px;
  }

  /* Workouts */
  .workout-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 32px;
  }

  .workout-copy {
    grid-column: 1 / -1;
  }

  .scene--workouts .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 14px;
  }

  .scene--workouts .feature-list li {
    min-height: 68px;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 8px 22px rgba(69, 40, 101, 0.06);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
  }

  .scene--workouts .feature-list strong {
    font-size: 0.73rem;
  }

  .scene--workouts .feature-list small {
    font-size: 0.58rem;
    line-height: 1.25;
  }

  .feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .phone {
    grid-column: 1;
    align-self: center;
    width: min(340px, 100%);
    min-height: 570px;
    height: 590px;
    padding: 30px 18px 22px;
    border-width: 7px;
    border-radius: 42px;
    transform: none;
  }

  .phone__speaker {
    top: 7px;
    width: 96px;
    height: 23px;
  }

  .phone__status {
    font-size: 0.62rem;
  }

  .phone__title {
    margin-top: 15px;
  }

  .phone__tabs {
    gap: 28px;
    margin: 13px -18px 0;
  }

  .phone__tabs span {
    padding-bottom: 9px;
  }

  .workout-hero-card {
    min-height: 126px;
    margin-top: 15px;
    padding: 17px;
    border-radius: 17px;
  }

  .workout-hero-card .preview-start {
    left: 17px;
    bottom: 14px;
  }

  .recovery-stack {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: stretch;
    gap: 10px;
  }

  .recovery-card,
  .sleep-card {
    min-height: 0;
    padding: 14px 10px;
    border-radius: 21px;
  }

  .recovery-card h3 {
    font-size: 0.68rem;
  }

  .score-ring {
    width: 78px;
    height: 78px;
    margin: 7px auto;
  }

  .sleep-bars {
    height: 38px;
    margin: 8px 0 4px;
    gap: 2px;
  }

  /* Money */
  .money-layout {
    gap: 12px;
    padding-bottom: 32px;
  }

  .money-copy {
    display: contents;
  }

  .money-copy h2 {
    grid-row: 1;
  }

  .money-copy > p {
    grid-row: 2;
    margin: 0 0 4px;
  }

  .spending-card {
    grid-row: 3;
    width: 100%;
    min-height: 0;
    padding: 18px 17px 14px;
    border-radius: 24px;
  }

  .spending-total {
    margin-top: 12px;
  }

  .spending-total strong {
    font-size: 1.75rem;
  }

  .spending-chart {
    height: 100px;
    margin-top: 3px;
  }

  .spending-card h4 {
    margin: 10px 0 4px;
  }

  .category-list > div {
    grid-template-columns: 11px 68px minmax(0, 1fr) 68px;
    min-height: 34px;
  }

  .money-mini-grid {
    grid-row: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 0;
  }

  .money-mini {
    min-height: 112px;
    padding: 15px;
    border-radius: 21px;
  }

  .money-mini strong {
    font-size: 1.18rem;
  }

  .donut {
    right: 13px;
    bottom: 13px;
    left: auto;
    width: 51px;
    height: 51px;
    transform: none;
  }

  .sparkline {
    height: 42px;
  }

  .insight-card {
    grid-row: 5;
    width: 100%;
    min-height: 180px;
    padding: 20px;
    border-radius: 22px;
  }

  /* Progress */
  .progress-layout {
    gap: 12px;
    padding-bottom: 32px;
  }

  .review-card {
    width: 100%;
    min-height: 0;
    padding: 18px 17px 14px;
    border-radius: 24px;
  }

  .review-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-top: 14px;
    padding-bottom: 13px;
  }

  .review-metrics strong {
    margin-top: 3px;
    font-size: 1rem;
  }

  .mood-header {
    margin-top: 13px;
  }

  .mood-chart {
    margin-top: 2px;
  }

  .mood-chart svg {
    height: 95px;
  }

  .wins-stack {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-content: stretch;
    gap: 10px;
  }

  .wins-card,
  .next-card {
    border-radius: 22px;
  }

  .wins-card {
    padding: 15px;
  }

  .wins-card li {
    min-height: 45px;
    gap: 8px;
    padding-bottom: 7px;
  }

  .win-icon {
    width: 30px;
    height: 30px;
  }

  .next-card {
    grid-template-rows: auto 1fr;
    min-height: 100%;
    padding: 16px 13px;
  }

  .next-plan-list {
    align-content: stretch;
  }

  .next-plan-list li {
    min-height: 38px;
    border-radius: 13px;
  }

  /* Privacy and closing */
  .privacy-layout {
    gap: 12px;
    padding-bottom: clamp(220px, 30svh, 300px);
  }

  .privacy-features {
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    margin-top: 17px;
  }

  .privacy-features article {
    grid-column: auto;
    min-height: 46px;
  }

  .privacy-features article > span {
    width: 36px;
    height: 36px;
    border-radius: 13px;
  }

  .compliance-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px 8px;
    width: 100%;
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 17px;
    white-space: normal;
  }

  .compliance-row i {
    display: none;
  }

  .policy-links {
    gap: 8px 14px;
    margin-top: 12px !important;
  }

  .closing-stack {
    gap: 10px;
    width: 100%;
  }

  .apps-card,
  .cta-card {
    padding: 17px;
    border-radius: 24px;
  }

  .apps-card h3 {
    margin-bottom: 7px;
  }

  .apps-card__note {
    margin: 4px auto 10px;
    font-size: 0.68rem;
  }

  .app-row--planned {
    grid-template-columns: repeat(2, 46px);
  }

  .cta-card p {
    margin: 6px 0 14px;
  }

  .site-footer {
    margin: 8px;
    padding: 25px 18px max(26px, env(safe-area-inset-bottom, 0px));
    border: 1px solid rgba(100, 65, 143, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
  }
}

@media (max-width: 350px) and (orientation: portrait) {
  .scene--hero .hero-copy h1,
  .section-copy h2 {
    font-size: 2.55rem;
  }

  .site-header .brand,
  .site-header.is-scrolled .brand {
    width: 108px;
  }

  .scene-grid,
  .scene--hero .hero-copy {
    padding-right: 14px;
    padding-left: 14px;
  }

  .category-list > div {
    grid-template-columns: 10px 61px minmax(0, 1fr) 59px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .button,
  .nav-toggle,
  .primary-nav a,
  .feature-list li,
  .app-tile,
  .app-store-link,
  .insight-card a,
  .scene-pagination a,
  .site-footer nav a {
    transition:
      transform 460ms cubic-bezier(.34, 1.56, .64, 1),
      color 180ms ease,
      background-color 180ms ease,
      border-color 180ms ease,
      box-shadow 220ms ease;
    transform-origin: center;
  }

  .button:hover,
  .nav-toggle:hover,
  .primary-nav a:hover,
  .feature-list li:hover,
  .app-tile:hover,
  .app-store-link:hover,
  .insight-card a:hover,
  .scene-pagination a:hover,
  .site-footer nav a:hover {
    transform: translateY(-2px) scale(1.045);
  }

  .button:active,
  .nav-toggle:active,
  .primary-nav a:active,
  .app-store-link:active,
  .insight-card a:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 130ms;
  }

  .site-footer nav a {
    display: inline-block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header *,
  .primary-nav {
    transition: none !important;
  }
}
