/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-text-muted: #78716c;
  --color-accent: #d97706;
  --color-accent-hover: #b45309;
  --color-border: #e7e5e4;
  --color-card-bg: #ffffff;
  --color-hero-gradient: linear-gradient(
    168deg,
    #fffbeb 0%,
    #fef3c7 30%,
    #fafaf9 70%
  );
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1080px;
  --nav-height: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

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

code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.875em;
  background: #f5f5f4;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

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

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 249, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
}

.nav-logo {
  width: 32px;
  height: 32px;
  mix-blend-mode: multiply;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

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

.nav-github {
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.nav-github:hover {
  opacity: 1;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: #d6d3d1;
  background: #f5f5f4;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius);
}

/* ── Hero ── */
.hero {
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 80px;
  text-align: center;
  background: var(--color-hero-gradient);
}

.hero-mascot {
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  border-radius: 20px;
  filter: drop-shadow(0 4px 12px rgba(217, 119, 6, 0.2));
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero-platforms {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* ── Section titles ── */
.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
}

/* ── Features ── */
.features {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.feature-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffbeb;
  border-radius: 10px;
  margin-bottom: 16px;
  color: var(--color-accent);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ── Preview ── */
.preview {
  padding: 80px 24px 96px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.preview-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-top: -32px;
  margin-bottom: 40px;
}

.preview-window {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.preview-titlebar {
  background: #f5f5f4;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

/* ── Mock App ── */
.mock-app {
  display: flex;
  height: 420px;
  background: #fff;
}

.mock-sidebar {
  width: 200px;
  background: #f8f8f7;
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  overflow-y: auto;
}

.mock-search {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #a8a29e;
  border-bottom: 1px solid var(--color-border);
}

.mock-tree {
  padding: 8px 0;
  font-size: 0.8rem;
  color: #57534e;
  user-select: none;
}

.mock-folder {
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  color: #57534e;
}

.mock-file {
  padding: 5px 12px 5px 32px;
  color: #78716c;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-file-active {
  background: #fef3c7;
  color: #92400e;
  font-weight: 500;
}

.mock-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mock-tabs {
  display: flex;
  background: #f0efee;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.78rem;
  flex-shrink: 0;
  overflow-x: auto;
}

.mock-tab {
  padding: 8px 14px;
  color: #78716c;
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-tab-active {
  background: #fff;
  color: #1c1917;
  font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.mock-tab-close {
  font-size: 0.7rem;
  opacity: 0.35;
  line-height: 1;
}

.mock-editor {
  flex: 1;
  padding: 28px 36px;
  overflow-y: auto;
  font-family: var(--font);
  line-height: 1.7;
  cursor: text;
  position: relative;
}

.mock-editor h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 2px;
  color: #1c1917;
}

.mock-editor h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 18px 0 2px;
  color: #1c1917;
}

.mock-editor p {
  margin: 4px 0;
  font-size: 0.92rem;
  color: #44403c;
}

.mock-editor ul {
  margin: 4px 0;
  padding-left: 22px;
}

.mock-editor li {
  font-size: 0.92rem;
  color: #44403c;
  margin: 2px 0;
}

.mock-editor li::marker {
  color: var(--color-accent);
}

.mock-editor blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 16px;
  margin: 14px 0;
  color: #78716c;
  font-style: italic;
  font-size: 0.92rem;
}

.mock-editor strong {
  font-weight: 600;
  color: #1c1917;
}

.mock-editor code {
  font-size: 0.82rem;
  background: #f5f5f4;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.mock-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--color-accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.mock-editor-hint {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.7rem;
  color: #a8a29e;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.mock-editor-hint.visible {
  opacity: 1;
}

/* ── Markdown live-rendering prefix ── */
.mock-md-line {
  margin: 4px 0;
  font-size: 0.92rem;
  color: #44403c;
}

.mock-md-prefix {
  display: inline-block;
  color: #a8a29e;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.85em;
  max-width: 40px;
  overflow: hidden;
  margin-right: 2px;
  vertical-align: baseline;
  transition: opacity 0.25s, max-width 0.25s, margin-right 0.25s;
}

.mock-md-prefix-hide {
  opacity: 0;
  max-width: 0;
  margin-right: 0;
}

/* ── Slash command menu ── */
.mock-slash-menu {
  position: absolute;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.05);
  padding: 4px 0;
  width: 180px;
  z-index: 10;
  animation: slash-in 0.15s ease-out;
}

.mock-slash-exit {
  animation: slash-out 0.15s ease-in forwards;
}

@keyframes slash-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slash-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

.mock-slash-item {
  padding: 6px 12px;
  font-size: 0.78rem;
  color: #57534e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.msi {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #78716c;
  background: #f5f5f4;
  border-radius: 4px;
  flex-shrink: 0;
}

.mock-slash-hl {
  background: #fef3c7;
  color: #92400e;
}

.mock-slash-hl .msi {
  background: #fde68a;
  color: #92400e;
}

/* ── Selection toolbar ── */
.mock-sel-toolbar {
  position: absolute;
  display: flex;
  gap: 2px;
  background: #1c1917;
  padding: 4px 5px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  z-index: 10;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}

.mock-sel-toolbar-show {
  opacity: 1;
  transform: translateY(0);
}

.mstb {
  color: #d6d3d1;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--font);
}

.mstb-press {
  background: var(--color-accent);
  color: #fff;
}

.mock-sel {
  background: rgba(191, 219, 254, 0.5);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Download ── */
.download {
  padding: 80px 24px 96px;
  text-align: center;
  background: #fffbeb;
}

.download-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-top: -32px;
  margin-bottom: 40px;
}

.download-platforms {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.platform-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.1);
  transform: translateY(-2px);
  color: var(--color-text);
}

.platform-coming-soon {
  opacity: 0.5;
  cursor: default;
  position: relative;
}

.platform-coming-soon:hover {
  border-color: var(--color-border);
  box-shadow: none;
  transform: none;
  color: var(--color-text-muted);
}

.coming-soon-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: #f5f5f4;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Philosophy ── */
.philosophy {
  padding: 80px 24px;
  text-align: center;
}

.philosophy-inner {
  max-width: 640px;
  margin: 0 auto;
}

.philosophy-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.philosophy-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text-muted);
}

/* ── Roadmap ── */
.roadmap {
  padding: 80px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.roadmap-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.roadmap-card {
  padding: 20px 24px;
  border-left: 3px solid var(--color-border);
  background: transparent;
  transition: background 0.15s;
}

.roadmap-card:not(:last-child) {
  border-bottom: none;
}

.roadmap-active {
  border-left-color: var(--color-accent);
  background: #fffbeb;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.roadmap-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.roadmap-version {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.roadmap-active .roadmap-version {
  color: var(--color-accent);
}

.roadmap-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.roadmap-card:not(.roadmap-active) h3 {
  color: var(--color-text-muted);
}

.roadmap-card p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.roadmap-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  background: #fff;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 4px;
}

.roadmap-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Footer ── */
.footer {
  padding: 32px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

.footer a {
  color: var(--color-accent);
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 56px;
  }

  .hero-mascot {
    width: 72px;
    height: 72px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .nav-links a:not(.nav-github) {
    display: none;
  }

  .download-platforms {
    flex-direction: column;
    align-items: center;
  }

  .platform-card {
    width: 100%;
    max-width: 240px;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .mock-sidebar {
    display: none;
  }

  .mock-app {
    height: 340px;
  }

  .mock-editor {
    padding: 20px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
