/* GainzNote 種目DB — tools/build_exercise_site.py がコピーする共通スタイル。
   配色・書体は紹介ページ（apps/gainznote/index.html）と揃える。 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #09090e;
  --surface: #101016;
  --surface-up: #17171f;
  --accent: #b8ff3c;
  --accent-dim: rgba(184, 255, 60, 0.09);
  --text: #eeeef4;
  --text-mid: #8888a0;
  --text-muted: #5a5a72;
  --border: rgba(255, 255, 255, 0.07);
  --border-up: rgba(255, 255, 255, 0.13);
  --max-w: 1160px;
  --px: clamp(1rem, 5vw, 3rem);
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --r: 16px;
  --r-sm: 8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 方眼紙のような薄いグリッド：仕様書・記録ノートの手触り */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.6;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- NAV ---- */
.nav-wrap {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9, 9, 14, 0.85);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--max-w); margin: 0 auto; height: 60px; padding: 0 var(--px);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.accent, .nav-logo .accent { color: var(--accent); }
.nav-db {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border: 1px solid var(--border-up); border-radius: 999px;
  font-size: 0.78rem; font-weight: 500; color: var(--text-mid);
  transition: border-color 0.2s, color 0.2s;
}
.nav-db:hover { color: var(--text); border-color: var(--accent); }
.nav-db .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--px); }

/* ---- INDEX HERO ---- */
.db-hero { padding: clamp(3rem, 9vw, 6.5rem) 0 2.5rem; animation: rise 0.7s ease-out both; }
.kicker, .cta-kicker, .card-no, .spec dt, .db-stats dt, .block-title span {
  font-family: var(--mono); letter-spacing: 0.08em;
}
.kicker { font-size: 0.72rem; color: var(--accent); margin-bottom: 1rem; }
.db-title {
  font-size: clamp(3.2rem, 12vw, 7.5rem); font-weight: 900; line-height: 0.95;
  letter-spacing: -0.04em;
}
.db-lead { margin-top: 1.4rem; max-width: 40rem; color: var(--text-mid); font-size: 1rem; }
.db-stats { display: flex; gap: 2.5rem; margin-top: 2rem; }
.db-stats dt { font-size: 0.66rem; color: var(--text-muted); }
.db-stats dd { font-family: var(--mono); font-size: 2rem; font-weight: 500; color: var(--accent); line-height: 1.2; }

.not-found { padding: clamp(4rem, 14vw, 9rem) var(--px) clamp(4rem, 10vw, 6rem); }
.not-found .db-title { font-size: clamp(2.4rem, 9vw, 5rem); }
.not-found .db-lead { margin-bottom: 2rem; }

/* ---- FILTERS ---- */
.filters {
  position: sticky; top: 60px; z-index: 50;
  padding: 0.9rem 0; margin: 0 calc(var(--px) * -1); padding-inline: var(--px);
  background: linear-gradient(var(--bg) 75%, transparent);
}
.search input {
  width: 100%; padding: 0.8rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border-up); border-radius: 999px;
  color: var(--text); font: inherit; font-size: 16px; outline: none;
  transition: border-color 0.2s;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--text-muted); }
.chips {
  display: flex; gap: 0.5rem; margin-top: 0.75rem;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-up);
  color: var(--text-mid); font: inherit; font-size: 0.85rem; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip span { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.chip:hover { color: var(--text); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #09090e; font-weight: 600; }
.chip.is-on span { color: rgba(9, 9, 14, 0.6); }
.empty { padding: 3rem 0; color: var(--text-mid); text-align: center; }

/* ---- GRID ---- */
.grid {
  list-style: none; display: grid; gap: 1rem; padding: 0.5rem 0 4rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.card[hidden] { display: none; }
.card a {
  display: block; height: 100%; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color 0.2s, transform 0.2s;
}
.card a:hover { border-color: rgba(184, 255, 60, 0.45); transform: translateY(-3px); }
.card-media { aspect-ratio: 16 / 9; background: var(--surface-up); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card a:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 0.9rem 1rem 1.1rem; }
.card-no { font-size: 0.68rem; color: var(--text-muted); }
.card-name { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; margin: 0.15rem 0 0.4rem; }
.card-meta { font-size: 0.78rem; color: var(--text-mid); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: var(--r-sm);
  background: var(--accent-dim); color: var(--accent); font-size: 0.74rem; font-weight: 600;
}

/* ---- DETAIL ---- */
.detail { padding-bottom: 3rem; }
.crumbs {
  display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 1.4rem 0;
  font-size: 0.8rem; color: var(--text-muted);
}
.crumbs a { color: var(--text-mid); }
.crumbs a:hover { color: var(--accent); }
.detail-head {
  display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  grid-template-columns: 1fr; animation: rise 0.6s ease-out both;
}
@media (min-width: 860px) { .detail-head { grid-template-columns: 1.15fr 1fr; } }
.detail-media {
  position: relative; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--border-up); background: var(--surface-up); aspect-ratio: 16 / 9;
}
.detail-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(184, 255, 60, 0.08);
}
.hero-video { width: 100%; height: 100%; object-fit: cover; }
.detail-title {
  font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900; line-height: 1.1;
  letter-spacing: -0.035em; margin: 0.3rem 0 0.4rem;
}
.aliases { font-size: 0.85rem; color: var(--text-mid); }
.detail-lead { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; font-size: 0.88rem; color: var(--text-mid); }
.spec {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 1.6rem;
  border: 1px solid var(--border-up); border-radius: var(--r); overflow: hidden;
}
.spec div { padding: 0.9rem 0.8rem; background: var(--surface); }
.spec div + div { border-left: 1px solid var(--border-up); }
.spec dt { font-size: 0.64rem; color: var(--text-muted); }
.spec dd { font-family: var(--mono); font-size: clamp(1.15rem, 4vw, 1.6rem); font-weight: 500; color: var(--text); line-height: 1.3; }
.spec div:first-child dd, .spec div:nth-child(2) dd { color: var(--accent); }
.spec-note { margin-top: 0.6rem; font-size: 0.75rem; color: var(--text-muted); }

.block { margin-top: clamp(2.5rem, 6vw, 3.5rem); }
.block-title {
  display: flex; align-items: baseline; gap: 0.8rem;
  font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em;
  padding-bottom: 0.8rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--border-up);
}
.block-title span { font-size: 0.75rem; color: var(--accent); }
.block-title.sub { font-size: 1.05rem; }
.muscles { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.muscles h3 { font-size: 0.78rem; font-weight: 500; color: var(--text-mid); margin-bottom: 0.5rem; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pills li {
  padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-up); font-size: 0.9rem;
}
.pills-main li { border-color: rgba(184, 255, 60, 0.5); color: var(--accent); font-weight: 600; }

.steps { list-style: none; counter-reset: step; display: grid; gap: 0.6rem; }
.steps li {
  counter-increment: step; position: relative;
  padding: 1rem 1.1rem 1rem 3.6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 1.1rem; top: 1rem;
  font-family: var(--mono); font-size: 0.85rem; color: var(--accent);
}
.tips { list-style: none; display: grid; gap: 0.5rem; }
.tips li { position: relative; padding-left: 1.4rem; color: var(--text); }
.tips li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.72em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--accent);
}

.mini-grid {
  list-style: none; display: grid; gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
}
.mini-grid a {
  display: block; overflow: hidden; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); transition: border-color 0.2s;
}
.mini-grid a:hover { border-color: rgba(184, 255, 60, 0.45); }
.mini-grid img { aspect-ratio: 16 / 9; width: 100%; height: auto; object-fit: cover; }
.mini-grid span { display: block; padding: 0.6rem 0.75rem; font-size: 0.88rem; font-weight: 600; }

/* ---- CTA ---- */
.cta {
  max-width: var(--max-w); margin: 2rem auto 0; padding: clamp(3rem, 8vw, 5rem) var(--px);
  text-align: center; border-top: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 70% at 50% 100%, var(--accent-dim), transparent 70%);
}
.cta-kicker { font-size: 0.72rem; color: var(--accent); }
.cta-head { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; margin: 0.6rem 0; }
.cta-sub { color: var(--text-mid); margin-bottom: 1.8rem; }
.cta-note { margin-top: 0.9rem; font-size: 0.75rem; color: var(--text-muted); }
.appstore-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; background: var(--accent); color: #09090e; border-radius: 999px;
  font-weight: 700; font-size: 1rem; transition: opacity 0.15s, transform 0.1s;
}
.appstore-btn:hover { opacity: 0.88; }
.appstore-btn:active { transform: scale(0.97); }
.appstore-btn svg { width: 20px; height: 20px; }

/* ---- FOOTER ---- */
.footer-bar {
  max-width: var(--max-w); margin: 0 auto; padding: 1.6rem var(--px);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-links a:hover { color: var(--text); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .card-body { padding: 0.6rem 0.7rem 0.8rem; }
  .card-name { font-size: 0.92rem; }
  .card-meta { font-size: 0.7rem; }
}
@media (max-width: 520px) {
  .spec { grid-template-columns: repeat(2, 1fr); }
  .spec div:nth-child(3) { border-left: 0; }
  .spec div:nth-child(n+3) { border-top: 1px solid var(--border-up); }
}
