.home-preview {
  padding: clamp(15px, 3.5vw, 44px);
  border: 1px solid #ddd5f1;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 100% 100%, #ffdab8 0, transparent 58%),
    radial-gradient(ellipse at 0 100%, #decdfd 0, transparent 58%),
    #f5efff;
}
.demo-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.demo-heading h2 {
  font-size: clamp(25px, 3.5vw, 39px);
  letter-spacing: -.045em;
  font-weight: 600;
}
.demo-heading p { margin-top: 8px; color: #52476a; }
.demo-examples {
  flex: none;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid #3c245f24;
  border-radius: 24px;
  background: #ffffff8c;
}
.demo-examples button {
  min-height: 34px;
  border: 0;
  padding: 5px 14px;
  border-radius: 18px;
  color: #493c5f;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.demo-examples button[aria-pressed=true] { background: #533697; color: white; }
.demo-examples button:hover:not([aria-pressed=true]) { background: #e9dcfa; }

.demo-browser {
  overflow: hidden;
  border: 1px solid #32265335;
  border-radius: 15px;
  background: #e1f3f9;
  box-shadow: 0 14px 38px #3d286426, 0 2px 4px #3926560d;
}
.demo-browser-bar, .demo-lesson-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
}
.demo-browser-bar {
  height: 43px;
  justify-content: space-between;
  background: #faf9fd;
  color: #494153;
  font-size: 11px;
}
.demo-window { display: flex; gap: 5px; }
.demo-window i { width: 8px; height: 8px; border-radius: 50%; background: #fb9b72; }
.demo-window i:nth-child(2) { background: #e6bd45; }
.demo-window i:nth-child(3) { background: #ae99e6; }
.demo-address { padding: 4px 13px; border-radius: 6px; background: #efedf4; }
.demo-address span { margin-inline: 4px; color: #6e657b; }
.demo-local { font: 11px/1.2 'SFMono-Regular', Consolas, monospace; }
.demo-lesson-bar { min-height: 33px; background: #416811; color: white; font-size: 11px; }
.demo-lesson-bar strong { border-right: 1px solid #ffffff70; padding-right: 12px; }
.demo-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(238px, .48fr);
  gap: clamp(14px, 2.8vw, 32px);
  align-items: center;
  padding: clamp(12px, 3.1vw, 32px);
  background: linear-gradient(160deg, #c1e8f6, #e8f6f6 65%, #d5ede1);
}
.demo-lesson {
  min-width: 0;
  padding: clamp(12px, 2.3vw, 28px);
  border: 1px solid #244f5c21;
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 16px #2f5f7110;
}
.demo-capture { position: relative; isolation: isolate; border-radius: 5px; }
.demo-question { font-size: clamp(13px, 1.55vw, 17px); color: #1e2522; font-weight: 600; }
.demo-graph { width: min(100%, 295px); height: auto; margin: 8px auto 0; }
.demo-axes { fill: #525558; font-size: 10px; }
.demo-axes path { fill: none; stroke: #777d7f; stroke-width: 1.3; }
.demo-original { color: #3475d7; }
.demo-reflection { color: #a03d14; opacity: 0; }
.demo-correct .demo-reflection { opacity: 1; animation: demo-reveal .45s ease-out both; }
.demo-original path, .demo-reflection path { fill: currentColor; fill-opacity: .08; stroke: currentColor; stroke-width: 2; }
.demo-original circle, .demo-reflection circle { fill: currentColor; }
.demo-original text, .demo-reflection text { fill: currentColor; font: italic 700 11px Arial, sans-serif; }
.demo-coordinates { display: flex; flex-wrap: wrap; gap: 9px 13px; }
.demo-coordinates > div { white-space: nowrap; font-size: 12px; }
.demo-coordinates input { width: 31px; height: 27px; padding: 0 4px; text-align: center; }
.demo-coordinates input, .demo-proof-table select {
  color: #262923;
  background: #fff;
  border: 1px solid #a6b0a4;
  border-radius: 3px;
}
.demo-proof-graph { width: min(100%, 270px); height: auto; margin: 4px auto; }
.demo-proof-lines { fill: none; stroke: #976008; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo-proof-points { fill: #976008; }
.demo-proof-marks { fill: #b2472f; }
.demo-proof-labels { fill: #262923; font: italic 13px Arial, sans-serif; }
.demo-proof-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.demo-proof-table th, .demo-proof-table td { border: 1px solid #dddce5; padding: 5px 7px; text-align: left; overflow-wrap: anywhere; }
.demo-proof-table th { background: #f3f0f8; }
.demo-proof-table select { width: 100%; min-width: 0; padding: 4px 2px; font: inherit; }
.demo-grade { margin-top: 15px; display: flex; align-items: center; gap: 10px; }
.demo-grade button { padding: 5px 16px; border: 0; border-radius: 4px; background: #416811; color: white; font-size: 12px; }
.demo-grade button:hover { background: #35530f; }
#demo-feedback { color: #992f22; font-size: 12px; }
.demo-correct #demo-feedback { color: #416811; font-weight: 700; animation: demo-reveal .35s ease both; }
.demo-filled input, .demo-filled select { background: #eef5df; transition: background .25s; }

.home-preview #trex-overlay { position: relative; z-index: auto; width: 100%; min-width: 0; min-height: 0; }
.home-preview #trex-header { cursor: default; touch-action: auto; }
.home-preview #trex-answer-card { min-height: 133px; }
.home-preview #trex-answer-area { overflow: visible; }
.home-preview #trex-answer-area.loading { padding-top: 10px; }
.home-preview #trex-answer-area.has-answer { animation: demo-reveal .3s ease-out both; }
.home-preview #trex-answer-area.trex-prose-answer { font-size: 18px; }
#demo-show-panel {
  padding: 7px 11px;
  border: 1px solid #26272340;
  border-radius: 4px;
  background: #fbfaf7;
  color: #50534a;
  font-size: 12px;
}
#demo-show-panel kbd { margin-left: 3px; }
.home-preview[data-stage=capture] .demo-capture { outline: 2px solid #8058d9; outline-offset: 6px; }
.demo-scan { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; }
.demo-scan::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 25%;
  background: linear-gradient(transparent, #a180ee37);
  border-bottom: 2px solid #926ae4;
}
.home-preview[data-stage=capture] .demo-scan { opacity: 1; }
.home-preview[data-stage=capture] .demo-scan::before { animation: demo-scan .8s ease-in-out both; }
@keyframes demo-scan { from { transform: translateY(-100%); } to { transform: translateY(400%); } }
@keyframes demo-reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.demo-workflow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 16px;
  color: #56486b;
  font-size: 11px;
}
.demo-workflow ol { display: flex; flex-wrap: wrap; gap: 7px 16px; list-style: none; margin: 0; padding: 0; }
.demo-workflow li { display: flex; align-items: center; gap: 6px; }
.demo-workflow li > span { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #6f589b; }
.demo-workflow li[aria-current=step] { color: #35205f; font-weight: 700; }
.demo-workflow li[aria-current=step] > span { background: #6840b6; box-shadow: 0 0 0 3px #6840b628; }
@media (max-width: 685px) {
  .demo-heading { align-items: start; flex-direction: column; gap: 12px; }
  .demo-workspace { grid-template-columns: minmax(0, 1fr); }
  .demo-dock { width: min(100%, 350px); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .home-preview *, .home-preview *::before { animation: none !important; transition: none !important; }
}
