/* ==========================================================================
   C-Agent Lab — Cジイ様向け AIエージェント導入提案デモ
   ========================================================================== */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --border: rgba(11, 11, 11, 0.10);
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;

  --brand: #2a78d6;
  --brand-dark: #184f95;
  --brand-soft: #e8f0fc;
  --accent-orange: #eb6834;
  --accent-aqua: #1baf7a;
  --accent-violet: #6250d6;

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 2px rgba(11,11,11,0.06), 0 8px 24px -12px rgba(11,11,11,0.12);
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --border: rgba(255,255,255,0.10);
    --gridline: #2c2c2a;
    --baseline: #383835;

    --brand: #3987e5;
    --brand-dark: #86b6ef;
    --brand-soft: rgba(57,135,229,0.14);

    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-serious: #ec835a;
    --status-critical: #e66767;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1em; color: var(--text-secondary); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--brand); background: var(--brand-soft);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); }
.section-head p { font-size: 16px; }

/* ---- Header / nav ---- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent-violet));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}
.navlinks { display: flex; gap: 6px; flex-wrap: wrap; }
.navlinks a {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  padding: 9px 13px; border-radius: 999px;
}
.navlinks a:hover, .navlinks a.active { color: var(--text-primary); background: var(--surface-2); }
.nav .cta-mini {
  background: var(--brand); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.navtoggle { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Hero ---- */
.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.01em; }
.hero h1 .hl { color: var(--brand); }
.hero-sub { font-size: 17px; max-width: 540px; }
.hero-photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); aspect-ratio: 4/3.1; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-tag {
  position: absolute; left: 18px; bottom: 18px; background: rgba(11,11,11,0.72);
  color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  backdrop-filter: blur(4px);
}
.addressee-card {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 20px; box-shadow: var(--shadow-1);
}
.addressee-card .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.addressee-card .meta { font-size: 13px; color: var(--text-secondary); }
.addressee-card .meta b { color: var(--text-primary); font-size: 15px; display: block; }

/* ---- Stat row ---- */
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 52px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--brand); }
.stat .label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ---- Cards / grid ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; box-shadow: var(--shadow-1);
}
.card .ico {
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.card h3 { font-size: 17px; }
.card p { font-size: 14px; margin-bottom: 0; }

.step-list { counter-reset: step; display: grid; gap: 18px; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 22px;
}
.step .n {
  width: 36px; height: 36px; border-radius: 10px; background: var(--text-primary); color: var(--page);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.step h4 { margin-bottom: 4px; font-size: 16px; }
.step p { font-size: 14px; margin-bottom: 0; }

/* ---- Section alt bg ---- */
.alt { background: var(--surface-2); }

/* ---- Skill match table ---- */
table.match { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-1); }
table.match th, table.match td { padding: 14px 18px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
table.match th { background: var(--surface-2); color: var(--text-secondary); font-weight: 700; font-size: 13px; }
table.match tr:last-child td { border-bottom: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.badge.ok { background: rgba(12,163,12,0.12); color: var(--status-good); }
.badge.strong { background: var(--brand-soft); color: var(--brand); }

/* ---- Case studies ---- */
.case {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1);
  margin-bottom: 24px;
}
.case .photo { min-height: 260px; }
.case .photo img { width: 100%; height: 100%; object-fit: cover; }
.case .body { padding: 32px; }
.case .tagrow { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tagrow .tag { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; }
.case ul { margin: 14px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-secondary); }
.case ul li { margin-bottom: 6px; }
.case.reverse { grid-template-columns: 1.1fr .9fr; }
.case.reverse .photo { order: 2; }

@media (max-width: 860px) {
  .hero-grid, .grid-3, .grid-2, .statrow { grid-template-columns: 1fr; }
  .case, .case.reverse { grid-template-columns: 1fr; }
  .case .photo { order: -1 !important; min-height: 200px; }
  .navlinks { display: none; }
  .navtoggle { display: inline-flex; }
}

/* ---- Footer ---- */
footer.site { border-top: 1px solid var(--border); padding: 48px 0 32px; background: var(--surface-2); }
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
footer.site .note { font-size: 13px; color: var(--text-muted); max-width: 520px; }
footer.site .cols { display: flex; gap: 48px; flex-wrap: wrap; }
footer.site .cols h5 { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
footer.site .cols a { display: block; font-size: 14px; margin-bottom: 8px; color: var(--text-secondary); }
footer.site .cols a:hover { color: var(--brand); }

/* ---- Chat demo widget ---- */
.chat-shell {
  display: grid; grid-template-columns: 1fr 320px; gap: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1);
}
.chat-main { display: flex; flex-direction: column; height: 560px; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.chat-header .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--status-good); box-shadow: 0 0 0 4px rgba(12,163,12,0.15); }
.chat-header .ttl { font-weight: 700; font-size: 15px; }
.chat-header .sub { font-size: 12px; color: var(--text-muted); }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; }
.msg.bot { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.bot .note { display:block; margin-top:8px; font-size: 11px; color: var(--text-muted); }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 16px; background: var(--surface-2); border-radius: 16px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 14px; }
.chip { font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chat-input { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 12px 18px; font-size: 14px; color: var(--text-primary); }
.chat-input input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chat-input button { background: var(--brand); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display:flex; align-items:center; justify-content:center; }
.chat-side { background: var(--surface-2); padding: 22px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.chat-side h4 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.side-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.side-metric .v { font-size: 20px; font-weight: 800; }
.side-metric .k { font-size: 12px; color: var(--text-muted); }
.side-log { font-size: 12.5px; color: var(--text-secondary); border-left: 2px solid var(--brand); padding: 6px 0 6px 10px; margin-bottom: 8px; }
@media (max-width: 860px) {
  .chat-shell { grid-template-columns: 1fr; }
  .chat-side { border-left: none; border-top: 1px solid var(--border); }
}

/* ---- Dashboard viz ---- */
.viz-root { color-scheme: light; }
.dash-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-1); }
.dash-card h3 { font-size: 15px; margin-bottom: 2px; }
.dash-card .cap { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }
.bars { display: flex; align-items: flex-end; gap: 22px; height: 220px; padding-top: 10px; margin-bottom: 34px; position: relative; }
.bars::before { content: ""; position: absolute; left: 0; right: 0; bottom: 28px; border-bottom: 1px solid var(--baseline); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bar-col .bar {
  width: 100%; max-width: 46px; border-radius: 4px 4px 0 0; background: var(--brand); position: relative; cursor: pointer;
  transition: filter .15s;
}
.bar-col .bar:hover { filter: brightness(1.12); }
.bar-col .val { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.bar-col .lbl { position: absolute; bottom: -26px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.tooltip {
  position: absolute; background: var(--text-primary); color: var(--page); font-size: 12px; padding: 6px 10px;
  border-radius: 6px; pointer-events: none; opacity: 0; transform: translate(-50%, -8px); transition: opacity .12s; z-index: 10; white-space: nowrap;
}
.tooltip.show { opacity: 1; }
.linechart { position: relative; height: 180px; }
.linechart svg { width: 100%; height: 100%; overflow: visible; }
.linechart .pt { cursor: pointer; }
.legend-row { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--text-secondary); }
.legend-row .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.sugg-list { display: flex; flex-direction: column; gap: 12px; }
.sugg { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.sugg .flag { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.sugg .flag.good { background: var(--status-good); }
.sugg .flag.warning { background: var(--status-warning); }
.sugg .flag.serious { background: var(--status-serious); }
.sugg .t { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.sugg .d { font-size: 12.5px; color: var(--text-secondary); }

.table-view { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 13px; }
.table-view th, .table-view td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--gridline); }
.table-view th { color: var(--text-muted); font-weight: 700; }
.toggle-table { font-size: 12.5px; color: var(--brand); font-weight: 700; cursor: pointer; margin-top: 12px; display: inline-block; }

@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---- Contact ---- */
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-1); }
.form-row { display: grid; gap: 14px; margin-bottom: 14px; }
.form-row label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.form-row input, .form-row textarea {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; color: var(--text-primary); font-family: inherit;
}
.form-row textarea { resize: vertical; min-height: 110px; }
.note-box { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13px; color: var(--text-secondary); margin-top: 18px; }
