/* project previews: a browser window with a short looping walkthrough of each app inside.
   Everything is sized in em off the window width (1em = 1/64 of it), so a preview scales as one picture */
.demo {
  container-type: inline-size;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  background: #fff;
  text-align: left;
}
.demo-bar, .demo-screen, .demo-cursor { font-size: calc(100cqw / 64); }
.demo-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.4em;
  height: 2.9em;
  padding: 0 1.2em;
  border-bottom: 1px solid #e7e7e4;
  background: #f7f7f5;
}
.demo-lights { display: flex; gap: .45em; }
.demo-lights i { width: .75em; height: .75em; border-radius: 50%; background: #ff5f57; }
.demo-lights i:nth-child(2) { background: #febc2e; }
.demo-lights i:nth-child(3) { background: #28c840; }
.demo-url {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45em;
  height: 1.75em;
  border: 1px solid #e3e3e0;
  border-radius: .55em;
  background: #fff;
  color: #3a3a3a;
  font: 500 .82em/1 "JetBrains Mono", ui-monospace, Menlo, monospace;
}
.demo-url::before {
  content: "";
  width: .6em;
  height: .7em;
  border: .14em solid #8a8a8a;
  border-radius: .15em;
  box-sizing: border-box;
}
.demo-more { color: #9a9a9a; font-size: .9em; letter-spacing: .1em; }
.demo-screen { position: relative; flex: 1; overflow: hidden; }

/* the cursor glides between targets; positions come from demos.js */
.demo-cursor {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: 1.5em;
  height: 1.5em;
  transform: translate(56em, 34em);
  transition: transform .8s cubic-bezier(.65, 0, .35, 1), opacity .3s ease;
  pointer-events: none;
}
.demo-cursor svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 .15em .25em rgba(0,0,0,.3)); transition: transform .15s ease; }
.demo-cursor.is-click svg { transform: scale(.82); }
.is-pressed { transform: scale(.95); }

/* ---------- Macros Tracker (its own dark look) ---------- */
.mt {
  padding: 1.8em 3.6em;
  background: radial-gradient(120% 80% at 30% 0%, #16161b, #0c0c0f 60%);
  color: #ededf0;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}
.mt-nav { display: flex; align-items: center; gap: 1.6em; }
.mt-logo { margin-right: auto; font-size: 1.05em; font-weight: 700; letter-spacing: .03em; }
.mt-logo em { color: #c8ff4d; font-style: normal; }
.mt-signin { color: #8d8d98; font-size: .82em; }
.mt-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .65em 1.05em;
  border-radius: .7em;
  background: #c8ff4d;
  color: #0c0c0f;
  font-size: .82em;
  font-weight: 600;
  transition: transform .15s ease, opacity .3s ease, background .3s ease;
}
.mt-card {
  display: grid;
  grid-template-columns: 11.5em 1fr;
  gap: .9em 1.8em;
  margin-top: 1.7em;
  padding: 1.7em 1.9em;
  border: 1px solid #232329;
  border-radius: 1.1em;
  background: #151519;
}
.mt-h { grid-column: 1 / -1; font-size: 1.45em; font-weight: 700; }
.mt-sub { grid-column: 1 / -1; margin-top: -.5em; color: #8d8d98; font-size: .78em; }
.mt-file { grid-column: 1 / -1; display: flex; align-items: center; gap: .9em; }
.mt-choose {
  padding: .6em 1.05em;
  border: 1px solid #232329;
  border-radius: .7em;
  background: #1b1b20;
  font-size: .8em;
  transition: transform .15s ease;
}
.mt-name { color: #8d8d98; font-size: .8em; }
.mt-photo {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #232329;
  border-radius: .8em;
  overflow: hidden;
  background: linear-gradient(135deg, #b78252, #8c5a33);
  opacity: 0;
  transform: scale(.96);
  transition: opacity .5s ease, transform .6s cubic-bezier(.16, 1, .3, 1);
}
/* a plate seen from above: toast and scrambled eggs */
.mt-plate { position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle, #fbfaf6 0 58%, #e9e6dd 59% 66%, #f6f4ee 67%); box-shadow: 0 .4em .9em rgba(40,20,5,.35); }
.mt-toast { position: absolute; left: 22%; top: 30%; width: 34%; height: 38%; border-radius: 22% 22% 14% 14%; background: radial-gradient(circle at 50% 45%, #e7b66e 0 52%, #b9783a 70%); transform: rotate(-12deg); }
.mt-egg { position: absolute; right: 20%; top: 26%; width: 34%; height: 44%; border-radius: 46% 54% 50% 50%; background: radial-gradient(circle at 40% 40%, #fff3a8, #f3cf4f 45%, #e8b93a 80%); }
.mt-herb { position: absolute; width: 4%; height: 4%; border-radius: 50%; background: #3f8a3a; }
.mt-herb.h1 { right: 33%; top: 38%; } .mt-herb.h2 { right: 27%; top: 52%; } .mt-herb.h3 { right: 40%; top: 58%; }
.mt-right { display: flex; flex-direction: column; align-items: flex-start; gap: .9em; min-width: 0; }
.mt-analyze { opacity: .45; }
.mt-skeleton, .mt-result { width: 100%; border-radius: .9em; }
.mt-skeleton {
  display: none;
  height: 7.6em;
  background: linear-gradient(90deg, #1b1b20 30%, #24242b 50%, #1b1b20 70%) 0 0 / 300% 100%;
  animation: mt-shimmer 1.2s linear infinite;
}
@keyframes mt-shimmer { to { background-position: -150% 0; } }
.mt-result {
  display: none;
  padding: 1.1em 1.3em;
  border: 1px solid #232329;
  background: #1b1b20;
}
.mt-row { display: flex; align-items: center; justify-content: space-between; gap: .8em; }
.mt-row b { font-size: .95em; font-weight: 600; }
.mt-conf { padding: .3em .6em; border: 1px solid #232329; border-radius: .5em; color: #8d8d98; font-size: .66em; white-space: nowrap; }
.mt-grams { display: block; margin-top: .25em; color: #8d8d98; font-size: .74em; }
.mt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8em; margin-top: .9em; }
.mt-stats b { display: block; font-size: 1.55em; font-weight: 700; line-height: 1.1; }
.mt-stats small { color: #8d8d98; font-size: .66em; }
.c-cal { color: #4dffd1; } .c-protein { color: #c8ff4d; } .c-fat { color: #ff9a4d; } .c-carbs { color: #b79cff; }
.demo.is-chosen .mt-photo { opacity: 1; transform: none; }
.demo.is-chosen .mt-name { color: #ededf0; }
.demo.is-chosen .mt-analyze { opacity: 1; }
.demo.is-analyzing .mt-analyze { opacity: .55; }
.demo.is-analyzing .mt-skeleton { display: block; }
.demo.is-result .mt-skeleton { display: none; }
.demo.is-result .mt-result { display: block; animation: demo-rise .6s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes demo-rise { from { opacity: 0; transform: translateY(.8em); } }

/* ---------- Make Solve (its light look) ---------- */
.ms {
  display: flex;
  flex-direction: column;
  background: #f3f4f1;
  color: #17191a;
  font-family: "Onest", -apple-system, system-ui, sans-serif;
}
.ms-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5em;
  height: 3.1em;
  padding: 0 2.4em;
  border-bottom: 1px solid #e0e2dd;
  background: #fff;
}
.ms-logo { display: flex; align-items: center; gap: .55em; font-size: .95em; }
.ms-logo b { font-weight: 700; }
.ms-logo span { color: #5a6062; }
.ms-icon { display: grid; grid-template-columns: repeat(3, .36em); gap: .08em; }
.ms-icon i { height: .36em; border-radius: .06em; background: #1f9a4c; }
.ms-icon i:nth-child(3n) { background: #c8262f; } .ms-icon i:nth-child(4) { background: #f2d22e; } .ms-icon i:nth-child(8) { background: #1f5fbf; }
.ms-tab { position: relative; color: #5a6062; font-size: .8em; }
.ms-tab.is-on { color: #17191a; font-weight: 600; }
.ms-tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1.32em; height: .15em; border-radius: .1em; background: #0f6b5c; }
.ms-theme { margin-left: auto; color: #8a8f91; font-size: .72em; }
.ms-body { position: relative; flex: 1; }
.ms-view {
  position: absolute;
  inset: 0;
  padding: 1.7em 3em;
  transition: opacity .5s ease, transform .6s cubic-bezier(.16, 1, .3, 1);
}
.ms-step { color: #0f6b5c; font-size: .72em; font-weight: 600; }
.ms-h { display: block; margin-top: .25em; font-size: 1.5em; font-weight: 700; letter-spacing: -.01em; }
.ms-grid { display: grid; grid-template-columns: 31em 1fr; gap: 2em; margin-top: 1.2em; }
.ms-cam {
  position: relative;
  display: grid;
  place-items: center;
  height: 21em;
  border-radius: .9em;
  background: radial-gradient(90% 90% at 50% 45%, #2a2f33, #101214 75%);
  overflow: hidden;
}
.ms-face { position: relative; display: grid; grid-template-columns: repeat(3, 3.3em); gap: .28em; padding: .32em; border-radius: .55em; background: #0b0c0d; transition: transform .35s ease; }
.ms-face i { height: 3.3em; border-radius: .38em; background: #3a3f42; transition: background .25s ease; }
.ms-frame { position: absolute; inset: -.9em; border: .16em solid #5cbca8; border-radius: .8em; opacity: 0; transform: scale(1.15); transition: opacity .25s ease, transform .35s cubic-bezier(.16, 1, .3, 1); }
.ms-cam.is-locked .ms-frame { opacity: 1; transform: none; }
.ms-hint { position: absolute; left: 0; right: 0; bottom: 1.1em; color: rgba(255,255,255,.7); font-size: .72em; text-align: center; }
.ms-side { display: flex; flex-direction: column; gap: .7em; }
.ms-label { color: #5a6062; font-size: .75em; }
.ms-count { font-size: 2.1em; font-weight: 700; line-height: 1; }
.ms-count small { color: #8a8f91; font-size: .55em; font-weight: 500; }
.ms-chips { display: grid; grid-template-columns: repeat(3, 3.3em); gap: .6em; margin: .3em 0 .5em; }
.ms-chip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .1em; padding: .18em; border: 1px solid #e0e2dd; border-radius: .35em; background: #fff; }
.ms-chip i { aspect-ratio: 1; border-radius: .12em; background: #c9cbc6; transition: background .3s ease; }
.ms-btn {
  align-self: flex-start;
  padding: .7em 1.1em;
  border-radius: .55em;
  background: #c4c7c1;
  color: #fff;
  font-size: .8em;
  font-weight: 600;
  transition: background .3s ease, transform .15s ease;
}
.demo.is-scanned .ms-btn { background: #0f6b5c; }
.ms-solve { opacity: 0; transform: translateY(1.2em); pointer-events: none; }
.demo.is-solving .ms-scan { opacity: 0; transform: translateY(-1em); }
.demo.is-solving .ms-solve { opacity: 1; transform: none; }
.ms-solve .ms-grid { grid-template-columns: 24em 1fr; align-items: center; margin-top: .6em; }
.ms-stage { display: grid; place-items: center; height: 20em; border: 1px solid #e0e2dd; border-radius: .9em; background: #fff; perspective: 60em; }
.ms-cube { position: relative; width: 10.5em; height: 10.5em; transform-style: preserve-3d; transform: rotateX(-27deg) rotateY(-42deg); animation: ms-sway 6s ease-in-out infinite; }
@keyframes ms-sway { 50% { transform: rotateX(-24deg) rotateY(-34deg); } }
.ms-side3 { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .22em; padding: .28em; border-radius: .55em; background: #17191a; backface-visibility: hidden; }
.ms-side3 i { border-radius: .28em; background: #c9cbc6; transition: background .35s ease, box-shadow .25s ease; }
.ms-side3 i.is-turning { box-shadow: inset 0 0 0 .16em rgba(255,255,255,.75); }
.ms-top { transform: rotateX(90deg) translateZ(5.25em); }
.ms-front { transform: translateZ(5.25em); }
.ms-right { transform: rotateY(90deg) translateZ(5.25em); }
.ms-panel { display: flex; flex-direction: column; gap: .45em; }
.ms-move { font: 700 3.2em/1 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: -.02em; }
.ms-say { font-size: .95em; font-weight: 600; }
.ms-note { color: #5a6062; font-size: .74em; min-height: 1.3em; }
.ms-strip { display: flex; flex-wrap: wrap; gap: .4em; margin-top: .6em; }
.ms-strip i { padding: .35em .55em; border-radius: .4em; background: #fff; border: 1px solid #e0e2dd; color: #5a6062; font: 500 .78em/1 "JetBrains Mono", ui-monospace, Menlo, monospace; font-style: normal; transition: background .25s ease, color .25s ease; }
.ms-strip i.is-done { color: #8a8f91; background: transparent; }
.ms-strip i.is-now { background: #e2eeea; border-color: #0f6b5c; color: #0f6b5c; }

@media (prefers-reduced-motion: reduce) {
  .demo-cursor { display: none; }
  .ms-cube { animation: none; }
}
