/* The tool demos (onboarding/partials/_tool_demo.html, played by
   onboarding/js/tool_demos.js): one tool's slice of the homepage's pine
   coach band, also the "See an example" dialogs. The slice lays itself out
   by its own width (a container query), so the band and a dialog share one
   set of rules. Every class starts td-, clear of the site's own (.bar, .sev,
   .tag...). Approved mock: docs/mocks/homepage/round3/homepage.html. */

/* .td is the container; .td-in, inside it, is what its width lays out. */
.td { container: td / inline-size; color: #fff; }
.td-in { display: grid; grid-template-areas: "head" "stage" "steps" "cta"; gap: 20px; }
.td p { margin: 0; }
.td-head { grid-area: head; }
.td-name { font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
.td-what { margin-top: 8px !important; color: rgba(255, 255, 255, .8); font-size: 16.5px; line-height: 1.55; max-width: 28em; text-wrap: pretty; }
.td-steps { grid-area: steps; display: grid; gap: 2px; list-style: none; margin: 0; padding: 0; }
.td-steps button { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: center; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 10px 9px 6px; color: rgba(255, 255, 255, .68); font: inherit; font-size: 15px; line-height: 1.35; cursor: pointer; }
.td-steps button:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.td-steps button:focus-visible { outline: 2px solid var(--color-mint); outline-offset: 0; }
.td-n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .3); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; transition: background .3s, border-color .3s, color .3s; }
.td-sbar { display: block; grid-column: 2; height: 2px; margin-top: 7px; background: rgba(255, 255, 255, .14); border-radius: 2px; overflow: hidden; }
.td-sbar i { display: block; height: 100%; background: var(--color-mint); transform: scaleX(0); transform-origin: left; }
.td-steps .done { color: rgba(255, 255, 255, .86); }
.td-steps .done .td-n { border-color: transparent; background: rgba(60, 196, 155, .28); color: #fff; }
.td-steps .on { color: #fff; font-weight: 600; }
.td-steps .on .td-n { border-color: var(--color-mint); background: var(--color-mint); color: var(--color-pine); }
.td-cta { grid-area: cta; }
.td-btn { width: 100%; font-size: 16px; padding: 14px 26px; border-radius: 10px; background: var(--color-mint); color: var(--color-pine); }
.td-btn:hover { background: var(--color-mint-hover); }

@container td (min-width: 760px) {
  .td-in { grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; grid-template-areas: ". stage" "head stage" "steps stage" "cta stage" ". stage"; column-gap: 56px; row-gap: 0; }
  .td-name { font-size: 34px; }
  .td-steps { margin-top: 22px; }
  .td-cta { margin-top: 24px; }
  .td-btn { width: auto; }
}

/* ---- The stage: a product window the script plays ---- */
.td-stage { grid-area: stage; position: relative; border-radius: 16px; overflow: hidden; background: var(--color-paper); color: var(--color-body); box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08); font-size: 14px; line-height: 1.5; text-align: left; }
.td-chrome { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: #ECEEE9; border-bottom: 1px solid var(--color-line); font-size: 12px; font-weight: 600; color: var(--color-muted); }
.td-chrome i { width: 9px; height: 9px; border-radius: 50%; background: #CDD2CC; }
.td-chrome span { margin-left: 10px; }
.td-dark { background: var(--color-ink); }
.td-dark .td-chrome { background: var(--color-ink-raise); border-color: var(--color-ink-line); color: var(--color-ink-muted); }
.td-dark .td-chrome i { background: var(--color-ink-line); }
/* Every screen sits in the same cell, so the stage is always the height of
   the tallest and never jumps between steps. */
.td-screens { display: grid; }
.td-screen { grid-area: 1 / 1; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }
.td-screen.on { opacity: 1; visibility: visible; transition: opacity .4s ease; }
@container td (min-width: 760px) { .td-screen { padding: 26px 28px; } }
.td-k { font-size: 12.5px; color: var(--color-muted); }
.td-mt { margin-top: 12px !important; }
.td-h4 { font-size: 15px; font-weight: 600; color: var(--color-pine); }
.td-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.25; }

/* Essay Coach */
.td-fld { font-size: 12.5px; font-weight: 600; color: var(--color-muted); }
.td-box { margin-top: 5px; background: var(--color-card); border: 1px solid var(--color-line-strong); border-radius: 8px; padding: 10px 12px; min-height: 42px; }
.td-caret { display: inline-block; width: 1.5px; height: 1em; background: var(--color-pine); vertical-align: -2px; margin-left: 1px; animation: td-blink 1s steps(1) infinite; }
@keyframes td-blink { 50% { opacity: 0; } }
.td-draft { position: relative; font-family: var(--font-serif); line-height: 1.6; min-height: 168px; }
.td-draft .td-txt { opacity: 0; transition: opacity .25s; }
.td-draft.filled .td-txt { opacity: 1; }
.td-draft.filled { animation: td-pasted .6s ease-out; }
@keyframes td-pasted { from { background: var(--color-mint-tint); } to { background: var(--color-card); } }
.td-ph { position: absolute; left: 12px; top: 10px; color: var(--color-faint); font-family: var(--font-sans); }
.td-draft.filled .td-ph { display: none; }
.td-wc { font-size: 12.5px; color: var(--color-muted); margin-top: 6px !important; opacity: 0; transition: opacity .3s; }
.td-wc.on { opacity: 1; }
.td-go-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.td-go { cursor: default; white-space: nowrap; flex: none; transition: transform .15s, background .15s; }
.td-go.press { transform: scale(.96); background: var(--color-pine-hover); }
.td-reading { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-muted); opacity: 0; transition: opacity .3s; }
.td-reading.on { opacity: 1; }
.td-spin { width: 14px; height: 14px; border: 2px solid var(--color-mint-line); border-top-color: var(--color-pine); border-radius: 50%; animation: td-spin .8s linear infinite; }
@keyframes td-spin { to { transform: rotate(360deg); } }
.td-notes-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.td-tally { display: flex; gap: 6px; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.td-tally.on { opacity: 1; transform: none; }
.td-sev { font-size: 11.5px; font-weight: 700; border: 1px solid; border-radius: 999px; padding: 1px 8px; background: #fff; }
.td-sev.k-works, .td-mk.k-works, .td-enote.k-works b { color: var(--color-works); border-color: var(--color-works-line); }
.td-sev.k-tighten, .td-mk.k-tighten, .td-enote.k-tighten b { color: var(--color-tighten); border-color: var(--color-tighten-line); }
.td-sev.k-fix, .td-mk.k-fix, .td-enote.k-fix b { color: var(--color-fix); border-color: var(--color-fix-line); }
.td-essay { font-family: var(--font-serif); font-size: 15px; line-height: 1.78; margin-top: 12px !important; }
.td-mark { background-repeat: no-repeat; background-size: 0% 100%; border-bottom: 2px solid transparent; padding-bottom: 1px; transition: background-size .8s cubic-bezier(.3, .7, .3, 1), border-color .4s .5s, box-shadow .3s; }
.td-mark.k-works { background-image: linear-gradient(#DCF2E8, #DCF2E8); }
.td-mark.k-tighten { background-image: linear-gradient(#F7ECD6, #F7ECD6); }
.td-mark.k-fix { background-image: linear-gradient(#F8E4DE, #F8E4DE); }
.td-mark.on { background-size: 100% 100%; }
.td-mark.on.k-works { border-bottom-color: var(--color-works-line); }
.td-mark.on.k-tighten { border-bottom-color: var(--color-tighten-line); }
.td-mark.on.k-fix { border-bottom-color: var(--color-fix-line); }
.td-mark.ring { box-shadow: 0 0 0 2px rgba(0, 61, 57, .18); border-radius: 2px; }
.td-mk { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-sans); font-size: 10px; font-weight: 600; line-height: 1; min-width: 16px; height: 16px; border-radius: 4px; margin-left: 4px; vertical-align: 3px; border: 1px solid; background: #fff; }
.td-essay .td-mk { opacity: 0; transition: opacity .3s .5s; }
.td-mark.on + .td-mk { opacity: 1; }
.td-enotes { display: grid; gap: 8px; margin-top: 14px; }
@container td (min-width: 760px) { .td-enotes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.td-enote { background: var(--color-card); border: 1px solid var(--color-line); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.td-enote.on { opacity: 1; transform: none; }
.td-enote-h { display: flex; align-items: center; gap: 6px; margin-bottom: 3px !important; }
.td-enote-h .td-mk { margin: 0; }
.td-enote b { font-size: 12px; }

/* Interview Practice: the room's ink, then the light feedback page */
.td-dark .td-screen { color: var(--color-ink-text); }
.td-question { display: flex; flex-direction: column; justify-content: center; }
.td-iq-k { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--color-ink-muted); }
.td-iq { font-family: var(--font-serif); font-size: 21px; line-height: 1.35; margin-top: 8px !important; max-width: 26em; }
@container td (min-width: 760px) { .td-iq { font-size: 25px; } }
.td-think { display: flex; align-items: center; gap: 18px; margin-top: 26px; }
.td-think p { font-size: 14px; color: var(--color-ink-muted); }
.td-think b { display: block; color: var(--color-ink-text); font-weight: 600; font-size: 15px; }
.td-ring { position: relative; width: 104px; height: 104px; flex: none; }
.td-ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.td-trk { fill: none; stroke: var(--color-ink-line); stroke-width: 6; }
.td-arc { fill: none; stroke: var(--color-mint); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; }
.td-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.td-cam { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #1A2747 0%, var(--color-ink-frame) 70%); border: 1px solid var(--color-ink-line); }
@container td (min-width: 760px) { .td-cam { aspect-ratio: 16 / 10; } }
.td-person { position: absolute; left: 50%; bottom: 0; width: 82%; transform: translateX(-50%); fill: var(--color-ink-line); }
@container td (min-width: 760px) { .td-person { width: 46%; } }
.td-rec, .td-clock { position: absolute; top: 10px; font-size: 12px; font-weight: 600; color: var(--color-ink-text); background: rgba(7, 13, 28, .6); border-radius: 999px; padding: 3px 10px; }
.td-rec { left: 12px; display: flex; align-items: center; gap: 7px; }
.td-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-rec); animation: td-blink 1s steps(1) infinite; }
.td-clock { right: 12px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.td-sub { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 88%; text-align: center; font-size: 13.5px; line-height: 1.4; color: #fff; background: rgba(7, 13, 28, .72); border-radius: 8px; padding: 6px 10px; }
.td-sub:empty { display: none; }
.td-saved { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7, 13, 28, .5); opacity: 0; transition: opacity .35s; }
.td-saved.on { opacity: 1; }
.td-saved span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--color-mint); }
.td-saved svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.td-prog { height: 4px; border-radius: 4px; background: var(--color-ink-line); margin-top: 10px; overflow: hidden; }
.td-prog i { display: block; height: 100%; width: 0; background: var(--color-rec); }
.td-cam-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--color-ink-muted); }
.td-dark .td-fb { background: var(--color-paper); color: var(--color-body); }
.td-qbox { background: var(--color-card); border: 1px solid var(--color-line); border-radius: 10px; padding: 10px 14px; }
.td-q { font-family: var(--font-serif); font-size: 15.5px; line-height: 1.35; margin-top: 2px !important; }
.td-fb .td-h4 { margin: 14px 0 6px !important; }
.td-para { opacity: 0; transform: translateY(6px); transition: opacity .45s, transform .45s; }
.td-para + .td-para { margin-top: 8px !important; }
.td-para.on { opacity: 1; transform: none; }
.td-para mark, .td-you mark { color: inherit; border-radius: 3px; padding: 0 2px; }
.td-para mark { background: var(--color-mint-tint); box-shadow: inset 0 -2px 0 var(--color-mint-line); }

/* Story Bank: the coach room's orb, one exchange at a time, and "Your story so far" */
.td-talk { display: flex; flex-direction: column; }
.td-room { flex: 1; display: grid; grid-template-rows: auto 1fr; gap: 16px; }
.td-convo { display: flex; flex-direction: column; }
.td-orb-row { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--color-line); }
.td-orb { --c: var(--color-pine); position: relative; width: 34px; height: 34px; flex: none; }
.td-orb[data-mode="listening"] { --c: var(--color-mint); }
.td-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c); opacity: .22; animation: td-breathe 1.4s ease-in-out infinite; }
.td-core { position: absolute; inset: 7px; border-radius: 50%; background: var(--c); transition: background .3s; }
@keyframes td-breathe { 50% { transform: scale(1.22); } }
.td-orb-t { font-size: 13.5px; font-weight: 600; }
.td-orb-s { font-size: 12px; color: var(--color-faint); }
.td-xchg { flex: 1; display: grid; align-content: center; padding-block: 12px; }
.td-xc { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s linear .3s; }
.td-xc.on { opacity: 1; visibility: visible; transition: opacity .3s; }
.td-bub { max-width: 86%; font-size: 13.5px; line-height: 1.45; padding: 9px 12px; border-radius: 12px; opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; }
.td-bub.on { opacity: 1; transform: none; }
.td-coach { background: var(--color-card); border: 1px solid var(--color-line); border-top-left-radius: 4px; align-self: flex-start; }
.td-you { background: var(--color-mint-tint); border: 1px solid var(--color-mint-line); border-top-right-radius: 4px; align-self: flex-end; }
.td-you mark { background: transparent; transition: background .8s; }
.td-you mark.lit { background: rgba(60, 196, 155, .5); }
.td-tick { align-self: flex-end; display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--color-works); background: #fff; border: 1px solid var(--color-mint-line); border-radius: 999px; padding: 1px 8px; margin-top: -4px; opacity: 0; transform: scale(.6); transition: opacity .3s, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.td-tick.on { opacity: 1; transform: none; }
.td-sc { order: -1; background: var(--color-card); border: 1px solid var(--color-line); border-radius: 14px; padding: 10px 12px; align-self: start; }
.td-sc-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--color-muted); }
.td-sc-h b { font-family: var(--font-mono); font-size: 16px; color: var(--color-body); }
.td-slots { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.td-slots li { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 11px; font-weight: 600; color: var(--color-faint); transition: color .3s; }
.td-ico { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--color-line-strong); display: grid; place-items: center; flex: none; transition: background .3s, border-color .3s; }
.td-slots .done { color: var(--color-works); }
.td-slots .done .td-ico { background: var(--color-mint); border-color: var(--color-mint); }
.td-slots .done .td-ico::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
@container td (min-width: 760px) {
  .td-room { grid-template-columns: minmax(0, 1fr) 190px; grid-template-rows: none; }
  .td-sc { order: 0; padding: 14px; }
  .td-slots { display: block; }
  .td-slots li { flex-direction: row; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--color-line); font-size: 13px; }
}
.td-draft-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-topic { font-size: 12px; font-weight: 600; color: var(--color-pine); background: var(--color-mint-tint); border-radius: 999px; padding: 2px 10px; }
.td-parts { margin-top: 8px; }
.td-part { padding: 9px 0; border-bottom: 1px solid var(--color-line); opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.td-part:last-child { border-bottom: 0; }
.td-part.on { opacity: 1; transform: none; }
.td-part-k { font-size: 12.5px; font-weight: 700; color: var(--color-pine); }
.td-bank-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.td-bank-h b { font-family: var(--font-mono); font-size: 15px; color: var(--color-body); display: inline-block; }
.td-bank-h b.bump { animation: td-bump .6s ease-out; }
@keyframes td-bump { 40% { transform: scale(1.45); color: var(--color-works); } }
.td-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
@container td (min-width: 760px) { .td-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } }
.td-tile { background: var(--color-card); border: 1px solid var(--color-line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; font-size: 12.5px; font-weight: 600; line-height: 1.25; transition: background .4s, border-color .4s; }
@container td (min-width: 760px) { .td-tile { min-height: 64px; gap: 6px; padding: 10px; } }
.td-st { font-size: 11px; font-weight: 600; color: var(--color-faint); }
.td-tile.strong { background: var(--color-mint-tint); border-color: var(--color-mint); }
.td-tile.strong .td-st { color: var(--color-works); }
.td-tile.drop { animation: td-drop .7s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes td-drop { from { transform: translateY(-14px) scale(1.06); box-shadow: 0 14px 24px -12px rgba(0, 61, 57, .5); } to { transform: none; box-shadow: none; } }

@media (prefers-reduced-motion: reduce) {
  .td *, .td *::before, .td *::after { transition: none !important; animation: none !important; }
}
