/* ==========================================================================
   FunctionAlps showcase — pages/home-2.css (features bento)
   Grid, card sizes and responsive rules from the Habitline replica (home.css
   features + home-2.css). Card contents rebuilt: Trends chart (was the streak
   image), Care plan list (was the planner, same loop), Library shelf phone (was
   routine stacks), Profile rings (was weekly reflection), Daily check-in (was
   gentle reminders, same ticker rows).
   ========================================================================== */
.features__container { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 50px; }
.features__head { display: flex; align-items: flex-end; gap: 10px; }
.features__left { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.features__right { flex: 1; display: flex; justify-content: flex-end; }
.features__right p { width: 420px; color: var(--c-ink-2); }
.features__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.fcard { display: flex; flex-direction: column; }
.fcard__top { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.fcard__top h3 { font: var(--t-h3); }
.card--dark .fcard__top p { color: var(--c-muted); }
.shade-20 { background: linear-gradient(180deg, rgba(20, 38, 26, .72) 0%, rgba(20, 38, 26, .55) 100%); }
.shade-top { background: linear-gradient(rgba(20, 38, 26, .92) 0%, rgba(20, 38, 26, .55) 50%, rgba(20, 38, 26, .35) 100%); }

/* 01 Trends (Habitline streak card) */
.fcard--streak { padding-bottom: 40px; }
.fcard--streak .fcard__top { padding: 40px; } .fcard--streak .fcard__top p { color: var(--c-ink-2); }
.fcard__streak { display: flex; justify-content: center; padding: 0 40px 40px; }
.fcard__streak-wrap { width: 100%; padding: 22px 22px 16px; background: var(--c-white); border-radius: var(--r-card); box-shadow: rgba(26, 26, 22, .05) 0 8px 18px 0; overflow: hidden; }
.trend__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.trend__title { font: 500 15px/1.3 var(--f-body); color: var(--c-ink); }
.trend__legend { display: flex; flex-wrap: wrap; gap: 12px; font: var(--t-xs); color: var(--c-ink-2); }
.trend__legend span { display: flex; align-items: center; gap: 6px; }
.trend__legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.trend__chart { width: 100%; height: auto; }
.trend__foot { display: flex; justify-content: space-between; margin-top: 8px; font: 400 12px/1.3 var(--f-body); color: var(--c-stone); }
.fcard__ticker { height: 52px; --ticker-gap: 30px; }
.chip-pill { display: flex; align-items: center; gap: 10px; height: 52px; padding: 10px 22px 10px 10px; background: var(--c-white); border-radius: 200px; box-shadow: var(--sh-card); }
.chip-pill p { font: var(--t-small); color: var(--c-ink); white-space: nowrap; }

/* 02 Care plan (Habitline planner; rows animated by pages/home.js) */
.fcard--planner { padding: 40px; gap: 40px; }
.planner { position: relative; z-index: 1; display: flex; flex-direction: column; padding: 0 1px; background: linear-gradient(rgba(20, 38, 26, .35) 0%, rgba(20, 38, 26, .6) 100%); border-radius: var(--r-card); box-shadow: var(--sh-glass); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); overflow: hidden; }
.planner__top { position: relative; flex: none; display: flex; align-items: center; gap: 20px; padding: 20px; }
.planner__top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255, 255, 255, .2); }
.planner__hello { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.planner__greet { font: var(--t-body); color: var(--c-white); }
.planner__date { font: var(--t-xs); color: var(--c-muted); }
.planner__meta { display: flex; align-items: center; gap: 6px; font: var(--t-xs); color: var(--c-white); }
.planner__pct { display: flex; padding: 2px 9px; background: var(--fa-gold); border-radius: 50px; }
.planner__list { position: relative; flex: none; height: 325px; overflow: hidden; }
.planner__item { position: absolute; left: 0; top: 0; width: calc(100% - 30px); height: 49px; display: flex; align-items: center; gap: 20px; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.planner__time { position: relative; flex: none; width: 70px; height: 48px; padding: 6px 0 6px 20px; }
.planner__time::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, .2); }
.planner__time::after { content: ""; position: absolute; left: 0; top: 47px; width: 14px; height: 1px; background: rgba(255, 255, 255, .2); }
.planner__time p { width: 50px; font: var(--t-xs); color: var(--c-white); text-align: right; }
.planner__task { flex: 1; min-width: 0; height: 49px; display: flex; align-items: center; padding: 14px; border-radius: var(--r-sm); background: rgba(20, 38, 26, .9); transition: background-color .3s; }
.planner__item.is-active .planner__task { background: rgba(111, 143, 94, .55); }
.planner__check { flex: none; display: flex; width: 0; padding-bottom: 1px; overflow: hidden; transition: width .3s; }
.planner__check > span { display: flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border-radius: 50px; background: var(--fa-gold); opacity: 0; transition: opacity .3s; }
.planner__check img { width: 11px; height: 11px; }
.planner__item.is-active .planner__check { width: 22px; padding-right: 6px; }
.planner__item.is-active .planner__check > span { opacity: 1; }
.planner__txt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.planner__name { flex: 1; min-width: 0; font: var(--t-small); color: var(--c-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner__dur { font: var(--t-xs); color: var(--c-muted); white-space: nowrap; }

/* 03 Library (Habitline routine stacks, full width) */
.fcard--stacks { grid-column: 1 / -1; flex-direction: row; padding: 40px; }
.stacks__left { position: relative; z-index: 1; width: 560px; flex: none; display: flex; flex-direction: column; justify-content: space-between; gap: 60px; min-height: 376px; }
.stacks__top { display: flex; flex-direction: column; align-items: flex-start; gap: 30px; }
.fcard--stacks .fcard__top { gap: 10px; }
.stacks__shelves { display: flex; flex-wrap: wrap; gap: 8px; }
.stacks__shelves span { padding: 6px 12px; border-radius: 50px; background: rgba(255, 255, 255, .1); font: var(--t-xs); color: var(--c-white); }
.stacks__note { font: var(--t-xs); color: var(--c-muted); }
.stacks__right { position: relative; width: 560px; height: 376px; flex: none; }
.stacks__deco { position: absolute; z-index: 2; left: 10px; top: 50%; margin-top: -100px; width: 180px; height: 200px; border-radius: 18px; overflow: hidden; box-shadow: rgba(0, 0, 0, .3) 0 20px 40px; rotate: -8deg; background: var(--c-white); }
.stacks__deco img { width: 100%; height: 130px; object-fit: cover; }
.stacks__deco p { padding: 10px 12px; font: 400 16px/1.2 var(--f-display); color: var(--c-ink); }
.stacks__phone { position: absolute; z-index: 1; right: 20px; top: 20px; width: 360px; }

/* 04 Functional Profile & Score (Habitline weekly reflection) */
.fcard--week { padding: 40px; gap: 40px; }
.week { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.week__glance { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 30px; padding: 30px; background: rgba(20, 38, 26, .92); border-radius: var(--r-card); }
.week__title { width: 100%; color: var(--c-white); text-align: center; }
.week__title small { color: var(--c-muted); font: var(--t-xs); }
.week__rings { width: 100%; display: flex; align-items: flex-end; gap: 10px; }
.week__ring { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.week__ring > p { width: 100%; color: var(--c-muted); text-align: center; }
.ring { position: relative; width: 80px; height: 80px; }
.ring--big { width: 120px; height: 120px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { stroke: rgba(255, 255, 255, .12); }
.ring__label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; font: 500 18px/18px var(--f-ui); color: var(--c-white); }
.ring--big .ring__label { font: 400 34px/34px var(--f-display); }
.week__stat { position: relative; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 20px; background: linear-gradient(rgba(20, 38, 26, .45) 0%, rgba(20, 38, 26, .7) 100%); border-radius: var(--r-card); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.week__stat-top { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding-bottom: 30px; }
.week__stat-top p { flex: 1; color: var(--c-white); }
.week__num { font: var(--t-h3l); color: var(--fa-gold); }
.week__sub { width: 100%; color: var(--c-muted); font: var(--t-small); }

/* 05 Daily check-in (Habitline gentle reminders) */
.fcard--remind .fcard__top { padding: 30px; }
.remind { position: relative; z-index: 1; height: 462px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 100px 0; }
.remind__note { position: relative; z-index: 1; width: 360px; display: flex; flex-direction: column; align-items: center; gap: 36px; padding: 40px; background: rgba(255, 255, 255, .07); border-radius: var(--r-card); box-shadow: var(--sh-card); backdrop-filter: blur(50px); -webkit-backdrop-filter: blur(50px); }
.remind__bell { position: absolute; z-index: 1; left: -20px; top: -30px; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--fa-gold); box-shadow: var(--glow-orange); }
.remind__bell img { width: 28px; height: 28px; }
.remind__text { width: 280px; display: flex; flex-direction: column; gap: 8px; }
.remind__when, .remind__desc { font: var(--t-xs); color: var(--c-muted); }
.remind__title { font: var(--t-h4); color: var(--c-white); }
.remind__buttons { width: 280px; display: flex; gap: 10px; }
.remind__btn { display: flex; align-items: center; justify-content: center; padding: 12px 26px; border-radius: var(--r-sm); background: rgba(20, 38, 26, .9); color: var(--c-white); white-space: nowrap; }
.remind__btn--light { flex: 1; background: var(--c-white); color: var(--fa-forest); }
.remind__rows { position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; gap: 20px; overflow: hidden; }
.remind__row { height: 72px; flex: none; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 16px; background: rgba(255, 255, 255, .06); border-radius: var(--r-xs); }
.note__txt { display: flex; flex-direction: column; white-space: nowrap; }
.note__title { font: 500 15px/20px var(--f-body); color: var(--c-white); }
.note__desc { font: var(--t-xs); color: var(--c-muted); }
.remind__overlay { position: absolute; z-index: 1; left: -10px; top: -10px; width: calc(100% + 20px); height: calc(100% + 20px); pointer-events: none; }
.remind__overlay--x { background: linear-gradient(90deg, #1F3A27 12%, rgba(31, 58, 39, .3) 30%, rgba(31, 58, 39, 0) 50%, rgba(31, 58, 39, .3) 70%, #1F3A27 88%); }
.remind__overlay--y { background: linear-gradient(#1F3A27 6%, rgba(31, 58, 39, .3) 30%, rgba(31, 58, 39, 0) 50%, rgba(31, 58, 39, .3) 70%, #1F3A27 88%); }

/* ---------- features: tablet / phone ---------- */
@media (max-width: 1199.98px) {
  .features__right p { width: 305px; }
  .features__left { flex: none; width: 435px; }
  .features__grid { grid-template-columns: 1fr; }
  .stacks__left { width: 335px; gap: 30px; min-height: 0; }
  .stacks__top { gap: 20px; }
  .stacks__right { width: 335px; height: 300px; }
  .stacks__deco { top: 70px; left: -20px; margin-top: 0; width: 140px; height: 160px; }
  .stacks__deco img { height: 100px; }
  .stacks__phone { right: 0; top: 0; width: 250px; }
  .week__stat { min-height: 0; }
}
@media (max-width: 809.98px) {
  .features__container { gap: 30px; }
  .features__head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .features__left, .features__right { width: 100%; }
  .features__right { justify-content: flex-start; }
  .features__right p { width: 100%; }
  .features__grid { gap: 20px; }
  .fcard--streak { padding-bottom: 20px; }
  .fcard--streak .fcard__top { padding: 20px; }
  .fcard__streak { padding: 0 20px 20px; }
  .fcard__streak-wrap { padding: 16px 14px 12px; }
  .fcard__ticker { --ticker-gap: 20px; }
  .fcard--planner, .fcard--week { padding: 20px; gap: 20px; }
  .fcard--stacks { flex-direction: column; height: auto; padding: 20px; }
  .stacks__left { width: 100%; gap: 20px; }
  .stacks__right { width: 100%; height: 320px; }
  .stacks__deco { top: 170px; left: -8px; width: 110px; height: 128px; }
  .stacks__deco img { height: 86px; } .stacks__deco p { font-size: 14px; padding: 8px 10px; }
  .stacks__phone { right: 0; top: 30px; width: 230px; }
  .week { grid-template-columns: 1fr; gap: 20px; }
  .week__glance { padding: 20px; gap: 20px; }
  .week__rings { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "a c" "b b"; gap: 16px 10px; justify-content: center; }
  .week__rings > .week__ring:nth-child(1) { grid-area: a; } .week__rings > .week__ring:nth-child(2) { grid-area: b; } .week__rings > .week__ring:nth-child(3) { grid-area: c; }
  .ring { width: 64px; height: 64px; } .ring--big { width: 96px; height: 96px; }
  .ring__label { font: 500 15px/15px var(--f-ui); } .ring--big .ring__label { font-size: 28px; line-height: 28px; }
  .week__stat { gap: 10px; }
  .week__stat-top { flex-direction: column; gap: 6px; padding-bottom: 0; }
  .week__stat-top p { flex: none; width: 100%; }
  .fcard--remind .fcard__top { padding: 20px; }
  .remind { height: 260px; padding: 20px; }
  .remind__note { width: 100%; max-width: 310px; gap: 20px; padding: 20px; }
  .remind__bell { left: -6px; top: -26px; width: 44px; height: 44px; } .remind__bell img { width: 22px; height: 22px; }
  .remind__text, .remind__buttons { width: 100%; }
  /* planner, phone variant (rows placed statically by pages/home.js) */
  .planner__top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .planner__hello { width: 100%; flex: none; }
  .planner__item { width: calc(100% - 20px); height: auto; }
  .planner__time { width: 50px; padding: 6px 0 6px 10px; }
  .planner__time p { width: 40px; }
  .planner__task { flex-direction: column; align-items: flex-start; height: auto; }
  .planner__item.is-active .planner__task { gap: 4px; }
  .planner__check, .planner__item.is-active .planner__check { display: none; width: 16px; height: 20px; padding: 0 0 4px; }
  .planner__item.is-active .planner__check { display: flex; }
  .planner__txt { width: 100%; flex-direction: column; align-items: flex-start; gap: 2px; }
  .planner__name { flex: none; width: 100%; white-space: normal; }
}
