/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f8f7f4;
  --bg-alt:    #ffffff;
  --bg-card:   #ffffff;
  --border:    #e5e3de;
  --text:      #1c1b18;
  --text-sub:  #6b6860;
  --text-muted:#a09e99;
  --accent:    #2563eb;
  --accent-lt: #eff6ff;
  --accent-dk: #1d4ed8;
  --green:     #16a34a;
  --green-lt:  #f0fdf4;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.10);
  --font:      'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --header-h:  60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248,247,244,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 32px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 1.1rem; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.3rem; color: var(--accent); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 6px 14px; border-radius: 6px;
  color: var(--text-sub); font-size: .9rem; font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-link:hover { background: var(--border); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-lt); color: var(--accent); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px; margin-left: auto;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: .2s;
}

/* Mobile nav */
.mobile-nav {
  display: none; flex-direction: column;
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  padding: 8px 16px 16px;
}
.mobile-nav.open { display: flex; }
.mnav-link {
  padding: 10px 8px; color: var(--text);
  font-size: 1rem; font-weight: 500; border-radius: 6px;
  text-decoration: none;
}
.mnav-link:hover { background: var(--bg); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 48px 24px 32px;
  margin-top: 80px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 24px; text-align: center;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-brand .logo-icon { font-size: 1.4rem; color: var(--accent); }
.footer-brand .logo-text { font-weight: 600; font-size: 1.05rem; }
.footer-tagline { color: var(--text-sub); font-size: .9rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.footer-nav a { color: var(--text-sub); font-size: .9rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-copy { color: var(--text-muted); font-size: .82rem; }

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }

/* ===== TYPOGRAPHY ===== */
.page-hero {
  padding: 80px 24px 64px;
  text-align: center;
  max-width: 760px; margin: 0 auto;
}
.tag {
  display: inline-block;
  background: var(--accent-lt); color: var(--accent);
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
  padding: 4px 12px; border-radius: 100px; margin-bottom: 20px;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: 1.1rem; font-weight: 600; }
.lead { font-size: 1.15rem; color: var(--text-sub); margin-top: 16px; line-height: 1.7; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title p { color: var(--text-sub); margin-top: 10px; font-size: 1rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius);
  font-family: var(--font); font-size: .95rem; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,.3); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 20px; }

/* ===== FEATURE CARDS ===== */
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent-lt); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { color: var(--text-sub); font-size: .92rem; }

/* ===== DOWNLOAD CARDS ===== */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 24px; }
.dl-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 28px;
  box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 16px;
}
.dl-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.dl-card-icon { font-size: 2rem; }
.dl-card h3 { font-size: 1.15rem; }
.dl-card .version {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .82rem;
  background: var(--green-lt); color: var(--green);
  padding: 3px 10px; border-radius: 100px;
}
.dl-card .desc { color: var(--text-sub); font-size: .9rem; flex: 1; }
.dl-card .btn { width: 100%; justify-content: center; margin-top: auto; }
.dl-error { color: #dc2626; font-size: .85rem; }

/* バージョン取得中スピナー */
.dl-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--green); border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Install tabs */
.install-tabs { margin-top: 48px; }
.tab-list { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 28px; }
.tab-btn {
  padding: 10px 20px; background: none; border: none;
  font-family: var(--font); font-size: .9rem; font-weight: 500;
  color: var(--text-sub); cursor: pointer; border-radius: 6px 6px 0 0;
  transition: .15s; position: relative; bottom: -2px;
}
.tab-btn.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text); background: var(--bg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== CODE ===== */
pre, code {
  font-family: var(--font-mono); font-size: .87rem;
}
.code-block {
  background: #1e1e1e; color: #d4d4d4;
  padding: 20px 24px; border-radius: var(--radius);
  overflow-x: auto; line-height: 1.6;
}
.code-block code { font-size: .85rem; }
.inline-code {
  background: var(--border); padding: 2px 7px; border-radius: 4px;
  font-size: .85em;
}

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th {
  text-align: left; padding: 12px 16px;
  background: var(--bg); border-bottom: 2px solid var(--border);
  font-weight: 600; color: var(--text-sub); font-size: .85rem;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ===== DOCS LAYOUT ===== */
.docs-layout {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 48px; align-items: start; padding: 48px 24px;
  max-width: 1100px; margin: 0 auto;
}
.docs-sidebar {
  position: sticky; top: calc(var(--header-h) + 24px);
}
.docs-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.docs-sidebar .sidebar-section {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .04em; color: var(--text-muted);
  margin: 16px 0 6px; padding: 0 10px;
}
.docs-sidebar a {
  padding: 7px 10px; border-radius: 6px; color: var(--text-sub);
  font-size: .9rem; text-decoration: none; transition: .15s;
}
.docs-sidebar a:hover { background: var(--border); color: var(--text); }
.docs-sidebar a.active { background: var(--accent-lt); color: var(--accent); font-weight: 500; }

.docs-content h2 { margin-top: 48px; margin-bottom: 16px; padding-top: 48px; border-top: 1px solid var(--border); }
.docs-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.docs-content h3 { margin-top: 28px; margin-bottom: 10px; }
.docs-content p { color: var(--text-sub); margin-bottom: 14px; }
.docs-content ul, .docs-content ol { padding-left: 20px; color: var(--text-sub); margin-bottom: 14px; }
.docs-content li { margin-bottom: 6px; }
.docs-content .code-block { margin: 16px 0; }

/* ===== CHANGELOG ===== */
.changelog-list { display: flex; flex-direction: column; gap: 28px; max-width: 760px; }
.cl-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 32px; box-shadow: var(--shadow); }
.cl-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.cl-version { font-size: 1.25rem; font-weight: 600; font-family: var(--font-mono); }
.cl-date { color: var(--text-muted); font-size: .88rem; }
.badge-latest {
  background: var(--green-lt); color: var(--green);
  font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 100px;
}
.cl-changes { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cl-changes li { display: flex; gap: 10px; font-size: .93rem; color: var(--text-sub); }
.cl-changes li::before { content: '—'; color: var(--accent); flex-shrink: 0; }

/* ===== LICENSE ===== */
.license-text {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  font-family: var(--font-mono); font-size: .82rem;
  line-height: 1.8; overflow-x: auto;
  white-space: pre-wrap; word-break: break-word;
  color: var(--text-sub);
}
.lib-table { margin-top: 32px; }

/* ===== HERO CTA ===== */
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

/* ===== LOGO IMAGE ===== */
.logo-img {
  width: 28px; height: 28px;
  border-radius: 6px; object-fit: contain;
}

/* ===== FEATURE DETAIL (左右交互) ===== */
.feature-detail {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center; padding: 72px 0;
  border-bottom: 1px solid var(--border);
}
.feature-detail:last-child { border-bottom: none; }
.feature-detail.reverse .fd-text { order: 2; }
.feature-detail.reverse .fd-media { order: 1; }
.fd-text { display: flex; flex-direction: column; gap: 16px; }
.fd-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 600; color: var(--accent);
  background: var(--accent-lt); padding: 4px 12px; border-radius: 100px;
  width: fit-content;
}
.fd-text h3 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.fd-text p { color: var(--text-sub); font-size: .97rem; line-height: 1.75; }
.fd-media {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); aspect-ratio: 16/10;
  display: flex; align-items: center; justify-content: center;
}
.fd-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fd-media-placeholder {
  color: var(--text-muted); font-size: .88rem; text-align: center;
  padding: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.fd-media-placeholder span { font-size: 2rem; }

@media (max-width: 768px) {
  .feature-detail { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; }
  .feature-detail.reverse .fd-text { order: 1; }
  .feature-detail.reverse .fd-media { order: 2; }
}

/* ===== REQUIREMENTS ===== */
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }
.req-item {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.req-item dt { font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--text-muted); margin-bottom: 6px; }
.req-item dd { font-weight: 500; font-size: .95rem; }

/* ===== NOTICE ===== */
.notice {
  background: var(--accent-lt); border-left: 3px solid var(--accent);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem; color: var(--text-sub); margin: 24px 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 56px 24px 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.page-header .container { max-width: 1100px; margin: 0 auto; }
.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-header p { color: var(--text-sub); margin-top: 10px; font-size: 1rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .section { padding: 48px 0; }
  .page-hero { padding: 56px 16px 40px; }
}

/* アニメーションなし */
.fade-up, .fade-up-1, .fade-up-2, .fade-up-3, .fade-up-4 {}
