/* ---------------------------------------
   Demo Hero : Navy base + Pastel playful
---------------------------------------- */
:root{
  --navy-1:#0d1b2a; /* 基調 */
  --navy-2:#0b1320; /* 下方向へ少し濃い */
  --p-blue:  #a3d5ff; /* パステルブルー */
  --p-pink:  #ffd1e8; /* パステルピンク */
  --p-mint:  #b8f2e6; /* パステルミント */
  --p-sun:   #ffe9a9; /* パステルイエロー */
  --text: #ffffff;
}

.demo-hero{
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text);
  overflow: hidden;

  /* Navyの土台 + パステルのほのかな光（多層グラデ） */
  background:
    radial-gradient(60% 80% at 15% 10%, rgba(163,213,255,0.25) 0%, rgba(163,213,255,0) 60%),
    radial-gradient(65% 80% at 85% 20%, rgba(255,209,232,0.22) 0%, rgba(255,209,232,0) 60%),
    radial-gradient(70% 85% at 30% 90%, rgba(184,242,230,0.20) 0%, rgba(184,242,230,0) 60%),
    linear-gradient(180deg, var(--navy-1) 0%, var(--navy-2) 100%);
  background-blend-mode: screen, screen, screen, normal;
  animation: heroGradientShift 14s ease-in-out infinite alternate;
}

/* ふわっと漂う柔らかい光（ぼかし円） */
.demo-hero::before,
.demo-hero::after{
  content:"";
  position:absolute;
  width:70vmax;
  height:70vmax;
  filter: blur(40px);
  opacity:.35;
  pointer-events:none;
}
.demo-hero::before{
  left:-20vmax; top:-10vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255,233,169,0.35), rgba(255,233,169,0) 55%);
  animation: floatA 18s ease-in-out infinite;
}
.demo-hero::after{
  right:-25vmax; bottom:-15vmax;
  background: radial-gradient(circle at 50% 50%, rgba(163,213,255,0.35), rgba(163,213,255,0) 55%);
  animation: floatB 22s ease-in-out infinite;
}

/* タイトル（やわらかいネオン） */
.demo-hero__title{
  font-weight: 700;
  font-size: clamp(38px, 6vw, 200px);
  line-height: 1.2;
  letter-spacing: .02em;

  text-shadow:
    0 2px 10px rgba(163,213,255,.55),
    0 0 24px rgba(255,209,232,.35);
  animation: titlePop 900ms cubic-bezier(.2,.7,.2,1) both 250ms;
}

/* スクロール誘導（やさしいバウンス矢印） */
.scroll-indicator{
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  letter-spacing: .35em;
  opacity: .8;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.scroll-indicator::after{
  content:"";
  width: 12px; height: 12px;
  border-right: 2px solid rgba(255,255,255,.85);
  border-bottom: 2px solid rgba(255,255,255,.85);
  transform: rotate(45deg) translateY(-2px);
  animation: scrollBounce 1.6s ease-in-out infinite;
  opacity: .9;
}

/* 余白（他セクションと干渉しないように軽く） */
section.demo-content{ padding: 48px 16px; }

/* -------- Animations -------- */
@keyframes heroGradientShift{
  0%   { background-position: 0% 0%, 100% 0%, 30% 100%, 0% 0%; }
  100% { background-position: 10% 5%, 90% 10%, 35% 95%, 0% 100%; }
}

@keyframes floatA{
  0%   { transform: translate3d(0,0,0) scale(1);   opacity:.35; }
  50%  { transform: translate3d(3vmax,2vmax,0) scale(1.05); opacity:.45; }
  100% { transform: translate3d(0,0,0) scale(1);   opacity:.35; }
}
@keyframes floatB{
  0%   { transform: translate3d(0,0,0) scale(1);   opacity:.30; }
  50%  { transform: translate3d(-3vmax,-2vmax,0) scale(1.07); opacity:.40; }
  100% { transform: translate3d(0,0,0) scale(1);   opacity:.30; }
}

@keyframes titlePop{
  0%   { transform: translateY(10px) scale(.98); opacity: 0; }
  100% { transform: translateY(0)     scale(1);   opacity: 1; }
}

@keyframes scrollBounce{
  0%,100% { transform: rotate(45deg) translateY(-2px); opacity:.9; }
  50%     { transform: rotate(45deg) translateY(3px);  opacity:.6; }
}

/* 動きが苦手な人向けの配慮 */
@media (prefers-reduced-motion: reduce){
  .demo-hero,
  .demo-hero::before,
  .demo-hero::after,
  .demo-hero_title,
  .scroll-indicator::after{
    animation: none !important;
  }
}

/*　hero説明  */
.demo-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 10px;
}
.demo-content__title {
  font-size: 22px;
  font-weight: 700;
  color: #1b1f23;
  margin-bottom: 20px;
  position: relative;
}
.demo-content__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: #f57c1f; /* ブランドオレンジ */
  margin-top: 10px;
}

.js-fade-lines{
    font-size: 16px;
    padding-bottom: 15px;
    color: #333;
}

/* 色はサイト側に変数がなければこの値が使われます */
:root {
  --accent: #ff7a1a; /* コーポレートのオレンジ想定。必要なら変更 */
  --ink: #1f2937;
  --line: #e5e7eb;
  --card: #ffffff;
}

/* HTMLセクション　*/
.demo-html {
  padding: 20px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.demo-html h2 {
  font-weight: 700;
  margin: 0 0 32px;
  
}

.demo-html .lead {
  margin: 0 0 24px;
  color: #333333;
}

.html-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 32px;
}

.html-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.html-card h3 {
  font-size: 1rem;
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--ink);
}

.html-card code {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px 6px;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

/* 入力系の見た目を整える */
input[type="text"] {
  width: 90%;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

select {
  width: 100%;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

input[type="text"]:focus,
select:focus,
button:focus,
a.link:focus {
  outline: 3px solid rgba(255, 122, 26, .25);
  outline-offset: 2px;
}

/* ラジオ & チェックの縦並び */
.choice-group {
  display: grid;
  gap: 8px;
}

/* ボタン */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: none;
  border-radius: 9999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn:hover { opacity: .9; }

.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

/* リンク */
.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 視覚的に非表示（スクリーンリーダー向け） */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* 段落サンプル */
.sample-paragraph { line-height: 1.8; }

.tag-output__code{
  font-size:13px;
}


/* ===== CSSセクション ===== */
.demo-css { 
    padding: 20px 16px;
    max-width: 1200px;
    margin: 0 auto;
 }
.demo-css h2 { font-weight: 800; margin: 0 0 32px; }
.demo-css .lead { margin: 0 0 20px; color: #4b5563; }

/* カードの並び（HTMLセクションと同じ感じ） */
.css-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 32px;
}

/* 説明テキスト */
.hint { color: #333333;  margin-top: 10px; }

/* --- ここからボタンの“差分クラス” --- */
/* 既存の .btn を基準として、各プロパティだけ上書きする */
.demo-css .btn--color { color: #111827; }                           /* 1) color */
.demo-css .btn--fontsize { font-size: 24px; }                       /* 2) font-size */
.demo-css .btn--fontweight { font-weight: 900; }                    /* 3) font-weight */
.demo-css .btn--bg { background-color: #111827; }                   /* 4) background-color */
.demo-css .btn--width { width: 100%; }                              /* 5) width */
.demo-css .btn--height { height: 56px; }                            /* 6) height */
.demo-css .btn--padding { padding: 18px 32px; }                     /* 7) padding */

/* 高さ指定時にテキストが上寄りになるブラウザ向けの軽い調整（任意） */
.demo-css .btn--height { display: inline-flex; align-items: center; }

/* 幅100%は行頭で目立つよう block にもできる（任意） */
/* .demo-css .btn--width { display: block; } */

/* ===== CSS操作プレイグラウンド ===== */
.css-play { margin-top: 28px; }

.css-play-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 左フォーム / 右プレビュー */
  gap: 20px;
}
@media (max-width: 920px) {
  .css-play-grid { grid-template-columns: 1fr; }
}

.css-controls,
.css-preview {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }

.unit-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.unit-wrap input[type="number"] {
  width: 140px;
  padding-right: 40px;        /* 単位スペース */
}
.unit {
  position: absolute;
  right: 10px;
  color: #6b7280;
  font-size: 14px;
}

.css-controls input[type="number"],
.css-controls input[type="color"] {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 16px;
  background: #fff;
  box-sizing: border-box;
}

.css-preview .preview-header {
  font-weight: 700;
  margin-bottom: 12px;
  color: #374151;
}

/* スタイルのダンプ表示 */
.style-dump {
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.style-dump__title {
  padding: 8px 10px;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}
.style-dump__code {
  margin: 0;
  padding: 12px;
  background: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
}

/* ===== JSセクション ===== */
.demo-js { 
    padding: 20px 16px; 
    margin: 0 auto;
    max-width: 1200px;
}

.demo-js .lead { margin: 0 0 20px; color: #333; }

.js-demo { 
    text-align: center;
    margin-bottom: 32px;
}
.js-demo .btn-row { justify-content: center; }


.js-lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* 結果表示・メッセージ */
.result-row { margin-top: 10px; font-size: 16px; }
.msg { margin-top: 8px; font-weight: 600; }
.msg.ok { color: #16a34a; }   /* 緑 */
.msg.ng { color: #dc2626; }   /* 赤 */

/* いいねのカウント表示 */
.like-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 10px;
  margin-left: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  font-weight: 700;
}

/* ===== データベースセクション ===== */
.demo-db{
    padding: 20px 16px; 
    margin: 0 auto;
    max-width: 1200px;
}
.book-price{
  margin-bottom:10px;
}
.db-list{
  padding-bottom:10px;
}

/* --- DB テーブル風リスト --- */
.db-box{
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.db-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  font-weight: 700;
  color: #1b1f23;
}
.db-head__count{
  font-weight: 800;
  color: #0c3766;
}

.db-table{
  max-height: 260px;          /* 多くなったら内側スクロール */
  overflow: auto;
}

.db-row{
  display: grid;
  grid-template-columns: 1fr 120px;   /* タイトル / 価格 */
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid #f1f5f9;
}
.db-row:first-child{ border-top: none; }

.db-row--head{
  position: sticky; top: 0;
  background: #f8fafc;
  z-index: 1;
  font-weight: 800;
  color: #334155;
  border-top: none;
  border-bottom: 1px solid #e2e8f0;
}

.db-cell{ min-width: 0; }                 /* 省略時の計算用 */
.db-cell--right{ text-align: right; }

.db-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;               /* 長いタイトルは省略表示 */
}

.db-price{
  font-variant-numeric: tabular-nums;    /* 桁が揃って見やすい */
  font-weight: 700;
  color: #111827;
}

.db-empty{
  padding: 22px 14px;
  text-align: center;
  color: #6b7280;
}

/* スマホ：価格列を少し広げる/詰める */
@media (max-width: 480px){
  .db-row{ grid-template-columns: 1fr 96px; }
}


/* ===== まとめセクション / CTA ===== */
.summary-cta { 
    padding: 48px 16px; 
    margin: 0 auto;
    max-width:1200px;
}

.lead{
    color: #333;
}

/* --- CTA ボックス --- */
.cta-centered { text-align: center; margin-top: 28px; }
.cta-eyebrow {
  display: inline-block;
  letter-spacing: .18em;
  font-weight: 800;
  font-size: 12px;
  color: #ff7a1a;
  background: rgba(255,122,26,.12);
  border: 1px solid rgba(255,122,26,.25);
  padding: 4px 10px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

/* --- プレミアムCTAボタン（ネイビーバージョン） --- */
.cta-btn--prime {
  --cta1: #0d1b2a;           /* ベース濃紺 */
  --cta2: #1b263b;           /* 上側グラデーション */
  --ring: rgba(13, 27, 42, .45);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  min-width: 280px;
  height: 64px;
  padding: 0 28px;

  color: #fff;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .02em;

  background: linear-gradient(180deg, var(--cta2), var(--cta1));
  border-radius: 9999px;
  box-shadow:
    0 12px 28px rgba(13, 27, 42,.35),
    0 4px 10px rgba(0,0,0,.2),
    inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}

/* 光沢 */
.cta-btn--prime::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0) 45%);
  pointer-events: none;
  mix-blend-mode: soft-light;
}

/* 放射グロー */
.cta-btn--prime::after {
  content: "";
  position: absolute; inset: -10px;
  border-radius: inherit;
  background: radial-gradient(60% 60% at 50% 50%, rgba(13,27,42,.25), transparent 65%);
  filter: blur(10px);
  z-index: -1;
  transition: opacity .2s ease;
  opacity: .7;
}

.cta-btn__icon { width: 22px; height: 22px; }

.cta-btn--prime:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(13,27,42,.45),
    0 6px 14px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.25);
}

.cta-btn--prime:active {
  transform: translateY(0);
  filter: brightness(.95);
}

.cta-btn--prime:focus {
  outline: none;
  box-shadow:
    0 0 0 4px var(--ring),
    0 12px 28px rgba(13,27,42,.35),
    0 4px 10px rgba(0,0,0,.2);
}