:root {
  --bg: #0b0c11;
  --panel: #16171d;
  --panel-2: #1c1d24;
  --border: #2a2b33;
  --border-subtle: #22232a;
  --accent: #b33a42;
  --accent-hover: #c8444e;
  --accent-glow: rgba(179, 58, 66, 0.22);
  --text: #ece4d4;
  --text-muted: #b8b1a3;
  --text-faint: #8a847a;
  --focus-ring: #c8444e;
  --header-bg: rgba(11, 12, 17, 0.82);
  --link: #e2737a;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ee;
    --panel: #ffffff;
    --panel-2: #f0ece3;
    --border: #d9d2c4;
    --border-subtle: #e8e2d6;
    --accent: #8f2c34;
    --accent-hover: #a3323a;
    --accent-glow: rgba(143, 44, 52, 0.10);
    --text: #1f1d18;
    --text-muted: #4a453c;
    --text-faint: #6d6659;
    --focus-ring: #8f2c34;
    --header-bg: rgba(247, 244, 238, 0.88);
    --link: #8f2c34;
  }
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--link);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.05em;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover {
  text-decoration: none;
  color: var(--text);
}
.wordmark img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}
.header-nav a:hover {
  color: var(--text);
  text-decoration: none;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.lang-switch a {
  padding: 0 2px;
  color: var(--text-faint);
}
.lang-switch a.active {
  color: var(--text);
  font-weight: 600;
}
.lang-switch .sep {
  color: var(--text-faint);
  opacity: 0.5;
}

@media (max-width: 820px) {
  .header-nav {
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .header-nav::-webkit-scrollbar {
    display: none;
  }
  .header-nav a {
    font-size: 0.82rem;
  }
  .header-nav .lang-switch {
    flex-shrink: 0;
  }
  .header-nav .nav-external {
    display: none;
  }
}
@media (max-width: 480px) {
  .wordmark-text {
    display: none;
  }
}
#latest-version {
  white-space: nowrap;
  color: var(--text-faint);
  margin-left: 8px;
}

/* Hero */
.hero {
  padding: 72px 0 48px;
  position: relative;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.hero-logo {
  width: 96px;
  height: 96px;
}
.hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.06em;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}
.hero .tagline {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.5;
  font-weight: 400;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:hover {
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--panel);
  border-color: var(--text-faint);
  color: var(--text);
}
.hero-gif-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 16px auto 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border), 0 24px 60px -20px rgba(0,0,0,0.5), 0 0 80px var(--accent-glow);
}
@media (prefers-color-scheme: light) {
  .hero-gif-wrap {
    box-shadow: 0 0 0 1px var(--border), 0 24px 40px -20px rgba(0,0,0,0.18), 0 0 60px var(--accent-glow);
  }
}
.hero-gif-wrap img {
  width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .hero {
    padding: 48px 0 32px;
  }
  .hero-logo {
    width: 72px;
    height: 72px;
  }
  .hero-actions .btn {
    padding: 10px 18px;
    font-size: 0.88rem;
  }
}

/* Section headings */
.section {
  padding: 48px 0;
}
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px;
}
.section-header h2 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.04em;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* Bento grid */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.bento-card {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.bento-card:hover {
  border-color: var(--border);
}
.bento-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.bento-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.bento-card .icon {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  color: var(--link);
  margin-bottom: 12px;
  line-height: 1;
}
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .col-span-4, .col-span-6, .col-span-12 {
    grid-column: span 12;
  }
}

/* Feature list */
.ask-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.ask-point {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
}
.ask-point h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.ask-point p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
  background: var(--panel-2);
}
.gallery-item .caption {
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  border-top: 1px solid var(--border-subtle);
}
.gallery-item .caption strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
  font-size: 0.88rem;
}
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-item img {
    height: auto;
    max-height: none;
  }
}
@media (min-width: 701px) and (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.text-link {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  counter-reset: step;
}
.step-item {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  counter-increment: step;
}
.step-item::before {
  content: counter(step);
  font-family: Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--link);
  display: block;
  margin-bottom: 8px;
}
.step-item h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.step-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

/* Community */
.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.community-card {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
}
.community-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.community-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .community-grid {
    grid-template-columns: 1fr;
  }
}

/* Divider */
.divider {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}
.divider img {
  width: 280px;
  max-width: 70%;
  opacity: 0.7;
  height: auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 32px;
  margin-top: 24px;
  background: var(--panel);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 0.85rem;
}
.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--text);
}
.footer-note {
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.6;
}
.footer-note a {
  color: var(--text-faint);
  text-decoration: underline;
}
.footer-note a:hover {
  color: var(--text-muted);
}

/* Small utility */
.center {
  text-align: center;
}
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.skip-link:focus {
  top: 12px;
}

.footer-molfar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-molfar img {
  image-rendering: pixelated;
  border-radius: 4px;
}

/* Text pages (privacy, download notes) */
.page-head {
  padding: 56px 0 8px;
}
.page-head h1 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.03em;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 10px;
}
.page-head p {
  color: var(--text-muted);
  max-width: 720px;
}
.prose {
  max-width: 760px;
  padding-bottom: 64px;
}
.prose h2 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.02em;
  font-size: 1.45rem;
  margin: 40px 0 12px;
}
.prose h3 {
  font-size: 1.05rem;
  margin: 28px 0 8px;
}
.prose p,
.prose ul,
.prose ol {
  margin-bottom: 14px;
  color: var(--text);
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin-bottom: 8px;
}
.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.9em;
  background: var(--panel-2);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
.prose pre {
  background: var(--panel-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 16px;
  overflow-x: auto;
  max-width: 100%;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: normal;
  white-space: pre;
}
.prose .summary {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
}
.table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th {
  color: var(--text-muted);
  font-weight: 600;
}
