/* ==========================================================================
   how-it-works.css  -  HOW IT WORKS (CONTENT)
   Used by: <section id="how"> in index.html.
   Part 1: the photo with sensor dots, and the sensor list beside it (behaviour: js/sensor-showcase.js).
   Part 2: the step cards and the call-out box.
   ========================================================================== */

/* SHOWCASE WRAP: the photo on one side, the sensor list on the other. No outer box any more:
   the photo and the list sit directly on the page. Stacked on phones, side by side on big screens,
   and the two sides are centred against each other so they line up. */
.photo-showcase-wrap {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
/* Big screens: photo on the left, sensor list on the right. */
@media (min-width: 940px) {
  .photo-showcase-wrap { grid-template-columns: 7fr 5fr; }
}

/* STAGE: just a holder for the photo (no background, no frame). */
.photo-stage-3d { position: relative; min-width: 0; }
/* CARD: the photo itself. Only rounded corners, nothing around it. */
.photo-card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.1, 1);
  background: var(--text-main);
}

/* The photo: rounded corners. */
.photo-card-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

/* SCANNER BEAM: a thin light line that moves up and down over the photo. 
.scanner-beam-line {
  position: absolute;
  left: 0; right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--brand-blue), #FFFFFF, var(--brand-blue), transparent);
  box-shadow: 0 0 16px 3px rgba(10, 91, 255, 0.8);
  animation: scanMove 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}
 Animation: the beam moves from top to bottom and back. 
@keyframes scanMove {
  0%, 100% { top: 8%; opacity: 0; }
  15%, 85% { opacity: 0.9; }
  50% { top: 92%; opacity: 1; }
} 
*/


/* SENSOR PIN: a clickable dot placed on the photo where a sensor sits. */
.photo-sensor-pin {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 15;
  display: grid;
  place-items: center;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* Pin gets bigger when hovered or selected. */
.photo-sensor-pin:hover, .photo-sensor-pin.active {
  transform: translate(-50%, -50%) scale(1.3);
}
/* The solid centre of a pin. */
.photo-pin-core {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
  font: 600 11px var(--font-mono);
  display: grid;
  place-items: center;
  box-shadow: 0 0 14px 2px rgba(10, 91, 255, 0.7);
  position: relative;
  z-index: 2;
}
/* The selected pin is filled with blue. */
.photo-sensor-pin.active .photo-pin-core {
  background: var(--brand-cyan);
  color: #fff;
  box-shadow: 0 0 20px 4px rgba(6, 182, 212, .75);
}
/* The jaw pin uses the orange safety colour. */
.photo-sensor-pin.jaw-pin .photo-pin-core {
  background: var(--safety-stripe);
  color: var(--text-main);
  box-shadow: 0 0 14px 2px rgba(255, 176, 32, 0.8);
}
/* PULSE: a ring that grows outward from the pin to attract attention. */
.photo-pin-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--brand-blue);
  opacity: 0;
  animation: pinPulseRing 2.4s ease-out infinite;
}
/* Orange pulse for the jaw pin. */
.photo-sensor-pin.jaw-pin .photo-pin-pulse { border-color: var(--safety-stripe); }
/* The second pulse starts later. */
.photo-pin-pulse:nth-child(2) { animation-delay: 0.8s; }
/* Animation: ring grows and fades out. */
@keyframes pinPulseRing {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* WHERE EACH PIN SITS on the photo (percent from the left and from the top). */
#photo-pin-1 { left: 43.5%; top: 59%; }  /* Chin */
#photo-pin-2 { left: 45.0%; top: 73%; }  /* Under Chin */
#photo-pin-3 { left: 52.0%; top: 72%; }  /* Throat */
#photo-pin-j { left: 60.0%; top: 35%; }  /* Jaw Clench */

/* LEGEND: the column beside the photo that explains the sensors (no outer box). */
.photo-side-legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  min-width: 0;
}

/* Legend title. */
.legend-header h3 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  margin: 8px 0 8px;
  letter-spacing: -.02em;
}
/* Legend description. */
.legend-header p {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.45;
}

/* The list of sensors. */
.sensor-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* One sensor row (click it to select the sensor). */
.sensor-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--soft-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
/* Row style when hovered or selected. */
.sensor-detail-item:hover, .sensor-detail-item.active {
  background: #FFFFFF;
  border-color: var(--brand-blue);
  box-shadow: 0 4px 12px rgba(10, 91, 255, 0.1);
}
/* The round badge with the sensor number. */
.sensor-detail-item i {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  font: 600 12px var(--font-mono);
  margin-top: 2px;
}
/* The jaw sensor badge is orange. */
.sensor-detail-item i.j { background: var(--safety-stripe); color: var(--text-main); }
/* Sensor name. */
.sensor-detail-text b { display: block; font-size: 15px; color: var(--text-main); }
/* Sensor description. */
.sensor-detail-text span { font-size: 13.5px; color: var(--text-body); line-height: 1.4; display: block; }

/* SPEECH BOX: shows the mouthed word, the sentence, and the "Hear it" button. */
.live-speech-box {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* The sentence text that will be spoken. */
.live-speech-box .say-preview {
  font-family: var(--font-fancy);
  font-style: italic;
  font-size: 22px;
  color: var(--brand-blue-dark);
  line-height: 1.25;
}
/* The "Hear it" button (uses the browser voice, see js/sensor-showcase.js). */
.speak-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(10, 91, 255, 0.08);
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  font: 500 11px var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  width: fit-content;
  transition: all 0.2s ease;
}
/* Button style when hovered. */
.speak-test-btn:hover { background: var(--brand-blue); color: #fff; }

/* STEPS: the row of step cards under the photo. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
/* One step card. */
.steps li {
  background: var(--page-bg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}
/* Top line of a card: number on the left, small text on the right. */
.steps .top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 11px var(--font-mono);
  letter-spacing: .1em;
  color: var(--text-small);
}
/* The step number badge. */
.steps .n { padding: 3px 7px; border: 1px solid var(--border-light); font-size: 11.5px; border-radius: 3px; }
/* The first card has a blue badge. */
.steps li:first-child .n { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }

/* A space for a small drawing inside the step card. */
.step-visual-slot {
  width: 100%;
  height: 95px;
  background: var(--soft-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Keep the drawing inside its space. */
.step-visual-slot svg { width: 100%; height: 100%; }

/* Step title. */
.steps h3 { font-weight: 400; font-size: 24px; letter-spacing: -.03em; margin-top: 4px; color: var(--text-main); }
/* Step text. */
.steps p { font-size: 14.5px; color: var(--text-body); line-height: 1.5; }
/* CALLOUT: the highlighted box under the steps. */
.callout { padding: 26px 30px; border: 1px solid rgba(10, 91, 255, .35); background: rgba(10, 91, 255, .05); border-radius: 6px; }
/* Text inside the callout. */
.callout p { flex: 1 1 460px; font-weight: 300; font-size: clamp(20px, 2vw, 25px); line-height: 1.3; letter-spacing: -.015em; }
