@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --text: #18181b;
  --text-secondary: #3f3f46;
  --muted: #71717a;
  --border: rgba(0, 0, 0, 0.07);
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --accent-surface: #e0e7ff;
  --accent-glow: rgba(79, 70, 229, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --max-width: 860px;
  --font: 'Sora', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-accent: 0 8px 30px rgba(79, 70, 229, 0.25);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── Navigation ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 0;
  margin: 0 0 36px;
  background: rgba(245, 243, 238, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-nav a {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

.site-nav a.current {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.lang-switch {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.lang-switch:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Header ── */
header {
  padding: 40px 0 12px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

header p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.6;
}

/* App page header with icon */
header:has(.icon) {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

header:has(.icon) > p {
  flex-basis: 100%;
  margin-top: -4px;
}

.icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

/* ── Hero (#intro) ── */
#intro {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  color: #fff;
  padding: 52px 44px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-accent);
}

#intro::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

#intro::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

#intro h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  color: #fff;
  border: none;
  padding: 0;
  position: relative;
}

#intro p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 520px;
  position: relative;
}

/* ── App Cards (#apps) ── */
#apps {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 32px;
}

#apps h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--text);
  border: none;
  padding: 0;
}

#apps article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px 24px;
  margin-bottom: 14px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}

#apps article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.18);
}

#apps article h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

#apps article p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
  font-size: 0.925rem;
}

#apps article a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition);
}

#apps article a::after {
  content: '\2192';
  font-size: 1.1em;
  transition: transform var(--transition);
}

#apps article a:hover { gap: 10px; }

/* ── Sections (general card) ── */
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 34px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}

section h3 {
  font-size: 1rem;
  font-weight: 650;
  margin: 22px 0 10px;
  color: var(--text);
}

section p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}

section p:last-child { margin-bottom: 0; }

section a:not(.primary-btn):not(.github-download-link) {
  color: var(--accent);
  font-weight: 500;
  transition: opacity var(--transition);
}

section a:not(.primary-btn):not(.github-download-link):hover {
  opacity: 0.75;
}

/* ── Showcase Image ── */
.showcase-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0 0 24px;
  display: block;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  cursor: default;
  transition: box-shadow var(--transition), transform var(--transition);
}

.showcase-img:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.005);
}

/* ── Features grid ── */
.features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.features li {
  background: var(--accent-light);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  line-height: 1.65;
  color: var(--text-secondary);
  font-size: 0.925rem;
  transition: transform var(--transition), background var(--transition);
}

.features li:hover {
  background: var(--accent-surface);
  transform: translateX(3px);
}

.features li strong {
  color: var(--accent-hover);
  font-weight: 600;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 14px 0;
  font-size: 0.9rem;
}

thead { background: var(--accent); }

th {
  color: #fff;
  font-weight: 600;
  font-size: 0.825rem;
  text-align: left;
  padding: 11px 16px;
  letter-spacing: 0.02em;
}

td {
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  line-height: 1.6;
}

tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.015); }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--accent-light); }

/* ── Code ── */
pre {
  background: #1a1b2e;
  color: #c9d1e8;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: 14px 0;
}

code { font-family: var(--font-mono); font-size: 0.85em; }

p code, li code, td code {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.8em;
  font-weight: 500;
}

/* ── Buttons ── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform 0.15s var(--ease), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
  color: #fff;
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Download section */
#download-list .primary-btn { margin: 4px 8px 4px 0; }

#download-list h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 24px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

#download-list h3:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}

#download-list hr { display: none; }

/* ── Contact Form ── */
#contact-section .form-row { margin-bottom: 20px; }

#contact-section label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 8px;
  color: var(--text);
}

#contact-section input[type="text"],
#contact-section input[type="email"],
#contact-section textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.925rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

#contact-section textarea { min-height: 160px; resize: vertical; }

#contact-section input:focus,
#contact-section textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

#contact-section .primary-btn { padding: 14px 36px; font-size: 0.95rem; }

/* ── Lists ── */
section ol { padding-left: 24px; margin: 12px 0; }
section ol li { margin-bottom: 14px; color: var(--text-secondary); line-height: 1.7; font-size: 0.925rem; }
section ol li strong { color: var(--text); }
section ul { padding-left: 24px; margin: 8px 0; }
section ul li { margin-bottom: 6px; color: var(--text-secondary); line-height: 1.7; font-size: 0.925rem; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 36px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

footer p { margin: 0; color: var(--muted); }

/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 9999;
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-overlay .close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--surface);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition);
}

.lightbox-overlay .close-btn:hover { transform: scale(1.06); }

/* ── Changelog ── */
#changelog { margin-top: 20px; }

#changelog details.changelog-details {
  background: var(--accent-light);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

#changelog summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}

#changelog summary:hover { background: var(--accent-surface); }

#changelog .changelog-content {
  padding-top: 12px;
  color: var(--text-secondary);
  max-height: 520px;
  overflow: auto;
}

#changelog .changelog-content pre {
  background: transparent;
  color: var(--text);
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 1.7;
}

/* ── Scroll Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in:nth-child(2) { transition-delay: 0.07s; }
.fade-in:nth-child(3) { transition-delay: 0.14s; }
.fade-in:nth-child(4) { transition-delay: 0.21s; }
.fade-in:nth-child(5) { transition-delay: 0.28s; }
.fade-in:nth-child(6) { transition-delay: 0.35s; }

/* ── Responsive ── */
@media (min-width: 640px) {
  body { font-size: 16px; }
  .features ul { grid-template-columns: repeat(2, 1fr); }
  header h1 { font-size: 2.1rem; }
  #intro { padding: 60px 52px; }
  #intro h2 { font-size: 2.5rem; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px 40px; }
  header { padding: 28px 0 8px; }
  header h1 { font-size: 1.4rem; }
  header:has(.icon) { gap: 14px; }
  .icon { width: 56px; height: 56px; border-radius: 12px; }
  section { padding: 24px 20px; margin-bottom: 16px; }
  #intro { padding: 36px 28px; }
  #intro h2 { font-size: 1.6rem; }
  .site-nav { gap: 2px; flex-wrap: wrap; padding: 10px 0; margin-bottom: 24px; }
  .site-nav a { font-size: 0.775rem; padding: 6px 10px; }
  #apps article { padding: 22px 20px; }
  .primary-btn { padding: 10px 18px; font-size: 0.825rem; }
  pre { padding: 16px 18px; font-size: 0.75rem; }
  th, td { padding: 9px 12px; font-size: 0.825rem; }
}
