:root {
  --yellow: #f5c400;
  --black: #111;
  --ink: #1b1b1b;
  --gray: #757575;
  --pale: #f5f5f3;
  --line: #e7e7e4;
  --white: #fff;
  --max: 1040px;
  --side: 40px;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--ink);
  background: var(--white);
  font-weight: 300;
  line-height: 2;
  -webkit-font-smoothing: antialiased;
}
.case-shell { width: min(var(--max), calc(100% - var(--side) * 2)); margin: 0 auto; }

.case-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
}
.case-nav-inner {
  width: min(var(--max), calc(100% - var(--side) * 2));
  height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-link img { display: block; width: auto; height: 28px; }
.back-link, .case-footer a { color: var(--ink); font-size: .73rem; text-decoration: none; }
.back-link::before { content: '←'; color: var(--yellow); margin-right: 7px; }

.case-hero { padding: 100px 0 90px; overflow: hidden; }
.hero-copy { max-width: 850px; }
.eyebrow { color: #aa8800; font-size: .65rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.case-hero h1 {
  margin-top: 20px;
  color: var(--black);
  font-size: clamp(2.2rem, 6.2vw, 4.9rem);
  line-height: 1.32;
  letter-spacing: -.045em;
}
.case-hero h1 span { background: linear-gradient(transparent 72%, var(--yellow) 0); }
.hero-lead { max-width: 680px; margin-top: 34px; color: #555; font-size: .98rem; }
.hero-demo { margin-top: 72px; }
.demo-window {
  padding: 28px;
  color: #eee;
  border-radius: 24px;
  background: #151515;
  box-shadow: 0 35px 80px rgba(0,0,0,.2);
}
.demo-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.demo-toolbar p { font-size: .95rem; font-weight: 700; letter-spacing: .18em; }
.demo-label { display: block; color: var(--yellow); font-size: .52rem; font-weight: 700; letter-spacing: .16em; }
.demo-sync { display: flex; align-items: center; gap: 7px; color: #aaa; font-size: .62rem; }
.demo-sync i { width: 7px; height: 7px; border-radius: 50%; background: #64d494; box-shadow: 0 0 0 4px rgba(100,212,148,.12); }
.demo-product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.demo-product-card { padding: 19px; border: 1px solid #303030; border-radius: 14px; background: #202020; }
.demo-product-card.is-active { border-color: rgba(245,196,0,.55); }
.demo-product-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.demo-product-head small, .detail-demo small { color: #777; font-size: .48rem; letter-spacing: .14em; }
.demo-product-head h2 { margin-top: 2px; color: #fff; font-size: .87rem; letter-spacing: .04em; }
.demo-product-head > span, .detail-demo-top > span { color: #64d494; font-size: .55rem; font-weight: 500; white-space: nowrap; }
.demo-product-head .status-ready { color: #aaa; }
.demo-product-card dl { margin: 19px 0; border-top: 1px solid #303030; }
.demo-product-card dl div { display: flex; justify-content: space-between; padding-top: 10px; }
.demo-product-card dt { color: #777; font-size: .52rem; }
.demo-product-card dd { color: #bbb; font-size: .55rem; }
.demo-progress { height: 4px; overflow: hidden; border-radius: 4px; background: #333; }
.demo-progress span { display: block; height: 100%; background: var(--yellow); }
.demo-stats { display: flex; align-items: baseline; gap: 11px; margin-top: 11px; }
.demo-stats b { color: #fff; font-size: .92rem; }
.demo-stats span { color: #777; font-size: .5rem; }
.demo-note { margin-top: 14px; color: #999; font-size: .62rem; text-align: right; }

.story-section { padding: 108px 0; border-top: 1px solid var(--line); }
.section-muted { background: var(--pale); }
.story-grid { display: grid; grid-template-columns: 180px minmax(0, 680px); gap: 76px; }
.story-heading { padding-top: 6px; }
.story-heading span { display: block; color: var(--yellow); font-size: 2rem; font-weight: 700; line-height: 1; }
.story-heading p { margin-top: 11px; color: var(--gray); font-size: .7rem; font-weight: 500; letter-spacing: .08em; }
.story-content h2 { margin-bottom: 32px; color: var(--black); font-size: clamp(1.65rem, 3.5vw, 2.45rem); line-height: 1.55; letter-spacing: -.02em; }
.story-content > p { margin-top: 18px; color: #4f4f4f; font-size: .9rem; }

.impact-flow { max-width: 420px; margin-top: 44px; text-align: center; }
.impact-flow div { padding: 13px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .76rem; font-weight: 500; }
.impact-flow span { display: block; height: 26px; color: #aaa; line-height: 26px; }
.impact-flow .impact-last { color: #fff; border-color: var(--black); background: var(--black); }

.old-process { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 44px; }
.old-process div { min-height: 126px; padding: 18px; border-radius: 12px; background: #fff; box-shadow: 0 5px 20px rgba(0,0,0,.04); }
.old-process b { display: block; color: var(--yellow); font-size: .62rem; }
.old-process span { display: block; margin-top: 10px; font-size: .7rem; line-height: 1.7; }
.old-process i { color: #aaa; font-style: normal; }
.problem-note { padding-left: 15px; border-left: 3px solid var(--yellow); font-weight: 500; }

.cause-section blockquote { margin-top: 44px; padding: 32px; color: #fff; border-radius: var(--radius); background: var(--black); font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 500; line-height: 1.7; }
.section-dark { color: #eee; background: #141414; }
.section-dark .story-heading p, .section-dark .story-content > p { color: #aaa; }
.section-dark .story-content h2 { color: #fff; }
.process-flow { max-width: 460px; margin-top: 50px; }
.process-flow div { padding: 17px 20px; border: 1px solid #333; border-radius: 12px; background: #202020; text-align: center; }
.process-flow small { display: block; color: #777; font-size: .52rem; letter-spacing: .16em; }
.process-flow b { display: block; margin-top: 4px; color: #fff; font-size: .8rem; }
.process-flow .process-ai { border-color: var(--yellow); background: rgba(245,196,0,.08); }
.process-flow .process-ai small { color: var(--yellow); }
.process-flow > span { display: block; height: 28px; color: #666; line-height: 28px; text-align: center; }

.detail-demo { margin-top: 44px; padding: 28px; color: #eee; border-radius: var(--radius); background: #191919; box-shadow: 0 24px 60px rgba(0,0,0,.16); }
.detail-demo-top { display: flex; align-items: flex-start; justify-content: space-between; }
.detail-demo-top h3 { color: #fff; font-size: 1.25rem; letter-spacing: .04em; }
.detail-periods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 25px; }
.detail-periods div { padding: 16px; border: 1px solid #303030; border-radius: 10px; background: #222; }
.detail-periods small, .detail-periods b { display: block; }
.detail-periods b { color: #ddd; font-size: .75rem; font-weight: 500; }
.detail-progress-row { display: flex; align-items: center; gap: 15px; margin-top: 25px; }
.detail-progress-row strong { color: var(--yellow); font-size: 1.35rem; }
.detail-progress-row > div { flex: 1; height: 6px; overflow: hidden; border-radius: 6px; background: #333; }
.detail-progress-row span { display: block; height: 100%; background: var(--yellow); }
.detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border: 1px solid #303030; border-radius: 10px; }
.detail-metrics div { padding: 16px; text-align: center; }
.detail-metrics div + div { border-left: 1px solid #303030; }
.detail-metrics small, .detail-metrics b { display: block; }
.detail-metrics b { color: #fff; font-size: 1.1rem; }
.detail-actions { display: flex; gap: 9px; margin-top: 18px; }
.detail-actions span { padding: 8px 14px; border-radius: 7px; color: #111; background: var(--yellow); font-size: .62rem; font-weight: 700; }

.outcome-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 42px; }
.outcome-cards div { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.outcome-cards b, .outcome-cards span { display: block; }
.outcome-cards b { font-size: .78rem; }
.outcome-cards span { margin-top: 8px; color: var(--gray); font-size: .65rem; line-height: 1.7; }

.improvement-loop { max-width: 480px; margin-top: 44px; }
.improvement-loop div { display: flex; align-items: center; gap: 15px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; }
.improvement-loop span { color: var(--yellow); font-size: .65rem; font-weight: 700; }
.improvement-loop b { font-size: .78rem; }
.improvement-loop i { display: block; height: 26px; color: #aaa; font-style: normal; line-height: 26px; text-align: center; }
.improvement-loop .loop-final { color: #fff; border-color: var(--black); background: var(--black); }
.next-section { background: #fff8d9; }
.scope-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; list-style: none; }
.scope-list li { position: relative; padding: 14px 16px 14px 40px; border: 1px solid var(--line); border-radius: 9px; font-size: .72rem; }
.scope-list li::before { content: '✓'; position: absolute; left: 16px; color: #aa8800; font-weight: 700; }

.case-footer { padding: 34px 0; border-top: 1px solid #2a2a2a; color: #777; background: var(--black); }
.case-footer > div { display: flex; align-items: center; justify-content: space-between; }
.case-footer a { color: #aaa; }
.case-footer p { font-size: .65rem; }

@media (max-width: 800px) {
  .demo-product-grid { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 120px minmax(0, 1fr); gap: 38px; }
  .old-process, .outcome-cards { grid-template-columns: 1fr; }
  .old-process i { transform: rotate(90deg); text-align: center; }
  .old-process div { min-height: 0; }
}

@media (max-width: 700px) {
  :root { --side: 20px; }
  .case-hero { padding: 70px 0 64px; }
  .case-hero h1 { font-size: 2.3rem; }
  .hero-demo { margin-top: 48px; }
  .demo-window { padding: 18px; border-radius: 16px; }
  .story-section { padding: 72px 0; }
  .story-grid { grid-template-columns: 1fr; gap: 28px; }
  .story-heading { display: flex; align-items: baseline; gap: 12px; }
  .story-heading span { font-size: 1.4rem; }
  .story-heading p { margin-top: 0; }
  .story-content h2 { font-size: 1.65rem; }
  .detail-periods, .scope-list { grid-template-columns: 1fr; }
  .detail-metrics b { font-size: .9rem; }
  .case-footer > div { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
