/* Kuvadoo apps home page (v45, 15 Oct 2026). Sections below the hero only (the hero itself is style.css, unchanged). Loaded only by /index.html; every rule is scoped to .home-page
   so the shared style.css and the other pages stay untouched. */

/* ---------- FinnSana app card ---------- */
.home-app {
  display: grid; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
@media (min-width: 60rem) { .home-app { grid-template-columns: 1.1fr .9fr; } }
.home-app-body { display: flex; flex-direction: column; gap: var(--s-5); padding: clamp(1.25rem, 1rem + 2vw, 2.75rem); }
.home-app-top { display: flex; align-items: center; gap: var(--s-4); }
.home-app-top h3 { margin: 0 0 var(--s-2); font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); }
.home-app-top h3 a { color: var(--text); text-decoration: none; }
.home-app-top h3 a:hover { color: var(--brand); }
.home-app-icon { width: 72px; height: 72px; flex: none; border-radius: 18px; box-shadow: var(--shadow-md); }
.home-app-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
@media (min-width: 40rem) { .home-app-list { grid-template-columns: 1fr 1fr; } }
.home-app-list li { display: flex; gap: var(--s-3); align-items: flex-start; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.45; }
.home-app-list .icon-tile { width: 44px; height: 44px; border-radius: 14px; }
.home-app-list .icon-tile svg { width: 22px; height: 22px; }
.home-app-list strong { display: block; color: var(--text); margin-bottom: 2px; }

/* small gold strip: echoes the FinnSana Plus card on /finnsana/ */
.home-plus {
  --gold: #e7b43c;
  padding: var(--s-4) var(--s-5); border-radius: var(--radius);
  background: #1b1608; color: rgb(255 246 223 / .8); border: 1.5px solid var(--gold);
}
.home-plus-title { display: block; margin-bottom: var(--s-1); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: #fff6df; }
.home-plus-title span { color: var(--gold); }
.home-plus p { margin: 0; font-size: .95rem; line-height: 1.5; }
.home-plus a { color: var(--gold); font-weight: 700; }
.home-plus a:hover { color: #f3c95a; }

.home-app-shots {
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--s-3);
  padding: var(--s-6) var(--s-4); background: var(--hero-grad); isolation: isolate; overflow: hidden;
}
.home-app-shots .phone { transition: transform .5s var(--spring); }
.home-app-shots .phone--main { width: min(11rem, 40%); z-index: 1; }
.home-app-shots .phone--side { width: min(8.5rem, 30%); padding: 5px; border-radius: 1.6rem; }
.home-app-shots .phone--side .phone-screen { border-radius: 1.25rem; }
.home-app-shots .phone--side:first-child { transform: rotate(-6deg) translateX(14%); }
.home-app-shots .phone--side:last-child { transform: rotate(6deg) translateX(-14%); }
.home-app:hover .home-app-shots .phone--main { transform: translateY(-6px) scale(1.03); }
.home-app:hover .home-app-shots .phone--side:first-child { transform: rotate(-8deg) translateX(8%); }
.home-app:hover .home-app-shots .phone--side:last-child { transform: rotate(8deg) translateX(-8%); }
.home-more-apps { margin: var(--s-5) 0 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Learn Finnish guides: picture cards ---------- */
.home-guide-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
@media (min-width: 40rem) { .home-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 70rem) { .home-guide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-guide {
  position: relative; display: flex; flex-direction: column; margin: 0; overflow: hidden;
  border-radius: calc(var(--radius) + .2rem); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--spring), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.home-guide:hover, .home-guide:focus-within { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.home-guide > img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s var(--ease); }
.home-guide:hover > img { transform: scale(1.04); }
.home-guide-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-5); }
.home-guide h3 { margin: 0; font-size: 1.25rem; }
.home-guide h3 a { color: var(--text); text-decoration: none; }
.home-guide h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.home-guide h3 a:focus-visible { outline: none; }
.home-guide h3 a:focus-visible::after { outline: 3px solid var(--brand); outline-offset: -3px; }
.home-guide p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.home-guides-all { margin: var(--s-6) 0 0; display: flex; justify-content: center; }

/* help tiles: titles are links */
.home-help h3 a { color: var(--text); text-decoration: none; }
.home-help h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.home-help h3 a:hover { color: var(--brand); }
.home-help p a { position: relative; z-index: 1; }

/* stats band sits fully below the hero (no overlap), so the hero cover looks exactly as before */
.home-page .home-stats { margin-top: 0; padding-top: var(--s-6); }
@media (max-width: 30rem) { .home-page .stat { font-size: 1.5rem; } }

/* ---------- Hero phone fan: motion (owner likes the 3-phone idea, 15 Oct 2026) ----------
   Layout stays as in style.css. Side phones get their position from variables so the
   entrance can open the fan from behind the main phone. Then a slow, out-of-phase bob,
   a soft glow behind the phones, and on desktop the fan opens a little on hover.
   Everything is transform/opacity only (cheap on phones) and off for reduced motion. */
.home-page .hero .phone-fan { --fx: 46%; --fr: 8deg; --fs: .84; isolation: isolate; }
.home-page .hero .phone-fan::before {
  content: ""; position: absolute; z-index: -1; inset: 12% 8%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(180 255 200 / .28), transparent 70%);
  filter: blur(18px); pointer-events: none;
}
.home-page .hero .phone-fan .phone--right { transform: translateX(var(--fx)) rotate(var(--fr)) scale(var(--fs)); }
.home-page .hero .phone-fan .phone--left  { transform: translateX(calc(var(--fx) * -1)) rotate(calc(var(--fr) * -1)) scale(var(--fs)); }
.home-page .hero .phone-fan .phone--main  { box-shadow: 0 30px 60px -22px rgb(0 0 0 / .55), inset 0 0 0 1px rgb(255 255 255 / .16); }
@media (max-width: 40rem) { .home-page .hero .phone-fan { --fx: 36%; --fr: 7deg; --fs: .78; } }

@media (prefers-reduced-motion: no-preference) {
  /* 1. entrance: main phone rises, side phones slide out from behind it */
  .home-page .hero .phone-fan .phone--main  { animation: fan-main-in .9s cubic-bezier(.2,.8,.2,1) .1s backwards, fan-bob 7s ease-in-out 1.2s infinite; }
  .home-page .hero .phone-fan .phone--right { animation: fan-right-in 1.1s cubic-bezier(.2,.9,.25,1.15) .35s backwards, fan-bob 8.2s ease-in-out 1.6s infinite; }
  .home-page .hero .phone-fan .phone--left  { animation: fan-left-in 1.1s cubic-bezier(.2,.9,.25,1.15) .45s backwards, fan-bob 9s ease-in-out 2.1s infinite; }
  @keyframes fan-main-in  { from { opacity: 0; translate: 0 28px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
  @keyframes fan-right-in { from { opacity: 0; transform: translateX(0) rotate(0) scale(.8); } }
  @keyframes fan-left-in  { from { opacity: 0; transform: translateX(0) rotate(0) scale(.8); } }
  /* 2. idle: a slow float, each phone on its own rhythm (uses `translate`, so it adds to the fan transform) */
  @keyframes fan-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
  .home-page .hero .phone-fan::before { animation: fan-glow 9s ease-in-out infinite; }
  @keyframes fan-glow { 0%, 100% { opacity: .7; scale: 1; } 50% { opacity: 1; scale: 1.06; } }
  /* the old generic entrance on the wrapper is replaced by the per-phone one above */
  .home-page .hero .phone-fan.rise-lcp { animation: none; }
}
/* 3. desktop hover: the fan opens a little (transition on the variables' result) */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .home-page .hero .phone-fan .phone--left, .home-page .hero .phone-fan .phone--right { transition: transform .7s cubic-bezier(.2,.8,.2,1); }
  .home-page .hero .phone-fan:hover { --fx: 52%; --fr: 10deg; }
}
