/* ==========================================================================
   MahoCraft / KomaFlow Static Website Styles
   Zero-build static CSS for Cloudflare Pages (mahocraft.com)
   ========================================================================== */

:root {
  --bg-base: #0d0f14;
  --bg-surface: #151923;
  --bg-elevated: #1c2230;
  --bg-card: rgba(25, 30, 42, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f3f5fa;
  --text-secondary: #a7b0c2;
  --text-muted: #768096;
  --accent-indigo: #6366f1;
  --accent-indigo-hover: #7c7ff6;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #22d3ee;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --max-w: 1120px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Microsoft JhengHei",
    "Noto Sans TC", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 75% 45% at 50% -10%, rgba(99, 102, 241, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(245, 158, 11, 0.08), transparent 60%);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(13, 15, 20, 0.82);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-indigo), #4338ca);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1rem;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  font-size: 0.84rem;
  padding: 0.45rem 0.9rem;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.85rem 1.55rem;
  border-radius: 10px;
}

.btn-primary {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.32);
}

.btn-primary:hover {
  background: var(--accent-indigo-hover);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.44);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: #232a3b;
  border-color: rgba(255, 255, 255, 0.28);
}

/* ---------- Hero ---------- */
.hero {
  padding: 4.5rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.75rem;
  align-items: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.32);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.hero-lead {
  margin: 0 0 1.75rem;
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 54ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.4rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- Workspace Visual Mockup ---------- */
.mockup-frame {
  background: #12151e;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mockup-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: #181c27;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.mockup-dots {
  display: flex;
  gap: 0.35rem;
}

.mockup-dots span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.mockup-dots span:nth-child(1) { background: #ef4444; }
.mockup-dots span:nth-child(2) { background: #f59e0b; }
.mockup-dots span:nth-child(3) { background: #10b981; }

.mockup-body {
  display: grid;
  grid-template-columns: 78px 1fr 84px;
  min-height: 295px;
}

.mockup-sidebar {
  background: #141822;
  border-right: 1px solid var(--border-subtle);
  padding: 0.65rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mockup-sidebar.right {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

.mockup-thumb {
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, #242b3d, #1b202e);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.mockup-thumb.used::after {
  content: "P.1";
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--accent-indigo);
  color: #fff;
}

.mockup-canvas-area {
  background: #0e1016;
  display: grid;
  place-items: center;
  padding: 1.1rem;
  position: relative;
}

.manga-page {
  width: 175px;
  aspect-ratio: 182 / 257;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  padding: 11px;
  display: grid;
  grid-template-rows: 1.05fr 1.15fr 0.9fr;
  gap: 6px;
  position: relative;
}

.manga-page::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(34, 211, 238, 0.55);
  pointer-events: none;
}

.panel-row-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 6px;
}

.koma-box {
  border: 2px solid #111827;
  background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
  position: relative;
  overflow: hidden;
}

.koma-box.skew {
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
  background: linear-gradient(135deg, #c7d2fe, #818cf8);
}

.koma-box.popout-host {
  overflow: visible;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
}

.popout-char {
  position: absolute;
  top: -12px;
  right: 10px;
  width: 34px;
  height: 52px;
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, #312e81, #4f46e5);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.mockup-prop {
  height: 14px;
  border-radius: 4px;
  background: #232939;
}

.mockup-prop.accent {
  background: rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.5);
}

/* ---------- Sections ---------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.75rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-indigo-hover);
  margin-bottom: 0.5rem;
}

.section-header h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
}

/* ---------- Features Grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

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

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.06rem;
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 880px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pricing-card.featured {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.13), rgba(25, 30, 42, 0.92) 45%);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 18px 46px rgba(99, 102, 241, 0.16);
}

.pricing-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pricing-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.pricing-desc {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1.35rem;
}

.price-amount {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.price-strike {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.check-list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  flex: 1;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.check-list li::before {
  content: "✓";
  color: var(--accent-emerald);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pricing-subnote {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ---------- Legal / Compliance Pages ---------- */
.legal-main {
  padding: 3.5rem 0 4.5rem;
}

.legal-article {
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.legal-article h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.legal-updated {
  margin: 0 0 1.5rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.legal-lang-note {
  display: none;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 0.88rem;
}

.legal-lang-note.visible {
  display: block;
}

.legal-article h2 {
  margin: 1.85rem 0 0.65rem;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.legal-article p,
.legal-article li {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.legal-article ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-article a {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 0;
  background: rgba(10, 12, 17, 0.85);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--text-primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
  }

  .features-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .legal-article {
    padding: 1.5rem;
  }
}
