*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; font-family: "DM Sans", system-ui, -apple-system, sans-serif; background: #3c3c3c; }

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #CFC5BD;
  padding: 48px 20px;
}

@media (min-width: 1024px) {
  .page {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 48px;
    padding: 48px 32px;
  }
}

.phone-wrapper {
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .phone-wrapper { flex-shrink: 1; align-self: auto !important; }
}

.phone-inner {
  width: 395px;
  height: 832px;
  transform-origin: top left;
}

.iphone-frame {
  position: relative;
  width: 395px;
  height: 832px;
  border-radius: 56px;
  background: #111111;
  padding: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 25px 50px -12px rgba(0,0,0,0.4), 0 12px 24px -8px rgba(0,0,0,0.3);
}

.iphone-viewport {
  width: 375px;
  height: 812px;
  border-radius: 46px;
  overflow: hidden;
  position: relative;
}

.btn-right { position: absolute; right: -2px; top: 180px; width: 3px; height: 80px; border-radius: 0 2px 2px 0; background: #222; }
.btn-left-1 { position: absolute; left: -2px; top: 130px; width: 3px; height: 28px; border-radius: 2px 0 0 2px; background: #222; }
.btn-left-2 { position: absolute; left: -2px; top: 185px; width: 3px; height: 52px; border-radius: 2px 0 0 2px; background: #222; }
.btn-left-3 { position: absolute; left: -2px; top: 245px; width: 3px; height: 52px; border-radius: 2px 0 0 2px; background: #222; }

.status-bar {
  position: absolute; left: 0; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  width: 375px; height: 54px; padding: 0 29px;
}
.status-time { width: 54px; text-align: center; font-size: 16px; font-weight: 600; line-height: 21px; letter-spacing: -0.32px; color: black; padding-top: 14px; }
.status-spacer { width: 125px; }
.status-icons { display: flex; align-items: center; gap: 6px; padding-top: 14px; }

.dynamic-island {
  position: absolute; left: 50%; top: 11px; z-index: 50;
  width: 125px; height: 37px; border-radius: 9999px; background: black;
  transform: translateX(-50%);
}

/* Screen backgrounds */
.screen { position: relative; width: 375px; height: 812px; overflow: hidden; }
.screen-onboarding { background: #F4F1EB; }
.screen-dashboard { background: #282828; }
.screen-recipes { background: #282828; }

.content-area {
  position: absolute; left: 0; top: 0;
  width: 375px; height: 716px;
  overflow: hidden; border-radius: 0 0 32px 32px;
  background: #F4F1EB;
}
.content-area::after {
  /* Anchored BELOW the clip line on purpose. At `top: 65%` the 500px circle's
     opaque core landed at y=715 in a 716px box, so `overflow: hidden` cut
     straight through solid colour and the ambient glow rendered as a hard-edged
     wedge. Pushing the core 170px past the bottom leaves only the falloff in
     frame, which is what a glow is. */
  content: ''; position: absolute; left: 50%; bottom: -300px;
  width: 620px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,163,113,0.5) 0%, rgba(255,163,113,0) 70%);
  pointer-events: none;
}

/* Bottom nav */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  width: 375px; height: 96px; padding: 0 16px;
}
.bottom-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 343px; height: 56px; gap: 8px;
}
.nav-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 9999px; }
.nav-icon-group { display: flex; align-items: center; gap: 12px; }
.nav-center { background: #FE9B66; }

/* Onboarding specific */
.onboarding-image { position: absolute; left: 0; top: 0; width: 375px; height: 573px; object-fit: cover; }
.blur-overlay {
  position: absolute; left: 0; bottom: 196px; width: 375px; height: 245px;
  background: rgba(244,241,235,0.6);
  /* Both properties, on purpose. There is no build step here, so nothing can
     collapse the pair the way Lightning CSS does in the Vite apps — older Safari
     gets the prefixed one and everything current gets the standard one. */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 62.5%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 62.5%);
}
.onboarding-text {
  position: absolute; left: 0; top: 518px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  width: 375px; padding: 0 16px 24px;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.onboarding-text.visible { opacity: 1; transform: translateY(0); }
.onboarding-title {
  width: 343px; text-align: center; font-size: 48px; font-weight: 600;
  line-height: 50px; letter-spacing: -0.05em; color: #282828; text-transform: capitalize;
}
.onboarding-subtitle {
  width: 343px; text-align: center; font-size: 18px; font-weight: 500;
  line-height: 24px; letter-spacing: -0.02em; color: #908D86;
}
.dots { display: flex; gap: 4px; }
.dot { width: 6px; height: 6px; border-radius: 9px; background: #D7D1C5; }
.dot.active { background: #424141; }
.cta-button {
  display: flex; align-items: center; justify-content: center;
  width: 343px; height: 56px; border-radius: 20px; background: #282828;
  color: white; font-size: 16px; font-weight: 500; text-transform: capitalize;
  border: none; cursor: pointer; font-family: inherit;
}

/* Calorie labels */
.calorie-label {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.calorie-label.visible { opacity: 1; transform: translateY(0); }
.calorie-pill {
  display: flex; align-items: center; justify-content: center;
  height: 40px; border-radius: 32px; background: rgba(255,255,255,0.8);
  font-size: 18px; font-weight: 600; line-height: 20px; letter-spacing: -0.03em; color: #282828;
  position: relative;
}
.calorie-pill::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: #FFA270;
}
.calorie-line {
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.calorie-line-bar {
  width: 3px; flex: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
  transform: scaleY(0); transform-origin: top;
  transition: transform 1s cubic-bezier(0.16,1,0.3,1);
}
.calorie-label.visible .calorie-line-bar { transform: scaleY(1); }
.calorie-line-dot {
  width: 12px; height: 12px; border-radius: 50%; background: white; flex-shrink: 0;
  opacity: 0; transition: opacity 0.4s ease;
}
.calorie-label.visible .calorie-line-dot { opacity: 1; }

/* Dashboard */
.dashboard-header {
  margin-top: 56px; display: flex; align-items: center; justify-content: space-between;
  width: 343px; height: 56px;
}
.header-circle { width: 44px; height: 44px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; }
.header-title { font-size: 14px; font-weight: 500; line-height: 20px; color: #282828; }

.progress-ring { position: relative; width: 343px; height: 231px; overflow: hidden; margin-top: 16px; }
/* Direct child, NOT a descendant. `.progress-ring svg` also matched the 18x18
   lightning bolt nested inside .ring-center and stretched it to 343x343 at
   0,0 — the giant orange wedge across the dashboard was that bolt, clipped
   by this container's 231px height. */
.progress-ring > svg { position: absolute; left: 0; top: 0; width: 343px; height: 343px; }
.ring-center {
  position: absolute; left: 50%; top: 100px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 10;
}
.ring-date { font-size: 14px; font-weight: 500; line-height: 18px; color: #FE9B66; }
.ring-kcal { margin-top: 4px; font-size: 28px; font-weight: 600; line-height: 32px; letter-spacing: -0.02em; color: #282828; text-align: center; }
.ring-goal { font-size: 14px; font-weight: 600; line-height: 16px; color: #FFA270; text-align: center; }

.add-btn {
  display: flex; align-items: center; justify-content: center;
  width: 343px; height: 48px; border-radius: 20px; background: #E8E3D8;
}

.meal-card {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 343px; height: 138px; border-radius: 24px; padding: 12px 20px 12px 12px;
  background: linear-gradient(178deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.6) 100%);
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.meal-card.visible { opacity: 1; transform: translateY(0); }
.meal-top { display: flex; align-items: flex-start; justify-content: space-between; }
.meal-left { display: flex; align-items: center; gap: 12px; }
.meal-img { height: 64px; object-fit: contain; }
.meal-info { display: flex; flex-direction: column; justify-content: center; }
.meal-title { font-size: 18px; font-weight: 600; line-height: 25px; letter-spacing: -0.03em; color: #282828; text-transform: capitalize; }
.meal-time { font-size: 14px; font-weight: 500; line-height: 18px; color: #908D86; }
.meal-right { display: flex; flex-direction: column; align-items: flex-end; }
.meal-kcal { font-size: 28px; font-weight: 600; line-height: 32px; letter-spacing: -0.02em; color: #282828; }
.meal-percent { font-size: 14px; font-weight: 600; line-height: 18px; color: #FFA270; }
.meal-bottom { display: flex; align-items: center; justify-content: space-between; padding-left: 8px; height: 42px; }
.meal-macros { display: flex; width: 180px; align-items: center; justify-content: space-between; }
.macro-item { display: flex; flex-direction: column; align-items: flex-start; }
.macro-label { font-size: 14px; font-weight: 500; line-height: 18px; color: #908D86; }
.macro-value { font-size: 14px; font-weight: 600; line-height: 20px; color: #282828; }

/* Recipes */
.recipes-header {
  display: flex; align-items: center; gap: 12px;
  width: 343px; height: 56px; padding-top: 56px;
}
.search-bar {
  display: flex; align-items: center; gap: 10px;
  width: 279px; height: 56px; border-radius: 20px; background: white;
  padding: 15px 16px;
}
.search-text { font-size: 18px; font-weight: 500; line-height: 20px; letter-spacing: -0.03em; color: #908D86; }
.bell-circle { width: 56px; height: 56px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; }

.categories {
  /* Five 80px chips plus gaps measure 432px against a 375px screen, so the
     fifth was sliced by `overflow: hidden` and read as a broken layout. A real
     scroller makes the same partial chip mean "there is more", and the trailing
     padding gives the last one somewhere to land. */
  display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden;
  padding-left: 16px; padding-right: 16px; width: 375px; margin-top: 20px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.categories::-webkit-scrollbar { display: none; }
.category-item { flex: 0 0 auto; }
.category-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 80px;
  opacity: 0; transform: translateY(20px) scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.category-item.visible { opacity: 1; transform: translateY(0) scale(1); }
.category-img-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 80px; height: 78px; border-radius: 20px; background: white; overflow: hidden;
}
.category-img { width: 56px; height: 56px; object-fit: contain; }
.category-label { width: 80px; text-align: center; font-size: 14px; font-weight: 500; line-height: 1.2em; color: #282828; }

.trending-header {
  display: flex; align-items: center; justify-content: space-between; width: 343px;
}
.trending-title { font-size: 20px; font-weight: 500; line-height: 25px; letter-spacing: -0.03em; color: #282828; text-transform: capitalize; }
.trending-link { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 500; line-height: 1.2em; color: #908D86; }

/* 384, not 400. The screen's children summed to exactly 716px, so
   `justify-content: space-between` had no slack to give and the trending
   header sat flush against the category chips. The active card is 380px,
   so this still clips nothing. */
.carousel { position: relative; width: 375px; height: 384px; overflow: hidden; }
.carousel-card {
  position: absolute; left: 50%; top: 50%;
  width: 325px; border-radius: 24px; overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.16,1,0.3,1), height 0.8s cubic-bezier(0.16,1,0.3,1);
}
.carousel-card img {
  position: absolute; left: 50%; transform: translateX(-50%); object-fit: contain;
  transition: all 0.8s cubic-bezier(0.16,1,0.3,1);
}
.carousel-card-top { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; display: flex; align-items: center; justify-content: space-between; }
.time-badge { display: flex; align-items: center; gap: 8px; }
.time-badge-circle { width: 24px; height: 24px; border-radius: 50%; background: #FFA270; display: flex; align-items: center; justify-content: center; }
.time-badge-text { font-size: 13px; font-weight: 600; line-height: 16px; color: #282828; }
.time-pill { display: flex; align-items: center; gap: 4px; border-radius: 9999px; background: #FFA270; padding: 3px 8px; }
.time-pill-text { font-size: 10px; font-weight: 600; line-height: 12px; color: #282828; }
.card-bottom-center {
  position: absolute; bottom: 16px; left: 0; width: 100%; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.difficulty { font-size: 22px; font-weight: 500; line-height: 28px; letter-spacing: -0.02em; color: #908D86; }
.difficulty-dots { display: flex; align-items: center; gap: 5px; }
.difficulty-dot { width: 9px; height: 26px; border-radius: 9999px; }
.card-kcal { font-size: 28px; font-weight: 600; line-height: 34px; letter-spacing: -0.02em; color: #282828; }
.card-bottom-side {
  position: absolute; left: 50%; top: 308px; width: 264px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between;
}
.side-difficulty { font-size: 17px; font-weight: 500; line-height: 22px; letter-spacing: -0.02em; color: #908D86; }
.side-kcal { font-size: 27px; font-weight: 600; line-height: 30px; letter-spacing: -0.02em; color: #282828; text-align: right; }
