
/* =========================================================
   Innobase Shared Styles (Refactored)
   - Single-source-of-truth, duplicates removed
   - Mobile-first where sensible
   - Last updated: 2025-08-26
   ========================================================= */

/* ------ Design tokens ------ */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --ink: #1e2a38;
  --ink-weak: #586474;
  --brand: #0f3d5e;
  --accent: #2eb5a3;
  --line: #e6e8eb;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(17, 24, 39, .08);
  --warn: #ef4444;
}

/* ------ Resets ------ */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.65; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { display: block; height: auto; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------ Layout primitives ------ */
.container { max-width: 1120px; margin-inline: auto; padding: 0 20px; }
.stack { display: grid; gap: 20px; }

/* ------ Header / Navigation ------ */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 14px; }

.logo { flex: 0 0 auto; display: flex; align-items: center; }
.logo img {
  display: block; flex-shrink: 0;
  height: 44px; width: auto; max-width: none; object-fit: contain;
}
.menu-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 10px; line-height: 0; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { display: block; width: 22px; height: 2px; background: var(--ink); position: relative; content: ""; }
.menu-toggle span::before { position: absolute; left: 0; top: -6px; }
.menu-toggle span::after { position: absolute; left: 0; top: 6px; }

.nav-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ------ Buttons ------ */
.btn {
  border: 1px solid var(--brand); color: #fff; background: var(--brand);
  padding: 12px 18px; border-radius: 999px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap; text-align: center;
}
.btn.secondary { background: #fff; color: var(--brand); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:focus-visible { outline: 3px solid rgba(46,181,163,.4); outline-offset: 2px; }

/* ------ Sections ------ */
section { padding: 72px 0; border-top: 1px solid var(--line); }
section.alt { background: var(--bg-soft); }
.section-eyebrow { font-size: .9rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; text-align: center; margin-bottom: 8px; }
.section-title { font-size: clamp(26px, 3vw, 36px); font-weight: 800; text-align: center; margin: 0 auto 32px; line-height: 1.4; }

/* ------ Typography ------ */
h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.3; margin: 6px 0 10px; }
.lead { color: var(--ink-weak); }

/* ------ Hero ------ */
.hero { padding: clamp(56px, 8vh, 88px) 0 64px; background: #fff; }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr min(520px, 42vw); }
.hero .viz { max-width: min(520px, 42vw); padding: 18px; display: grid; place-items: center; min-height: 320px; }
.hero .viz img { width: 100%; height: auto; object-fit: contain; }
.hero h1 { max-width: 20ch; } .hero .lead { max-width: 46ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.viz { position: relative; border-radius: var(--radius); padding: 18px; background: #fff; box-shadow: var(--shadow); }
.viz::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(15,61,94,.25), rgba(46,181,163,.25));
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ------ Grids & Cards ------ */
.grid-4, .grid-3, .grid-2 { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 0 rgba(17,24,39,.03); }
.icon { width: 44px; height: 44px; border-radius: 10px; border: 1px dashed #cdd6df; display: grid; place-items: center; margin-bottom: 10px; }

/* ------ Problems list ------ */
.problem-list { display: grid; gap: 14px; }
.problem-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.dot { width: 18px; height: 18px; border-radius: 999px; background: var(--warn); margin-top: 4px; box-shadow: 0 0 0 4px rgba(239,68,68,.08); }

/* ------ Compare block ------ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare .col { border-radius: 16px; padding: 18px; border: 1px solid var(--line); background: #fff; }
.compare .col.bad { background: #f9fafb; }
.compare h4 { margin: 0 0 8px; font-size: 1.05rem; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.check li::before { content: "✔"; font-weight: 800; color: #059669; margin-top: 2px; }
.x li::before { content: "✖"; color: #ef4444; }

/* ------ Flow ------ */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: step; }
.flow .node { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.flow .node::before { counter-increment: step; content: counter(step); position: absolute; top: 10px; left: 12px; width: 26px; height: 26px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.flow .node::after { content: ""; position: absolute; top: 50%; right: -10px; width: 20px; height: 2px; background: linear-gradient(90deg, var(--brand), var(--accent)); transform: translateY(-50%); }
.flow .node:last-child::after { display: none; }

/* ------ Table (Before/After) ------ */
table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
th, td { text-align: left; padding: 14px 16px; background: #fff; }
th { color: #4b5563; font-size: .9rem; background: transparent; }
tr { box-shadow: 0 1px 0 rgba(17,24,39,.04); }
.before { color: #6b7280; } .after { color: #065f46; font-weight: 700; }

/* ------ KPI ------ */
#results .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 12px; }
#results .kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; display: grid; place-items: center; text-align: center; min-height: 140px; box-shadow: 0 1px 0 rgba(17,24,39,.03); }
.kpi-label { display: block; color: var(--ink-weak); font-weight: 700; font-size: 12px; letter-spacing: .04em; margin-bottom: 8px; text-transform: uppercase; }
.kpi-value { display: flex; align-items: baseline; gap: 6px; color: var(--brand); font-weight: 800; font-size: clamp(36px, 4.8vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; justify-content: center; }
.kpi-value em { font-style: normal; font-size: .42em; font-weight: 800; letter-spacing: .06em; color: var(--ink-weak); }
.kpi-value .unit { font-size: .42em; font-weight: 700; color: var(--ink); opacity: .9; }
.kpi-sub { display: block; margin-top: 6px; font-size: 14px; color: var(--ink); opacity: .95; }

/* ------ CTA band ------ */
.cta-band { background: linear-gradient(135deg, var(--brand), #0c2f49 60%); color: #fff; border-radius: 20px; padding: 28px; display: grid; gap: 16px; align-items: center; }
.cta-band .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ------ Forms / iframe embed ------ */
.iframe-wrap { position: relative; width: 100%; padding-top: 150%; overflow: hidden; }
.iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------ Narrow pages (about/privacy) ------ */
body.narrow { min-height: 100dvh; display: flex; flex-direction: column; }
body.narrow main.container { max-width: 860px; width: min(860px, 100%); margin: 0 auto; padding: 40px 20px; box-sizing: border-box; }
.narrow h1 { font-size: 2rem; margin: 0 0 20px; text-align: center; }
.narrow dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 8px 16px; }
.narrow dt { font-weight: 700; color: var(--ink-weak); align-self: center; padding: 10px 0; }
.narrow dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.narrow p { margin-bottom: 16px; }
footer { margin-top: auto; }

/* ------ Footer ------ */
footer { padding: 40px 0; background: #0e2435; color: #cbd5e1; }
footer a { color: #cbd5e1; }
.footer-inner { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; align-items: center; }

/* ------ Responsive ------ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero .viz { margin: 0 auto; min-height: 260px; max-width: 640px; }
  .hero h1, .hero .lead { max-width: 100%; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .narrow dl { grid-template-columns: 1fr; gap: 4px; }
  .narrow dt { padding-bottom: 0; font-size: .95rem; }
  .narrow dd { padding-top: 0; }
}
@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }
  .nav-actions {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
  }
  header.nav-open .nav-actions { display: flex; }
  .nav-actions a { padding: 14px 20px; border-top: 1px solid var(--line); border-radius: 0; }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .btn { padding: 12px 16px; }
  .footer-inner { gap: 16px; }
  .logo img { height: 40px; }
}
