:root {
  --sage: #7c9473;
  --sage-dark: #5f7857;
  --sage-light: #e8eee4;
  --cream: #faf7f0;
  --cream-deep: #f1ead9;
  --terracotta: #e08a63;
  --terracotta-dark: #c96f49;
  --ink: #3a3a32;
  --ink-soft: #6b6b5f;
  --white: #ffffff;
  --line: #e3ddc9;
  --shadow: 0 8px 24px rgba(60, 55, 35, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}

.logo .mark {
  width: 34px;
  height: 34px;
}

.logo .sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
  display: block;
  letter-spacing: 0.03em;
}

nav.main-nav {
  display: flex;
  gap: 28px;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 14.5px;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--sage-dark);
  border-color: var(--sage);
}

.nav-cta {
  background: var(--sage);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--sage-dark); border-color: transparent !important; }

.menu-btn { display: none; }

@media (max-width: 760px) {
  nav.main-nav { display: none; }
  .menu-btn {
    display: block;
    background: var(--sage);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero .eyebrow {
  display: inline-block;
  background: var(--sage-light);
  color: var(--sage-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.4;
  margin: 0 0 20px;
  font-weight: 800;
}

.hero h1 .accent { color: var(--terracotta-dark); }

.hero p.lead {
  font-size: 16.5px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 0 32px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  box-shadow: 0 10px 22px rgba(224, 138, 99, 0.35);
}
.btn-primary:hover { background: var(--terracotta-dark); }

.btn-secondary {
  background: #fff;
  color: var(--sage-dark);
  border-color: var(--sage);
}
.btn-secondary:hover { background: var(--sage-light); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--sage); }

.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
section.tight { padding: 40px 0; }
.alt-bg { background: var(--cream-deep); }

.section-head { max-width: 620px; margin: 0 0 40px; }
.section-head .tag {
  color: var(--sage-dark);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.section-head h2 {
  font-size: clamp(22px, 3vw, 30px);
  margin: 8px 0 12px;
  font-weight: 800;
}
.section-head p { color: var(--ink-soft); margin: 0; font-size: 15px; }

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card .icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--sage-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card .icon-badge svg { width: 24px; height: 24px; }

.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- Steps flow ---------- */
.flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}
.flow-step {
  flex: 1 1 150px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  position: relative;
}
.flow-step .num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  margin: 0 auto 10px;
}
.flow-step h4 { font-size: 14px; margin: 0 0 4px; }
.flow-step p { font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.flow-arrow {
  align-self: center;
  color: var(--sage);
  font-size: 20px;
  padding: 0 6px;
}
@media (max-width: 760px) {
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* ---------- Product icon tile ---------- */
.pic-tile {
  aspect-ratio: 1 / 1;
  background: var(--sage-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pic-tile img { width: 62%; height: 62%; object-fit: contain; }
.pic-tile.small { width: 56px; height: 56px; border-radius: 10px; }
.pic-tile.small img { width: 60%; height: 60%; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: #2f3a2c;
  color: #d8ddcf;
  padding: 48px 0 28px;
  margin-top: 40px;
}
footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
footer.site-footer .brand { font-weight: 700; font-size: 17px; color: #fff; margin-bottom: 8px; }
footer.site-footer .cols { display: flex; gap: 56px; flex-wrap: wrap; }
footer.site-footer h5 { font-size: 12.5px; color: #a9b39c; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 12px; }
footer.site-footer a { text-decoration: none; color: #d8ddcf; font-size: 14px; }
footer.site-footer li { margin-bottom: 8px; }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer .bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12.5px;
  color: #8f9a83;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 760px;
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data th {
  background: var(--cream-deep);
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 12.5px;
  position: sticky; top: 0;
}
table.data tbody tr:hover { background: var(--sage-light); cursor: pointer; }
table.data td.price { font-weight: 700; color: var(--terracotta-dark); }
table.data td.desc { white-space: normal; max-width: 220px; color: var(--ink-soft); font-size: 12.5px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge.tier-S { background: #f6e2c9; color: #8a5a1f; }
.badge.tier-A { background: #e2ecfa; color: #2f5a92; }
.badge.tier-B { background: #eae2fa; color: #5a3f92; }
.badge.tier-N { background: #eee; color: #777; }

/* breakdown row */
.breakdown-row td {
  background: #fbf9f2;
  white-space: normal;
}
.breakdown {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 4px 0;
}
.breakdown b { color: var(--ink); }
.breakdown .eq { color: var(--terracotta-dark); font-weight: 700; }

/* ---------- Demo panel ---------- */
.demo-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-toolbar {
  background: var(--cream-deep);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: #e3ddc9; color: #8a8873;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.stepper .dot.active { background: var(--terracotta); color: #fff; }
.stepper .dot.done { background: var(--sage); color: #fff; }
.stepper .seg { width: 24px; height: 2px; background: var(--line); }
.stepper span.label { font-size: 12.5px; color: var(--ink-soft); margin-right: 4px; }

.demo-body { padding: 30px; }

.dropzone {
  border: 2px dashed #c9c0a1;
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--cream);
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--sage); background: var(--sage-light); }
.dropzone svg { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--sage); }
.dropzone p { margin: 4px 0; color: var(--ink-soft); font-size: 13.5px; }
.dropzone .or { font-size: 12px; color: #a19d86; margin: 10px 0; }

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage-light);
  color: var(--sage-dark);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
}

.stat-row {
  display: flex;
  gap: 16px;
  margin: 22px 0;
  flex-wrap: wrap;
}
.stat-box {
  flex: 1 1 140px;
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat-box .n { font-size: 24px; font-weight: 800; color: var(--terracotta-dark); }
.stat-box .l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.log-panel {
  background: #22281f;
  color: #c8d3bd;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  height: 150px;
  overflow-y: auto;
  line-height: 1.9;
}
.log-panel .ok { color: #9fd88a; }
.log-panel .warn { color: #e8c07a; }

.actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 26px;
  flex-wrap: wrap;
  gap: 12px;
}

.disclaimer {
  background: var(--sage-light);
  border-left: 4px solid var(--sage);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--sage-dark);
  margin-top: 22px;
}

/* progress */
.progress-track {
  height: 8px;
  background: var(--cream-deep);
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sage), var(--terracotta));
  transition: width .35s ease;
}

/* case study */
.case-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.case-head {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.case-head .pic-tile { width: 64px; height: 64px; flex: none; }
.case-head h3 { margin: 0 0 4px; font-size: 15.5px; }
.case-head .meta { font-size: 12.5px; color: var(--ink-soft); }
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.compare > div { padding: 18px 20px; }
.compare .before { background: #fbf7ef; border-right: 1px solid var(--line); }
.compare .after { background: #f3f8ef; }
.compare .k { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.compare .v { font-size: 22px; font-weight: 800; }
.compare .before .v { color: #9c9484; }
.compare .after .v { color: var(--sage-dark); }
.compare .note { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* pricing plan */
.plan-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  position: relative;
}
.plan-card.highlight { border-color: var(--terracotta); }
.plan-card .ribbon {
  position: absolute; top: -12px; left: 24px;
  background: var(--terracotta); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.plan-card h3 { margin: 6px 0 6px; font-size: 18px; }
.plan-card .price { font-size: 26px; font-weight: 800; color: var(--terracotta-dark); margin: 10px 0 4px; }
.plan-card .price small { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.plan-card ul { padding-left: 18px; margin: 18px 0; font-size: 13.5px; color: var(--ink-soft); }
.plan-card li { margin-bottom: 8px; }

.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq-item h4 { margin: 0 0 6px; font-size: 15px; }
.faq-item p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.cta-band {
  background: var(--sage);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  color: #fff;
}
.cta-band h2 { margin: 0 0 10px; font-size: 26px; }
.cta-band p { color: #e5ecdf; margin: 0 0 26px; }
.cta-band .btn-primary { box-shadow: 0 10px 22px rgba(0,0,0,0.15); }
.cta-band .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.cta-band .btn-secondary:hover { background: rgba(255,255,255,0.12); }

.breadcrumb {
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 18px 0 0;
}
.breadcrumb a { color: var(--sage-dark); text-decoration: none; }

.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.rule-table th, .rule-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.rule-table th { background: var(--cream-deep); font-size: 12px; color: var(--ink-soft); }

.formula-box {
  background: #22281f;
  color: #e8e4d4;
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 2;
  overflow-x: auto;
}
.formula-box .op { color: #e8c07a; }
.formula-box .var { color: #9fd88a; }
