/* ==========================================================================
   ai-layer.css  -  "HOW ONE WORD BECOMES A SENTENCE" WALKTHROUGH (CONTENT)
   Used by: <section id="ais"> in index.html.
   The behaviour (changing steps, moving dots) is in js/ai-walkthrough.js.
   ========================================================================== */

/* The whole walkthrough section. */
#ais { background: var(--page-bg); overflow: hidden; }
/* Two columns on big screens: text on the left (5 parts), picture on the right (7 parts). One column on phones. */
.ais-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .ais-grid { grid-template-columns: 5fr 7fr; gap: 40px; } }
/* The left column: text at the top, step controls at the bottom. */
.ais-left { display: flex; flex-direction: column; justify-content: space-between; gap: 26px; }
/* Paragraph in the left column (not too wide, so it is easy to read). */
.ais-left p { color: var(--text-body); max-width: 52ch; }
/* CAPTION: the area with the step text and the progress bars. */
.caption { border-top: 1px solid var(--border-light); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
/* The step title and description. Minimum height stops the page from jumping when the text changes. */
#stepText { min-height: 5.6em; font-size: 15px; line-height: 1.5; color: var(--text-body); }
/* The step title (small capital letters). */
#stepText b { display: block; margin-bottom: 6px; font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-main); }
/* SEGS: the row of 4 progress bars (one for each step). */
.segs { display: flex; gap: 8px; }
/* One clickable progress bar. */
.segs button { flex: 1; height: 22px; border: 0; background: none; padding: 0; cursor: pointer; position: relative; }
/* Each bar is made of two layers: a grey track (before) and a blue fill (after). */
.segs button::before, .segs button::after { content: ""; position: absolute; left: 0; top: 10px; height: 2px; }
/* The grey track. */
.segs button::before { right: 0; background: var(--border-light); }
/* The blue fill (starts at 0 width). */
.segs button::after { width: 0; background: var(--brand-blue-dark); }
/* A finished step is filled completely. */
.segs button.done::after { width: 100%; }
/* The current step fills slowly over 3.8 seconds, which is the time before the next step. */
.segs button.on::after { animation: fill 3.8s linear forwards; }
/* When paused, the current bar is shown full and does not move. */
.segs.paused button.on::after { width: 100%; animation: none; }
/* The HELP step bar is red. */
.segs button.alert::after { background: var(--alert-red); }
/* Animation: width grows from 0 to 100%. */
@keyframes fill { to { width: 100%; } }
/* The Pause / Play button. */
.pause-btn { align-self: flex-start; min-height: 32px; border: 0; background: none; padding: 0; cursor: pointer; font: 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-body); }

/* STAGE: the big box on the right that shows the dots and the picture of the current step. */
.stage { position: relative; min-height: 380px; background: var(--soft-bg); border: 1px solid var(--border-light); border-radius: 8px; display: flex; flex-direction: column; flex-wrap: wrap; align-items: center; justify-content: center; overflow: hidden; padding: 16px; }
/* On bigger screens the dots and the picture sit side by side. */
@media (min-width: 600px) { .stage { min-height: 440px; flex-direction: row; } }
/* A faint pattern of tiny dots on the stage background. */
.stage::before { content: ""; position: absolute; inset: 0; opacity: .5; background: radial-gradient(var(--border-light) 1px, transparent 1.2px) 0 0/22px 22px; }
/* DOT WRAP: the dot picture with its plain-words caption underneath. */
.dot-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; flex: 0 1 280px; width: min(100%, 280px); min-width: 0; }
/* A bit bigger on bigger screens. */
@media (min-width: 600px) { .dot-wrap { flex-basis: 320px; width: min(100%, 320px); } }
/* The canvas where the 800 dots are drawn (js/ai-walkthrough.js). */
#dotCanvas { position: relative; width: 100%; aspect-ratio: 1; flex-shrink: 0; }
/* CAPTION: tells the visitor what the dots are showing right now. */
.dot-caption { position: relative; padding: 6px 14px; border: 1px solid var(--brand-line); border-radius: 999px; background: #fff; color: var(--brand-blue-dark); font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; text-align: center; }
/* PANELS: holds the 4 pictures on top of each other. Only one is visible at a time. */
.panels { position: relative; flex: 1 1 280px; align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr); padding: 16px; min-width: 0; width: 100%; }
/* More space inside the panels on bigger screens. */
@media (min-width: 600px) { .panels { padding: 24px; } }
/* PANEL: one picture. Hidden by default. */
.panel { grid-area: 1/1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; opacity: 0; transform: translateY(8px); transition: .6s; pointer-events: none; }
/* The panel that is visible right now. */
.panel.on { opacity: 1; transform: none; pointer-events: auto; }

/* CHIPS: a row of small word tags (Step 1 picture). */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* One small word tag. */
.chip { padding: 6px 10px; border: 1px solid var(--border-light); background: #FFFFFF; color: var(--text-body); font: 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 3px; }
/* The tag that Sentio picked is blue. */
.chip.hot { color: var(--brand-blue-dark); border-color: var(--brand-blue-dark); background: var(--brand-tint); font-weight: 500; }
/* The HELP tag is red. */
.chip.red { color: var(--alert-red); border-color: var(--alert-red); background: rgba(198, 40, 40, .06); }
/* SENT: one suggested sentence box (Step 2 picture). */
.sent { padding: 12px 14px; background: #FFFFFF; border: 1px solid var(--border-light); font-weight: 300; opacity: .75; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; border-radius: 4px; }
/* Bigger sentence box on bigger screens. */
@media (min-width: 600px) { .sent { padding: 14px 16px; font-size: 17px; } }
/* The sentence the person picked has a blue border and glow. */
.sent.pick { border-color: var(--brand-blue-dark); opacity: 1; box-shadow: 0 0 0 3px rgba(10, 91, 255, .18); }
/* Small label inside a sentence box (SUGGESTED / YOU PICK). */
.sent small { flex-shrink: 0; align-self: flex-start; white-space: nowrap; font: 10px var(--font-mono); letter-spacing: .06em; color: var(--brand-blue-dark); }
/* PHONE: a drawn phone with rounded corners (Step 3 picture). */
.phone { width: 180px; margin: 0 auto; border: 5px solid var(--text-main); border-radius: 26px; padding: 20px 10px; display: flex; flex-direction: column; gap: 8px; background: var(--section-bg); }
/* Bigger phone on bigger screens. */
@media (min-width: 600px) { .phone { width: 200px; border-radius: 30px; padding: 26px 12px; } }
/* BUBBLE: a chat message bubble inside the phone. */
.bubble { align-self: flex-end; max-width: 88%; padding: 9px 11px; background: var(--brand-blue); color: #fff; border-radius: 14px 14px 3px 14px; font-size: 12px; line-height: 1.3; }
/* Slightly bigger text on bigger screens. */
@media (min-width: 600px) { .bubble { font-size: 13px; } }
/* RINGS: the alarm picture (HELP step) with red circles that grow outward. */
.rings { position: relative; width: 130px; height: 130px; margin: 0 auto; display: grid; place-items: center; font-weight: 500; font-size: 24px; letter-spacing: .1em; color: var(--alert-red); }
/* Bigger alarm picture on bigger screens. */
@media (min-width: 600px) { .rings { width: 150px; height: 150px; font-size: 26px; } }
/* Each red circle grows and fades again and again. */
.rings i { position: absolute; inset: 0; border: 2px solid var(--alert-red); border-radius: 50%; opacity: 0; animation: ring 2.4s ease-out infinite; }
/* The 2nd and 3rd circles start later so they do not move together. */
.rings i:nth-child(2) { animation-delay: .8s; } .rings i:nth-child(3) { animation-delay: 1.6s; }
/* Animation: circle grows from small to big while fading out. */
@keyframes ring { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

/* LANES: the muscle signal lines (Step 1 picture). */
.lanes { display: flex; flex-direction: column; gap: 8px; }
/* One lane: a name and a wavy line. */
.lane { display: flex; align-items: center; gap: 12px; font: 10.5px var(--font-mono); color: var(--text-small); }
/* The lane name (fixed width). */
.lane span { flex: 0 0 52px; }
/* The drawing area of a lane. */
.lane svg { flex: 1; min-width: 0; height: 30px; border-bottom: 1px solid var(--border-light); }
/* The wavy line itself (shape is changed by js/core.js). */
.lane polyline { fill: none; stroke: #94A3B8; stroke-width: 1.3; vector-effect: non-scaling-stroke; }
