/* RootTree 公式サイト
   明るい配色＝朝露ボタニカル、暗い配色＝夜空アストロラーベ（docs/prototype のテーマに合わせる） */

:root {
  color-scheme: light dark;
  --bg: #edf5f0;
  --bg-alt: #e2eee7;
  --surface: #f8fbf9;
  --surface-2: #ffffff;
  --text: #10231a;
  --muted: #4a5d53;
  --line: rgba(16, 35, 26, 0.14);
  --accent: #2d6a4f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(45, 106, 79, 0.1);
  --brass: #a8811f;
  --branch: #2d6a4f;
  --rootline: #9c6644;
  --ground: #3b7a57;
  --soil: rgba(156, 102, 68, 0.07);
  --c-core: #0f766e;
  --c-interest: #10b981;
  --c-theme: #059669;
  --c-goal: #f59e0b;
  --c-action: #38bdf8;
  --c-root: #b45309;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 30px -18px rgba(16, 35, 26, 0.35);
  --radius: 14px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d1f;
    --bg-alt: #0b1430;
    --surface: #0f1a38;
    --surface-2: #132044;
    --text: #e8eefc;
    --muted: #a3b0cc;
    --line: rgba(148, 163, 184, 0.22);
    --accent: #d4af37;
    --accent-ink: #1a1405;
    --accent-soft: rgba(212, 175, 55, 0.12);
    --brass: #d4af37;
    --branch: #7c8db5;
    --rootline: #b07d4f;
    --ground: #d4af37;
    --soil: rgba(176, 125, 79, 0.08);
    --c-core: #fef08a;
    --c-interest: #60a5fa;
    --c-theme: #818cf8;
    --c-goal: #fbbf24;
    --c-action: #34d399;
    --c-root: #fb923c;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 14px 34px -20px rgba(0, 0, 0, 0.8);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 116px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
  font-feature-settings: "palt" 1;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { word-break: auto-phrase; text-wrap: balance; line-height: 1.35; letter-spacing: 0.01em; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 820px; }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

.ext-icon { display: inline-block; width: 0.82em; height: 0.82em; margin-left: 0.28em; vertical-align: -0.06em; opacity: 0.75; }

/* ---------- ヘッダー（このサイトのページ／このページの見出し／言語） ---------- */

.chrome {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.chrome-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: 0.02em; flex: none; margin: 0; }
.brand img { border-radius: 7px; }
.site-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: none; color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.lang { display: flex; align-items: center; gap: 2px; flex: none; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang a, .lang span { padding: 3px 8px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang span[aria-current] { background: var(--text); color: var(--bg); font-weight: 700; }

@media (max-width: 719px) {
  .chrome-in { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .brand { order: 1; }
  .lang { order: 2; margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; margin: 4px -16px 0; padding: 0 12px 8px; }
}

.toc { border-top: 1px solid var(--line); }
.toc-in { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.toc-label { flex: none; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); font-family: var(--mono); text-transform: uppercase; }
.toc-label::after { content: ""; display: inline-block; width: 1px; height: 12px; background: var(--line); margin-left: 12px; vertical-align: -1px; }
.toc-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.toc-links::-webkit-scrollbar { display: none; }
.toc-links a { flex: none; font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.toc-links a:hover { color: var(--text); background: var(--accent-soft); }
.toc-links a::before { content: "#"; color: var(--brass); margin-right: 3px; font-family: var(--mono); }

/* ---------- ボタン（機械式スイッチの押し心地） ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; transition: transform 0.065s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: scale(0.94); }
.btn-main { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px -10px var(--accent); }
.btn-sub { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-sub:hover { border-color: var(--accent); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cta-center { justify-content: center; }

/* ---------- ヒーロー ---------- */

.hero { padding: 40px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 75% 35%, var(--accent-soft), transparent 70%);
}
.hero-in { position: relative; display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 88px; } .hero-in { grid-template-columns: 1.02fr 1fr; gap: 40px; } }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--brass); text-transform: uppercase; margin-bottom: 12px; }
.hero h1 { font-size: clamp(30px, 7.4vw, 52px); font-weight: 800; letter-spacing: 0.01em; line-height: 1.28; }
.hero h1 .line { display: block; }
html[lang="en"] .hero h1 { font-size: clamp(30px, 6.6vw, 50px); line-height: 1.15; letter-spacing: -0.01em; }
.lead { margin-top: 20px; color: var(--muted); font-size: 16.5px; max-width: 34em; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.badges li { font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }

.hero-fig { margin: 0; }
.fig-stage {
  position: relative; border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 62%, var(--soil), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow); overflow: hidden; aspect-ratio: 420 / 400;
}
.tree-svg { width: 100%; height: 100%; }
.tree-svg .soil { fill: var(--soil); stroke: none; }
.tree-svg .ground { fill: none; stroke: var(--ground); stroke-width: 1.4; opacity: 0.8; }
.tree-svg .ticks { fill: none; stroke: var(--ground); stroke-width: 1; opacity: 0.5; }
.tree-svg .edge { stroke: var(--branch); stroke-linecap: round; opacity: 0.85; }
.tree-svg .edge-root { stroke: var(--rootline); }
.tree-svg .node { stroke: var(--surface-2); stroke-width: 1.6; }
.tree-svg .grain { fill: var(--c-goal); opacity: 0.9; }
.node-core { fill: var(--c-core); }
.node-interest { fill: var(--c-interest); }
.node-theme { fill: var(--c-theme); }
.node-goal { fill: var(--c-goal); }
.node-action { fill: var(--c-action); }
.node-root { fill: var(--c-root); }

.switch {
  display: flex; width: max-content; margin: 14px auto 0; padding: 4px; gap: 4px;
  border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}
.switch[hidden] { display: none; }
.switch button {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); background: transparent; border: 0;
  min-height: 38px; padding: 6px 16px; border-radius: 999px; cursor: pointer; transition: transform 0.065s ease, background-color 0.2s ease, color 0.2s ease;
}
.switch button:active { transform: scale(0.92); }
.switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 3px 8px -3px rgba(0, 0, 0, 0.3); }

.legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend .glyph { width: 14px; height: 14px; }
.hero-fig figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

.glyph { width: 30px; height: 30px; flex: none; stroke: none; }
.glyph-core { fill: var(--c-core); }
.glyph-interest { fill: var(--c-interest); }
.glyph-theme { fill: var(--c-theme); }
.glyph-goal { fill: var(--c-goal); }
.glyph-action { fill: var(--c-action); }
.glyph-root { fill: var(--c-root); }

/* ---------- セクション ---------- */

.sec { padding: 64px 0; }
@media (min-width: 900px) { .sec { padding: 96px 0; } }
.sec-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec h2 { font-size: clamp(24px, 5vw, 36px); font-weight: 800; max-width: 26em; }
.sec-lead { margin-top: 14px; color: var(--muted); max-width: 40em; }
.center .sec-lead { margin-left: auto; margin-right: auto; }
.more { margin-top: 24px; font-weight: 600; }
.more a { text-decoration: none; }

.roles { list-style: none; display: grid; gap: 12px; margin-top: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .roles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .roles { grid-template-columns: repeat(3, 1fr); } }
.role { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.role h3 { font-size: 16px; }
.role p { font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.role-root { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--c-root))); }

.cards { list-style: none; display: grid; gap: 14px; margin-top: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-4, .cards-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .cards-4 { grid-template-columns: repeat(4, 1fr); } .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card h3 { font-size: 17px; margin-top: 12px; }
.card p { font-size: 14.5px; color: var(--muted); margin-top: 6px; }
.ico { width: 30px; height: 30px; color: var(--accent); }

.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr 0.9fr; gap: 56px; } }
.points { list-style: none; margin-top: 26px; display: grid; gap: 16px; }
.points li { padding-left: 18px; border-left: 2px solid var(--brass); }
.points h3 { font-size: 16px; }
.points p { font-size: 14.5px; color: var(--muted); }

.habit-art { display: grid; gap: 22px; justify-items: center; padding: 28px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.grain-node { position: relative; width: 150px; height: 150px; }
.grain-node .core { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--c-action); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c-action) 22%, transparent); }
.grain-node .orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--line); animation: spin 18s linear infinite; }
.grain-node .orbit::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--c-goal); box-shadow: 0 0 8px var(--c-goal); }
.grain-node .o2 { inset: 16px; animation-duration: 13s; animation-direction: reverse; }
.grain-node .o3 { inset: 30px; animation-duration: 10s; }
.grain-node .o4 { inset: 8px; animation-duration: 22s; border-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .grain-node .orbit { animation: none; } }
.mosaic { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; width: 100%; max-width: 320px; }
.cell { aspect-ratio: 1; border-radius: 3px; background: var(--line); }
.cell.on { background: var(--c-action); box-shadow: 0 0 6px color-mix(in srgb, var(--c-action) 60%, transparent); }

.plans { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 760px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { padding: 26px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.plan h3 { font-size: 18px; }
.plan-plus { border: 1.5px solid var(--accent); }
.price { margin-top: 10px; display: flex; align-items: baseline; gap: 4px; }
.price .num { font-size: 40px; font-weight: 800; letter-spacing: -0.01em; font-family: var(--mono); }
.price .unit { color: var(--muted); font-size: 15px; }
.trial { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.checks { list-style: none; margin-top: 18px; display: grid; gap: 8px; font-size: 15px; }
.checks li { padding-left: 24px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.notes { margin-top: 22px; padding-left: 1.2em; font-size: 14px; color: var(--muted); display: grid; gap: 6px; }

.faq { margin-top: 28px; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--brass); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 16px; color: var(--muted); font-size: 15px; }

.sec-end { padding-bottom: 88px; }

/* ---------- 文書ページ ---------- */

.doc { padding: 44px 0 80px; }
.doc h1 { font-size: clamp(26px, 6vw, 38px); font-weight: 800; }
.doc-meta { margin-top: 10px; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.doc-lead { margin-top: 20px; }
.doc-toc { margin-top: 28px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.doc-toc p { font-size: 12px; font-family: var(--mono); letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.doc-toc ol { margin-top: 8px; padding-left: 1.4em; columns: 2 220px; column-gap: 28px; font-size: 14.5px; }
.doc-toc li { break-inside: avoid; }
.doc-body h2 { font-size: 20px; margin-top: 44px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc-body h3 { font-size: 17px; margin-top: 26px; }
.doc-body p { margin-top: 14px; }
.doc-body ul, .doc-body ol { margin-top: 12px; padding-left: 1.4em; display: grid; gap: 6px; }
.doc-body code { font-family: var(--mono); font-size: 0.9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc-body th, .doc-body td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.doc-body thead th { background: var(--bg-alt); font-size: 13px; }
.doc-body tbody th { width: 30%; font-weight: 600; background: var(--surface); }
.doc-body tr:last-child th, .doc-body tr:last-child td { border-bottom: 0; }
@media (max-width: 599px) {
  .doc-body thead { display: none; }
  .doc-body tr, .doc-body tbody th, .doc-body td { display: block; width: auto; }
  .doc-body tbody th { border-bottom: 0; padding-bottom: 2px; background: transparent; font-size: 13px; color: var(--muted); }
  .doc-body tr { border-bottom: 1px solid var(--line); }
  .doc-body tr:last-child { border-bottom: 0; }
  .doc-body td { border-bottom: 0; padding-top: 0; }
}
.contact { margin-top: 16px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; }
.contact p { margin: 0; }
.doc-end { margin-top: 48px; font-size: 13px; color: var(--muted); text-align: right; }

/* ---------- フッター ---------- */

.foot { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 48px 0 28px; font-size: 14px; }
.foot > .wrap:first-child { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .foot > .wrap:first-child { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .foot > .wrap:first-child { grid-template-columns: 1.4fr 1fr 1fr 0.7fr; } }
.foot-tag { margin-top: 10px; color: var(--muted); }
.foot-mail { margin-top: 8px; }
.foot-h { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); font-family: var(--mono); text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; }
.foot-col ul { list-style: none; display: grid; gap: 4px; }
.foot-col a { color: var(--text); text-decoration: none; }
.foot-col a:hover { color: var(--accent); text-decoration: underline; }
.foot-col a[aria-current] { color: var(--accent); font-weight: 600; }
.foot-ext ul { padding-left: 10px; border-left: 2px dotted var(--line); }
.foot-copy { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
