/* ============================================================
   Case Study: Meta Pixel 実装事例
   トークンはトップページ (css/style.css) と統一
   ============================================================ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #141824;
  --bg-tertiary: #1e2333;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a8b8;
  --text-muted: #7e8696;
  --accent-primary: #ffa500;
  --accent-secondary: #ffb347;
  --accent-glow: rgba(255, 165, 0, 0.4);
  --on-accent: #0a0e1a;
  --border-primary: #2a3040;
  --border-subtle: #1a1f2e;
  --gradient-accent: linear-gradient(135deg, #ffa500 0%, #ff7f00 100%);
  --font-display: "Space Grotesk", "Inter", "Noto Sans JP", sans-serif;
  --code-bg: #0d1420;
  --content-width: 1080px;
}

/* ---------- reset / base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

/* ---------- layout ---------- */

.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 72px;
}

.section--mist {
  background: var(--bg-secondary);
}

.section-label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 20px;
}

.section-lead {
  max-width: 720px;
  margin-bottom: 40px;
  color: var(--text-secondary);
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

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

/* トップページのヘッダーと同じロゴ画像を置く。Works から遷移した先で
   ブランドが変わって見えないようにするため */
.site-logo {
  display: flex;
  align-items: center;
}

.site-logo picture {
  display: block;
}

.site-logo img {
  width: auto;
  height: 30px;
}

.header-back {
  font-size: 14px;
  font-weight: 500;
}

/* ---------- breadcrumb ---------- */

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  padding-block: 14px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--border-primary);
}

/* ---------- hero ---------- */

.hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding-block: 64px 56px;
}

.hero-category {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent-primary);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 18px;
}

.hero-lead {
  max-width: 760px;
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-meta li {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
}

.hero-meta .meta-key {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.06em;
}

.hero-meta .meta-value {
  font-weight: 500;
}

/* ---------- overview: event table ---------- */

.event-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
}

.event-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--bg-primary);
}

.event-table th,
.event-table td {
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-primary);
  vertical-align: top;
}

.event-table thead th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.event-table tbody tr:last-child td {
  border-bottom: none;
}

.event-table .event-name {
  font-family: "Inter", monospace, sans-serif;
  font-weight: 700;
  color: var(--accent-primary);
  white-space: nowrap;
}

.overview-note {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------- demo CTA ---------- */

.demo-cta {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 48px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.demo-cta-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
}

.demo-cta-text {
  max-width: 560px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
}

.demo-cta-text strong {
  color: var(--text-primary);
}

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  border-radius: 10px;
  padding: 16px 36px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--light {
  background: var(--accent-primary);
  color: var(--on-accent);
}

.btn--light:hover {
  background: var(--accent-secondary);
}

.btn--primary {
  background: var(--gradient-accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-secondary);
}

.demo-cta-note {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- code blocks ---------- */

.code-card {
  margin-bottom: 48px;
}

.code-card:last-child {
  margin-bottom: 0;
}

.code-card-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

.code-card-desc {
  max-width: 760px;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.code-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
  background: var(--code-bg);
}

.code-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-frame-file {
  font-family: "Inter", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

.code-frame-lang {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* Prism テーマの背景をトークン --code-bg に統一 */
.code-frame pre[class*="language-"] {
  margin: 0;
  padding: 22px 24px;
  background: var(--code-bg);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
  border-radius: 0;
}

.code-frame code[class*="language-"] {
  background: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-shadow: none;
}

.code-source {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- screenshots ---------- */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.shot-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  overflow: hidden;
}

.shot-item img {
  width: 100%;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.shot-item figcaption {
  padding: 18px 22px 22px;
  font-size: 14px;
  line-height: 1.75;
}

.shot-item .shot-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.shot-note {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- flow ---------- */

.flow-list {
  counter-reset: flow;
  display: grid;
  gap: 0;
}

.flow-item {
  counter-increment: flow;
  position: relative;
  padding: 0 0 36px 72px;
}

.flow-item:last-child {
  padding-bottom: 0;
}

/* 番号 */
.flow-item::before {
  content: counter(flow, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: var(--on-accent);
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 15px;
  border-radius: 50%;
}

/* 縦ライン */
.flow-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 56px;
  bottom: 8px;
  width: 2px;
  background: var(--border-primary);
}

.flow-item h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-top: 8px;
}

.flow-item p {
  max-width: 720px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ---------- pricing ---------- */

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.price-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
}

.price-card--featured {
  border: 2px solid var(--accent-primary);
  position: relative;
}

.price-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.price-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.price-amount .price-unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.price-target {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-primary);
}

.price-features {
  display: grid;
  gap: 10px;
  font-size: 14px;
  flex-grow: 1;
}

.price-features li {
  position: relative;
  padding-left: 22px;
}

.price-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
  transform: rotate(-45deg);
}

.price-features li.is-plus {
  font-weight: 700;
  color: var(--text-primary);
}

.price-note {
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- final CTA ---------- */

.final-cta {
  text-align: center;
}

.final-cta .section-title {
  margin-bottom: 12px;
}

.final-cta-text {
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--text-secondary);
}

.final-cta .btn {
  min-width: 300px;
}

.final-cta-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .price-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-inline: auto;
  }

  .price-card--featured {
    order: -1;
  }
}

@media (max-width: 768px) {
  .section {
    padding-block: 56px;
  }

  .shot-grid {
    grid-template-columns: 1fr;
  }

  .demo-cta {
    padding: 36px 26px;
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-cta .btn {
    width: 100%;
  }

  .flow-item {
    padding-left: 60px;
  }

  .flow-item::before {
    width: 42px;
    height: 42px;
  }

  .flow-item:not(:last-child)::after {
    left: 20px;
  }
}
