/* SPDX-License-Identifier: AGPL-3.0-or-later */
:root {
  --bg: #faf8f3;
  --bg-2: #f1ede3;
  --fg: #1c2420;
  --muted: #5d6763;
  --line: #e3dfd4;
  --accent: #0f766e;
  --accent-deep: #0b5c56;
  --accent-soft: #dff1ec;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(28, 36, 32, 0.07);
  --radius: 20px;
  font-family: "Hiragino Sans", "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101614;
    --bg-2: #161e1b;
    --fg: #e9efec;
    --muted: #9ba9a4;
    --line: #27312d;
    --accent: #5eead4;
    --accent-deep: #2dd4bf;
    --accent-soft: #15302b;
    --card: #182220;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.85;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.35; letter-spacing: 0.01em; }

/* ---- header -------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px max(16px, calc(50% - 540px));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
}

.mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.menu {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.menu a:hover { color: var(--fg); }

.open {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 7px 18px;
  border-radius: 999px;
  color: var(--bg);
  background: var(--accent);
}

/* ---- layout -------------------------------------------------------- */

/* clip, not hidden, so nothing inside becomes a scrolling box; the hero's
   soft shape reaches past the right edge and must not widen the page */
main { padding: 0 16px; overflow-x: clip; }

section {
  max-width: 1080px;
  margin: 0 auto;
}

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin: 0 0 18px;
}

.section-lead { margin: -8px 0 28px; color: var(--muted); }

/* ---- hero ----------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding: 72px 0 56px;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40px -200px auto auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  z-index: -1;
  pointer-events: none;
}

.kicker {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.88rem;
}

.kicker.light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0 0 30px;
  max-width: 36em;
  color: var(--muted);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid var(--line);
  color: var(--fg);
  background: var(--card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.fine {
  margin: 20px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* the camera panel in the hero: a frame, what the AI found, and its answer */

.vlm {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frame { border-radius: 16px; overflow: hidden; background: #e6f0d6; line-height: 0; }
.frame svg { width: 100%; height: auto; display: block; }
.scene { opacity: 0; transition: opacity 0.6s ease; }
.scene.on { opacity: 1; }
.scanline { opacity: 0; }
.frame.scanning .scanline { animation: scan 1.4s ease-in-out; }

@keyframes scan {
  0% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(360px); }
}

.rec { animation: rec 1.6s steps(1) infinite; }
@keyframes rec { 50% { opacity: 0.2; } }

.box { opacity: 0; transition: opacity 0.3s ease; }
.box.on { opacity: 1; }
.box rect:first-child {
  fill: rgba(15, 118, 110, 0.08);
  stroke: #0f766e;
  stroke-width: 2.5;
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  transition: stroke-dashoffset 0.9s ease;
}
.box.on rect:first-child { stroke-dashoffset: 0; }
.box .tag { fill: #0f766e; }
.box text { fill: #fff; }

/* the animals' play, only in the frame that shows */
.scene .bob, .scene .hop, .scene .rock, .scene .wiggle, .scene .swing, .scene .nod, .scene .tail, .scene .flutter {
  transform-box: fill-box;
  transform-origin: center;
}
.scene.on .bob { animation: bob 1.1s ease-in-out infinite; }
.scene.on .hop { animation: hop 1.8s ease-in-out infinite; }
.scene.on .rock { animation: rock 0.9s ease-in-out infinite alternate; }
.scene.on .wiggle { animation: wiggle 0.7s ease-in-out infinite alternate; }
.scene.on .swing { transform-origin: 50% 0; animation: swing 1.6s ease-in-out infinite alternate; }
.scene.on .nod { animation: nod 1.2s ease-in-out infinite; }
.scene.on .tail { transform-origin: 0 100%; animation: tail 1.4s ease-in-out infinite alternate; }
.scene.on .flutter { animation: flutter 3.2s ease-in-out infinite; }
.scene .d1 { animation-delay: -0.3s; }
.scene .d2 { animation-delay: -0.7s; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-16px); } }
@keyframes hop { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(8px, -12px); } 50% { transform: translate(16px, 0); } 75% { transform: translate(8px, -12px); } }
@keyframes rock { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes wiggle { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes swing { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes nod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tail { from { transform: rotate(-18deg); } to { transform: rotate(14deg); } }
@keyframes flutter { 0%, 100% { transform: translate(0, 0) scaleX(1); } 25% { transform: translate(14px, -10px) scaleX(0.3); } 50% { transform: translate(28px, -2px) scaleX(1); } 75% { transform: translate(14px, 8px) scaleX(0.3); } }

.reading { padding: 4px 8px 2px; }
.reading-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.reading-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.reading-text { margin: 0 0 6px; min-height: 3.4em; font-size: 0.95rem; opacity: 0; transform: translateY(6px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reading-text.on { opacity: 1; transform: none; }

.log { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.log-head { margin: 0 0 2px; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.log-head span { font-weight: 400; margin-left: 4px; }
.log ul { list-style: none; margin: 0; padding: 0; font-size: 0.84rem; color: var(--muted); }
.log li { display: flex; gap: 10px; padding: 2px 0; }
.log li.enter { animation: rise 0.45s ease both; }
.log .when { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }

.vlm figcaption { font-size: 0.75rem; color: var(--muted); text-align: right; padding: 0 6px 2px; }

/* ---- the dialogue section --------------------------------------------- */

.dialog {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0 56px;
}

.dialog h2 { margin-bottom: 12px; }
.dialog-text p:not(.kicker) { color: var(--muted); }

/* the example dialogue */

/* the four steps above the dialogue; the shown one is filled */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.note { margin: -4px 0 12px; color: var(--muted); font-size: 0.9rem; }

/* ---- the path: know, think, make, start ------------------------------- */

.path { padding: 8px 0 56px; }

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 18px;
  background: var(--bg-2);
  border-radius: var(--radius);
  position: relative;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 38px;
  right: -13px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
  z-index: 1;
}

.step-num {
  margin: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
}

.step h3 { margin: 0; font-size: 1.3rem; }

.skill {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.skill:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
/* the icon sits beside the title; the one-line note runs under both */
.skill .icon { width: 26px; height: 26px; border-radius: 7px; }
.skill .icon svg { width: 16px; height: 16px; }
.skill > span:last-child { display: contents; }
.skill strong { font-size: 0.97rem; line-height: 1.5; }
.skill small { grid-column: 1 / -1; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }

/* ---- steps ---------------------------------------------------------- */

.steps { padding: 24px 0 48px; }
.steps h2 { text-align: center; margin-bottom: 36px; }

.steps > ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  position: relative;
}

.steps > ol::before {
  content: "";
  position: absolute;
  top: 46px;
  left: 16%;
  right: 16%;
  border-top: 2px dashed var(--line);
  z-index: 0;
}

.steps > ol > li {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.num {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  box-shadow: 0 0 0 6px var(--bg);
}

h3 { margin: 14px 0 6px; font-size: 1.15rem; }

.steps p, .skills .card p { margin: 0; color: var(--muted); }

/* ---- skills --------------------------------------------------------- */

.skills { padding: 48px 0 64px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skills .card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.skills .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 14px;
}

.icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skills .tag {
  margin: 0;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.skills h3 { margin: 4px 0 8px; }

/* ---- the example dialogue and how to load, inside 使い方 ------------ */

.usage {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 24px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--fg);
  font-size: 1.05rem;
  text-align: center;
}

.usage strong { color: var(--accent-deep); margin-right: 8px; }

.example {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 32px;
  align-items: center;
  margin-top: 40px;
}

.example h3 { margin-top: 0; font-size: 1.3rem; }
.example-text p { color: var(--muted); }

.load { margin-top: 32px; padding: 24px 26px; background: var(--bg-2); border-radius: var(--radius); }
.load h3 { margin-top: 0; }
.load ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; color: var(--muted); }
.load li strong { display: inline-block; min-width: 7.5em; color: var(--fg); }
.load .note { margin: 16px 0 0; }

.beliefs { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; text-align: left; }
.beliefs li { color: rgba(255, 255, 255, 0.9); font-size: 1.02rem; }
.beliefs strong { color: #fff; }
.beliefs a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.beliefs a:hover { text-decoration-color: #fff; }

/* ---- how to load, at work ------------------------------------------- */

.howto {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.howto article {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.howto h3 { margin-top: 0; }
.howto dl { margin: 0; }
.howto dt { font-weight: 700; margin-top: 10px; }
.howto dt:first-child { margin-top: 0; }
.howto dd { margin: 0; color: var(--muted); }
.howto ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.howto li { margin: 4px 0; }

/* ---- news ------------------------------------------------------------ */

.news { padding: 16px 0 56px; }
.news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.news-head h2 { margin-bottom: 8px; }

.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.news-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
}

.news-list a:hover { color: var(--accent); }
.date { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-block;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.8;
}

.chips { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.more-link { font-weight: 700; text-decoration: none; }

/* ---- generated pages (skills, thinking, news) ------------------------ */

main.doc { padding: 40px 16px 64px; }
main.doc > article { max-width: 760px; margin: 0 auto; }
main.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 4px 0 12px; }
main.doc .lead { font-size: 1.05rem; }
main.doc .actions { margin: 20px 0 10px; }
main.doc button.button { font: inherit; font-weight: 700; cursor: pointer; }
.kicker a { color: inherit; text-decoration: none; }

.prose { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }
.prose h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose code { font-size: 0.9em; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.prose pre { background: var(--bg-2); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.table { overflow-x: auto; margin: 16px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-2); }
.prose table.policy th { white-space: nowrap; width: 1%; }
.tsukaikata .prose td:first-child { min-width: 9em; }

.own-news { padding: 12px 16px; border-radius: 12px; background: var(--bg-2); font-size: 0.95rem; }
.own-news a { font-weight: 700; }
.areas-head { margin: 24px 0 8px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.areas { display: flex; flex-wrap: wrap; gap: 8px; }
.areas button {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.areas button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.news-day h2 a { color: inherit; text-decoration: none; }
.news-day h2 a:hover { text-decoration: underline; }
.news-day li { display: flex; gap: 10px; align-items: baseline; margin: 6px 0; }
.news-day li .chip { flex: none; }
.news-day[hidden], .news-day li[hidden] { display: none; }

/* diagrams on the thinking page: drawn tall, so they read on a phone */
.fig { margin: 20px auto 8px; max-width: 420px; }
.fig svg, .fig img { width: 100%; height: auto; display: block; }
.fig text { text-anchor: middle; font-family: inherit; font-size: 15px; fill: var(--fg); }
.fig text.small { font-size: 13.5px; }
.fig text.strong, .fig .strong text { font-weight: 700; }
.fig .fm { fill: var(--muted); font-size: 13px; }
.fig .fb rect { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.fig .fx rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.fig .fm-box rect { fill: var(--bg-2); stroke: var(--line); stroke-width: 1.5; }
.fig .fdash rect { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.fig .fno { stroke: #d9534f; stroke-width: 3; stroke-linecap: round; }
.fig .fhit rect { fill: rgba(217, 83, 79, 0.16); stroke: #d9534f; stroke-width: 1.5; }
.fig .fx2 rect { fill: var(--accent); stroke: none; }
.fig .fx2 + text, .fig text.on-accent { fill: var(--bg); }
.fig .fperson circle, .fig .fperson path { fill: var(--accent); }
.fig .fperson-muted circle, .fig .fperson-muted path { fill: var(--muted); opacity: 0.6; }
.fig .fno-mark { fill: #d9534f; font-size: 26px; font-weight: 700; }
.fig .fok-mark { fill: var(--accent); font-size: 26px; font-weight: 700; }
.fig .fa-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.fig .fa-head { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.toc { margin: 16px 0 0; padding: 16px 20px 16px 40px; background: var(--bg-2); border-radius: 14px; color: var(--muted); }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* a guide's page: the parts for people, then the full text folded away */
.people .items { columns: 2; column-gap: 32px; padding-left: 1.4em; }
.people .items li, .people .flow li { margin: 6px 0; break-inside: avoid; }
.people .flow li { margin: 12px 0; }
.full { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 8px; }
.full summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 10px 0; }
.full summary:hover { color: var(--fg); }
.full[open] summary { color: var(--fg); }
.full .prose { margin-top: 0; border-top: none; }

.news-entry { padding: 8px 0 20px; border-bottom: 1px solid var(--line); }
.news-entry h2 { margin-top: 28px; }
.news-entry .src, .prose p.src { font-size: 0.85rem; color: var(--muted); }
.news-day ul { margin: 0; }

/* ---- belief band ---------------------------------------------------- */

.belief {
  max-width: none;
  margin: 0 -16px;
  padding: 72px 16px;
  /* fixed deep teal in both themes, so the white text stays readable */
  background: linear-gradient(135deg, #0b4f4a, #0f766e);
  color: #fff;
}

.belief-inner { max-width: 760px; margin: 0 auto; }

.belief h2 { color: #fff; }

.belief p {
  font-size: 1.05rem;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.92);
}

.more {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

/* ---- promises, cta --------------------------------------------------- */

.promise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 64px 0;
}

.promise article { padding: 4px 4px 0; }
.promise h3 { margin: 12px 0 6px; }
.promise p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 64px 0;
}

.pair article {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 30px 28px;
}

.pair h2 { font-size: 1.3rem; }
.pair p { margin: 0 0 12px; color: var(--muted); }

.cta {
  text-align: center;
  padding: 16px 0 72px;
}

.cta h2 { margin-bottom: 22px; }

/* ---- footer --------------------------------------------------------- */

footer {
  padding: 32px max(16px, calc(50% - 540px)) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer p { margin: 0 0 6px; }
footer strong { color: var(--fg); }
.small { font-size: 0.85rem; }

/* ---- narrow screens ------------------------------------------------- */

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding: 48px 0 40px; }
  .vlm { max-width: 560px; width: 100%; justify-self: center; }
  .dialog { grid-template-columns: 1fr; }
  .steps > ol, .grid, .pair, .howto, .promise, .example, .load ul { grid-template-columns: 1fr; }
  .people .items { columns: 1; }

  .step:nth-child(2)::after { display: none; }
  .steps > ol::before { display: none; }

  .bar { flex-wrap: wrap; row-gap: 6px; }
  .menu { order: 3; width: 100%; margin-left: 0; gap: 15px; overflow-x: auto; }
  .open { margin-left: auto; }
}

@media (max-width: 600px) {

  .step::after { display: none; }
}

@media (max-width: 480px) {
  h1 { font-size: 2.2rem; }
  .lead { font-size: 1rem; }
  .belief { padding: 56px 16px; }
}

/* The site search (sagasu.html) */
.sagasu { display: flex; gap: 8px; margin: 18px 0 8px; }
.sagasu input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.sagasu-list { padding-left: 1.2em; }
.sagasu-list li { margin: 10px 0; }
.sagasu-list a { text-decoration: none; }
.sagasu-h { display: block; color: var(--muted); font-size: 0.92em; }
.sagasu-x { margin: 2px 0 0; color: var(--muted); font-size: 0.88em; }

/* The log of fixes made from the record (kaiseki/kiroku.html) */
.kiroku-entry dl { margin: 6px 0 18px; }
.kiroku-entry dt { font-weight: 700; margin-top: 8px; }
.kiroku-entry dd { margin: 2px 0 0; }

/* The uses of AI on the top page: six side by side, not a sequence */
.use-list { grid-template-columns: repeat(3, 1fr); }
.use-list .step::after { display: none; }
.use-list .step h3 { font-size: 1.1rem; line-height: 1.5; }
.others { margin-top: 20px; }
@media (max-width: 880px) { .use-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .use-list { grid-template-columns: 1fr; } }

/* aiai tools, for those who also sell to companies */
.tools-intro { padding: 8px 0 48px; }
.tools-intro .section-lead { max-width: 46em; }
.tool-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .tool-cards { grid-template-columns: 1fr; } }

.fine.bad { color: #d9534f; }

/* "Next to read": lines Gemini added from the record (tools/kaiseki_jidou.py) */
.annai { margin: 28px 0 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--bg-2); border-radius: 10px; }
.annai-head { margin: 0 0 6px; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.annai ul { margin: 0; padding-left: 1.1em; }

/* hidden means hidden, whatever display a class gives */
[hidden] { display: none !important; }

/* The flow of the first use on the top page, and the page of all uses (katsuyou.html) */
.flow-list .step h3 { font-size: 1.05rem; }
.try { align-self: flex-start; font-size: 0.82rem; font-weight: 700; color: var(--accent); text-decoration: none;
  padding: 3px 10px; border: 1px solid var(--accent); border-radius: 999px; }
.try:hover { background: var(--accent-soft); }

/* The top page: the hero's words, the flow, and the cards to the other pages */
.hero.simple { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 8px; }
.hero.simple .lead { max-width: 46em; }
.mokuji { padding: 24px 0 64px; }

/* The top heading breaks only between its phrases */
.hero h1 .nb { display: inline-block; }

/* The top page's flow: a step opens to its explanation, a step the site's Gemini can
   do has a button on its right, and a question branches to the right */
.nagare { --c1: 470px; --c2: 290px; --gap: 40px; max-width: calc(var(--c1) + var(--gap) + var(--c2)); margin: 10px auto 24px; }
.nagare-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--c2); column-gap: var(--gap); align-items: center; }
.nagare-step, .nagare-q { grid-column: 1; margin: 0; line-height: 1.5; letter-spacing: 0; }
p.nagare-step, .nagare-step > summary, .nagare-q { padding: 10px 14px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
p.nagare-step.gemini, .nagare-step.gemini > summary { background: var(--accent-soft); border-color: var(--accent); }
/* the end is an outline, not a fill: the pressable button under the flow is the filled one */
p.nagare-step.tsukuru { background: transparent; border-color: var(--accent); border-radius: 999px; color: var(--accent); font-weight: 700; }
.nagare-q { border-radius: 999px; background: var(--bg-2); }
.nagare-step > summary { cursor: pointer; list-style: none; }
.nagare-step > summary::-webkit-details-marker { display: none; }
.nagare-step > summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; vertical-align: 3px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s ease; }
.nagare-step[open] > summary::after { vertical-align: -1px; transform: rotate(-135deg); }
.nagare-step > summary:hover { border-color: var(--accent); }
.nagare-setsumei { margin: 8px calc(-1 * (var(--gap) + var(--c2))) 0 0; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); font-size: 0.93rem; line-height: 1.8; letter-spacing: 0.02em; }
.nagare-setsumei p, .nagare-setsumei ul { margin: 0 0 8px; }
.nagare-setsumei ul { padding-left: 1.2em; }
.nagare-setsumei .fine { margin: 10px 0 0; font-size: 0.8rem; }
.nagare-side, .nagare-try { grid-column: 2; position: relative; margin: 0; line-height: 1.5; }
.nagare-side { padding: 6px 8px; text-align: center; font-size: 0.86rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.nagare-side::before { content: ""; position: absolute; top: 50%; left: calc(4px - var(--gap)); width: calc(var(--gap) - 10px); height: 2.5px;
  margin-top: -1.25px; border-radius: 2px; background: var(--accent); }
.nagare-side::after { content: ""; position: absolute; top: 50%; left: -11px; width: 7px; height: 7px; margin-top: -5px;
  border-top: 2.5px solid var(--accent); border-right: 2.5px solid var(--accent); transform: rotate(45deg); }
.nagare-label { position: absolute; bottom: calc(50% + 3px); left: calc(-1 * var(--gap)); width: var(--gap); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.nagare .nb { display: inline-block; }
.nagare-try { align-self: start; justify-self: start; margin-top: 7px; padding: 5px 14px; border: 1.5px solid var(--accent); border-radius: 999px;
  color: var(--accent); font-size: 0.86rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nagare-try:hover { background: var(--accent-soft); }
button.nagare-try { background: none; font-family: inherit; line-height: 1.5; cursor: pointer; }
/* beside a step Gemini does: "スキルをコピー" and "Gemini で試す", side by side on a PC, one over the other on a phone */
.nagare-btns { grid-column: 2; align-self: start; display: flex; gap: 8px; margin-top: 7px; }
.nagare-btns .nagare-try { margin: 0; }
.nagare-side { justify-self: start; width: 128px; }
@media (min-width: 601px) { .nagare-try { min-width: 9.6em; text-align: center; } }  /* "スキルをコピー" is as wide as "Gemini で試す" */
/* what the copy button of the first step says for 2.5 seconds, under it, over the next row */
.nagare-row { position: relative; }
.nagare-said { position: absolute; right: 0; top: calc(100% - 6px); z-index: 2; width: max-content; max-width: min(24em, 100%); padding: 4px 10px; border: 1px solid var(--accent);
  border-radius: 8px; background: var(--card); color: var(--accent); font-size: 0.8rem; box-shadow: var(--shadow); }
.nagare-said:empty { display: none; }
.nagare-ya { position: relative; height: 26px; margin-right: calc(var(--gap) + var(--c2)); }
.nagare-ya::before { content: ""; position: absolute; top: 4px; bottom: 5px; left: 50%; width: 2.5px; margin-left: -1.25px; border-radius: 2px; background: var(--accent); }
.nagare-ya::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 7px; height: 7px; margin-left: -5px;
  border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(45deg); }
.nagare-ya span { position: absolute; top: 0; left: calc(50% + 12px); font-size: 0.8rem; line-height: 26px; color: var(--muted); }
@media (max-width: 600px) {
  .nagare { --c2: 104px; --gap: 26px; }
  p.nagare-step, .nagare-step > summary, .nagare-q { padding: 9px 4px; font-size: 0.8rem; }
  .nagare-step > summary::after { margin-left: 6px; }
  .nagare-side { padding: 6px 4px; font-size: 0.8rem; width: auto; }
  .nagare-btns { flex-direction: column; gap: 4px; margin-top: 0; }
  .nagare-try { margin-top: 7px; padding: 4px 6px; font-size: 0.75rem; letter-spacing: 0; }
  .nagare-setsumei { padding: 12px 14px; }
}

/* The top page's cards to the other pages: a small drawing, a title, one line */
.card-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card-link { display: block; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; }
.card-link:hover { border-color: var(--accent); }
.card-link svg { display: block; color: var(--accent); margin-bottom: 8px; }
.card-link strong { display: block; }
.card-link span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.88rem; }
.nagare-note { margin: 14px 0 8px; text-align: center; }
.nagare-start { justify-content: center; margin: 16px 0 0; }
/* under the column of steps, not the page: the right column is left out, as under the explanations */
.nagare-foot { margin-right: calc(var(--gap) + var(--c2)); }
@media (max-width: 600px) { .nagare-foot { margin-right: 0; } }
sup { line-height: 0; }
.menu a[aria-current="page"] { color: var(--accent); font-weight: 700; }
@media (max-width: 880px) { .card-links { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-links { grid-template-columns: 1fr; } }

/* The "あわせて読む" frame: three cards chosen from the record. At 1180 px and wider it is a column of 240 px to the right of
   the text (760 px), 40 px apart, both together in the middle; it stays under the header. Narrower, it follows the text
   as cards in 3, 2 or 1 columns. */
.waku { max-width: 760px; margin: 28px auto 0; }
.waku-head { font-size: 1.1rem; margin: 0 0 10px; }
.waku-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.waku-card { display: block; height: 100%; padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: inherit; text-decoration: none; }
.waku-card:hover { border-color: var(--accent); }
.waku-kind { display: block; color: var(--muted); font-size: 0.78rem; }
.waku-card strong { display: block; margin-top: 2px; }
.waku-desc { display: block; margin-top: 4px; color: var(--muted); font-size: 0.86rem; }
.waku-note { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); }
.waku-note a { color: inherit; }
@media (max-width: 880px) { .waku-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .waku-cards { grid-template-columns: 1fr; } }
@media (min-width: 1180px) {
  main.doc.has-waku { display: grid; grid-template-columns: minmax(0, 760px) 240px; column-gap: 40px; justify-content: center; align-items: start; }
  main.doc.has-waku > article { grid-column: 1; grid-row: 1; margin: 0; max-width: none; }
  main.doc.has-waku > .waku { grid-column: 2; grid-row: 1; position: sticky; top: 84px; margin: 0; max-width: none; }
  .waku-cards { grid-template-columns: 1fr; }
}
