:root {
  --bg-start: #090b16;
  --bg-mid: #111633;
  --bg-end: #08121f;
  --accent: #5b8def;
  --accent2: #85ffe4;
  --accent3: #b5b7ff;
  --text: #f5f7ff;
  --muted: #99a3c4;
  --card: rgba(255,255,255,0.06);
  --radius-lg: 22px;
  --shadow: 0 22px 50px rgba(0,0,0,0.35);
  --max: 1140px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(140deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  background-size: 300% 300%;
  animation: gradientMove 16s ease infinite;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  position: relative;
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
#particles { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; }
.glow-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 10%, rgba(91,141,239,0.35), transparent 50%),
              radial-gradient(circle at 80% 10%, rgba(181,183,255,0.25), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(6,7,10,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.015);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: "Orbitron", sans-serif;
  letter-spacing: .02em;
  font-size: .9rem;
}
.logo-icon img {
  width: 38px;
  height: 38px;
  border-radius: 1.4rem;
  object-fit: cover;
}
.nav-links {
  display: flex;
  gap: 1.2rem;
  font-size: .8rem;
  color: #e6ebff;
}
.nav-links a { 
  position: relative;
  color: #e6ebff;
  text-decoration: none;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease-out;
}
.nav-links a:hover { color: #ffffff; }
.nav-links a:hover::after { transform: scaleX(1); }

.hero {
  max-width: var(--max);
  margin: 52px auto 34px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 3rem;
  align-items: center;
  position: relative;
}
.hero-left .badge {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  background: rgba(133,255,228,0.1);
  border: 1px solid rgba(133,255,228,0.35);
  border-radius: 999px;
  padding: .25rem .8rem .2rem;
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2.5rem, 3.8vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: .01em;
  margin-bottom: 1.1rem;
}
.hero-highlight {
  background: linear-gradient(90deg, #8ef, #5b8def 40%, #b5b7ff 75%);
  -webkit-background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--muted);
  max-width: 550px;
  margin-bottom: 1.4rem;
}
.hero-card {
  position: relative;
  background: radial-gradient(circle at 10% 10%, rgba(91,141,239,.25), rgba(13,15,22,.01));
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 20px;
  padding: 1.1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.hero-card .x-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: .8rem;
  text-decoration: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 600;
}
.profile { display: flex; gap: .6rem; align-items: center; }
.avatar img {
  width: 56px; height: 56px;
  border-radius: 18px;
  object-fit: cover;
}

section { max-width: var(--max); margin: 50px auto 0; padding: 0 18px; }
.section-title {
  font-size: 1.25rem;
  margin-bottom: 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 70px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent2), transparent);
  animation: glowline 3s linear infinite;
  border-radius: 3px;
}
@keyframes glowline { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.grid { display: grid; gap: 1.15rem; }
.projects { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.035);
  border-radius: 18px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* ボタンを下揃えにする */
  gap: .4rem;
}
.card-title {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: .25rem; /* ← Udemyと同等に詰める */
}

.card-desc {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .4rem; /* ← タイトルとの距離を狭める */
}
footer {
  max-width: var(--max);
  margin: 40px auto;
  padding: 0 18px 32px;
  color: var(--muted);
  font-size: .7rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: .7rem 1.05rem;
  border-radius: 999px;
  color: #ffffff;
  font-size: .8rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .25s ease, color .25s ease;
  align-self: flex-start;
  margin-top: auto; /* カード内で下に固定 */
}
.btn-secondary:hover {
  background: linear-gradient(90deg, var(--accent2), var(--accent)); /* エメラルド→ブルー */
  color: #060910;
}

.coupon-box {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 8px;
  padding: .5rem .8rem;
  font-size: .8rem;
  font-weight: 700;
  color: #060910;
  box-shadow: 0 0 15px rgba(133,255,228,0.25);
  margin-top: .5rem;
}
.coupon-box strong {
  color: #060910;
}
/* ==============================
   📱 スマホ向けレイアウト調整
   ============================== */
@media (max-width: 480px) {
  /* ヒーロー全体を1カラムに */
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
  }

  /* 左右の配置を整理（タイトル以外は左揃え） */
  .hero-left {
    text-align: left;
  }

  .hero-title {
    font-size: 1.9rem;
    line-height: 1.2;
    text-align: left; 
  }

  .hero-sub {
    font-size: .85rem;
    margin: 0 auto 1.4rem;
    text-align: left; /* 説明文は左揃え */
  }

  .badge {
    margin-left: 0; /* 左寄せ */
  }

  /* プロフィールカード */
  .hero-card {
    max-width: 280px;
    margin: 0 auto;
    padding: 1rem;
  }

  /* ヘッダー（ナビゲーション） */
  .nav {
    flex-direction: column;
    gap: .5rem;
    text-align: center;
  }

  .logo {
    justify-content: center;
  }

  /* Udemy／Kindleカード */
  .card {
    padding: .8rem;
  }

  .card-title {
    line-height: 1.25;
    font-size: .95rem;
    margin-bottom: .25rem;
  }

  .card-desc {
    font-size: .8rem;
    margin-bottom: .4rem;
  }

  /* ボタンサイズを調整 */
  .btn-secondary {
    font-size: .8rem;
    padding: .65rem 1rem;
  }
  
  #kindle .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.8rem; /* 余白を少しだけ詰めてもOK（お好みで） */
  }

}