/* ============================================================
   MindmapMD — mindmapmd.dev
   Map your thinking — beautifully, in Markdown.
   ============================================================ */

:root {
  --bg: #13100e;
  --surface: #1a1614;
  --surface-2: #231d19;
  --border: #2c2521;
  --text: #ede5db;
  --text-muted: #a39a90;
  --text-faint: #6e645b;
  --accent: #f4d28d;
  --accent-hover: #fbdfa3;
  --accent-dim: #b89764;

  --max-width: 1080px;
  --radius: 12px;
  --radius-sm: 6px;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-jp: 'Inter', 'Hiragino Sans', 'Yu Gothic UI', Meiryo, system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

em { font-style: italic; color: var(--accent); font-weight: 500; }

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

/* ------------------------------------------------------------
   Language visibility
   ------------------------------------------------------------ */
html[lang="en"] [data-lang="ja"],
html[lang="ja"] [data-lang="en"] {
  display: none !important;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  background: rgba(19, 16, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.brand img { border-radius: 6px; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1;
}
.lang-switch:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}
.lang-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.lang-switch svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  text-align: center;
  white-space: nowrap;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--accent);
  color: #1a1614;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.875rem;
}
.btn-ghost:hover { color: var(--accent); }

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(244, 210, 141, 0.06), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

html[lang="ja"] .hero-title {
  font-family: var(--font-jp);
}

.hero-sub {
  max-width: 36rem;
  margin: 0 auto 2.25rem;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--text-muted);
  line-height: 1.65;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   Demo
   ------------------------------------------------------------ */
.demo {
  padding: 1.5rem 0 5rem;
}

.demo-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 80px -32px rgba(0, 0, 0, 0.8);
  aspect-ratio: 16 / 10;
}

.demo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

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

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.feature h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.feature p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------
   CTA Banner
   ------------------------------------------------------------ */
.cta-banner {
  padding: 5rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.cta-banner h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 auto 2rem;
  max-width: 32rem;
  line-height: 1.3;
}

.cta-meta {
  margin-top: 1.25rem;
  color: var(--text-faint);
  font-size: 0.875rem;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-faint);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

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

/* ------------------------------------------------------------
   Subpages (privacy, terms, 404)
   ------------------------------------------------------------ */
.page { padding: 4.5rem 0 6rem; }

.page article {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.page .lede {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.page p, .page li {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.page ul, .page ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.page li { margin-bottom: 0.5rem; }

.page pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.page pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.page a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
}
.page a:not(.btn):hover { text-decoration-color: var(--accent); }

.page-meta {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.notfound {
  text-align: center;
}
.notfound h1 {
  font-size: clamp(4rem, 10vw, 6rem);
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 720px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero { padding: 3rem 0 2rem; }
  .demo { padding: 1rem 0 3.5rem; }
  .cta-banner { padding: 3.5rem 0; }
  .features { padding: 3rem 0; }
  .site-footer { padding: 1.75rem 0; }
  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
