:root {
  --bg: #f5f1e6;
  --ink: #1c1a14;
  --ink-soft: #4a4536;
  --muted: #8a8470;
  --hair: rgba(28, 26, 20, 0.14);
  --card: #ffffff;
  --accent: #e8c25a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15140f;
    --ink: #f3efe2;
    --ink-soft: #c9c3ae;
    --muted: #8b8570;
    --hair: rgba(243, 239, 226, 0.14);
    --card: #201e17;
    --accent: #e8c25a;
  }
}
:root[data-theme="dark"] {
  --bg: #15140f;
  --ink: #f3efe2;
  --ink-soft: #c9c3ae;
  --muted: #8b8570;
  --hair: rgba(243, 239, 226, 0.14);
  --card: #201e17;
  --accent: #e8c25a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans JP', -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.75;
  transition: background 0.2s ease, color 0.2s ease;
}
a { color: inherit; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(10, 9, 6, 0.15) 0%, rgba(10, 9, 6, 0.75) 88%),
    url("Gallery/VRChat_2023-10-05_06-45-21.725_3840x2160_preview.jpeg") center 30% / cover no-repeat;
  color: #f5f1e6;
}

.theme-toggle {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  gap: 4px;
  font-size: 0.72rem;
  z-index: 2;
}
.theme-toggle button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(245, 241, 230, 0.8);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  backdrop-filter: blur(6px);
}
.theme-toggle button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px 56px;
  width: 100%;
}

.hero-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin-bottom: 18px;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.hero h1 {
  font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 1;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: 1rem;
  max-width: 40ch;
  margin: 0 0 22px;
  color: rgba(245, 241, 230, 0.88);
}

.hero-links {
  display: flex;
  gap: 10px;
}
.hero-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease;
}
a.hero-icon-btn:hover {
  background: rgba(232, 194, 90, 0.25);
  border-color: var(--accent);
}
.hero-icon-btn.is-pending {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Shell ---------- */

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Gallery ---------- */

.gallery-section {
  padding: 64px 0 56px;
}

.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 22px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 120px;
  gap: 8px;
}
.gallery .photo:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.gallery .photo:nth-child(2) { grid-column: span 3; grid-row: span 2; }
.gallery .photo:nth-child(3) { grid-column: span 2; grid-row: span 2; }
.gallery .photo:nth-child(4) { grid-column: span 2; grid-row: span 2; }
.gallery .photo:nth-child(5) { grid-column: span 2; grid-row: span 2; }

.photo {
  overflow: hidden;
  border-radius: 4px;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.photo:hover img { transform: scale(1.06); }

/* ---------- About ---------- */

.about-section {
  padding: 40px 0 56px;
  border-top: 1px solid var(--hair);
}
.about-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: baseline;
}
.about-row dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
}
.about-row dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Projects ---------- */

.projects-section {
  padding: 40px 0 72px;
  border-top: 1px solid var(--hair);
}

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: 'JetBrains Mono', monospace;
}
.index-row {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
}
.index-row:first-child { padding-top: 0; }
.index-row:last-child { border-bottom: none; }

.idx-num {
  color: var(--muted);
  font-size: 0.78rem;
}

.idx-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  min-width: 0;
}
.idx-name {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
}
a.idx-name:hover { color: var(--accent); }
span.idx-name { color: var(--muted); font-weight: 500; }

.idx-desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
}

.idx-links {
  display: grid;
  grid-template-columns: 66px 74px;
  gap: 12px;
  font-size: 0.74rem;
  white-space: nowrap;
}
.link-slot {
  display: flex;
  align-items: center;
  height: 1.4em;
}
.idx-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--muted);
}
.idx-links a:hover { color: var(--accent); }

footer {
  padding: 32px 0 48px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .gallery .photo { grid-column: span 1 !important; grid-row: span 1 !important; }
  .index-row { grid-template-columns: 2em 1fr; }
  .idx-links { grid-column: 2 / -1; }
}

@media (max-width: 520px) {
  .hero-inner, .shell { padding-left: 22px; padding-right: 22px; }
  .about-row { grid-template-columns: 1fr; gap: 4px; }
}
