/* Kan Do website — shared styles */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --accent: #2fa257;
  --accent-strong: #248a48;
  --accent-soft: rgba(47, 162, 87, 0.12);
  --blue: #007aff;
  --hairline: rgba(0, 0, 0, 0.09);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.16);
  --code-bg: #f0f0f2;
  --radius: 14px;
  --topbar-h: 60px;
  --sidebar-w: 272px;
  --outline-w: 220px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161618;
    --surface: #1f1f22;
    --surface-2: #29292d;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #6e6e73;
    --accent: #4cc97e;
    --accent-strong: #62d58f;
    --accent-soft: rgba(76, 201, 126, 0.16);
    --blue: #409cff;
    --hairline: rgba(255, 255, 255, 0.11);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --code-bg: #2a2a2e;
  }
}
:root[data-theme="dark"] {
  --bg: #161618;
  --surface: #1f1f22;
  --surface-2: #29292d;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #6e6e73;
  --accent: #4cc97e;
  --accent-strong: #62d58f;
  --accent-soft: rgba(76, 201, 126, 0.16);
  --blue: #409cff;
  --hairline: rgba(255, 255, 255, 0.11);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --code-bg: #2a2a2e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 100%;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 15px; }
.topnav a { color: var(--text); opacity: 0.85; }
.topnav a:hover { opacity: 1; text-decoration: none; }
.topnav-cta {
  background: var(--accent); color: #fff !important; opacity: 1 !important;
  padding: 7px 16px; border-radius: 980px; font-weight: 600;
}
.topnav-cta:hover { background: var(--accent-strong); }
.menu-btn {
  display: none; margin-left: auto; background: none; border: 1px solid var(--hairline);
  border-radius: 8px; padding: 6px 8px; color: var(--text); cursor: pointer;
}
body.wiki .topnav .topnav-cta { display: none; }

/* ---------- landing ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hero { text-align: center; padding: 72px 0 40px; }
.hero .app-icon {
  width: 104px; height: 104px; margin: 0 auto 22px; border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: clamp(38px, 6vw, 60px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.hero .tagline { font-size: clamp(18px, 2.4vw, 23px); color: var(--muted); max-width: 640px; margin: 18px auto 0; line-height: 1.45; }
.hero .platforms { margin-top: 18px; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; }
.hero .platforms span::before { content: "•"; color: var(--faint); margin-right: 8px; }
.hero .platforms span:first-child::before { content: none; }
.cta-row { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 980px;
  font-size: 17px; font-weight: 600; text-decoration: none !important; transition: transform .15s ease, background .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.btn-secondary:hover { transform: translateY(-1px); }
.price-note { font-size: 14px; color: var(--muted); margin-top: 14px; }
.hero-shot { margin: 48px auto 0; max-width: 1040px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-shot img { width: 100%; }

.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--hairline); }
.section-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.section-head p { font-size: 18px; color: var(--muted); margin-top: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature {
  background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
}
.feature .glyph {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feature p { font-size: 15px; color: var(--muted); }
.feature a { font-size: 14px; font-weight: 600; display: inline-block; margin-top: 10px; }

.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-bottom: 72px; }
.showcase:last-child { margin-bottom: 0; }
.showcase.flip .showcase-media { order: 2; }
.showcase-media { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
.showcase-copy h3 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 12px; }
.showcase-copy p { font-size: 17px; color: var(--muted); }
.showcase-copy ul { margin: 16px 0 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.showcase-copy li { padding-left: 26px; position: relative; font-size: 16px; }
.showcase-copy li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); }
.showcase-copy .more { display: inline-block; margin-top: 18px; font-weight: 600; }

.platform-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.platform {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px 16px; text-align: center; box-shadow: var(--shadow);
}
.platform strong { display: block; font-size: 16px; margin-top: 8px; }
.platform span { font-size: 13px; color: var(--muted); }
.platform svg { width: 30px; height: 30px; color: var(--accent); }

.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.gallery figure { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.gallery figcaption { font-size: 12.5px; color: var(--muted); padding: 8px 10px; text-align: center; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { font-weight: 600; cursor: pointer; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--muted); font-size: 15px; }

.cta-band { text-align: center; padding: 72px 20px; background: linear-gradient(180deg, #4cc97e, #2fa257); color: #fff; border-radius: 24px; margin: 0 20px 72px; }
.cta-band h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.025em; }
.cta-band p { font-size: 18px; opacity: 0.92; margin-top: 10px; }
.cta-band .btn-primary { background: #fff; color: #1d6a3a; margin-top: 26px; }
.cta-band .btn-primary:hover { background: #f4fff7; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding: 40px 20px 56px; font-size: 13px; color: var(--muted); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 14px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 15px; }
.footer-brand img { border-radius: 6px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

/* ---------- wiki layout ---------- */
.wiki-layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); max-width: 1400px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 20px 16px 40px; border-right: 1px solid var(--hairline); font-size: 14px;
}
.sidebar-search { position: relative; margin-bottom: 14px; }
.sidebar-search input, .wiki-hero-search input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.wiki-hero-search input { font-size: 16px; padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.search-results {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; z-index: 20;
}
.search-results a { display: block; padding: 10px 12px; color: var(--text); border-bottom: 1px solid var(--hairline); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover, .search-results a.selected { background: var(--surface-2); text-decoration: none; }
.search-results .sr-title { font-weight: 600; }
.search-results .sr-section { font-size: 12px; color: var(--muted); }
.search-results .sr-snippet { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.search-results .sr-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.wiki-hero-search { position: relative; max-width: 560px; margin: 22px auto 0; }
.wiki-hero-search .search-results { text-align: left; }
.sidebar-home { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.sidebar-home.active, .sidebar a.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 0 10px; margin-bottom: 4px; }
.nav-group ul { list-style: none; }
.nav-group a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text); opacity: 0.9; }
.nav-group a:hover { background: var(--surface-2); text-decoration: none; opacity: 1; }
.nav-group a.active { font-weight: 600; opacity: 1; }

.content { display: grid; grid-template-columns: minmax(0, 1fr) var(--outline-w); gap: 40px; padding: 36px 40px 80px; }
.wiki-home .content { display: block; max-width: 1000px; }
.doc { max-width: 760px; min-width: 0; }
.doc-section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.doc-title { font-size: clamp(30px, 4vw, 40px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; margin: 6px 0 10px; }
.doc-summary { font-size: 18px; color: var(--muted); margin-bottom: 28px; }
.doc-body { font-size: 16.5px; }
.doc-body > * + * { margin-top: 1em; }
.doc-body h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.015em; margin-top: 2.2em; padding-top: 0.4em; border-top: 1px solid var(--hairline); }
.doc-body h3 { font-size: 18.5px; font-weight: 700; margin-top: 1.8em; }
.doc-body h4 { font-size: 16px; font-weight: 700; margin-top: 1.4em; }
.doc-body h2 .anchor, .doc-body h3 .anchor, .doc-body h4 .anchor { float: left; margin-left: -1.2em; width: 1.2em; color: var(--faint); opacity: 0; font-weight: 400; }
.doc-body h2:hover .anchor, .doc-body h3:hover .anchor, .doc-body h4:hover .anchor { opacity: 1; text-decoration: none; }
.doc-body ul, .doc-body ol { padding-left: 1.4em; }
.doc-body li + li { margin-top: 0.35em; }
.doc-body li > ul, .doc-body li > ol { margin-top: 0.35em; }
.doc-body strong { font-weight: 650; }
.doc-body code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.doc-body pre { background: var(--code-bg); border-radius: 12px; padding: 14px 16px; overflow: auto; font-size: 13.5px; line-height: 1.5; }
.doc-body pre code { background: none; padding: 0; font-size: inherit; }
.doc-body blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; color: var(--muted); }
.doc-body img { border-radius: 12px; box-shadow: var(--shadow); margin: 8px 0; }
.doc-body figure.shot { margin: 1.4em 0; text-align: center; }
.doc-body figure.shot img { display: inline-block; max-height: 560px; width: auto; max-width: 100%; margin: 0; border: 1px solid var(--hairline); }
.doc-body figure.shot.phone img { max-height: 520px; }
.doc-body figure.shot figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.doc-body hr { border: none; border-top: 1px solid var(--hairline); margin: 2em 0; }
.doc-body kbd { font-family: var(--font); font-size: 0.85em; background: var(--surface); border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc-body th, .doc-body td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.doc-body th { font-weight: 650; background: var(--surface-2); }
.callout { border-radius: 12px; padding: 14px 18px; background: var(--surface-2); border: 1px solid var(--hairline); }
.callout > * + * { margin-top: 0.6em; }
.callout-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.callout-tip { background: var(--accent-soft); border-color: transparent; }
.callout-tip .callout-label { color: var(--accent-strong); }
.callout-warning { background: rgba(255, 149, 0, 0.13); border-color: transparent; }
.callout-warning .callout-label { color: #b86a00; }
.callout-mac, .callout-ios { background: rgba(0, 122, 255, 0.09); border-color: transparent; }
.callout-mac .callout-label, .callout-ios .callout-label { color: var(--blue); }
.callout p:last-child { margin-bottom: 0; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.pager a { flex: 1; max-width: 48%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager a span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.pager-next { margin-left: auto; text-align: right; }

.outline { position: sticky; top: calc(var(--topbar-h) + 28px); align-self: start; font-size: 13px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; }
.outline-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.outline ul { list-style: none; border-left: 1px solid var(--hairline); }
.outline li a { display: block; padding: 4px 12px; color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; }
.outline li.lvl3 a { padding-left: 24px; font-size: 12.5px; }
.outline li a:hover { color: var(--text); text-decoration: none; }
.outline li a.current { color: var(--accent-strong); border-left-color: var(--accent); }

.wiki-hero { text-align: center; padding: 20px 0 40px; }
.wiki-hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 6px 0 12px; }
.wiki-hero .doc-summary { max-width: 640px; margin: 0 auto; }
.wiki-section { margin-top: 44px; }
.wiki-section h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.015em; }
.wiki-section-blurb { color: var(--muted); margin: 4px 0 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 18px; color: var(--text); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.card p { font-size: 14px; color: var(--muted); }

/* ---------- simple pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 56px 20px 80px; }
.page h1 { font-size: clamp(30px, 4vw, 40px); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 10px; }
.page .lead { font-size: 18px; color: var(--muted); margin-bottom: 28px; }
.page h2 { font-size: 22px; font-weight: 750; margin-top: 2em; margin-bottom: 0.5em; }
.page p + p { margin-top: 1em; }
.page ul { padding-left: 1.4em; margin-top: 0.6em; }
.contact { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); margin: 28px 0 40px; }
.contact h2 { margin-top: 0; }
.contact > p { color: var(--muted); margin-bottom: 18px; }
.contact form { display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .req { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--hairline);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field textarea { resize: vertical; min-height: 140px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-actions .btn { cursor: pointer; border: none; font-family: inherit; }
.form-actions .btn[disabled] { opacity: 0.6; cursor: default; }
.form-status { font-size: 14.5px; margin: 0; }
.form-status.ok { color: var(--accent-strong); font-weight: 600; }
.form-status.error { color: #d0342c; font-weight: 600; }
.form-note { font-size: 13.5px; color: var(--muted); margin-top: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } .contact { padding: 20px 16px; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .content { grid-template-columns: minmax(0, 1fr); padding: 28px 28px 80px; }
  .outline { display: none; }
}
@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; gap: 24px; }
  .showcase.flip .showcase-media { order: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .topnav { display: none; }
  body.wiki .menu-btn { display: inline-flex; }
  body:not(.wiki) .topnav { display: flex; gap: 14px; font-size: 14px; }
  body:not(.wiki) .topnav a:not(.topnav-cta):not([href="/wiki/"]) { display: none; }
  .brand span { white-space: nowrap; }
  .wiki-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: min(320px, 86vw); height: auto;
    background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; z-index: 40; box-shadow: none;
  }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 24px 16px 64px; }
  .doc-body { font-size: 16px; }
  .doc-body h2 .anchor, .doc-body h3 .anchor, .doc-body h4 .anchor { display: none; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 24px; }
  .section { padding: 48px 0; }
  .cta-band { margin: 0 16px 48px; padding: 48px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .card { transition: none; } }
