/* ============================================================
   Explorentory. Header, hero, footer, base typography, and the
   common components (.text, .section-title, .tech-table) come from
   the shared subpage system (shared/site.css). This file keeps the
   bespoke components: research cards, comparison table, LLM mode
   cards, state-history flow, chart blocks, UX rows, and the three
   D3 diagram containers (rendered by diagram-*.js).
   ============================================================ */

/*-----------------------------------------------------------------*/
/* Section Titles & Body Text                                       */
/*-----------------------------------------------------------------*/

.section-title {
  font-size: clamp(12px, 2.5vw, 25px);
  font-weight: bold;
  margin: 90px 0 20px 0;
  color: black;
}

.subsection-title {
  font-size: clamp(11px, 2vw, 20px);
  font-weight: bold;
  margin: 44px 0 14px 0;
  color: #222;
}

.text {
  font-size: clamp(10px, 1.6vw, 16px);
  line-height: 1.6;
  color: #636363;
  text-align: justify;
}

.text code, code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88em;
  background: #f2f2f2;
  padding: 1px 4px;
  border-radius: 2px;
  color: #333;
}

/*-----------------------------------------------------------------*/
/* Research Question Grid                                          */
/*-----------------------------------------------------------------*/

.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  margin: 32px 0 0 0;
}

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

.research-card {
  border-top: 2px solid #000;
  padding-top: 16px;
}

.card-num {
  font-size: clamp(9px, 1.4vw, 13px);
  color: #bbb;
  margin-bottom: 6px;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.card-title {
  font-weight: bold;
  color: #111;
  font-size: clamp(14px, 1.9vw, 19px);
  margin-bottom: 8px;
}

.card-question {
  /* font-style: italic; */
  color: #000000;
  font-size: clamp(12px, 1.6vw, 16px);
  margin-bottom: 14px;
  line-height: 1.5;
}

.feature-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-bullets li {
  padding: 3px 0 3px 18px;
  position: relative;
  color: #777;
  font-size: clamp(9px, 1.5vw, 14px);
  line-height: 1.5;
}

.feature-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #bbb;
}

/*-----------------------------------------------------------------*/
/* Platform Comparison Table                                       */
/*-----------------------------------------------------------------*/

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: clamp(9px, 1.5vw, 14px);
}

.comparison-table thead tr {
  border-bottom: 2px solid #000;
}

.comparison-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: bold;
  color: #111;
}

.comparison-table th:first-child {
  width: 22%;
}

.comparison-table tbody tr {
  border-bottom: 1px solid #eee;
}

.comparison-table tbody tr:hover {
  background: #fafafa;
}

.comparison-table td {
  padding: 9px 14px;
  color: #636363;
  vertical-align: top;
  line-height: 1.5;
}

.comparison-table td:first-child {
  font-weight: bold;
  color: #333;
}

.comparison-table td:last-child {
  color: #333;
}

/*-----------------------------------------------------------------*/
/* D3 Diagram Containers                                           */
/*-----------------------------------------------------------------*/

.diagram-container {
  width: 100%;
  margin: 28px 0;
  overflow: hidden;
}

.diagram-container svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Architecture diagram is wider than the others; allow horizontal scroll
   on small viewports so text remains readable */
#data-pipeline-diagram {
  overflow-x: auto;
  overflow-y: hidden;
}

#data-pipeline-diagram svg {
  min-width: 640px; /* prevents text from becoming illegible on phones */
}

/*-----------------------------------------------------------------*/
/* Screenshots Grid (2×2)                                          */
/*-----------------------------------------------------------------*/

.screenshots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

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

/*-----------------------------------------------------------------*/
/* UX Feature Rows                                                 */
/*-----------------------------------------------------------------*/

.ux-feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  margin: 20px 0 40px 0;
}

@media (max-width: 600px) {
  .ux-feature-row {
    grid-template-columns: 1fr;
  }
}

.ux-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/*-----------------------------------------------------------------*/
/* Image Placeholders                                              */
/*-----------------------------------------------------------------*/

.img-placeholder {
  width: 100%;
  box-sizing: border-box;
  background: #ececec;
  border: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: clamp(9px, 1.4vw, 13px);
  font-family: Helvetica, Arial, sans-serif;
  text-align: center;
  padding: 12px;
}

.screenshots-grid figure.screenshot {
  margin: 0;
}
.screenshots-grid figure.screenshot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
}
.screenshots-grid figure.screenshot figcaption {
  margin-top: 8px;
  font-size: clamp(10px, 1.4vw, 13px);
  color: #636363;
  text-align: center;
}

/*-----------------------------------------------------------------*/
/* Charts Section                                                  */
/*-----------------------------------------------------------------*/

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin: 28px 0;
}

@media (max-width: 580px) {
  .chart-row {
    grid-template-columns: 1fr;
  }
}

.chart-block {
  display: flex;
  flex-direction: column;
}

.chart-placeholder {
  aspect-ratio: 4 / 3;
}

/*-----------------------------------------------------------------*/
/* ML Formula Box                                                  */
/*-----------------------------------------------------------------*/

.ml-formula-box {
  background: #f8f8f8;
  border-left: 3px solid #000;
  padding: 18px 22px;
  margin: 22px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(9px, 1.5vw, 14px);
  color: #333;
  line-height: 2;
}

.ml-formula-box b {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(10px, 1.6vw, 15px);
  color: #111;
}

/*-----------------------------------------------------------------*/
/* Technical Stack Table                                           */
/*-----------------------------------------------------------------*/

.tech-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: clamp(9px, 1.5vw, 14px);
}

.tech-table tbody tr {
  border-bottom: 1px solid #eee;
}

.tech-table tbody tr:first-child {
  border-top: 2px solid #000;
}

.tech-table td {
  padding: 9px 14px;
  color: #636363;
  vertical-align: top;
  line-height: 1.5;
}

.tech-table td:first-child {
  font-weight: bold;
  color: #333;
  width: 26%;
  white-space: nowrap;
}

/*-----------------------------------------------------------------*/
/* LLM Modes Grid                                                  */
/*-----------------------------------------------------------------*/

.llm-modes-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 32px 0;
}

@media (max-width: 720px) {
  .llm-modes-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .llm-modes-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  border-top: 2px solid #868686;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-badge {
  display: inline-block;
  font-size: clamp(11px, 1.4vw, 14px);
  font-weight: bold;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 2px;
  width: fit-content;
}

.mode-filter  { background: #e8f0fe; color: #1a56db; }
.mode-sort    { background: #fef3e8; color: #c05621; }
.mode-explain { background: #edfaed; color: #276749; }
.mode-contact { background: #fce8f8; color: #7b2182; }
.mode-unclear { background: #f2f2f2; color: #666;    }

.mode-title {
  font-weight: bold;
  color: #111;
  font-size: clamp(11px, 1.6vw, 16px);
}

.mode-desc {
  color: #636363;
  font-size: clamp(9px, 1.3vw, 13px);
  line-height: 1.55;
  flex: 1;
}

.mode-schema {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(8px, 1vw, 10px);
  background: #f8f8f8;
  padding: 8px 10px;
  border-radius: 2px;
  color: #555;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
}

/*-----------------------------------------------------------------*/
/* Filtering Iteration / State History Flow                        */
/*-----------------------------------------------------------------*/

.state-history-flow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 24px 0 32px 20px;
  max-width: 600px;
}

.history-step {
  border-left: 2px solid #ddd;
  padding: 11px 16px;
  background: #fafafa;
  width: 100%;
  box-sizing: border-box;
}

.hs-active   { border-left-color: #111; }
.hs-reverted { border-left-color: #276749; background: #f2faf2; }

.hs-label {
  font-weight: bold;
  font-size: clamp(10px, 1.4vw, 13px);
  color: #222;
  margin-bottom: 3px;
}

.hs-sub {
  font-size: clamp(9px, 1.2vw, 11px);
  color: #888;
}

.history-arrow {
  font-size: clamp(10px, 1.3vw, 12px);
  color: #bbb;
  padding: 4px 0 4px 16px;
}

.revert-arrow {
  color: #276749;
  font-weight: bold;
}

/*-----------------------------------------------------------------*/
/* Footer                                                          */
/*-----------------------------------------------------------------*/

.footer {
  font-size: clamp(10px, 1.5vw, 15px);
  line-height: 1.5;
  height: 200px;
  margin: 100px 0 0 0;
  color: #636363;
}

/* Safety: keep every image/video/svg within its column (prevents overflow). */
.subpage img, .subpage video, .subpage svg { max-width: 100%; height: auto; }
.screenshots-grid img, .ux-feature-row img, .chart-block img { width: 100%; display: block; }
