/* === Main Container === */
.cashewmachine-view {
  display: flex;
  flex-direction: column;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  margin: -16px;
  background: var(--color-window-bg);
  font-family: "SF Pro Display", "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Top Bar === */
.cashewmachine-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-titlebar-border);
  background: var(--color-window-bg);
  position: relative;
}

.cashewmachine-back-btn {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-micro);
  font-family: inherit;
}

.cashewmachine-back-btn:hover {
  color: var(--color-text);
}

/* === Segmented Control === */
.cashewmachine-segmented-control {
  display: flex;
  align-items: center;
  background: var(--color-titlebar);
  border-radius: var(--radius-xl);
  padding: 2px;
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.cashewmachine-segmented-control .segment {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-micro);
}

.cashewmachine-segmented-control .segment:hover {
  color: var(--color-text);
}

.cashewmachine-segmented-control .segment.active {
  background: var(--color-window-bg);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

/* === Body Layout === */
.cashewmachine-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === Sidebar === */
.cashewmachine-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-titlebar-border);
  background: var(--color-titlebar);
  padding: 24px;
  overflow-y: auto;
}

.cashewmachine-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.cashewmachine-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cashewmachine-sidebar-list li {
  margin-bottom: 10px;
}

.cashewmachine-sidebar-list li a {
  font-size: 13px;
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-micro);
}

.cashewmachine-sidebar-list li a:hover {
  color: var(--color-text);
}

.cashewmachine-sidebar-list li.active a {
  color: var(--color-accent);
  font-weight: 600;
}

.cashewmachine-sidebar-sublist {
  list-style: none;
  padding-left: 14px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.cashewmachine-sidebar-sublist li {
  margin-bottom: 6px;
}

.cashewmachine-sidebar-sublist li a {
  font-size: 12px;
  color: var(--color-text-light);
  font-weight: 400;
}

.cashewmachine-sidebar-sublist li a:hover {
  color: var(--color-text);
}

/* === Content Area === */
.cashewmachine-content-area {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  background: var(--color-window-bg);
}

/* === Image Placeholder === */
.cashewmachine-image-placeholder {
  width: 100%;
  height: 380px;
  background: #ECF0F6;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border: 1px dashed rgba(0, 102, 204, 0.15);
}

.cashewmachine-image-placeholder .placeholder-icon {
  background: var(--color-window-bg);
  padding: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.cashewmachine-image-placeholder .placeholder-label {
  font-size: 14px;
  font-weight: 500;
  color: #8E9AAB;
}

/* === Stats Grid === */
.cashewmachine-stats-grid {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.cashewmachine-stats-grid .stat-card {
  flex: 1;
  padding: 18px 20px;
  background: var(--color-window-bg);
  border: 1px solid var(--color-titlebar-border);
  
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform var(--duration-layout) ease, box-shadow var(--duration-layout) ease;
}

.cashewmachine-stats-grid .stat-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.cashewmachine-stats-grid .stat-card h4 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.cashewmachine-stats-grid .stat-card p {
  font-size: 14px;
  color: var(--color-text-light);
  margin: 4px 0 0 0;
  font-weight: 500;
}

/* === Section Title === */
.cashewmachine-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 48px;
  margin-bottom: 20px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cashewmachine-section-title::before {
  content: '';
  display: inline-block;
  width: 48px;
  height: 6px;
  border-radius: 3px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.cm-subtopic {
  font-family: "SF Pro Display", "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  text-align: center;
}

/* === Intro Text === */
.cashewmachine-intro-text {
  font-size: 24px;
  line-height: 1.45;
  letter-spacing: -0.025em;
  margin-top: 16px;
  font-weight: 500;
  color: var(--color-text);
}

.cashewmachine-intro-text .light {
  color: var(--color-text-light);
  font-weight: 400;
}

/* === Cashew Journey Section === */
.cashewmachine-journey-section {
  margin-top: 64px;
  margin-bottom: 48px;
}

.journey-header {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 48px;
}

.journey-subtitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px 0;
}

.journey-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.02em;
}

/* === Cashew Journey Scroll Story === */
.scroll-story-container {
  --bg-color: var(--color-window-bg, #FFFFFF);
  --card-bg: var(--color-window-bg, #FFFFFF);
  --card-border: var(--color-titlebar-border, #E5E9F2);
  --text-main: var(--color-text, #1d1d1f);
  --text-muted: var(--color-text-light, #86868b);
  --accent: #D4A373;
  --accent-muted: #E8DFD1;
  
  position: relative;
  height: 4000px;
  width: 100%;
}

.sticky-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 16px 0 32px 0;
  background: var(--color-window-bg);
  z-index: 10;
}

.progress-bar-wrapper {
  width: 100%;
  max-width: 840px;
  margin: 0;
  position: relative;
}

.progress-track-line {
  position: relative;
  width: 100%;
  height: 4px;
  background-color: var(--accent-muted);
  border-radius: var(--radius-sm);
}

.progress-fill-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-sm);
  width: 0%;
  will-change: width;
}

.cashew-indicator {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 12px rgba(44, 38, 34, 0.16));
  z-index: 30;
  will-change: transform, left;
  transition: transform 0.1s ease-out;
}

.stages-nodes-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
}

.stage-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  cursor: pointer;
}

.stage-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-muted);
  margin-bottom: 8px;
  transition: all var(--duration-layout) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stage-node.completed .stage-dot {
  background-color: var(--accent);
}

.stage-node.active .stage-dot {
  background-color: var(--accent);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--bg-color), 0 0 0 6px var(--accent);
}

.stage-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  transition: all var(--duration-layout) ease;
  white-space: nowrap;
  font-family: inherit;
}

.stage-node.completed .stage-label {
  color: var(--color-text);
}

.stage-node.active .stage-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  transform: scale(1.06);
}

.showcase-card {
  width: 100%;
  max-width: 760px;
  background-color: var(--color-window-bg);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-titlebar-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 440px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.stage-content-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  position: absolute;
  pointer-events: none;
}

.stage-content-frame.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  pointer-events: auto;
}

.illustration-box {
  width: 100%;
  max-width: 400px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step-badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.step-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}

.step-desc {
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.6;
  max-width: 460px;
}

/* === Health Risks Interactive Scroll === */
.workers-pinned-scroll-container {
  position: relative;
  height: 2500px;
}

.workers-sticky-viewport {
  position: sticky;
  top: 0;
  height: 600px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 16px;
  background: var(--color-window-bg);
  border-radius: var(--radius-xl);
  z-index: 10;
}

.workers-anchor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(340px, 70%);
  height: min(480px, 65%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.workers-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.08));
}

.circle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: min(500px, 75%);
  height: min(500px, 75%);
  aspect-ratio: 1 / 1;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s linear;
}

.circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: #E5E5E0;
  stroke-width: 1.5;
  opacity: 0.4;
}

.circle-stroke {
  fill: none;
  stroke: #1F1F1F;
  stroke-width: 1.8;
  stroke-dasharray: 1382.3;
  stroke-dashoffset: 1382.3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.05s linear;
}

.risk-card {
  position: absolute;
  width: clamp(220px, 24%, 310px);
  z-index: 20;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  padding: 18px 20px;
  
  border: 1px solid var(--color-titlebar-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  font-family: inherit;
}

.risk-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.risk-card.top-right { top: 12%; right: 6%; }
.risk-card.bottom-right { bottom: 12%; right: 6%; }
.risk-card.bottom-left { bottom: 12%; left: 6%; }
.risk-card.top-left { top: 12%; left: 6%; }

.risk-icon {
  color: #1F1F1F;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.risk-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.3;
}

.risk-desc {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.5;
  font-weight: 400;
}





/* --- Project Theme Accent Colors --- */
/* Section title bar uses accent color via ::before pseudo-element */

.cashewmachine-segmented-control .segment.active {
  background: var(--color-accent) !important;
  color: white !important;
}

.cashewmachine-sidebar-list li.active a {
  color: var(--color-accent) !important;
}

.cashewmachine-intro-text .dark, .cashewmachine-intro-text .light {
  color: var(--color-accent) !important;
}

/* === Research Cards === */
.cashewmachine-research-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.cashewmachine-research-cards.ticket-style {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 20px 0;
}

.ticket-card {
  width: 260px;
  padding: 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  color: #1a1a1a;
  transition: transform var(--duration-layout) ease, box-shadow var(--duration-layout) ease;
  position: relative;
}

.ticket-card:hover {
  transform: scale(1.05) rotate(0deg) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  z-index: 10;
}

/* Colors based on the image */
.ticket-orange { background-color: #EA5E45; transform: rotate(-3deg); }
.ticket-yellow { background-color: #F8C330; transform: translateY(12px) rotate(2deg); }
.ticket-blue   { background-color: #6C9FCE; transform: rotate(-1deg); }

.ticket-inner {
  border: 1px solid #1a1a1a;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ticket-header {
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  border-bottom: 1px solid #1a1a1a;
  padding: 6px;
  text-transform: uppercase;
}

.ticket-inner h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 16px 12px;
  margin: 0;
  border-bottom: 1px solid #1a1a1a;
  color: #1a1a1a !important;
}

.ticket-body {
  padding: 24px 12px;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-body p {
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  margin: 0;
  color: #1a1a1a;
  font-weight: 400;
}

.ticket-body p strong {
  font-weight: 800;
  font-size: 15px;
}

.ticket-footer {
  display: flex;
  border-top: 1px solid #1a1a1a;
}

.ticket-cell {
  flex: 1;
  text-align: center;
  font-size: 11px;
  padding: 8px 4px;
  text-transform: uppercase;
}
.ticket-cell:first-child {
  border-right: 1px solid #1a1a1a;
}
.ticket-cell strong {
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

.cashewmachine-stat-card h4, .stat-card h4 {
  color: var(--color-accent) !important;
}

/* === CNSL Section === */
.cashewmachine-cnsl-section {
  width: 100%;
}

.cnsl-images-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}

.cnsl-img-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 400px;
  width: 100%;
}

.sensitive-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  background: #000; /* Dark background under blurred image */
}

.cnsl-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.5s ease, transform 0.5s ease;
}

.cnsl-img.blurred {
  filter: blur(25px);
  transform: scale(1.1); /* Prevent blurred edges bleeding */
}

.sensitive-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: opacity 0.4s ease;
  z-index: 10;
}

.sensitive-overlay-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  filter: invert(1); /* Ensure the icon is white */
}

.sensitive-overlay-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.sensitive-overlay-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  color: white;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background var(--duration-micro);
}

.sensitive-overlay:hover .sensitive-overlay-btn {
  background: rgba(255,255,255,0.3);
}

.cnsl-img-source {
  font-size: 11px;
  color: var(--color-accent);
  text-decoration: underline;
  opacity: 0.8;
  transition: opacity var(--duration-micro);
}

.cnsl-img-source:hover {
  opacity: 1;
}

/* === Venn Diagram Section === */
.cm-venn-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 40px 0 60px 0;
  width: 100%;
}

.cm-venn-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.cm-venn-card {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: white;
  min-height: 60px;
}

.cm-venn-col.left .cm-venn-card {
  justify-content: space-between;
}

.cm-venn-col.right .cm-venn-card {
  justify-content: flex-start;
  gap: 16px;
}

.cm-venn-card.venn-orange { background-color: #EA5E45; }
.cm-venn-card.venn-yellow { background-color: #F8C330; color: #1a1a1a; }
.cm-venn-card.venn-yellow h4 { color: #1a1a1a; }
.cm-venn-card.venn-blue { background-color: #6C9FCE; }

.cm-venn-content h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
}

.cm-venn-content p {
  margin: 0;
  font-size: 15px;
  opacity: 0.9;
  line-height: 1.4;
}

.cm-venn-icon {
  width: 24px;
  height: 24px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: bold;
}

.cm-venn-col.left .cm-venn-icon {
  color: #a55c23;
}

.cm-venn-col.right .cm-venn-icon {
  color: #8b4513;
}

.cm-venn-center {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cm-venn-circle {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 20px;
  box-sizing: border-box;
}

.left-circle {
  left: 10px;
  background-color: rgba(234, 94, 69, 0.85); /* Orange matching ticket-orange */
  padding-right: 40px;
}

.right-circle {
  right: 10px;
  background-color: rgba(108, 159, 206, 0.85); /* Blue matching ticket-blue */
  padding-left: 40px;
}

.cm-venn-vs {
  position: absolute;
  z-index: 2;
  font-size: 24px;
  font-weight: 900;
  color: white;
  text-shadow: 0px 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 900px) {
  .cm-venn-section {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .cnsl-images-grid {
    flex-direction: column;
  }
  .cnsl-img {
    width: 100%;
    max-width: 100%;
  }
}
