:root {
  --bg: #F4F6F4;
  --surface: #FFFFFF;
  --sunken: #EAEEEC;
  --ink: #1D2A2B;
  --muted: #5B6B6D;
  --line: #D8E0DD;
  --accent: #2C6E5F;
  --accent-deep: #22594C;
  --accent-weak: #E1EEE9;
  --now: #B8741A;
  --now-weak: #F6EAD8;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --wrap: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --narrow: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  word-break: auto-phrase;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
p { margin: 0 0 1em; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em; background: var(--sunken); padding: .1em .4em; border-radius: 4px;
  word-break: break-all;
}

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.narrow { width: min(var(--narrow), 100% - 48px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-small { min-height: 38px; padding: 6px 16px; font-size: 14px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo img { width: 28px; height: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(36px, 5.4vw, 64px); font-weight: 900; line-height: 1.22; letter-spacing: .01em;
}
.lead { font-size: 17px; color: var(--muted); max-width: 30em; margin: 28px 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.note { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* live timeline */
.demo-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 26px 20px; box-shadow: 0 30px 60px -36px rgba(29, 42, 43, .35);
}
.demo-day { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0 0 10px 86px; }
.demo-now { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; margin-bottom: 6px; }
.demo-now-label { text-align: right; color: var(--now); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-now-bar { height: 3px; background: var(--now); border-radius: 2px; transform-origin: left; animation: grow 1.1s cubic-bezier(.2, .7, .2, 1) .25s both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .demo-now-bar { animation: none; } }
.demo-list { list-style: none; margin: 0; padding: 0; }
.demo-item { display: grid; grid-template-columns: 74px 16px 1fr; gap: 0 12px; position: relative; }
.demo-item::before { content: ""; position: absolute; left: 93px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.demo-time { text-align: right; padding-top: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.demo-dot { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 19px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }
.demo-ev { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 6px 0 12px; }
.demo-item.soon .demo-ev { border-color: var(--accent); }
.demo-title { font-weight: 700; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-actions { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fake-btn { font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; color: var(--ink); }
.fake-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.fake-btn { font-family: inherit; line-height: inherit; cursor: pointer; }
button.fake-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.demo-create[aria-busy="true"] { opacity: .7; cursor: default; }

/* 「ノートを作成」で現れるドキュメントの見本 */
.demo-doc {
  margin-top: 12px; padding: 12px 14px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: 13px;
}
.doc-kind { margin: 0 0 4px; font-size: 11px; color: var(--muted); }
.doc-title { margin: 0 0 2px; font-weight: 700; font-size: 15px; }
.doc-meta { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.doc-h { margin: 0 0 6px; font-weight: 700; font-size: 13px; }
.doc-line { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.doc-line.short { width: 60%; }
.doc-reset {
  margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent);
  font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
/* JS が動くときだけ、最初は閉じておく（JS なしでは見本をそのまま表示） */
.js .demo-doc:not(.is-open) { display: none; }
.js .demo-doc.is-open { animation: doc-in .55s var(--ease) both; }
.no-js .doc-reset, .no-js .demo-create { pointer-events: none; }
@keyframes doc-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.chip { font-size: 12px; font-weight: 500; padding: 1px 9px; border-radius: 999px; }
.chip-accent { background: var(--accent-weak); color: var(--accent); }
.demo-caption { font-size: 13px; color: var(--muted); margin: 6px 0 0 86px; }

/* ---------- ホーム画面のツアー ---------- */
.tour { padding: 24px 0 96px; }
.tour-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; align-items: start; }
.tour-media { position: sticky; top: 88px; }
.tour-frame { position: relative; overflow: hidden; }
.tour-frame img { width: 100%; }
/* 今の説明の部分だけを明るく残し、ほかを少し暗くする切り抜き（位置は tools/mockups/home.py の座標から） */
.tour-spot {
  position: absolute; left: calc(var(--l, 0) * 1%); top: calc(var(--t, 0) * 1%); width: calc(var(--w, 100) * 1%); height: calc(var(--h, 100) * 1%);
  border-radius: 12px; box-shadow: 0 0 0 200vmax rgba(29, 42, 43, .36); opacity: 0; pointer-events: none;
  transition: left .6s var(--ease), top .6s var(--ease), width .6s var(--ease), height .6s var(--ease), opacity .4s var(--ease);
}
.tour[data-area] .tour-spot { opacity: 1; }
.tour[data-area="schedule"] .tour-spot, .tour-step[data-area="schedule"] { --l: 20.6; --t: 24.6; --w: 44; --h: 43.4; }
.tour[data-area="words"] .tour-spot, .tour-step[data-area="words"] { --l: 65.9; --t: 24.6; --w: 32.3; --h: 14.8; }
.tour[data-area="sticky"] .tour-spot, .tour-step[data-area="sticky"] { --l: 65.9; --t: 41.2; --w: 32.3; --h: 25.8; }
.tour[data-area="calendar"] .tour-spot, .tour-step[data-area="calendar"] { --l: 20.6; --t: 72; --w: 77.6; --h: 28; }
.tour-steps { list-style: none; margin: 0; padding: 0; }
.tour-step { padding: 22vh 0; }
.tour-step:first-child { padding-top: 12vh; }
.tour-step:last-child { padding-bottom: 30vh; }
.tour-step h3 { font-size: 22px; margin-bottom: 12px; }
.tour-step p { color: var(--muted); margin: 0; }
.js .tour-step { opacity: .45; transition: opacity .4s var(--ease); }
.js .tour-step.is-active { opacity: 1; }
/* 幅が狭いときは固定をやめ、各説明の下にその部分を切り抜いた画像を置く */
.tour-crop { display: none; }

/* ---------- 見出しと画像の控えめな登場（JS が動き、動きを減らす設定でないときだけ） ---------- */
.motion .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.motion .reveal.is-in { opacity: 1; transform: none; }
.window {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 80px -48px rgba(29, 42, 43, .45);
}
.window-bar { height: 40px; display: flex; align-items: center; justify-content: center; background: var(--sunken); border-bottom: 1px solid var(--line); }
.window-url { font-size: 12px; color: var(--muted); background: var(--surface); border-radius: 6px; padding: 2px 16px; }

/* ---------- points ---------- */
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 112px; }
.point { padding: 4px 32px 0; border-left: 1px solid var(--line); }
.point:first-child { border-left: 0; padding-left: 0; }
.point h3 { font-size: 18px; margin-bottom: 12px; }
.point p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- sections ---------- */
.section-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; margin-bottom: 20px; }
.section-lead { color: var(--muted); margin-bottom: 40px; }
.features, .install, .settings, .faq, .contact { padding: 88px 0; }
.features { background: var(--surface); border-block: 1px solid var(--line); }

.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; padding: 48px 0; }
.feature + .feature { border-top: 1px solid var(--line); }
.feature.reverse .feature-text { order: 2; }
.feature-text h3 { font-size: 22px; margin-bottom: 16px; }
.feature-text p { color: var(--muted); }
.feature-img { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.feature-img.phone { justify-self: center; width: min(320px, 100%); border-radius: 36px; border: 8px solid var(--ink); }
.feature-more { border-top: 1px solid var(--line); padding-top: 48px; max-width: 760px; }
.feature-more h3 { font-size: 22px; margin-bottom: 16px; }
.feature-more + .feature-more { margin-top: 48px; }
.feature-more p { color: var(--muted); }
.pair { margin: 24px 0 0; display: grid; gap: 10px; }
.pair div { display: grid; grid-template-columns: 5em 1fr; gap: 16px; align-items: baseline; }
.pair dt { font-weight: 700; color: var(--accent); }
.pair dd { margin: 0; }

/* install steps */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 36px 64px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
}
.steps > li::after { content: ""; position: absolute; left: 19px; top: 44px; bottom: 6px; width: 2px; background: var(--line); }
.steps > li:last-child::after { display: none; }
/* 番号をつなぐ線を、スクロールに合わせて上から伸ばす（対応ブラウザのみ。ほかは最初から表示） */
@supports (animation-timeline: view()) {
  .steps > li { view-timeline-name: --step; }
  .steps > li::after {
    transform-origin: top; animation: step-line linear both;
    animation-timeline: --step; animation-range: entry 60% cover 55%;
  }
}
@keyframes step-line { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.steps h3 { font-size: 19px; margin-bottom: 10px; padding-top: 4px; }
.steps p { color: var(--muted); }
.callout { background: var(--now-weak); color: var(--ink) !important; border-radius: 10px; padding: 14px 18px; font-size: 15px; }
.kv { list-style: none; padding: 0; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kv li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; font-size: 15px; }
.kv li + li { border-top: 1px solid var(--line); }
.kv span { color: var(--muted); }

details.alt { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
details.alt summary { cursor: pointer; padding: 16px 20px; font-weight: 500; }
.alt-body { padding: 0 20px 18px; color: var(--muted); }
.plain-steps { margin: 0; padding-left: 1.4em; }
.plain-steps li { margin-bottom: 6px; }

/* settings */
.settings { background: var(--surface); border-block: 1px solid var(--line); }
.howto { display: grid; gap: 34px; }
.howto h3 { font-size: 18px; margin-bottom: 8px; }
.howto p { color: var(--muted); margin: 0; }

/* faq */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; font-weight: 700; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--muted); padding-bottom: 20px; margin: 0; }

/* contact */
.contact .mail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 24px 0 4px; }
.mail-text { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.mail-text b { color: var(--accent); font-weight: 700; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 104px; /* 下の余白は左下の Ko-fi ボタンと重ならないように */ font-size: 13px; color: var(--muted); }
.footer-inner p { margin: 0 0 6px; }
.footer-inner a { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-demo { max-width: 520px; }
  .feature, .feature.reverse { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .feature.reverse .feature-text { order: 0; }
  .points { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .point, .point:first-child { border-left: 0; padding: 0 0 0 18px; border-left: 3px solid var(--accent-weak); }
}
@media (max-width: 900px) {
  .site-nav { display: none; }
  .header-cta { margin-left: auto; }
  .tour-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tour-media { display: none; }
  .tour-step, .tour-step:first-child, .tour-step:last-child { padding: 0 0 40px; }
  .js .tour-step { opacity: 1; }
  .tour-crop {
    display: block; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg) url(images/home.webp) no-repeat;
    height: 0; padding-bottom: calc(var(--h) * 1080 / (var(--w) * 1440) * 100%);
    background-size: calc(100 / var(--w) * 100%) auto;
    background-position: calc(var(--l) / (100 - var(--w)) * 100%) calc(var(--t) / (100 - var(--h)) * 100%);
  }
}
@media (max-width: 760px) {
  .hero { padding: 40px 0 40px; }
  .lead { font-size: 16px; margin: 20px 0 26px; }
  .cta-row .btn { flex: 1 1 100%; }
  .demo-card { padding: 20px 16px 16px; }
  .demo-now, .demo-item { grid-template-columns: 56px 14px 1fr; gap: 0 10px; }
  .demo-now { grid-template-columns: 56px 1fr; }
  .demo-item::before { left: 72px; }
  .demo-day, .demo-caption { margin-left: 66px; }
  .shot { margin-bottom: 64px; }
  .window { border-radius: 10px; }
  .window-bar { height: 30px; }
  .points { margin-bottom: 72px; }
  .features, .install, .settings, .faq, .contact { padding: 64px 0; }
  .feature { padding: 36px 0; }
  .steps > li { padding-left: 54px; }
  .mail-text { font-size: 19px; }
}

/* ---------- 動きを減らす設定：すべて止めて最終状態を表示 ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .demo-doc.is-open { animation: none; }
  .tour-spot, .js .tour-step { transition: none; }
  .motion .reveal { opacity: 1; transform: none; transition: none; }
  .steps > li::after { animation: none !important; transform: none; }
}
