/* MY DEVELOPMENT ARCHIVE — 共通スタイル
   web/index.html, web/project.html, web/devlog.html で共通利用する。
   diagram.html と近いダークトーンの配色に揃えている。 */

:root {
  color-scheme: dark;

  --bg: #05070f;
  --bg-glow: radial-gradient(60% 50% at 50% -10%, rgba(124, 92, 255, .18), transparent),
             radial-gradient(50% 40% at 90% 0%, rgba(56, 189, 248, .12), transparent);
  --panel: linear-gradient(180deg, #0c1224, #070a14);
  --panel-soft: linear-gradient(180deg, #0a0f1f, #05070f);
  --border: rgba(255, 255, 255, .1);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #e7ebf7;
  --text-dim: #a4adc4;
  --text-faint: #6b7391;

  --accent-purple: #a78bfa;
  --accent-blue: #60a5fa;
  --accent-green: #4ade80;
  --accent-orange: #fbbf24;
  --accent-pink: #f472b6;
  --accent-red: #f87171;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  background-image: var(--bg-glow);
  background-repeat: no-repeat;
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-x: clip;
}

a { color: inherit; }

img, video { max-width: 100%; }

.wrap {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ---------- アクセシビリティ / モバイル基盤 ---------- */

.skip-link {
  position: fixed;
  top: -100%;
  left: 12px;
  z-index: 200;
  background: var(--accent-blue);
  color: #04101f;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: top .15s ease;
}

.skip-link:focus {
  top: max(12px, env(safe-area-inset-top));
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 上部固定バー ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(5, 7, 15, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.topbar-brand span {
  color: var(--accent-purple);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 0;
  min-height: 44px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
}

.search-box input::placeholder { color: var(--text-faint); }

/* ---------- ヒーロー ---------- */

.hero {
  padding: 32px 0 8px;
  text-align: center;
}

.hero-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--accent-blue);
  font-weight: 700;
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, #fff, #c9d3ff 60%, var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: 17px;
  color: var(--text-dim);
}

.hero-lede {
  max-width: 640px;
  margin: 14px auto 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.75;
}

.hero-team {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- ヒーロー内メディアショーケース ---------- */

.hero-media {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
  margin: 28px 0 6px;
  text-align: left;
}

.hero-media-main {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border-radius: 22px;
  border: 1px solid rgba(85, 230, 255, .25);
  background: #060914;
  box-shadow: var(--shadow-lg);
}

.hero-media-main video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.hero-media-main span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(3, 7, 16, .74);
  backdrop-filter: blur(10px);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #55e6ff;
}

.hero-media-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.hero-media-side img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 104px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .hero-media { grid-template-columns: 1fr; }
  .hero-media-main video { min-height: 200px; }
  .hero-media-side { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .hero-media-side img { min-height: 120px; }
}

/* ---------- CTAボタン（共通） ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, .35);
  background: rgba(96, 165, 250, .1);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 800;
  color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
}

.cta:hover, .cta:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.cta.primary {
  border-color: rgba(167, 139, 250, .5);
  background: linear-gradient(135deg, rgba(96, 165, 250, .18), rgba(167, 139, 250, .2));
}

/* ---------- ステータスストリップ（共通） ---------- */

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.status-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.status-item strong, .status-item b {
  display: block;
  font-size: .82rem;
  color: var(--text);
}

.status-item span {
  display: block;
  margin-top: 5px;
  color: var(--text-faint);
  font-size: .72rem;
  line-height: 1.45;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 16px rgba(74, 222, 128, .8);
}

@media (max-width: 760px) {
  .status-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- メディアプレビューグリッド（トップページ） ---------- */

.media-preview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

.media-preview-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 180px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: #060914;
}

.media-preview-card img, .media-preview-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-preview-wide { grid-row: span 2; min-height: 372px; }
.media-preview-video { grid-column: span 2; }

.media-preview-video span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(3, 7, 16, .72);
  backdrop-filter: blur(10px);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: #55e6ff;
}

/* ---------- スタック紹介カード（トップページ） ---------- */

.stack-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(17, 24, 48, .98), rgba(8, 10, 23, .98));
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.stack-feature-copy { padding: 26px; }

.stack-feature-kicker {
  margin: 0 0 8px;
  color: #55e6ff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.stack-feature h3 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
}

.stack-feature p {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: .9rem;
  line-height: 1.7;
}

.stack-feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.stack-feature-tags span {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: .68rem;
}

.stack-feature-media { position: relative; min-height: 260px; }
.stack-feature-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

.stack-feature-media:after {
  content: "OPEN SPECIAL PAGE →";
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(3, 7, 16, .78);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
}

@media (max-width: 760px) {
  .media-preview-grid { grid-template-columns: 1fr 1fr; }
  .media-preview-wide { grid-column: 1 / -1; grid-row: auto; min-height: 260px; }
  .media-preview-video { grid-column: 1 / -1; min-height: 220px; }
  .stack-feature { grid-template-columns: 1fr; }
  .stack-feature-media { min-height: 220px; }
}

.stats-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  min-width: 108px;
}

.stat-tile .num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.stat-tile .label {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- セクション共通 ---------- */

.section {
  padding: 30px 0 6px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.section-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-faint);
}

.section-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 30px 0 0;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.active-filters:empty { display: none; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(167, 139, 250, .16);
  border: 1px solid rgba(167, 139, 250, .4);
  color: #ddd6ff;
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font-size: 12px;
}

.filter-pill button {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-dim);
  background: var(--panel-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
}

/* ---------- カードグリッド（プロジェクト・最近の開発） ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}

.card:hover, .card:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card-emoji { font-size: 26px; }

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.card-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.badge.status-進行中 { color: #bbf7d0; border-color: rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .1); }
.badge.status-完了 { color: #bfdbfe; border-color: rgba(96, 165, 250, .4); background: rgba(96, 165, 250, .1); }
.badge.status-休止 { color: #fde68a; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); }
.badge.status-実験中 { color: #fbcfe8; border-color: rgba(244, 114, 182, .4); background: rgba(244, 114, 182, .08); }
.badge.status-情報未入力 { color: var(--text-faint); border-style: dashed; }

/* ---------- タイムライン ---------- */

.timeline-date-group + .timeline-date-group { margin-top: 22px; }

.timeline-date {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: .02em;
}

.timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-card {
  display: block;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.timeline-card:hover, .timeline-card:focus-visible {
  border-left-color: var(--accent-blue);
}

.timeline-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.timeline-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.timeline-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ---------- チップ（AI・技術タグ） ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  min-height: 44px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.chip .count {
  font-size: 11px;
  color: var(--text-faint);
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }

.chip.is-active {
  background: rgba(167, 139, 250, .18);
  border-color: var(--accent-purple);
  color: #ede9fe;
}

/* ---------- 詳細ページ ---------- */

.detail-header {
  padding: 26px 0 4px;
}

.detail-back {
  display: inline-block;
  font-size: 13px;
  color: var(--accent-blue);
  text-decoration: none;
  margin-bottom: 14px;
}

.detail-back:hover { text-decoration: underline; }

.detail-eyebrow {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 6px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  line-height: 1.3;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.detail-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}

.detail-panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-purple);
}

.detail-panel p, .detail-panel li {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail-panel ul {
  margin: 0;
  padding-left: 1.2em;
}

.detail-field + .detail-field {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-list a {
  display: block;
  font-size: 14px;
  color: var(--accent-blue);
  text-decoration: none;
  word-break: break-all;
}

.link-list a:hover { text-decoration: underline; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.shot-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}

.related-devlog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- ライトボックス ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 8, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* ---------- フッター ---------- */

.site-footer {
  margin-top: 50px;
  padding: 20px 16px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.site-footer a { color: var(--text-dim); text-decoration: underline; }

@media (min-width: 720px) {
  .stat-tile { min-width: 130px; }
}

/* ---------- ガイド（複数AI比較） ---------- */

.topbar-nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
  font-size: 13px;
}

.topbar-nav a {
  text-decoration: none;
  color: var(--text-dim);
  white-space: nowrap;
}

.topbar-nav a:hover, .topbar-nav a:focus-visible {
  color: var(--text);
}

.theme-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(160deg, rgba(167, 139, 250, .16), rgba(96, 165, 250, .06) 60%, transparent), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-lg);
  transition: transform .15s ease, border-color .15s ease;
}

.theme-card:hover, .theme-card:focus-visible {
  border-color: var(--accent-purple);
  transform: translateY(-2px);
}

.theme-card-emoji { font-size: 34px; }

.theme-card-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.theme-card-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.ai-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.ai-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}

.ai-choice-card:hover, .ai-choice-card:focus-visible {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.ai-choice-emoji { font-size: 30px; }

.ai-choice-label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.badge.guide-status-not-started { color: var(--text-faint); border-style: dashed; }
.badge.guide-status-in-progress { color: #fde68a; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); }
.badge.guide-status-published, .badge.guide-status-completed { color: #bbf7d0; border-color: rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .1); }

.markdown-body h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 22px 0 8px;
}

.markdown-body h2:first-child { margin-top: 0; }

.markdown-body h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 16px 0 6px;
}

.markdown-body p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
}

.markdown-body ul {
  margin: 0 0 10px;
  padding-left: 1.3em;
}

.markdown-body li {
  font-size: 14.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.markdown-body code {
  background: rgba(255, 255, 255, .08);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-all;
}
