/* =========================================================
   smabo — site styles
   Palette: friendly indigo / cyan, rounded & approachable
   ========================================================= */

:root {
  --indigo:      #4f46e5;
  --indigo-dark: #3730a3;
  --cyan:        #06b6d4;
  --ink:         #1e203a;
  --ink-soft:    #4a4d6b;
  --muted:       #74779a;
  --bg:          #ffffff;
  --bg-soft:     #f5f6fc;
  --bg-tint:     #eef0fb;
  --line:        #a8a8a8;
  --card:        #ffffff;
  --radius:      18px;
  --radius-sm:   12px;
  --shadow:      0 10px 30px -12px rgba(40, 42, 90, 0.25);
  --shadow-sm:   0 4px 14px -6px rgba(40, 42, 90, 0.2);
  --maxw:        1100px;
  --font: "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI",
          "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
          Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

h1, h2, h3 { line-height: 1.3; font-weight: 800; }

/* ----- layout helpers ----- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding-block: 84px; }
.section--tint { background: var(--bg-soft); }

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section__head h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.3rem);
  margin: 0 0 14px;
}
.section__head p { color: var(--muted); margin: 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--indigo);
  background: var(--bg-tint);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ----- buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--indigo); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--indigo-dark); }
.nav__links a.btn--primary,
.nav__links a.btn--primary:hover { color: #fff; }
.btn--ghost { background: #fff; color: var(--indigo); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--indigo); }

/* index page CTA buttons: outline pill matching the roadmap "Read Guide" style
   (rmap-tip-btn in roadmap.css) — indigo border, fills solid on hover */
.btn--outline {
  background: #fff;
  color: var(--indigo);
  border-color: var(--indigo);
}
.btn--outline:hover { background: var(--indigo); color: #fff; }

/* =========================================================
   header / nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a {
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
}
.nav__links a:hover { color: var(--indigo); text-decoration: none; }

.nav__toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle span + span { margin-top: 6px; }

/* =========================================================
   hero
   ========================================================= */
.hero {
  background:
    radial-gradient(1100px 500px at 80% -10%, var(--bg-tint), transparent 60%),
    radial-gradient(900px 450px at 0% 10%, #e6fbff, transparent 55%);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding-block: 80px;
}
.hero h1 {
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--indigo), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 32px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* hero illustration */
.hero__art { display: grid; place-items: center; }
.robot { width: min(360px, 90%); height: auto; filter: drop-shadow(var(--shadow)); }

/* =========================================================
   feature cards
   ========================================================= */
.grid {
  display: grid;
  gap: 24px;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--bg-tint);
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.card h3 { margin: 0 0 10px; font-size: 1.2rem; }
.card p { margin: 0; color: var(--ink-soft); }

/* =========================================================
   architecture (3 devices)
   ========================================================= */
.arch {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
}
.arch__node {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.arch__node .emoji { font-size: 2.2rem; }
.arch__node h3 { margin: 12px 0 6px; font-size: 1.15rem; }
.arch__node .tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  color: var(--indigo); background: var(--bg-tint);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}
.arch__node p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.arch__node--optional { border-style: dashed; opacity: 0.95; }
.arch__link {
  display: grid; place-items: center;
  color: var(--muted); font-weight: 800; font-size: 1.4rem;
}
.arch__link small { display: block; font-size: 0.62rem; font-weight: 700; }

/* =========================================================
   "what you can do" list
   ========================================================= */
.use {
  display: flex;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.use__num {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  color: #fff; font-weight: 800; font-size: 1.1rem;
}
.use h3 { margin: 2px 0 8px; font-size: 1.1rem; }
.use p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.use .combo {
  display: inline-block; margin-top: 12px;
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 8px;
}

/* =========================================================
   repo cards
   ========================================================= */
.repo {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  height: 100%;
}
.repo:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.repo__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.repo__emoji { font-size: 1.6rem; }
.repo h3 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.repo .badge {
  font-size: 0.68rem; font-weight: 700; color: #fff;
  background: var(--cyan); padding: 2px 9px; border-radius: 999px;
}
.repo .badge--opt { background: var(--muted); }
.repo p { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.95rem; flex: 1; }
.repo__link { font-weight: 700; color: var(--indigo); font-size: 0.9rem; }

/* =========================================================
   components page
   ========================================================= */
.doc-hero {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: #fff;
  padding-block: 64px;
}
.doc-hero .eyebrow { background: rgba(255,255,255,0.15); color: #fff; }
.doc-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.8rem); margin: 0 0 14px; }
.doc-hero p { margin: 0; color: rgba(255,255,255,0.85); max-width: 620px; }

.component { scroll-margin-top: 80px; }
.component + .component { border-top: 1px solid var(--line); }
.component__title { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.component__title .emoji { font-size: 1.8rem; }
.component__title h2 { margin: 0; font-size: 1.7rem; }
.component__title code {
  font-size: 0.85rem; color: var(--muted);
  background: var(--bg-soft); padding: 3px 10px; border-radius: 8px;
}
.component__lead { color: var(--ink-soft); margin: 0 0 28px; max-width: 720px; }

.subhead {
  font-size: 1.05rem; font-weight: 800; margin: 32px 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.subhead::before {
  content: ""; width: 4px; height: 1.1em;
  background: linear-gradient(var(--indigo), var(--cyan)); border-radius: 2px;
}

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table.spec {
  width: 100%; border-collapse: collapse; font-size: 0.92rem; background: #fff;
}
table.spec th, table.spec td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.spec thead th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }
table.spec tbody tr:last-child td { border-bottom: none; }
table.spec code { font-size: 0.85em; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--bg-tint);
  padding: 2px 6px; border-radius: 6px;
  font-size: 0.88em;
}
pre {
  background: var(--ink);
  color: #e8e9f5;
  padding: 20px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 0.85rem; line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.82rem; font-weight: 600;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--ink-soft); padding: 5px 12px; border-radius: 999px;
}

.callout {
  display: flex; gap: 12px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--indigo);
  border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 22px 0;
  font-size: 0.92rem; color: var(--ink-soft);
}
.callout .emoji { font-size: 1.2rem; }

/* =========================================================
   footer
   ========================================================= */
.site-footer {
  background: var(--ink);
  color: #c7c9e6;
  padding-block: 48px 36px;
}
.site-footer a { color: #fff; }
.footer__grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px;
  margin-bottom: 28px;
}
.footer__brand { max-width: 320px; }
.footer__brand .brand { color: #fff; margin-bottom: 10px; }
.footer__brand p { margin: 0; font-size: 0.9rem; color: #9a9cc4; }
.footer__col h4 { margin: 0 0 12px; font-size: 0.9rem; color: #fff; }
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin-bottom: 8px; font-size: 0.9rem; }
.footer__col a { color: #c7c9e6; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px; font-size: 0.82rem; color: #8385ad;
  text-align: center;
}

/* =========================================================
   language switcher
   ========================================================= */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lang-switch__item {
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
a.lang-switch__item { text-decoration: none; }
a.lang-switch__item:hover { color: var(--indigo); background: var(--bg-tint); }
.lang-switch__sep { color: var(--line); padding: 0 1px; }
.lang-switch__item--active { color: var(--indigo); background: var(--bg-tint); }

/* =========================================================
   responsive
   ========================================================= */
@media (max-width: 860px) {
  .section { padding-block: 60px; }
  .hero__grid { grid-template-columns: 1fr; padding-block: 56px; text-align: center; }
  .hero__cta { justify-content: center; }
  .hero__art { order: -1; }
  .robot { width: min(280px, 70%); }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .arch { grid-template-columns: 1fr; }
  .arch__link { padding: 4px 0; }
  .arch__link span { transform: rotate(90deg); display: inline-block; }

  .nav__toggle { display: none; }
}

@media (max-width: 480px) {
  /* header nav (logo + JP/EN switch + GitHub button) is too tight to fit on
     one row at phone widths with the desktop sizing — shrink everything. */
  .nav { gap: 8px; }
  .brand { font-size: 1.05rem; gap: 6px; }
  .brand__mark { width: 26px; height: 26px; }
  .nav__links { gap: 8px; }
  .lang-switch { font-size: 0.72rem; }
  .lang-switch__item { padding: 3px 5px; }
  .nav__links a.btn--primary { padding: 7px 12px; font-size: 0.78rem; }
}
