/* 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; }
}

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;
}

.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);
}

.hero-figure { margin: 0; width: 100%; }

.hero-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.node rect, .node circle {
  fill: var(--card);
  stroke: var(--line);
  stroke-width: 1.5;
}

.node.core circle {
  fill: var(--accent);
  stroke: none;
}

.node.you rect {
  fill: var(--accent-soft);
  stroke: none;
}

.node text {
  text-anchor: middle;
  font-family: inherit;
  fill: var(--fg);
}

.node-title { font-size: 17px; font-weight: 700; }
.node-sub { font-size: 13px; fill: var(--muted) !important; }
.core-title { font-size: 18px; font-weight: 700; fill: var(--bg) !important; }
.core-title.big { font-size: 34px; }
.tag { font-size: 12px; fill: var(--muted); text-anchor: middle; font-family: inherit; }

.flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.flow.dialogue { stroke-width: 2; }

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

.steps { padding: 48px 0; }
.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; }

/* ---- 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 ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.howto li { margin: 4px 0; }

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

.news { padding: 16px 0 56px; }

.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); }

.news-entry { padding: 8px 0 20px; border-bottom: 1px solid var(--line); }
.news-entry h2 { margin-top: 28px; }
.news-entry .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;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  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);
}

/* ---- pair, cta ------------------------------------------------------ */

.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; }
  .hero-figure { max-width: 520px; justify-self: center; }
  .steps ol, .grid, .pair, .howto { grid-template-columns: 1fr; }
  .steps ol::before { display: none; }
  .bar { flex-wrap: wrap; row-gap: 6px; }
  .menu { order: 3; width: 100%; margin-left: 0; gap: 18px; overflow-x: auto; }
  .open { margin-left: auto; }
}

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