/* ---------- home: bento layout (loaded after style.css) ---------- */
main.home { max-width: 1120px; padding-top: clamp(40px, 9vh, 88px); }

/* soft violet light that follows the mouse */
.cursor-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(520px circle at var(--cx, 50%) var(--cy, 30%), rgba(139, 92, 246, .11), transparent 60%);
}
.cursor-glow.on { opacity: 1; }

/* sticky nav pill, appears once you scroll past the grid's top */
.pill-nav {
  position: fixed; top: 14px; left: 50%; z-index: 20;
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: rgba(12, 12, 15, .85); border: 1px solid var(--border-hi); border-radius: 999px;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(139, 92, 246, .08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translate(-50%, -80px); opacity: 0; transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .3s;
}
.pill-nav.show { transform: translate(-50%, 0); opacity: 1; }
.pill-nav a { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; font: 500 13px var(--mono); color: var(--muted); transition: color .2s, background .2s; }
.pill-nav a:hover, .pill-nav a.active { color: #fff; background: rgba(139, 92, 246, .22); }
.pill-nav .pill-home { color: var(--text); font-weight: 600; }
.pill-nav .pill-home img { width: 20px; height: 20px; border-radius: 50%; }

/* ---------- the grid ---------- */
.bento {
  display: grid; gap: 14px; margin-bottom: 96px;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(176px, auto);
  grid-template-areas:
    "hero hero discord discord"
    "hero hero music   music"
    "now  gh   gh      anime"
    "stack sites sites anime";
}
.b-hero    { grid-area: hero; }
.b-discord { grid-area: discord; }
.b-music   { grid-area: music; }
.b-now     { grid-area: now; }
.b-gh      { grid-area: gh; }
.b-anime   { grid-area: anime; }
.b-stack   { grid-area: stack; }
.b-sites   { grid-area: sites; }
.bento > .card { padding: 20px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.b-label { display: flex; align-items: center; gap: 7px; font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }

/* staggered fade-in for the tiles */
.bento > .reveal:nth-child(2) { transition-delay: .06s; }
.bento > .reveal:nth-child(3) { transition-delay: .12s; }
.bento > .reveal:nth-child(4) { transition-delay: .18s; }
.bento > .reveal:nth-child(5) { transition-delay: .24s; }
.bento > .reveal:nth-child(6) { transition-delay: .3s; }
.bento > .reveal:nth-child(7) { transition-delay: .36s; }
.bento > .reveal:nth-child(8) { transition-delay: .42s; }

/* hero */
.b-hero {
  position: relative; padding: 34px 34px 30px !important; justify-content: center;
  background: radial-gradient(520px circle at 0% 0%, rgba(124, 58, 237, .18), transparent 65%), radial-gradient(420px circle at 100% 100%, rgba(91, 33, 182, .08), transparent 70%), var(--panel);
  border-color: rgba(255, 255, 255, .1);
}
.b-hero .eyebrow { margin-bottom: 6px; }
.b-hero .hello { text-align: left; font-size: clamp(40px, 5.4vw, 64px); }
.b-hero .tagline { text-align: left; margin: 14px 0 0; max-width: 28rem; font-size: 16px; }
.hero-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.copy-tag {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border-hi); background: rgba(88, 101, 242, .1);
  font: 500 13px var(--mono); color: var(--text); transition: border-color .2s, background .2s, transform .2s;
}
.copy-tag svg { width: 16px; height: 16px; fill: #8b93ff; }
.copy-tag .copy-hint { color: var(--faint); font-size: 11px; padding-left: 8px; border-left: 1px solid var(--border-hi); }
.copy-tag:hover { border-color: rgba(139, 147, 255, .6); background: rgba(88, 101, 242, .18); }
.copy-tag:active { transform: scale(.97); }
.copy-tag:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 3px; }
.b-hero .socials { justify-content: flex-start; margin-top: 16px; }

/* the chibi: poke it */
.chibi {
  position: absolute; right: 18px; bottom: 14px; width: 84px; height: 84px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 10px 24px rgba(139, 92, 246, .45)); -webkit-tap-highlight-color: transparent;
}
.chibi img { width: 100%; height: 100%; animation: intro-bob 2.6s ease-in-out infinite; }
.chibi:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 4px; border-radius: 16px; }
.chibi.hop img { animation: chibi-hop .5s cubic-bezier(.3,1.6,.5,1); }
.chibi.spin img { animation: chibi-spin .9s cubic-bezier(.3,1.4,.5,1); }
@keyframes chibi-hop { 40% { transform: translateY(-18px) rotate(-6deg); } }
@keyframes chibi-spin { to { transform: rotate(360deg) scale(1.1); } }
.chibi-say {
  position: absolute; right: 70px; bottom: 74px; white-space: nowrap; pointer-events: none;
  padding: 6px 11px; border-radius: 12px 12px 2px 12px; background: #f5f3ff; color: #1e1036;
  font: 600 12px Inter, sans-serif; opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .2s, transform .25s cubic-bezier(.3,1.5,.5,1);
}
.chibi-say.show { opacity: 1; transform: none; }

/* discord tile reuses the existing card, minus its old page margins */
.b-discord.discord { max-width: none; margin: 0; padding: 20px; }
.b-discord .dc-activity { margin-top: 14px; padding-top: 14px; }
.b-discord .act:has(.bar) { display: none; } /* Spotify lives in its own tile */

/* music: now playing, or the playlist */
.b-music { padding: 0 !important; justify-content: center; }
.np { display: flex; align-items: center; gap: 20px; padding: 20px; height: 100%; }
.np[hidden], .np-list[hidden] { display: none; }
.np-disc { position: relative; flex: none; width: 128px; height: 128px; border-radius: 50%; overflow: hidden; background: #111; box-shadow: 0 0 0 6px #0c0c0f, 0 0 40px -8px rgba(29, 185, 84, .55); animation: np-spin 8s linear infinite; }
.np-disc img { width: 100%; height: 100%; object-fit: cover; }
.np-disc::after { content: ""; position: absolute; inset: 42%; border-radius: 50%; background: #0c0c0f; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
@keyframes np-spin { to { transform: rotate(360deg); } }
.np-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.np-text .b-label { color: #1ed760; margin-bottom: 8px; }
.np-text strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text > span:not(.b-label):not(.np-bar) { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar { display: block; height: 4px; margin-top: 14px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.np-bar i { display: block; height: 100%; width: 0; background: #1ed760; border-radius: inherit; transition: width 1s linear; }
.np-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.np-eq b { width: 3px; background: currentColor; border-radius: 1px; animation: np-eq 1s ease-in-out infinite; }
.np-eq b:nth-child(2) { animation-delay: .2s; } .np-eq b:nth-child(3) { animation-delay: .4s; }
@keyframes np-eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }
.np-list { padding: 12px; }
.np-list iframe { display: block; border: 0; border-radius: 12px; background: #121212; }

/* now */
.now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.now-list li { display: flex; flex-direction: column; min-width: 0; }
.now-k { font: 500 11px var(--mono); color: var(--violet-hi); }
.now-v { font-weight: 600; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.now-v:hover { color: var(--lilac); }

/* github contributions */
.b-gh { justify-content: space-between; }
.gh-grid { width: 100%; height: auto; display: block; }
.gh-grid rect { rx: 2px; }
.gh-total { margin-top: 10px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.gh-total strong { color: var(--lilac); font-size: 16px; }

/* anime: favourites cross-fade */
.b-anime { position: relative; padding: 0 !important; }
.b-anime .b-label { position: absolute; top: 16px; left: 16px; z-index: 3; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.anime-stage { position: absolute; inset: 0; z-index: 0; }
.anime-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1.2s ease, transform 6s ease-out; }
.anime-stage img.on { opacity: 1; transform: scale(1); }
.b-anime::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(7,6,11,.6) 0%, transparent 24%, transparent 38%, rgba(7,6,11,.88) 68%, rgba(7,6,11,.97) 100%); }
.anime-cap { position: relative; z-index: 3; margin-top: auto; padding: 0 16px; font-weight: 700; font-size: 16px; line-height: 1.25; text-shadow: 0 2px 10px rgba(0,0,0,.8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.anime-stats { position: relative; z-index: 3; display: flex; gap: 14px; padding: 8px 16px 16px; font: 12px var(--mono); color: #d9d5ea; }
.anime-stats strong { color: var(--lilac); font-size: 14px; }

/* stack */
.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stack li { font: 500 12px var(--mono); padding: 4px 9px; border-radius: 8px; color: var(--lilac); background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .22); }

/* sites for friends */
.b-sites { justify-content: space-between; }
.b-sites-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.b-sites-row img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--border-hi); transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.b-sites:hover .b-sites-row img:nth-child(odd) { transform: translateY(-4px) rotate(-1.5deg); }
.b-sites:hover .b-sites-row img:nth-child(even) { transform: translateY(-4px) rotate(1.5deg); }
.b-sites-text { margin-top: 12px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---------- projects: dim the others on hover ---------- */
.made .featured:hover > .tile:not(:hover) { opacity: .55; }
.made .tile { transition: opacity .3s, transform .35s cubic-bezier(.2,.7,.2,1), border-color .35s, box-shadow .35s; }
.section { margin-bottom: 88px; }
.best-repos { grid-template-columns: repeat(3, 1fr); }
.footer p + p { margin-top: 6px; }
.footer p:first-of-type { color: var(--faint); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 30; padding: 10px 16px; border-radius: 12px;
  background: #f5f3ff; color: #1e1036; font: 600 14px Inter, sans-serif; box-shadow: 0 18px 50px -12px rgba(0,0,0,.8);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.3,1.5,.5,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- easter egg: star burst + secret mode ---------- */
.burst { position: fixed; z-index: 40; pointer-events: none; font-size: 18px; color: var(--lilac); animation: burst 1.1s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes burst { to { transform: translate(var(--bx), var(--by)) rotate(var(--br)) scale(.4); opacity: 0; } }
html.secret .aurora { filter: hue-rotate(0deg); animation: secret-hue 3s linear infinite; }
html.secret .hello span { animation: secret-hue 3s linear infinite; }
@keyframes secret-hue { to { filter: hue-rotate(360deg); } }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "hero hero"
      "discord discord"
      "music music"
      "now anime"
      "stack anime"
      "gh gh"
      "sites sites";
  }
  .best-repos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr; grid-auto-rows: auto;
    grid-template-areas: "hero" "discord" "music" "now" "gh" "anime" "stack" "sites";
  }
  .b-anime { min-height: 300px; }
  .b-hero { padding: 26px 22px 104px !important; }
  .np-disc { width: 92px; height: 92px; }
  .np { gap: 16px; }
  .best-repos { grid-template-columns: 1fr; }
  .pill-nav a { padding: 7px 10px; }
}

@media (hover: none) { .cursor-glow { display: none; } .made .featured:hover > .tile:not(:hover) { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cursor-glow, .np-disc, .chibi img, .anime-stage img { animation: none !important; transition: none !important; }
}
@media (max-width: 600px) {
  .b-hero .socials { gap: 8px; flex-wrap: nowrap; }
  .b-hero .social { width: 40px; height: 40px; }
  .b-hero .social svg { width: 17px; height: 17px; }
}
.anime-stats { align-self: flex-start; margin: 6px 16px 16px; padding: 5px 10px; border-radius: 999px; background: rgba(7, 6, 11, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
