:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555;
  --color-accent: #0066cc;
  --color-accent-hover: #0052a3;
  --color-surface: #f5f5f7;
  --color-border: #e0e0e0;
  --color-code-bg: #f0f0f0;
  --max-width: 960px;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-text: #f0f0f0;
    --color-text-secondary: #aaa;
    --color-accent: #4da6ff;
    --color-accent-hover: #80bfff;
    --color-surface: #2a2a2a;
    --color-border: #3a3a3a;
    --color-code-bg: #2d2d2d;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

header {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  margin-right: 150px;
}

.lang-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s, border-color 0.2s;
}

.lang-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.lang-btn:hover:not(.active) {
  border-color: var(--color-accent);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

/* ダウンロードボタン直下の動作要件。リード文より小さく、控えめに置く。 */
.hero .hero-note {
  font-size: 0.9375rem;
  margin: 1rem 0 0;
}

.philosophy {
  text-align: center;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
}

/* hero 直下の 1 つ目は下の philosophy と 1 ブロックに見せる（罫線は最後だけ）。 */
.philosophy.review {
  border-bottom: none;
  padding-bottom: 1rem;
}

.philosophy-lead {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.philosophy-body {
  font-size: 1.125rem;
  line-height: 2;
  color: var(--color-text-secondary);
}

.philosophy-body code {
  background: var(--color-code-bg);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.screenshot {
  text-align: center;
  padding: 2rem 0;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: none;
  }
}

.carousel-slide {
  position: relative;
  flex: 0 0 100%;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 800;
}

.carousel-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 3rem 2rem 1.5rem;
  box-sizing: border-box;
  text-align: right;
  font-size: 48pt;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  pointer-events: none;
}

/* ファイル形式ではなく機能を紹介するスライドは、位置と色で区別する
   （形式名は右下・白、機能は左下・アクセント色）。 */
.carousel-caption.feature {
  text-align: left;
  color: var(--color-accent);
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.carousel-prev {
  left: 1rem;
}

.carousel-next {
  right: 1rem;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(0, 0, 0, 0.75);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
  background: var(--color-surface);
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
}

.carousel-dot.active {
  background: var(--color-accent);
}

.features {
  padding: 3rem 0;
}

.features h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* カードで際立たせるほどではない機能は、グリッドの下に列挙する。 */
.feature-list {
  list-style: none;
  margin-top: 1.5rem;
  padding: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.feature-list li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--color-border);
}

.feature-list strong {
  color: var(--color-text);
  font-weight: 600;
}

section.requirements,
section.install {
  padding: 3rem 0;
}

section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* 本文中のリンク。色指定がないとブラウザ既定の #0000EE になり暗背景で読めない
   （.btn-primary や .github-ribbon はクラス側の指定が優先される）。 */
main a {
  color: var(--color-accent);
}

/* 手順の中で使う短いパスなので、ブロックではなくインラインで見せる。 */
.install code {
  background: var(--color-code-bg);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.9375em;
  white-space: nowrap;
}

.install ol {
  padding-left: 1.25rem;
}

.install li {
  margin-bottom: 0.5rem;
  line-height: 1.9;
}

.note {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 1rem;
  font-size: 0.875rem;
}

footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-top: 3rem;
}

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

footer a:hover {
  text-decoration: underline;
}

.github-ribbon {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  overflow: hidden;
  width: 150px;
  height: 150px;
  pointer-events: none;
}

.github-ribbon span {
  position: absolute;
  display: block;
  width: 220px;
  padding: 0.5rem 0;
  top: 38px;
  right: -50px;
  transform: rotate(45deg);
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.github-ribbon span:hover {
  background: var(--color-accent-hover);
}

@media (max-width: 600px) {
  .hero h2 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .github-ribbon {
    width: 100px;
    height: 100px;
  }

  .lang-switcher {
    margin-right: 100px;
  }

  .github-ribbon span {
    width: 150px;
    padding: 0.35rem 0;
    top: 25px;
    right: -40px;
    font-size: 0.6875rem;
  }

  .carousel-caption {
    padding: 2rem 1rem 1rem;
    font-size: 1.75rem;
  }

}

/* ---- 詳細ページ（/features） ---- */

.breadcrumb {
  padding: 1.5rem 1.5rem 0;
  max-width: 900px;
  margin: 0 auto;
  font-size: 0.9375rem;
}

.breadcrumb a {
  color: var(--color-accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.page-intro {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-intro h2 {
  font-size: 1.875rem;
  margin-bottom: 0.75rem;
}

.page-intro p {
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.section-more {
  margin-top: 1.5rem;
  text-align: center;
}

.section-more a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.section-more a:hover {
  text-decoration: underline;
}

.feature-defs {
  max-width: 900px;
  margin: 0 auto;
}

.feature-defs dt {
  font-weight: 600;
  margin-top: 1.25rem;
}

.feature-defs dd {
  margin: 0.35rem 0 0;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.file-types,
.shortcuts,
.faq {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

.file-types h3,
.shortcuts h3,
.faq h3 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

/* 拡張子の並びは横に長くなるため、ページ本体ではなく表だけを横スクロールさせる。 */
.table-scroll {
  overflow-x: auto;
}

.file-type-table,
.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.file-type-table th,
.file-type-table td,
.shortcut-table th,
.shortcut-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.file-type-table thead th {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.file-type-table tbody th,
.shortcut-table th {
  white-space: nowrap;
  font-weight: 600;
}

.file-type-table td.extensions {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  word-break: break-word;
}

.file-type-table td.extensions p {
  margin-top: 0.5rem;
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.shortcut-table kbd {
  display: inline-block;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h4 {
  font-size: 1.0625rem;
  margin-bottom: 0.4rem;
}

.faq-item p {
  color: var(--color-text-secondary);
  line-height: 1.8;
}
