:root {
  --fg: #0b1530;
  --fg-muted: #5b6478;
  --fg-soft: #8a8a8a;
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --border: #e6e8ee;
  --accent: #7c3aed;
  --accent-deep: #6d28d9;
  --accent-soft: #f3edff;
  --max: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* rui note popover */
.note {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}
.note-trigger {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.note-trigger:hover,
.note-trigger[aria-expanded="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: translateY(-1px);
}
.note-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.note-body {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(11, 21, 48, 0.12);
  z-index: 20;
  font-size: 13px;
  line-height: 1.75;
  color: var(--fg);
  text-align: left;
  animation: noteIn 0.18s ease-out;
}
.note-body::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.note-body .note-text {
  display: block;
  margin: 0;
  font-weight: 500;
}
.note-body .note-signature {
  display: block;
  font-size: 11px;
  color: var(--fg-soft);
  margin-top: 8px;
  letter-spacing: 0.06em;
}
@keyframes noteIn {
  from { opacity: 0; transform: translate(-50%, -4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Note in dark contexts (case-metrics, stat-strip) */
.stat-strip .note-trigger,
.case-metrics .note-trigger {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.stat-strip .note-trigger:hover,
.case-metrics .note-trigger:hover,
.stat-strip .note-trigger[aria-expanded="true"],
.case-metrics .note-trigger[aria-expanded="true"] {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

@media (max-width: 640px) {
  .note-body { min-width: 220px; max-width: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .note-body { animation: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans JP", Inter, ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "palt";
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.72; }

h1, h2, h3, h4 {
  font-family: Inter, "Noto Sans JP", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.container.narrow { max-width: 760px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.brand {
  font-family: Inter, sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.brand:hover { opacity: 1; }
.site-header nav { display: flex; gap: 20px; align-items: center; }
.site-header nav a { color: var(--fg-muted); font-size: 14px; font-weight: 500; }
.site-header nav a:hover { color: var(--fg); opacity: 1; }
.cta-link {
  background: var(--fg);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700 !important;
}
.cta-link:hover { background: var(--accent); opacity: 1; }

/* Hero */
.hero {
  padding: 96px 0 56px;
  background: var(--bg);
}
.hero .kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  margin: 0 0 28px;
  font-family: Inter, sans-serif;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  margin: 0 0 28px;
  letter-spacing: -0.025em;
}
.hero .lead {
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 720px;
  margin: 0 0 40px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-decoration: none;
}
.btn.primary { background: var(--fg); color: #fff; }
.btn.primary:hover { background: var(--accent); opacity: 1; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { background: var(--bg-alt); opacity: 1; }

/* Stat strip (separate section, no card boundary) */
.strip { padding: 24px 0 80px; background: var(--bg); }
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  list-style: none;
  padding: 40px 32px;
  margin: 0;
  background: var(--fg);
  border-radius: var(--radius);
  color: #fff;
}
.stat-strip li { text-align: center; }
.stat-strip strong {
  display: inline-block;
  font-family: Inter, sans-serif;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
}
.stat-strip .unit {
  font-size: 24px;
  font-weight: 700;
  margin-left: 4px;
  color: rgba(255,255,255,0.7);
}
.stat-strip .label {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 12px;
  letter-spacing: 0.04em;
}

/* Strip note */
.strip-note {
  text-align: center;
  color: var(--fg-soft);
  font-size: 11px;
  margin: 16px 0 0;
  letter-spacing: 0.02em;
}

/* Section */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); }
.section-kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  margin: 0 0 16px;
  font-family: Inter, sans-serif;
}
.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  margin: 0 0 12px;
}
.section .section-sub {
  color: var(--fg-muted);
  font-size: 16px;
  margin: 0 0 48px;
  max-width: 680px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(11, 21, 48, 0.08);
}
.card.highlighted {
  border-color: var(--accent);
  border-width: 2px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 60%);
}
.ribbon {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-family: Inter, sans-serif;
}
.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--fg);
}
.card .price {
  font-family: Inter, sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--fg);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}
.card .price span {
  display: block;
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0;
}
.card ul {
  padding-left: 0;
  list-style: none;
  margin: 0 0 20px;
  color: var(--fg);
  font-size: 14px;
}
.card ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.card ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 12px; height: 2px;
  background: var(--accent);
}
.card-foot {
  font-size: 12px;
  color: var(--fg-muted);
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* How it works */
.how-flow-caption {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -12px 0 20px;
  color: var(--fg-muted);
  font-size: 13px;
  font-family: Inter, "Noto Sans JP", sans-serif;
  letter-spacing: 0.04em;
}
.how-flow-caption-text {
  font-weight: 700;
}
.how-flow {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  margin-bottom: 48px;
  overflow-x: auto;
}
.how-flow .mermaid {
  display: flex;
  justify-content: center;
  font-family: Inter, sans-serif;
  min-height: 180px;
}
.how-principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.principle {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.p-num {
  font-family: Inter, sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  flex-shrink: 0;
}
.p-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--fg);
}
.p-body p {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.65;
}
.how-stack {
  text-align: center;
  color: var(--fg-muted);
  font-size: 12px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}

/* Case study */
.case {
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.case-subhead {
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.14em;
  margin: 32px 0 20px;
  text-transform: uppercase;
}
.case-ba {
  display: grid;
  gap: 16px;
  margin-bottom: 8px;
}
.ba-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 20px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  align-items: start;
}
.ba-label {
  font-family: Inter, sans-serif;
  font-weight: 700;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
}
.ba-before, .ba-after {
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
}
.ba-tag {
  display: inline-block;
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fff;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  margin-right: 8px;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.ba-tag.after {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.ba-before strong { color: var(--fg); }
.ba-after strong { color: var(--accent); }
.ba-after em { color: var(--fg-muted); font-style: normal; }

.case-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.metric {
  background: var(--fg);
  color: #fff;
  padding: 20px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.mval {
  display: block;
  font-family: Inter, sans-serif;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.mlabel {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.case-note {
  font-size: 11px;
  color: var(--fg-soft);
  margin: 12px 0;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .ba-row { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .ba-label { font-size: 13px; }
  .principle { flex-direction: row; }
  .how-flow { padding: 24px 16px; }
}
.case-head h3 {
  font-family: Inter, sans-serif;
  font-size: 26px;
  font-weight: 900;
  margin: 0 0 8px;
}
.case-tags { color: var(--fg-muted); font-size: 13px; margin: 0 0 32px; }
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 28px;
}
.case-grid h4 {
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 12px;
  letter-spacing: 0.14em;
  font-family: Inter, sans-serif;
}
.case-grid ul { padding-left: 0; list-style: none; margin: 0; font-size: 14px; }
.case-grid ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}
.case-grid ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 8px; height: 2px;
  background: var(--fg-soft);
}
.case-grid strong { color: var(--accent); font-weight: 900; }
.case-tech {
  font-size: 12px;
  color: var(--fg-muted);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin: 0 0 8px;
}
.case-link { font-size: 13px; margin: 0; }

@media (max-width: 720px) {
  .case { padding: 28px 20px; }
  .case-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* About */
.about-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.about-body { flex: 1; min-width: 0; }
.about-body p:first-child { margin-top: 0; }
.section .meta {
  color: var(--fg-muted);
  font-size: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .about-row { flex-direction: column; gap: 16px; align-items: center; text-align: center; }
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  transition: border-color 0.15s;
}
.faq-item[open] {
  border-color: var(--accent);
}
.faq-item summary {
  font-family: Inter, "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
  line-height: 1.6;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s;
  line-height: 1;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item p {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.8;
}
.faq-item p strong { color: var(--fg); }

/* Form */
.contact-form {
  display: grid;
  gap: 20px;
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.contact-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  font-family: Inter, "Noto Sans JP", sans-serif;
}
.req {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.contact-form button { justify-self: start; }
.form-status { margin: 0; font-size: 14px; min-height: 1.2em; }
.form-status.ok { color: #15803d; }
.form-status.err { color: #b91c1c; }

@media (max-width: 720px) {
  .contact-form { padding: 28px 20px; }
}

/* Footer */
.site-footer {
  padding: 56px 0;
  background: var(--bg-alt);
  color: var(--fg-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.site-footer .disclaimer {
  font-size: 12px;
  color: var(--fg-soft);
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
  line-height: 1.7;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.site-footer .footer-row p { margin: 0; }
.footer-links a { color: var(--fg-muted); margin: 0 6px; }

@media (max-width: 720px) {
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 13px; }
  .stat-strip { gap: 24px; padding: 32px 20px; }
  .stat-strip strong { font-size: 44px; }
  .section { padding: 72px 0; }
  .footer-row { flex-direction: column; align-items: flex-start; text-align: left; }
}
