/* Vimdow website. Tokens follow the app icon: charcoal, accent green, light window greys. */

:root {
  color-scheme: dark light;
  --bg: #13161c;
  --bg-raised: #1b2028;
  --surface: #232932;
  --border: rgba(255, 255, 255, 0.09);
  --text: #e6eaf0;
  --muted: #9aa3b0;
  --accent: #4cd07d;
  --accent-ink: #0b1f14;
  --link: #7fe0a3;
  --kbd-bg: #2c323d;
  --kbd-text: #f3f5f8;
  --kbd-border: #3a414d;
  --desktop-top: #3a4150;
  --desktop-bottom: #1b1f27;
  --window-top: #f3f5f8;
  --window-bottom: #d6dce4;
  --window-title: #dce1e8;
  --window-dot: #a3abb6;
  --focus: #4cd07d;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 62ch;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f5f8;
    --bg-raised: #ffffff;
    --surface: #ffffff;
    --border: #d6dce4;
    --text: #1b2028;
    --muted: #5a6472;
    --accent: #1f9e55;
    --accent-ink: #ffffff;
    --link: #17804a;
    --kbd-bg: #ffffff;
    --kbd-text: #1b2028;
    --kbd-border: #c3cad4;
    --desktop-top: #cfd6df;
    --desktop-bottom: #aeb7c3;
    --window-top: #ffffff;
    --window-bottom: #e9edf2;
    --window-title: #e3e8ee;
    --window-dot: #b8c0ca;
    --focus: #1f9e55;
  }
}

/* Language-specific type. Order matters: a Japanese page must never fall back to a Chinese font. */
:lang(ko) { --font-body: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
:lang(ja) { --font-body: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif; }
:lang(zh-Hans) { --font-body: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

:lang(ko) body, :lang(ja) body, :lang(zh-Hans) body { line-height: 1.75; }
:lang(ko) { word-break: keep-all; }
:lang(ja), :lang(zh-Hans) { overflow-wrap: anywhere; text-autospace: normal; text-spacing-trim: space-first; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { font-feature-settings: "palt"; }
:lang(ko) em, :lang(ja) em, :lang(zh-Hans) em { font-style: normal; font-weight: 600; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 650; }
h3 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--kbd-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--kbd-bg);
  color: var(--kbd-text);
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.5;
  text-align: center;
  vertical-align: baseline;
}
kbd + kbd { margin-left: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -100px;
  padding: 8px 12px; background: var(--accent); color: var(--accent-ink);
  border-radius: 6px; z-index: 10;
}
.skip:focus { top: 12px; }

/* Layout */
.site-header, main, .site-footer {
  width: min(100% - 32px, 960px);
  margin-inline: auto;
}

.site-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none;
}
.brand img { border-radius: 8px; }
.lang-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-inline-start: auto; }
.lang-nav a {
  padding: 4px 9px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem;
}
.lang-nav a:hover { color: var(--text); background: var(--bg-raised); }
.lang-nav a[aria-current] { color: var(--accent); background: var(--bg-raised); font-weight: 600; }
.gh { font-size: 0.95rem; }

main > section { padding: 56px 0; border-top: 1px solid var(--border); }
main > section:first-child { border-top: 0; padding-top: 32px; }
.prose p, section > p { max-width: var(--measure); }

/* Hero */
.hero { text-align: center; }
.hero h1 { margin-inline: auto; max-width: 20ch; }
:lang(ko) .hero h1, :lang(ja) .hero h1, :lang(zh-Hans) .hero h1 { max-width: 26ch; }
.hero .lead { margin: 0 auto 1.4em; max-width: var(--measure); color: var(--muted); font-size: 1.15rem; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
section:not(.hero) .cta { justify-content: flex-start; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 20px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-raised); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer; font: inherit; font-weight: 600;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.button.primary:hover { filter: brightness(1.08); }
.button.small { min-height: 36px; padding: 4px 14px; font-size: 0.9rem; }

/* Demo */
.demo { margin: 40px auto 0; max-width: 720px; text-align: start; }
.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--desktop-top), var(--desktop-bottom));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.desktop { position: absolute; inset: 0; }
.menubar {
  position: absolute; left: 0; right: 0; top: 0; height: 6%;
  display: flex; align-items: center; gap: 3%;
  padding: 0 2.5%;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
}
.menubar .apple { width: 2%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.7); }
.menubar .menu { width: 6%; height: 28%; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
.menubar .mode {
  margin-inline-start: auto;
  padding: 0 1.2%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.75);
  font: 600 clamp(8px, 1.7vw, 12px) / 1.6 var(--font-mono);
  letter-spacing: 0.06em;
  transition: background 200ms, color 200ms;
}
.stage.is-command .mode { background: var(--accent); color: #0b1f14; }

.window {
  position: absolute;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--window-top), var(--window-bottom));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: left 450ms cubic-bezier(0.25, 0.1, 0.25, 1), top 450ms cubic-bezier(0.25, 0.1, 0.25, 1),
              width 450ms cubic-bezier(0.25, 0.1, 0.25, 1), height 450ms cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 200ms;
}
.stage.is-command .window { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--accent); }
.titlebar { display: flex; gap: 5px; align-items: center; height: 22px; padding: 0 8px; background: var(--window-title); }
.titlebar i { width: 8px; height: 8px; border-radius: 50%; background: var(--window-dot); }
.pane { position: relative; padding: 10px; }
.cursor { display: block; width: 8px; height: 14px; background: var(--accent); }

.keycaps {
  position: absolute; left: 50%; bottom: 5%;
  display: flex; gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}
.keycaps kbd {
  min-width: 2.2em;
  padding: 0.25em 0.6em;
  font-size: clamp(11px, 2.4vw, 17px);
  background: #1b2028;
  color: #f3f5f8;
  border-color: #3a414d;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  animation: key-pop 180ms ease-out;
}
@keyframes key-pop {
  from { transform: translateY(8px) scale(0.9); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.demo-controls { display: flex; justify-content: flex-end; margin: 12px 0 4px; }
.demo-steps {
  margin: 8px 0 0; padding: 0 0 0 1.4em;
  columns: 2; column-gap: 24px;
  color: var(--muted); font-size: 0.95rem;
}
.demo-steps li { padding: 3px 6px; margin: 0 0 2px -6px; border-radius: 6px; break-inside: avoid; transition: background 200ms, color 200ms; }
.demo-steps li.is-active { background: var(--bg-raised); color: var(--text); }
.real-video { margin-top: 20px; }
.real-video summary { cursor: pointer; color: var(--link); }
.real-video video { display: block; width: 100%; margin-top: 12px; border-radius: 12px; background: #000; }

/* How it works */
.how { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.how li { position: relative; padding: 20px 20px 12px 64px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; }
.how li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 20px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font: 700 0.95rem / 1 var(--font-mono);
}
.how h3 { margin-bottom: 0.4em; }
.how p { margin: 0; color: var(--muted); }

/* Features */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature { padding: 20px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; }
.feature h3 { margin-bottom: 0.4em; }
.feature p { margin: 0; color: var(--muted); }

/* Cheat sheet */
.table-wrap { overflow-x: auto; }
.cheat { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.cheat th, .cheat td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: top; }
.cheat th { color: var(--muted); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
:lang(ko) .cheat th, :lang(ja) .cheat th, :lang(zh-Hans) .cheat th { text-transform: none; letter-spacing: 0; }
.cheat td.keys { white-space: nowrap; }
.chord { display: inline-block; }
.or { margin: 0 0.45em; color: var(--muted); }
.note { color: var(--muted); font-size: 0.95rem; }

/* Footer */
.site-footer { padding: 32px 0 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.92rem; }
.site-footer p { margin: 0 0 0.5em; }

@media (max-width: 640px) {
  .demo-steps { columns: 1; }
  .cheat td.keys { white-space: normal; }
  .cheat th, .cheat td { padding: 8px 8px; }
  main > section { padding: 40px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .window, .menubar .mode, .demo-steps li { transition: none; }
  .keycaps kbd { animation: none; }
}
