:root {
  --bg: #121318;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f1f0ec;
  --muted: #aaa79f;
  --accent: #c9aa87;
  --accent-strong: #e0c5a8;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  min-height: 100dvh;
  height: 100%;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Hiragino Mincho ProN", serif;
  color: var(--text);
  line-height: 1.8;

  background: radial-gradient(circle at top center, #1a1c26 0%, var(--bg) 58%, var(--bg) 100%);
  background-position: top center;
  background-size: 100% 140%;
  background-repeat: no-repeat;

  padding: env(safe-area-inset-top, 0px) 0 calc(24px + env(safe-area-inset-bottom, 0px));
  animation: fadeUp 0.7s ease-out;

  position: relative;
  overflow-x: hidden;
}

/* ===== ⭐ JS星レイヤー ===== */

.star-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* パララックス回転 */
.layer-back {
  animation: rotateSlow 320s linear infinite;
}

.layer-mid {
  animation: rotateMid 200s linear infinite;
}

.layer-front {
  animation: rotateFast 120s linear infinite;
}

/* 星 */
.star {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  background: white;

  animation: starTwinkle linear infinite;
}

/* 明滅 */
@keyframes starTwinkle {
  0% { opacity: 0.1; }
  50% { opacity: 1; }
  100% { opacity: 0.1; }
}

/* ===== 回転 ===== */

@keyframes rotateSlow {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.1);
  }
}

@keyframes rotateMid {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.12);
  }
}

@keyframes rotateFast {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.15);
  }
}

img {
  max-width: 100%;
  display: block;
}

.novel-prewrap {
  white-space: pre-wrap;
  word-break: break-word;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--accent-strong);
}

header,
.container,
.info-list,
.gallery-item,
.work,
footer {
  position: relative;
  z-index: 1;
  transition: background 0.3s ease, border-color 0.3s ease;
}

header {
  padding: 40px 20px 20px;
  text-align: center;
}

header h1,
header p,
.info-list p,
.gallery-item figcaption,
.work p,
footer {
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

nav a {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

nav a:hover,
nav a:focus {
  background: var(--surface-strong);
  color: #fff;
}

.work {
  margin-bottom: 32px;
}

.work--muted {
  opacity: 0.82;
  font-size: 1rem;
}

header h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0;
}

header p {
  font-size: 1rem;
  margin: 0.8rem auto 0;
  max-width: 560px;
}

.container {
  width: min(100%, 960px);
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 20px 50px;
}

ul {
  padding-left: 1.2rem;
  margin: 0.8rem 0;
}

li {
  margin-bottom: 0.75rem;
}

.work--muted h2 {
  font-size: 1.15rem;
  color: rgba(241, 240, 236, 0.82);
}

.work--muted a {
  color: rgba(201, 170, 135, 0.84);
}

.work--muted p {
  color: rgba(170, 163, 154, 0.78);
}

h2 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  color: #f8f5ee;
}

.info-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.info-item {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.info-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.info-item .date,
.info-item p {
  display: block;
}

.info-item .date {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201, 170, 135, 0.16);
  color: var(--accent-strong);
  font-size: 0.8rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.gallery-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.gallery-item img {
  display: block;
  width: 100%;
}

.gallery-item figcaption {
  padding: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

footer {
  margin-top: 40px;
  text-align: center;
  padding: 24px 20px;
  color: var(--muted);
}

@media screen and (max-width: 720px) {
  body { padding-bottom: 30px; }
  header { padding: 32px 18px 16px; }

  nav a {
    font-size: 0.9rem;
    padding: 9px 14px;
  }

  .container {
    padding: 24px 16px 40px;
  }

  .gallery {
    gap: 14px;
  }
}

@media screen and (max-width: 520px) {
  html { font-size: 14px; }
  body { padding-bottom: 30px; }

  header {
    padding: 26px 14px 14px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .container {
    padding: 20px 14px 32px;
  }

  nav {
    gap: 8px;
  }

  nav a {
    flex: 1 1 100%;
    max-width: 100%;
    text-align: center;
    padding: 10px 12px;
  }

  h2 {
    font-size: 1.25rem;
  }

  .work {
    margin-bottom: 28px;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 星雲 ===== */
.nebula {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;

  background: radial-gradient(circle, var(--nebula-color), transparent 70%);

  animation: nebulaPulse linear infinite;
}

/* 脈動（拡大＋透明度変化） */
@keyframes nebulaPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

.subtitle {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.tagline {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 6px;
}

/* ===== 小説一覧 ===== */

.works {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.work-card {
  display: block;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
  transition: all 0.25s ease;
}

.work-card h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  border: none;
}

.work-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ホバー */
.work-card:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

/* muted */
.work-card.muted {
  opacity: 0.75;
}

/* nav 現在位置 */
nav a.active {
  background: var(--surface-strong);
}

/* ===== スマホ調整 ===== */

@media (max-width: 520px) {
  .works {
    gap: 14px;
  }

  .work-card {
    padding: 16px;
  }

  .work-card h2 {
    font-size: 1.1rem;
  }
}

/* ===== シンプル戻るナビ ===== */

.simple-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.simple-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);

  background: var(--surface);
  color: var(--text);

  font-size: 0.9rem;
  text-decoration: none;

  transition: all 0.2s ease;
}

/* サブテキスト */
.simple-nav a span {
  font-size: 0.7rem;
  opacity: 0.7;
  color: var(--muted);
}

/* ホバー */
.simple-nav a:hover {
  background: var(--surface-strong);
}
