/* ==========================================================================
   Personal Hub / Digital Room  —  Dark + Bento Grid + a little retro
   ========================================================================== */
:root {
  --bg: #0B0D10;
  --card: #14171C;
  --card-2: #1A1E25;
  --border: #272B33;
  --text: #F4F4F5;
  --sub: #9298A5;
  --accent: #7C6CFF;
  --radius: 22px;
  --gap: 16px;
  --font: "Space Grotesk", "Zen Kaku Gothic New", system-ui, sans-serif;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--sub); }
.small { font-size: .8rem; }
.mono { font-family: var(--mono); }

/* ほんのり背景の光 */
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% -5%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(500px 380px at -5% 40%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
body::after { /* うっすらノイズ(レトロ感) */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px max(24px, calc((100% - 1152px) / 2));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.logo { font-weight: 700; font-size: 1.25rem; text-decoration: none; letter-spacing: .02em; }
.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none; color: var(--sub); font-size: .95rem;
  padding: 6px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--card-2); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 8px 24px 40px; }

/* ---------- card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  min-width: 0;
}
.glass {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, rgba(255,255,255,.04)), rgba(255,255,255,.02));
  border-color: rgba(255,255,255,.09);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 20px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}
.label {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .14em;
  color: var(--sub); margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.more {
  display: inline-block; margin-top: 18px; font-size: .9rem; text-decoration: none; color: var(--sub);
  transition: color .2s;
}
.more:hover { color: var(--accent); }
.card-head .more { margin-top: 0; }

/* ---------- Bento grid (top) ---------- */
.bento {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "hero hero hero hero"
    "proj proj proj np"
    "fav  news news side";
}
.bento .hero { grid-area: hero; }
.bento .projects { grid-area: proj; }
.bento .now-playing { grid-area: np; }
.bento .favorites { grid-area: fav; }
.bento .recently  { grid-area: news; }
.side-stack { grid-area: side; display: flex; flex-direction: column; gap: var(--gap); }
.side-stack:empty { display: none; }

/* hero */
.hero { padding: clamp(36px, 7vw, 88px) clamp(26px, 6vw, 72px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: auto -10% -60% auto; width: 460px; height: 460px;
  border-radius: 50%; filter: blur(40px); opacity: .35;
  background: conic-gradient(from 180deg, var(--accent), #3ad6ff, var(--accent));
  animation: spin 18s linear infinite;
}
.hero > * { position: relative; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 4.2rem); font-weight: 700; max-width: 14em; }
.hero-text { font-family: var(--font-jp); color: var(--sub); margin-top: 22px; font-size: clamp(.95rem, 1.6vw, 1.1rem); }
.explore {
  display: inline-flex; gap: 8px; align-items: center; margin-top: 36px;
  text-decoration: none; font-size: .9rem; padding: 10px 20px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-2); transition: border-color .2s, transform .2s;
}
.explore:hover { border-color: var(--accent); transform: translateY(-2px); }
.explore span { animation: bob 1.8s ease-in-out infinite; }

/* projects */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 4px; }
.project-card {
  display: block; text-decoration: none; border-radius: 16px; overflow: hidden;
  background: var(--card-2); border: 1px solid var(--border);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 18px 40px -20px color-mix(in srgb, var(--accent) 70%, transparent);
}
.project-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: #0f1216; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.project-card:hover .project-thumb img { transform: scale(1.05); }
.thumb-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #0f1216), #0f1216 70%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255,255,255,.04) 22px 23px);
  background-blend-mode: screen;
}
.thumb-placeholder span { font-family: var(--mono); font-size: 2rem; opacity: .7; letter-spacing: .1em; }
.project-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 14px 16px 4px; }
.project-meta h3 { font-size: 1.02rem; }
.project-meta .muted { font-size: .82rem; }
.arrow { color: var(--sub); transition: color .2s, transform .2s; font-size: 1.1rem; }
.project-card:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.project-desc { font-family: var(--font-jp); font-size: .85rem; color: var(--sub); padding: 0 16px 16px; }

/* now playing */
.now-playing { display: flex; flex-direction: column; }
.np-main { display: flex; flex-direction: column; gap: 16px; }
.np-text h3 { font-size: 1.3rem; }
.album-art {
  width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: #0f1216; border: 1px solid var(--border); flex-shrink: 0;
}
.album-art img { width: 100%; height: 100%; object-fit: cover; }
.art-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.4rem; color: rgba(255,255,255,.8);
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 80%, #fff 0%), transparent 55%),
              radial-gradient(circle at 80% 90%, #3ad6ff66, transparent 50%), #15131f;
}
.now-playing .album-art.lg { max-width: 240px; box-shadow: 0 20px 40px -18px rgba(0,0,0,.8); }
.progress { height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); margin-top: 20px; overflow: hidden; }
.progress span {
  display: block; height: 100%; width: 36%; border-radius: inherit; background: var(--accent);
  box-shadow: 0 0 12px var(--accent); animation: play 60s linear infinite;
}
.progress-time { display: flex; justify-content: space-between; font-size: .7rem; color: var(--sub); margin-top: 6px; }
.np-comment { font-family: var(--font-jp); font-size: .9rem; margin-top: 14px; color: #d7d9e0; }
.now-playing .more { margin-top: auto; padding-top: 18px; }
.music-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: .85rem; }
.music-links:empty { display: none; }
.music-links a { color: var(--sub); text-decoration: none; }
.music-links a:hover { color: var(--accent); }

/* equalizer */
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }

/* favorites */
.fav-list { display: grid; gap: 6px; }
.fav-list li > a, .fav-list li { text-decoration: none; }
.fav-list li > a, .fav-list li:not(:has(> a)) {
  display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; transition: background .2s;
}
.fav-list li > a:hover { background: var(--card-2); }
.fav-icon { font-size: 1.3rem; grid-row: span 2; text-align: center; }
.fav-title { font-weight: 500; }
.fav-desc { font-size: .78rem; font-family: var(--font-jp); line-height: 1.4; }

/* recently */
.news-list li { display: flex; gap: 18px; padding: 12px 0; border-bottom: 1px dashed var(--border); font-family: var(--font-jp); }
.news-list li:last-child { border-bottom: 0; }
.news-list time { color: var(--accent); font-size: .85rem; white-space: nowrap; padding-top: 2px; }
.news-list a { text-decoration: none; } .news-list a:hover { color: var(--accent); }

/* recommend mini */
.mini-music { display: grid; gap: 12px; }
.mini-music li { display: flex; gap: 12px; align-items: center; }
.mini-music strong { display: block; font-size: .92rem; font-weight: 500; }
.mini-music .muted { font-size: .78rem; }
.mini-art {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--border); color: var(--accent);
}
.mini-art img { width: 100%; height: 100%; object-fit: cover; }
.recommend .more { margin-top: 14px; }

/* retro counter */
.counter-num { display: flex; gap: 3px; }
.counter-num span {
  flex: 1; max-width: 28px; text-align: center; padding: 4px 0; border-radius: 5px; font-size: 1.05rem;
  background: #07080a; border: 1px solid var(--border); color: #7dffb2; text-shadow: 0 0 8px #7dffb299;
}
.counter .small { margin-top: 10px; font-family: var(--font-jp); }

/* ---------- sub pages ---------- */
.page-head { padding: 40px 4px 30px; }
.page-head h1 { font-family: var(--font-jp); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 8px; }
.page-head .label { margin-bottom: 10px; }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.work-item { padding: 10px; }
.work-item .project-card { background: transparent; border: 0; box-shadow: none; }
.work-item:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.work-item .project-card:hover { transform: none; box-shadow: none; }
.work-item .project-thumb { border-radius: 14px; }

.music-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.music-layout .now-playing { position: sticky; top: 90px; }
.music-list { display: grid; gap: var(--gap); }
.music-card { display: grid; grid-template-columns: 132px 1fr; gap: 22px; align-items: center; transition: border-color .25s; }
.music-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.music-card h3 { font-size: 1.15rem; }
.music-comment { font-family: var(--font-jp); margin-top: 10px; color: #d7d9e0; font-size: .92rem; }

.about-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); }
.about-text { font-family: var(--font-jp); font-size: 1.02rem; line-height: 2; }
.about-news { grid-column: 1 / -1; }

.notfound { text-align: center; padding: 80px 24px; margin-top: 30px; }
.notfound h1 { font-family: var(--font-jp); margin: 10px 0; }
.notfound .label { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 60px 24px 50px; border-top: 1px solid var(--border); margin-top: 30px; }
.footer-msg { font-size: 1.3rem; font-weight: 500; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px; margin: 20px 0; }
.footer-links a { color: var(--sub); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.copyright { color: var(--sub); font-size: .8rem; font-family: var(--mono); }

/* ---------- animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(3px); } }
@keyframes play { from { width: 8%; } to { width: 100%; } }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "hero hero"
      "proj proj"
      "np   fav"
      "news news"
      "side side";
  }
  .side-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .music-layout { grid-template-columns: 1fr; }
  .music-layout .now-playing { position: static; }
  .now-playing .album-art.lg { max-width: 180px; }
}
@media (max-width: 639px) {
  :root { --gap: 12px; --radius: 18px; }
  .wrap { padding: 4px 16px 30px; }
  .site-header { padding: 14px 16px; }
  .nav a { padding: 6px 10px; font-size: .88rem; }
  .card { padding: 20px; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "hero" "proj" "np" "fav" "news" "side"; }
  .side-stack { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .music-card { grid-template-columns: 88px 1fr; gap: 16px; }
  .about-layout { grid-template-columns: 1fr; }
  .news-list li { flex-direction: column; gap: 2px; }
}
