/* David Mouse landing page styles */
:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-dark: #1e1e1e;
  --text: #1a1a1a;
  --text-muted: #555;
  --text-light: #fff;
  --accent: #1a5fb4;
  --accent-hover: #124a8f;
  --success: #1e7a2e;
  --warn: #f1c232;
  --danger: #d63838;
  --border: #e3e3e3;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Accessibility: visible keyboard focus and skip link */
:focus-visible { outline: 3px solid #0b3d91; outline-offset: 2px; border-radius: 4px; }
footer :focus-visible { outline-color: #ffd54f; }
main:focus { outline: none; }
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: #fff; color: #0b3d91; padding: 10px 16px; border: 2px solid #0b3d91; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 8px; text-decoration: none; }

body {
  font-family: -apple-system, "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

a { color: var(--accent); text-decoration: none; }
p a:not(.btn):not(.dl-btn), li a, .section-lede a { text-decoration: underline; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Top nav */
.topnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
/* 固定導覽列只在大畫面使用；放大 200% 以上或小螢幕時改回一般排版，避免遮住內容與鍵盤焦點 */
html { scroll-padding-top: 80px; }
@media (max-width: 1100px), (max-height: 640px) {
  .topnav { position: static; backdrop-filter: none; }
  html { scroll-padding-top: 0; }
}
.topnav .container { flex-wrap: wrap; gap: 8px 16px; }
.nav-links { flex-wrap: wrap; }
.new-window { font-size: 0.875em; font-weight: 400; }
.topnav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.brand a { color: var(--text); text-decoration: none; }
.brand .badge {
  font-size: 0.6875rem;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.875rem; display: inline-block; padding: 6px 4px; min-height: 28px; }
.nav-links a:hover { color: var(--accent); }
.lang-switch {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text);
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(180deg, #f3f7fc 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: 2.75rem;
  line-height: 1.25;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero .lede {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 720px;
}
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.1s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.free-tag {
  display: inline-block;
  background: var(--success);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Download section — sits right after hero, two big cards */
#download {
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fc 100%);
}
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 24px 0 32px;
}
@media (max-width: 720px) {
  .download-grid { grid-template-columns: 1fr; }
}
.download-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.download-card.primary { border-color: var(--accent); }
.download-card.feature { border-color: #8e44ad; }
.download-card.feature .dl-btn {
  background: #8e44ad;
  color: #fff;
}
.download-card.feature .dl-btn:hover {
  background: #732d91;
  color: #fff;
  text-decoration: none;
}
.download-card .dl-icon {
  font-size: 2.75rem;
  margin-bottom: 12px;
}
.download-card h3 { font-size: 1.375rem; margin-bottom: 8px; }
.download-card .dl-sub {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 20px;
  flex: 1;
}
.download-card .dl-btn {
  display: inline-block;
  text-align: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  width: 100%;
}
.download-card.primary .dl-btn {
  background: var(--accent);
  color: #fff;
}
.download-card.primary .dl-btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
.download-card.secondary .dl-btn {
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}
.download-card.secondary .dl-btn:hover {
  background: var(--text);
  color: #fff;
  text-decoration: none;
}
.download-card .dl-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
  line-height: 1.5;
}
.download-card .dl-note strong { color: var(--danger); }

/* Section */
section { padding: 64px 0; }
section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}
section .section-lede {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin-bottom: 40px;
  max-width: 720px;
}

/* David story */
.story {
  background: #fff8d8;
  border-left: 6px solid var(--warn);
  padding: 32px 40px;
  border-radius: var(--radius);
  margin: 24px 0;
}
.story h3 { font-size: 1.375rem; margin-bottom: 12px; color: #7a5d00; }
.story .placeholder-notice {
  background: rgba(214, 56, 56, 0.08);
  color: var(--danger);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  margin-bottom: 16px;
  border: 1px dashed var(--danger);
}
.story-quote {
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 600;
  color: #7a5d00;
  line-height: 1.65;
  margin-bottom: 20px;
  padding: 0;
}

/* Problem / Solution grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.25rem; margin-bottom: 12px; }
.card .emoji { font-size: 2rem; margin-bottom: 8px; }
.card .emoji.corner-arrows {
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", sans-serif;
  font-size: 1.625rem;
  line-height: 1.05;
  letter-spacing: 2px;
  font-weight: bold;
}

/* Screenshots */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}
@media (max-width: 720px) {
  .shots { grid-template-columns: 1fr; }
}
.shot {
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 1px solid #333;
}
.shot img {
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
}
.shot figcaption {
  margin-top: 12px;
  color: #ddd;
  font-size: 0.8125rem;
}
/* Watch mode's real window is a tiny 90x90 widget — scale the screenshot up
   so it doesn't look broken sitting next to the full-size mode shots. */
.shot.shot-watch img {
  width: 180px;
  height: 180px;
}

/* Steps */
.steps { display: flex; flex-direction: column; gap: 20px; }
.step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 28px;
  border: 1px solid var(--border);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.step-num {
  background: var(--accent);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.step h3 { font-size: 1.125rem; margin-bottom: 6px; }
.step .step-body { flex: 1; }
.step code {
  background: #f1f1f1;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 0.8125rem;
  color: #c0392b;
}

/* Code block */
pre {
  background: var(--bg-dark);
  color: #d4d4d4;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 16px 0;
}
pre .comment { color: #6a9955; }

/* Footer */
footer {
  background: var(--bg-dark);
  color: #aaa;
  padding: 40px 0 30px;
  margin-top: 40px;
}
footer a { color: #4ba3f0; }
footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
footer h4 { color: #fff; margin-bottom: 12px; font-size: 0.9375rem; }
footer ul { list-style: none; }
footer ul li { margin: 6px 0; font-size: 0.875rem; }
footer .credit {
  width: 100%;
  border-top: 1px solid #333;
  padding-top: 20px;
  margin-top: 24px;
  font-size: 0.8125rem;
  text-align: center;
  color: #b5b5b5;
}

/* Free / accessible badges */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}
@media (max-width: 720px) {
  .feature-row { grid-template-columns: 1fr; }
}
.feature {
  text-align: center;
  padding: 24px;
}
.feature .emoji { font-size: 2.5rem; margin-bottom: 12px; }
.feature h4 { font-size: 1.0625rem; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 0.875rem; }

/* Mobile nav: allow wrapping with enough spacing between touch targets */
@media (max-width: 720px) {
  .topnav .container { flex-wrap: wrap; row-gap: 4px; }
  .nav-links { flex-wrap: wrap; gap: 4px 12px; }
  .nav-links a { padding: 8px 6px; min-height: 32px; }
}

/* Reflow at 320px: grid children may shrink, code blocks wrap instead of widening the page */
.grid-2 > *, .shots > *, .download-grid > *, .feature-row > * { min-width: 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; }
