/* My Little Apps — home page only. Livelier colours and moving card pictures.
   Loaded after site.css; every rule is scoped to body.home so the other pages stay as they are. */

body.home{
  --bg:#f3eefc; --surface:#ffffff; --surface-2:#efeaf8; --line:#ddd5ee;
  --text:#1b1830; --text-dim:#5d5874;
  --accent:#6a3fc8; --accent-ink:#ffffff; --warm:#c0661f;
  --glow-a:rgba(255,92,170,.30); --glow-b:rgba(80,150,255,.28); --glow-c:rgba(255,170,60,.26);
  --tint:12%; --edge:38%; --halo:22%;
  --shadow:0 1px 2px rgba(40,20,80,.06),0 14px 34px rgba(60,30,120,.12);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) body.home{
    --bg:#151436; --surface:#1d1b42; --surface-2:#28254f; --line:#363267;
    --text:#f1eeff; --text-dim:#b2abd6;
    --accent:#b89bff; --accent-ink:#160f33; --warm:#ffb45e;
    --glow-a:rgba(255,70,170,.34); --glow-b:rgba(60,140,255,.32); --glow-c:rgba(255,150,40,.22);
    --tint:20%; --edge:45%; --halo:30%;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 16px 40px rgba(0,0,0,.38);
  }
}
:root[data-theme="dark"] body.home{
  --bg:#151436; --surface:#1d1b42; --surface-2:#28254f; --line:#363267;
  --text:#f1eeff; --text-dim:#b2abd6;
  --accent:#b89bff; --accent-ink:#160f33; --warm:#ffb45e;
  --glow-a:rgba(255,70,170,.34); --glow-b:rgba(60,140,255,.32); --glow-c:rgba(255,150,40,.22);
  --tint:20%; --edge:45%; --halo:30%;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 16px 40px rgba(0,0,0,.38);
}

body.home{
  background:
    radial-gradient(60vmax 45vmax at 8% -6%,var(--glow-a),transparent 70%),
    radial-gradient(55vmax 45vmax at 100% 6%,var(--glow-b),transparent 70%),
    radial-gradient(70vmax 50vmax at 50% 105%,var(--glow-c),transparent 70%),
    var(--bg);
  background-attachment:fixed;
}
.home .nav a[aria-current="page"]{background:color-mix(in srgb,var(--surface) 80%,transparent)}

/* hero */
.home .hero h1{line-height:.98;padding-bottom:.06em;
  background:linear-gradient(95deg,#ff4fa3 0%,#a46bff 38%,#4c9dff 66%,#ffaa3b 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent}
.home .byline{margin-top:6px}

/* cards, each tinted by its own colour */
.home .card{
  background:linear-gradient(180deg,color-mix(in srgb,var(--c) var(--tint),var(--surface)) 0%,var(--surface) 75%);
  border-color:color-mix(in srgb,var(--c) var(--edge),var(--line));
  box-shadow:var(--shadow),0 0 0 1px color-mix(in srgb,var(--c) 8%,transparent),0 10px 40px -12px color-mix(in srgb,var(--c) var(--halo),transparent)}
.home .card .pic{position:relative;background:#07050d}
.home .card .pic canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.home .card .pic video{width:100%;height:100%;object-fit:cover;display:block}
.home .flow span{background:color-mix(in srgb,var(--c) 16%,var(--surface-2))}
.home .card .go{color:color-mix(in srgb,var(--c) 85%,var(--text))}

/* Rosonata: rosette centre in the lower right, turning slowly */
.home .p-rosonata .rose{position:absolute;left:70%;top:78%;width:150%;height:auto;aspect-ratio:1;max-width:none;object-fit:fill;
  -webkit-mask-image:radial-gradient(circle,#000 62%,transparent 70.5%);mask-image:radial-gradient(circle,#000 62%,transparent 70.5%);
  transform:translate(-50%,-50%);animation:home-spin 90s linear infinite}
@keyframes home-spin{to{transform:translate(-50%,-50%) rotate(360deg)}}

/* Melodentity: the real score from the app over the screenshot; a wave runs through it and the notes hop */
.home .p-melo{background:#e9edf3}
.home .p-melo .paper{position:absolute;left:4.875%;top:28.67%;width:90.25%;height:48.83%;background:#fefdf8;border-radius:6px}
.home .p-melo .paper svg{position:absolute;left:.46%;top:1.16%;width:99.3%;height:98.5%;overflow:visible}
.home .p-melo .paper .hop{transform-box:view-box;animation:home-hop 3.8s cubic-bezier(.3,.6,.4,1) infinite;animation-delay:var(--d,0s)}
@keyframes home-hop{0%{transform:translateY(0)}6%{transform:translateY(-16px)}12%{transform:translateY(0)}16%{transform:translateY(-5px)}20%,100%{transform:translateY(0)}}

/* Kaleidosong: the alien picture stays, the kaleidoscope behind it moves */
.home .p-kaleido .thumb{position:absolute;z-index:2;left:7%;top:23%;width:53%;aspect-ratio:16/9;border:5px solid #fff;border-radius:10px;overflow:hidden;box-shadow:0 8px 24px rgba(0,0,0,.45)}
.home .p-kaleido .thumb img{width:100%;height:100%;object-fit:cover}
.home .p-kaleido .arrow{position:absolute;z-index:2;left:63%;top:42%;width:34px;height:34px;border-radius:50%;background:#fff;color:#111;display:grid;place-items:center;font-weight:700;font-size:20px;line-height:1;box-shadow:0 4px 14px rgba(0,0,0,.4)}

/* Games: all three side by side, with names */
.home .p-games{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:3px;background:color-mix(in srgb,var(--c) 60%,#000)}
.home .p-games figure{position:relative;margin:0;overflow:hidden;background:#000}
.home .p-games figure img{width:100%;height:100%;object-fit:cover;animation:home-drift 14s ease-in-out infinite alternate}
.home .p-games figure:nth-child(1) img{transform-origin:50% 25%}
.home .p-games figure:nth-child(2) img{object-position:62% 50%;animation-delay:-4s}
.home .p-games figure:nth-child(3) img{object-position:50% 40%;animation-delay:-9s}
.home .p-games figure:nth-child(4) img{object-position:50% 35%;animation-delay:-6s}
.home .p-games figcaption{position:absolute;left:0;right:0;bottom:0;padding:22px 8px 8px;font-size:.8rem;font-weight:700;line-height:1.15;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.85))}
@keyframes home-drift{from{transform:scale(1.02)}to{transform:scale(1.14)}}

/* Storyglobe: the books slowly come closer */
.home .p-story img{animation:home-drift 16s ease-in-out infinite alternate}

/* promise row */
.home .promise div{background:color-mix(in srgb,var(--c) var(--tint),var(--surface));border-color:color-mix(in srgb,var(--c) var(--edge),var(--line))}

/* more from Kuga Lab: one line under each project */
.home .more{--c:#a46bff}
.home .more h3{margin:4px 0 12px}
.home .plist{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.home .plist a{display:grid;grid-template-columns:12px 1fr;column-gap:12px;align-items:baseline;text-decoration:none;color:inherit;
  background:color-mix(in srgb,var(--d) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--d) 35%,var(--line));border-radius:14px;padding:11px 14px}
.home .plist b{width:12px;height:12px;border-radius:50%;background:var(--d);align-self:center;grid-row:span 2}
.home .plist strong{font-weight:700}
.home .plist span{color:var(--text-dim);font-size:.93rem;line-height:1.45}
.home .more .all{display:inline-block;margin-top:14px;font-weight:700;color:var(--accent);text-decoration:none}

/* support */
.home .support{--c:#ff5e8a;background:color-mix(in srgb,var(--c) var(--tint),var(--surface));border-color:color-mix(in srgb,var(--c) var(--edge),var(--line))}
.home .support .btn.primary{background:linear-gradient(95deg,#ff5e8a,#ff9a3c);color:#fff}

@media (prefers-reduced-motion:reduce){body.home *{animation:none!important}}
