/* Milu — minimalist landing page.
 * Single column, generous whitespace, serif body, sand-warm accent
 * pulled from the icon. No comic fonts, no mocked screenshots, no
 * busy gradients. The page is the story; the rest is space. */

:root {
  /* Editorial paper-and-ink palette. Cool off-white background,
   * near-black text, no warm undertones — the icon supplies all the
   * color the page needs. Distinct from any "AI assistant" warm
   * cream/burgundy palette by design. */
  --bg: #fbfbfa;
  --ink: #161618;
  --muted: #6f7075;
  --line: #e8e8ea;
  --accent: #161618;
  --serif: 'Newsreader', Georgia, 'Iowan Old Style', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --zh: 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', serif;
  --pad: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0e;
    --ink: #ececeb;
    --muted: #8a8b8f;
    --line: #232325;
    --accent: #ececeb;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  /* Page voice is sans by default. Only the Origin section (the
   *  dictionary-style "what does 麋鹿 mean" panel) opts into serif —
   *  see `.origin` below. */
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  transition: border-color 120ms ease;
}
a:hover {
  border-bottom-color: var(--ink);
}

em {
  font-style: italic;
  color: var(--muted);
}

/* ─── Atmospheric background art ────────────────────────────────────────
 *  Two stacked layers: a warm radial sunset glow (top-right, fading to
 *  forest dusk at the bottom-left) and an inline SVG of overhead tree
 *  branches reaching in from the upper-right corner. Layered via
 *  explicit z-index — the page content sits on z:1, art sits on z:0.
 *  Avoiding `z-index: -1` because it can fall behind `body`'s
 *  background-color in some browsers and become invisible. */
.bg-art {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.bg-art-glow {
  position: absolute;
  inset: 0;
  background:
    /* sunset on the upper-right horizon — warm gold/amber */
    radial-gradient(
      ellipse 80% 70% at 95% -10%,
      color-mix(in srgb, #d4a574 70%, transparent) 0%,
      color-mix(in srgb, #c08a5a 38%, transparent) 25%,
      transparent 65%
    ),
    /* sunset rose halo blooming through the upper centre */
    radial-gradient(
      ellipse 80% 60% at 60% 5%,
      color-mix(in srgb, #c97a52 28%, transparent) 0%,
      transparent 65%
    ),
    /* deep forest dusk at the bottom-left, cooler green */
    radial-gradient(
      ellipse 100% 80% at -5% 110%,
      color-mix(in srgb, #324032 50%, transparent) 0%,
      color-mix(in srgb, #3a3a48 22%, transparent) 35%,
      transparent 75%
    ),
    /* warm-to-cool diagonal wash so the page doesn't feel flat */
    linear-gradient(
      165deg,
      color-mix(in srgb, #d4a574 18%, transparent) 0%,
      transparent 45%,
      color-mix(in srgb, #2a2a32 12%, transparent) 100%
    );
}
.bg-art-branches {
  position: absolute;
  top: -30px;
  right: -60px;
  width: clamp(520px, 75vw, 980px);
  height: auto;
  aspect-ratio: 800 / 500;
  color: #1a120a;
  opacity: 0.42;
}
.bg-art-branch path {
  vector-effect: non-scaling-stroke;
}

/* The page content needs to sit ABOVE .bg-art. Without an explicit
 *  z-index here, the fixed art layer would render on top in document
 *  order. */
.page {
  position: relative;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  .bg-art-glow {
    background:
      radial-gradient(
        ellipse 80% 70% at 95% -10%,
        color-mix(in srgb, #d4884a 50%, transparent) 0%,
        color-mix(in srgb, #8a4a2a 28%, transparent) 25%,
        transparent 65%
      ),
      radial-gradient(
        ellipse 80% 60% at 60% 5%,
        color-mix(in srgb, #b85a3a 28%, transparent) 0%,
        transparent 65%
      ),
      radial-gradient(
        ellipse 100% 80% at -5% 110%,
        color-mix(in srgb, #1a2520 75%, transparent) 0%,
        color-mix(in srgb, #221a26 40%, transparent) 35%,
        transparent 75%
      ),
      linear-gradient(
        165deg,
        color-mix(in srgb, #3a1f10 30%, transparent) 0%,
        transparent 45%,
        color-mix(in srgb, #050708 50%, transparent) 100%
      );
  }
  .bg-art-branches {
    color: #f0d4a4;
    opacity: 0.55;
  }
}

@media (max-width: 640px) {
  .bg-art-branches {
    width: 130vw;
    right: -35vw;
    top: -40px;
    opacity: 0.32;
  }
  @media (prefers-color-scheme: dark) {
    .bg-art-branches { opacity: 0.45; }
  }
}

/* Page is intentionally narrow — long lines fight zen. */
.page {
  max-width: 580px;
  margin: 0 auto;
  padding: 96px var(--pad) 80px;
}

/* Header: icon, wordmark, single line tagline. The icon is the
 * loudest thing on the page — everything else recedes. */
.head {
  text-align: center;
  margin-bottom: 88px;
}
.head-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display: block;
  margin: 0 auto 24px;
  /* Subtle lift, no harsh shadow. */
  box-shadow: 0 6px 24px color-mix(in srgb, var(--ink) 8%, transparent);
}
.head-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 44px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1;
}
.head-tag {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-style: italic;
}

/* Hero "screenshot" — a CSS-rendered mock of Milu, not a real PNG.
 * Faithful to the actual chrome (titlebar with sessions + traffic
 * lights, tab bar, sidebar, two split panes) but rendered in the
 * page's own neutral palette so it sits inside the zen flow rather
 * than fighting it. Replace with a real capture later — keep the
 * `.shot-window` aspect ratio so the layout doesn't reflow. */
.shot {
  margin: 0 0 88px;
}
.shot-window {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent),
    0 18px 40px -12px color-mix(in srgb, var(--ink) 14%, transparent);
}
.shot-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--ink) 4%, var(--bg));
  border-bottom: 1px solid var(--line);
}
.shot-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.shot-dot--red { background: #ff5f57; }
.shot-dot--yellow { background: #febc2e; margin-right: 22px; }
.shot-dot--yellow + .shot-session { margin-left: 0; }
.shot-dot--green { background: #28c840; display: none; } /* match Milu's hidden-inset titlebar */
.shot-session {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.shot-session::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 6px;
  background: transparent;
}
.shot-session--active {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}
.shot-session--active::before {
  background: var(--ink);
}
.shot-session-plus {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  padding: 0 6px;
}
.shot-tabs {
  display: flex;
  gap: 0;
  padding: 6px 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.shot-tab {
  padding: 6px 12px 8px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.shot-tab--active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.shot-body {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  min-height: 240px;
}
.shot-sidebar {
  background: color-mix(in srgb, var(--ink) 3%, var(--bg));
  border-right: 1px solid var(--line);
  padding: 10px 6px;
  font-size: 11px;
  color: var(--muted);
}
.shot-folder,
.shot-file {
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot-folder::before {
  content: '▸ ';
  color: color-mix(in srgb, var(--muted) 60%, transparent);
}
.shot-folder--open::before {
  content: '▾ ';
}
.shot-file::before {
  content: '· ';
  color: color-mix(in srgb, var(--muted) 50%, transparent);
}
.shot-folder--indent { padding-left: 14px; }
.shot-file--indent { padding-left: 16px; }
.shot-file--indent2 { padding-left: 28px; }
.shot-file--active {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}
.shot-pane {
  padding: 18px 18px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.shot-pane:last-child {
  border-right: 0;
}
/* Markdown-rendered pane — uses the page's serif so the mock
 * feels like a real Milu render of a real markdown file. */
.shot-pane--md {
  font-family: var(--serif);
  color: var(--ink);
}
.shot-h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.shot-p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.shot-p--muted {
  color: var(--muted);
}
.shot-blockquote {
  margin-top: 14px;
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--ink) 25%, transparent);
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--zh), var(--serif);
}
/* Code pane — monospace; subtle syntax tinting using the same
 * accent family so it doesn't burst out of the palette. */
.shot-pane--code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink);
}
.shot-line {
  white-space: pre;
}
.shot-line--gutter {
  margin-top: 6px;
  color: var(--muted);
}
.shot-line-num {
  display: inline-block;
  width: 22px;
  text-align: right;
  margin-right: 8px;
  color: color-mix(in srgb, var(--muted) 60%, transparent);
}
/* Subtle syntax tinting — single cool slate-blue for keywords/types
 * so the code reads as code without dragging in any of the page's
 * neutral palette. */
.shot-kw { color: #4a5b88; font-weight: 600; }
.shot-fn { color: var(--ink); font-weight: 500; }
.shot-ty { color: #6f7480; }
.shot-str { color: #4f7558; }
.shot-comment { color: var(--muted); font-style: italic; }
.shot figcaption {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Origin story — the "why is it called Milu" section. This is the
 * one block that opts into the editorial serif voice (Newsreader),
 * because it reads like a dictionary entry. The rest of the page is
 * sans by default. */
.origin {
  margin-bottom: 64px;
  font-family: var(--serif);
}
.origin-zh {
  font-family: var(--zh);
  text-align: center;
  margin: 0 0 28px;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.origin-zh-name {
  font-size: 32px;
  font-weight: 600;
  margin-right: 14px;
}
.origin-zh-aka {
  font-size: 17px;
  color: var(--muted);
}
.origin p {
  margin: 0 0 18px;
}
.origin p:last-child {
  margin-bottom: 0;
}

/* Surface section — what the app actually is. Minimal list, no
 * column trickery, no icons. Just lines on the page. */
.surface {
  margin-bottom: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.surface > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-style: italic;
}
.surface ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.surface li {
  padding: 6px 0;
  color: var(--ink);
}
.surface li::before {
  content: '·';
  color: var(--muted);
  margin-right: 12px;
  font-weight: 700;
}

/* CTA: one primary download button, a small meta line, and a
 * collapsed "first launch" note. No secondary buttons, no rows of
 * pills, no stat counts. */
.cta {
  margin-bottom: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 120ms ease, transform 80ms ease;
}
.btn:hover {
  background: color-mix(in srgb, var(--ink) 80%, var(--muted));
  border-bottom: 0;
}
.btn:active {
  transform: translateY(1px);
}
.cta-meta {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-family: var(--sans);
}
.cta-meta a {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--muted) 30%, transparent);
}
.cta-meta a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.note {
  margin-top: 28px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}
.note summary {
  cursor: pointer;
  list-style: none;
  padding: 6px 0;
  user-select: none;
}
.note summary::-webkit-details-marker {
  display: none;
}
.note summary::before {
  content: '+';
  display: inline-block;
  width: 18px;
  color: var(--muted);
}
.note[open] summary::before {
  content: '−';
}
.note-body {
  padding: 6px 0 6px 18px;
}
.note-body p {
  margin: 8px 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.note-body pre {
  margin: 10px 0;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  overflow-x: auto;
  color: var(--ink);
}
.note-body code {
  font-family: inherit;
}
.note-foot {
  font-style: italic;
}

/* Footer: a single line of dot-separated text, low contrast. */
.foot {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.foot a {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--muted) 25%, transparent);
}
.foot a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.foot-dot {
  margin: 0 8px;
  opacity: 0.6;
}

/* Mobile: tighten paddings, keep everything else as-is — the layout
 * is already a single column at every viewport. */
@media (max-width: 640px) {
  .page {
    padding: 64px 20px 60px;
  }
  body {
    font-size: 17px;
  }
  .head {
    margin-bottom: 64px;
  }
  .head-name {
    font-size: 38px;
  }
  .origin-zh-name {
    font-size: 28px;
  }
  .origin,
  .surface,
  .cta {
    margin-bottom: 48px;
  }
  /* On narrow screens the three-column body crushes the panes —
   * collapse to a single column showing only the markdown side
   * (the most legible at small widths). */
  .shot { margin-bottom: 56px; }
  .shot-body {
    grid-template-columns: 1fr;
  }
  .shot-sidebar,
  .shot-pane--code {
    display: none;
  }
  .shot-pane--md {
    border-right: 0;
  }
}
