/* =============================================================
   CASE STUDY — Shared layout for all CS_*.html pages
   keisuke-portfolio / css/case-study.css
   ============================================================= */

/* ── Hero ─────────────────────────────────────────────── */
.cs-hero {
  padding: 96px 64px 48px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.cs-hero__back {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-60);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  transition: color 0.3s var(--ease);
}
.cs-hero__back:hover { color: var(--ink-100); }

.cs-hero__brand {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 12px;
}

.cs-hero__title {
  font-size: 42px;
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--ink-60);
  max-width: 720px;
  text-wrap: balance;
}
.cs-hero__title .bold { font-weight: 600; color: var(--ink-100); }

.cs-hero__role {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-60);
  letter-spacing: 0.04em;
}

.cs-hero__statement {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-60);
}

.cs-hero__kanji {
  margin-top: 16px;
  font-family: 'Noto Serif JP', serif;
  font-weight: 200;
  font-size: 15px;
  letter-spacing: 0.2em;
  color: var(--ink-40);
}

.cs-hero__image {
  margin-top: 32px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  width: 100%;
  position: relative;
  background: linear-gradient(160deg, #0D0D0F 0%, #1A1A1F 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0;
}

/* Kanji watermark on hero image — per-project color via --hero-kanji-color */
.cs-hero__image::before {
  content: attr(data-kanji);
  font-family: 'Noto Serif JP', serif;
  font-weight: 200;
  font-size: 180px;
  line-height: 1;
  color: var(--hero-kanji-color, rgba(255, 255, 255, 0.04));
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Design system decision: hero image labels are hidden globally.
   Markup is preserved in HTML for future use — control visibility here. */
.cs-hero__image-label {
  display: none;
}

/* ── Hero Thumbnail Strip ─────────────────────────────── */
.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.hero-thumbs--3 {
  grid-template-columns: repeat(3, 1fr);
}

.hero-thumb {
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #0D0D0F;
  transition: opacity 0.25s var(--ease);
}

.hero-thumb:hover { opacity: 0.8; }

.hero-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

/* img inside image containers */
.cs-hero__image img,
.inline-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Overview Bar ─────────────────────────────────────── */
.overview-bar {
  border-top: 1px solid var(--rule-40);
  border-bottom: 1px solid var(--rule-40);
  padding: 24px 0;
}

.overview-bar__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 64px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 48px;
}

/* Some pages use overview-bar__item, others use overview-item directly */
.overview-bar__item,
.overview-item {
  padding: 0;
  white-space: nowrap;
  text-align: center;
}

.overview-bar__label,
.overview-item__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 4px;
}

.overview-bar__value,
.overview-item__value {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-100);
}

/* ── Tags Bar ─────────────────────────────────────────── */
.tags-bar {
  padding: 20px 64px;
  border-bottom: 1px solid var(--rule-40);
}

.tags-bar__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Also used on some pages as .tags */
.tags {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 64px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-80);
  background: var(--paper);
  border: 1px solid var(--rule-40);
  border-radius: 20px;
  padding: 5px 12px;
}

/* ── Key Highlight (stats) ────────────────────────────── */
.key-highlight {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 64px 48px;
}

.key-highlight__inner {
  border-top: 1px solid var(--rule-40);
  border-bottom: 1px solid var(--rule-40);
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

/* Some pages use __stat, others use __item */
.key-highlight__stat,
.key-highlight__item {
  padding: 0 32px;
  border-left: 1px solid var(--rule-40);
}
.key-highlight__stat:first-child,
.key-highlight__item:first-child { border-left: none; padding-left: 0; }
.key-highlight__stat:last-child,
.key-highlight__item:last-child  { padding-right: 0; }

.key-highlight__value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-100);
  display: block;
}

.key-highlight__label {
  font-size: 12px;
  font-weight: 300;
  color: var(--ink-60);
  margin-top: 8px;
  display: block;
}

/* ── Narrative Content ────────────────────────────────── */
.brief-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 64px 48px;
}

.brief-content h3 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shu);
  margin: 40px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-40);
}
.brief-content h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.brief-content p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-80);
  margin: 0 0 16px;
}
.brief-content p:last-child {
  margin-bottom: 0;
}

/* Closing lines — green card, philosophy statements */
.brief-content p:last-of-type {
  color: var(--ink-100);
  font-weight: 400;
}

/* ── References Section ──────────────────────────────── */
.references {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 64px 48px;
}
.references h3 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin: 0 0 12px;
}
.references p {
  font-size: 13px;
  font-weight: 300;
  line-height: 2;
  color: var(--ink-60);
}

.content-section { margin-bottom: 48px; }

.content-section__overline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shu);
  margin-bottom: 12px;
}

.content-section__heading {
  font-size: 28px;
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink-100);
  margin-bottom: 20px;
}

.content-section__body {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-80);
}
.content-section__body + .content-section__body { margin-top: 16px; }

/* ── Inline Image Placeholder ─────────────────────────── */
.inline-image {
  margin-top: 24px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16/9;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule-40);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  position: relative;
}
.inline-image::before {
  content: attr(data-kanji);
  font-family: 'Noto Serif JP', serif;
  font-weight: 200;
  font-size: 96px;
  line-height: 1;
  color: rgba(29, 29, 31, 0.06);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.inline-image--full  { aspect-ratio: 16/7; }
.inline-image--dark  { background: linear-gradient(135deg, #0D0D0F 0%, #1A0A0A 100%); border-color: transparent; }
.inline-image--dark::before { color: rgba(179, 58, 58, 0.08); }

.inline-image__label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-40);
  z-index: 1;
}
.inline-image--dark .inline-image__label { color: rgba(255, 255, 255, 0.28); }

/* ── Pull Quote ───────────────────────────────────────── */
.pull-quote {
  border-left: 2px solid var(--shu);
  padding: 0 0 0 20px;
  margin: 32px 0;
}
.pull-quote__text {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink-100);
  font-style: italic;
}

/* ── Inline Half Images ───────────────────────────────── */
.inline-image--half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.inline-image--half .inline-image { margin-top: 0; }

/* ── Partner Logos Block ──────────────────────────────── */
/*
 * Usage:
 *   <div class="partner-logos-block">
 *     <p class="partner-logos-block__label">Partner Ecosystem</p>
 *     <div class="partner-logos-block__grid">
 *       <div class="partner-logo-item"><!-- SVG logo --></div>
 *       …
 *     </div>
 *   </div>
 *
 * Grid auto-sizes to the number of items via repeat(auto-fit).
 * Override column count inline if needed:
 *   style="grid-template-columns: repeat(4, 1fr)"
 */
.partner-logos-block {
  margin: 32px 0;
  padding: 28px 32px;
  border: 1px solid var(--rule-40);
  border-radius: 10px;
  background: var(--paper);
}

.partner-logos-block__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 24px;
}

.partner-logos-block__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  align-items: center;
}

.partner-logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-right: 1px solid var(--rule-40);
  color: var(--ink-60);
  transition: color 0.3s var(--ease);
}
.partner-logo-item:last-child { border-right: none; }
.partner-logo-item:hover { color: var(--ink-100); }
.partner-logo-item svg {
  width: 100%;
  max-width: 100px;
  height: 44px;
}

@media (max-width: 767px) {
  .partner-logos-block__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .partner-logo-item:nth-child(3n) { border-right: none; }
  .partner-logo-item:nth-child(-n+3) {
    border-bottom: 1px solid var(--rule-40);
  }
}

/* ── Prev / Next Navigation ───────────────────────────── */
.prev-next {
  padding: 48px 64px;
  border-top: 1px solid var(--rule-40);
}
.prev-next__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
/* Support both naming conventions (__item and __link) */
.prev-next__item,
.prev-next__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--rule-40);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.prev-next__item:hover,
.prev-next__link:hover { background: var(--paper); border-color: var(--rule-60); }
/* Direction labels */
.prev-next__dir,
.prev-next__label { font-size: 11px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-40); }
.prev-next__title { font-size: 16px; font-weight: 500; color: var(--ink-100); }
.prev-next__item--next,
.prev-next__link--next { text-align: right; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1119px) {
  .cs-hero      { padding: 88px 40px 40px; }
  .overview-bar { padding: 20px 0; }
  .overview-bar__inner { padding: 0 40px; flex-wrap: wrap; gap: 24px; }
  .tags-bar     { padding: 16px 40px; }
  .brief-content { padding: 32px 40px 48px; }
  .references   { padding: 0 40px 40px; }
  .key-highlight { padding: 0 40px 48px; }
  .prev-next    { padding: 40px; }
}

@media (max-width: 600px) {
  .cs-hero          { padding: 80px 20px 32px; }
  .cs-hero__title   { font-size: 30px; }
  .cs-hero__statement { font-size: 14px; }
  .overview-bar     { padding: 16px 0; }
  .overview-bar__inner { padding: 0 20px; flex-direction: column; gap: 16px; }
  .tags-bar         { padding: 16px 20px; }
  .brief-content    { padding: 28px 20px 40px; }
  .brief-content h3 { margin: 32px 0 12px; padding-top: 20px; }
  .content-section  { margin-bottom: 32px; }
  .references       { padding: 0 20px 32px; }
  .key-highlight    { padding: 0 20px 40px; }
  .key-highlight__value { font-size: 22px; }
  .prev-next        { padding: 32px 20px; }
  .prev-next__inner { grid-template-columns: 1fr; gap: 12px; }
  .prev-next__item--next,
  .prev-next__link--next { text-align: left; }
  .inline-image--half { grid-template-columns: 1fr; }
}


/* =============================================================
   STARD LAYOUT SYSTEM — cs-content · toc · stard-section
   Shared across all case studies that use the TOC + body grid.
   ============================================================= */

/* ── Content Layout (TOC + Body) ─────────────────────── */
.cs-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 64px 64px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 64px;
}

/* ── Table of Contents ────────────────────────────────── */
.toc { position: sticky; top: 80px; align-self: start; }
.toc__label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-40); margin-bottom: 16px;
}
.toc__list { list-style: none; }
.toc__list li { margin-top: 12px; }
.toc__list a {
  font-size: 13px; font-weight: 400; color: var(--ink-60);
  transition: color 0.3s var(--ease);
}
.toc__list a:hover,
.toc__list a.active { color: var(--ink-100); }

/* ── STARD Sections ───────────────────────────────────── */
.stard-section {
  padding: 48px 0;
  border-top: 1px solid var(--rule-40);
}
.stard-section:first-child { border-top: none; }
.stard-section__overline {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-40); margin-bottom: 8px;
}
.stard-section__title {
  font-size: 26px; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.02em; color: var(--ink-100); margin-bottom: 24px;
}
.stard-section__body p {
  font-size: 15px; font-weight: 300; line-height: 1.75;
  color: var(--ink-80); margin-top: 16px;
}
.stard-section__body p:first-child { margin-top: 0; }

/* ── Before / After Inline ────────────────────────────── */
.ba-inline {
  margin: 32px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: #E5253A; border-radius: 8px; overflow: hidden;
}
.ba-inline__cell { background: var(--white); padding: 24px; }
.ba-inline__label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 8px;
}
.ba-inline__label--before,
.ba-inline__label--after { color: #E5253A; }
.ba-inline__text {
  font-size: 14px; font-weight: 300; line-height: 1.6; color: var(--ink-80);
}

/* ── Artifact Image Block ─────────────────────────────── */
.cs-artifact {
  margin: 32px 0 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rule-40);
}
.cs-artifact img { width: 100%; display: block; }
.cs-artifact__caption {
  font-size: 12px; font-weight: 400; color: var(--ink-60);
  padding: 10px 16px;
  border-top: 1px solid var(--rule-40);
  background: var(--paper);
  margin: 0;
}

/* ── Metrics Grid ─────────────────────────────────────── */
/* Column count is set per-page via inline override */
.metrics {
  max-width: var(--max-w); margin: 0 auto; padding: 48px 64px;
}
.metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* default; override inline per page */
  border-top: 1px solid var(--rule-40);
  border-bottom: 1px solid var(--rule-40);
  padding: 32px 0;
}
.metrics__item { padding: 0 32px; border-left: 1px solid var(--rule-40); }
.metrics__item:first-child { border-left: none; padding-left: 0; }
.metrics__item:last-child { padding-right: 0; }
.metrics__value {
  font-size: 28px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink-100);
}
.metrics__label {
  font-size: 12px; font-weight: 300; color: var(--ink-60); margin-top: 8px;
}

/* ── Recognition ──────────────────────────────────────── */
.recognition {
  padding: 48px 0 0; border-top: 1px solid var(--rule-40);
}
.recognition__title {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-40); margin-bottom: 16px;
}
.recognition__list { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.recognition__list li { font-size: 14px; font-weight: 400; color: var(--ink-80); }

/* ── Flow Node & Pipeline ─────────────────────────────── */
.flow-icon {
  display: flex; justify-content: center; align-items: flex-start;
  margin: 40px 0; padding: 16px 0;
}
.flow-node {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.flow-node__disc {
  position: relative; width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.flow-node__ring-outer {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--rule-40);
  animation: ring-outer 4s ease-in-out infinite;
}
.flow-node__ring-inner {
  position: absolute; inset: 14px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  animation: ring-inner 6s linear infinite;
}
.flow-node__kanji {
  font-size: 32px; font-weight: 200; color: var(--ink-60);
  letter-spacing: -0.02em; line-height: 1;
  position: relative; z-index: 1;
  animation: kanji-breathe 4s ease-in-out infinite;
}
.flow-node__icon {
  width: 36px; height: 36px;
  position: relative; z-index: 1;
  animation: kanji-breathe 4s ease-in-out infinite;
  display: block;
}
.flow-node__label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-40); text-align: center;
}
.flow-node__sublabel {
  font-size: 11px; font-weight: 300; color: var(--ink-60);
  text-align: center; margin-top: -8px;
}
.flow-pipeline {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 0; margin: 48px 0;
}
.flow-pipeline .flow-node__disc { width: 100px; height: 100px; }
.flow-pipeline .flow-node__kanji { font-size: 26px; }
.flow-connector {
  display: flex; align-items: center; padding: 0 8px;
  margin-top: 50px; gap: 6px;
}
.flow-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-40); display: block;
}
.flow-dot:nth-child(1) { animation: dot-flow 1.8s ease-in-out 0.0s infinite; }
.flow-dot:nth-child(2) { animation: dot-flow 1.8s ease-in-out 0.3s infinite; }
.flow-dot:nth-child(3) { animation: dot-flow 1.8s ease-in-out 0.6s infinite; }
.flow-dot:nth-child(4) { animation: dot-flow 1.8s ease-in-out 0.9s infinite; }
.flow-dot:nth-child(5) { animation: dot-flow 1.8s ease-in-out 1.2s infinite; }

/* ── Keyframe Animations ──────────────────────────────── */
@keyframes ring-outer {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.08); opacity: 0.7; }
}
@keyframes ring-inner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes kanji-breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes dot-flow {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ── Snow / Weather Animation Layer ──────────────────── */
#snow-zone { position: relative; overflow: hidden; }
#snow-zone img { position: relative; z-index: 2; }

/* ── Scroll Reveal ────────────────────────────────────── */
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive: STARD layout ─────────────────────────── */
@media (max-width: 1119px) {
  .cs-content { grid-template-columns: 1fr; gap: 0; }
  .toc {
    position: static; display: flex; flex-wrap: wrap;
    gap: 8px 24px; padding-bottom: 32px;
    border-bottom: 1px solid var(--rule-40);
  }
  .toc__label { width: 100%; }
  .toc__list { display: flex; flex-wrap: wrap; gap: 8px 24px; }
  .toc__list li { margin-top: 0; }
}
@media (max-width: 767px) {
  .metrics { padding: 32px 24px; }
  .metrics__grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .metrics__item { border-left: none; padding: 0; }
  .cs-content { padding: 0 24px 40px; }
  .ba-inline { grid-template-columns: 1fr; }
  .flow-pipeline { flex-wrap: wrap; gap: 24px; }
  .flow-connector { display: none; }
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .weather-hero { display: none !important; }
  .flow-node__ring-outer,
  .flow-node__ring-inner,
  .flow-node__kanji,
  .flow-dot { animation: none !important; opacity: 0.6; }
}
