:root {
  --bg: #0b0e17;
  --panel: #131829;
  --text: #eef1fb;
  --muted: #97a0ba;
  --accent: #6c5ce7;
  --accent-2: #37e6d0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* 背景のぼんやりした光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px 420px at 80% 15%, rgba(108, 92, 231, 0.18), transparent 70%),
    radial-gradient(520px 420px at 12% 85%, rgba(55, 230, 208, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== ヘッダー ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  backdrop-filter: blur(12px);
  background: rgba(11, 14, 23, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.logo span {
  color: var(--accent-2);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 28px;
  font-size: 14px;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px 40px 60px;
  z-index: 1;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: center;
  width: min(1200px, 100%);
  margin-inline: auto;
}

.hero__greeting {
  color: var(--accent-2);
  font-size: 15px;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.hero__text h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.3;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  color: var(--muted);
  margin-top: 22px;
  line-height: 2;
  font-size: 15px;
}

.hero__cta {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #8e7bff);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(108, 92, 231, 0.5);
}

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.hero__canvas-wrap {
  position: relative;
  height: min(72vh, 620px);
  /* canvas の内部解像度にグリッド列幅が引っ張られないようにする */
  min-width: 0;
}

#hero-canvas {
  /* レイアウト計算に canvas の内部解像度が影響しないよう絶対配置で切り離す */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#hero-canvas:active {
  cursor: grabbing;
}

.hero__hint {
  position: absolute;
  bottom: 4px;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.hero__scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.3em;
}

.hero__scroll::after {
  content: "";
  width: 1px;
  height: 44px;
  margin-top: 8px;
  background: linear-gradient(var(--accent-2), transparent);
  animation: scroll-line 1.8s ease-in-out infinite;
  transform-origin: top;
}

@keyframes scroll-line {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(0); opacity: 0; }
}

/* ===== Works ===== */
.works {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 80px 40px 120px;
}

.section-label {
  color: var(--accent-2);
  font-size: 13px;
  letter-spacing: 0.3em;
  margin-bottom: 10px;
}

.works h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
}

.works__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 44px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(108, 92, 231, 0.5);
}

.card__thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #2c2660, #1b4f56);
}

.card:nth-child(2) .card__thumb {
  background: linear-gradient(135deg, #16355c, #3a2a6e);
}

.card:nth-child(3) .card__thumb {
  background: linear-gradient(135deg, #114b44, #2b3a78);
}

.card__body {
  padding: 20px;
}

.card__body h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.card__body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ===== About ===== */
.about {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 80px 40px 100px;
}

.about__inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 44px;
}

.about__avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 28px;
  background: linear-gradient(135deg, #2c2660, #1b4f56);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.about__lead {
  color: var(--muted);
  line-height: 2;
  font-size: 15px;
  margin-top: 20px;
}

.about__lead strong {
  color: var(--text);
}

.skill-list {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.skill-list li {
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--text);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
}

.about__links {
  margin-top: 28px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.icon-link {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(55, 230, 208, 0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.icon-link:hover {
  color: #fff;
  border-color: #fff;
}

/* ===== Contact ===== */
.contact {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 80px 40px 120px;
}

.contact__lead {
  color: var(--muted);
  font-size: 15px;
  margin-top: 14px;
  margin-bottom: 44px;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact__form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.contact__form input,
.contact__form textarea {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.contact__form input:focus,
.contact__form textarea:focus {
  border-color: var(--accent);
}

.contact__form input::placeholder,
.contact__form textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.contact__form .btn {
  align-self: flex-start;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* ===== フッター ===== */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== レスポンシブ ===== */
@media (max-width: 900px) {
  .nav {
    display: none;
  }

  /* 下部はスクロールインジケーター(約90px)と重ならないよう余白を確保 */
  .hero {
    padding: 90px 24px 150px;
  }

  .hero__scroll {
    bottom: 18px;
  }

  .hero__scroll::after {
    height: 36px;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__text h1 {
    font-size: clamp(1.4rem, 6.2vw, 2rem);
  }

  /* スマホではキャラクターを先頭に */
  .hero__canvas-wrap {
    order: -1;
    height: 46vh;
  }

  .hero__cta {
    justify-content: center;
  }

  .works {
    padding: 60px 24px 90px;
  }

  .works__grid {
    grid-template-columns: 1fr;
  }

  .about {
    padding: 60px 24px 80px;
  }

  .about__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about__avatar {
    max-width: 200px;
    margin-inline: auto;
  }

  .contact {
    padding: 60px 24px 100px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
